[Protractor] Running tests on multiple browsers
Testing your AngularJS application on multiple browsers is important, and Protractor offers this ability through the multiCapabilities configuration option. Learn how to use this option, as well as configure your e2e tests to run on only a single browser for rapid development.
By default, protractor will use chrome as default browser. You can also use other browser:
exports.config = {
capabilities: {
name: "Firefox",
browserName: "firefox"
},
specs: [
'./e2etest/**/*.spec.js'
],
seleniumAddress: 'http://localhost:4444/wd/hub'
};
If you want to run on multi browsers, then you can use 'multiCapabilities':
exports.config = {
multiCapabilities: [
{
name: "Chrome",
browserName: "chrome"
},
{
name: "Firefox",
browserName: "firefox"
}
],
specs: [
'./e2etest/**/*.spec.js'
],
seleniumAddress: 'http://localhost:4444/wd/hub'
};
But it probably good when you are actually developing the project, you can run only on one browser for saving time, so you can modify the scripts tags:
"test-e2e": "protractor conf.js",
"test-e2e-dev": "protractor conf.js --chrome"
More flexable code:
var browsers = {
firefox: {
name: 'Firefox',
browserName: 'firefox'
},
chrome: {
name: 'Chrome',
browserName: 'chrome'
}
}
var config = {
specs: [
'./e2etest/**/*.spec.js'
],
baseUrl: 'http://localhost:3333'
};
if (process.argv[3] === '--chrome') {
config.capabilities = browsers.chrome;
} else {
config.multiCapabilities = [
browsers.firefox,
browsers.chrome
]
}
exports.config = config;
package.json:
"scripts": {
"test-start": "webdriver-manager start",
"test-e2e": "protractor conf.js",
"test-e2e-dev": "protractor conf.js --chrome"
},
[Protractor] Running tests on multiple browsers的更多相关文章
- appium(3)-Running Tests
Running Tests Preparing your app for test (iOS) Test apps run on the simulator have to be compiled ...
- [React Testing] Setting up dependencies && Running tests
To write tests for our React code, we need to first install some libraries for running tests and wri ...
- [Git] Automatically running tests before commits with ghooks
Wouldn't it be nice if everyone ran the tests before committing code? With ghooks, you can automatic ...
- Running tests on PyCharm using Robot Framework
问题: I started using PyCharm with the robot framework, but i'm facing an issue. how can i run my test ...
- Learning ROS: Running ROS across multiple machines
Start the master ssh hal roscore Start the listener ssh hal export ROS_MASTER_URI=http://hal:11311 r ...
- JavaScript测试工具
大家都知道Javascript的测试比较麻烦,一般是开发使用一些浏览器的插件比如IE develop bar或是firebug来调试,而测试往往需要通过页面展示后的js错误提示来定位.那么还有其他比较 ...
- selenium docs
Note to the Reader - Docs Being Revised for Selenium 2.0! Introduction Test Automation for Web Appli ...
- vue单页面模板说明文档(1)
Introduction This boilerplate is targeted towards large, serious projects and assumes you are somewh ...
- tox 试用
安装 pip install tox tox 使用 tox 包含一个tox.ini 文件,此文件可以自动,或者手工编写 tox.ini 文件格式 # content of: tox.ini , put ...
随机推荐
- CodeSmith使用总结--调用自定义方法
上一篇读取了一个表的内容,但是到了真正应用的时候还是不够用的,我们很容易可以对比出来,SQL里边的数据类型的定义和C#中有所不同,比如Saler--String,大写的String在C#中不是一个类型 ...
- SqlBulkCopy使用心得 (大量数据导入)
文章转载原地址:http://www.cnblogs.com/mobydick/archive/2011/08/28/2155983.html 最近做的项目由于之前的设计人员懒省事,不按照范式来,将一 ...
- cookie 的Domain删除失败的问题
最近接手一个老项目,项目中使用的是cookie来做的处理的,新增的时候cookie添加了域, 但是删除的时候没有添加域,导致删除cookie的时候一直失败!还有cookie的创建与删除,应该都必需经过 ...
- window.dialogArguments的使用
<HTML> <HEAD> <TITLE>showModelessDialogEX.htm</TITLE> <SCRIPT> var sUs ...
- hdu1520 第一道树形DP,激动哇咔咔!
A - 树形dp Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Sta ...
- hdu 1232畅通工程
Problem Description 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇.省政府"畅通工程"的目标是使全省任何两个城镇间都可以实现交通 ...
- I/O复用-epoll模型
epoll函数 epoll函数的使用与select.poll上有很大的差异. epoll使用一组函数来完成任务,而不是单个函数. epoll把用户关心的文件描述符上的事件放在内核里的一个事件表中,从而 ...
- Java中list<Object>集合去重实例
一:Java中list去重的方法很多,下面说一下其中一种方法:把list里的对象遍历一遍,用list.contain(),如果不存在就放入到另外一个list集合中: 二:实例 这里需要注意的是:使用c ...
- redis的特色
总结一下redis的特点: 1.独特的键值对模型 很多数据库只能处理一种数据结构: • SQL 数据库 —— 表格 • Memcached —— 键值对数据库,键和值都是字符串 ...
- javascript中定义事件的三种方式
在javascript中,可以为某个元素指定事件,指定的方式有以下三种: 1.在html中,使用onclick属性 2.在javascript中,使用onclick属性 3.在javascipt中,使 ...