[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 ...
随机推荐
- c#基础: 线程的初级用法总结
启动一个线程的两种方法: a.使用无参的方法 Thread thread1 = new Thread(new ThreadStart("调用的方法名")): ...
- Linux查看系统状态及备份
1. 如何看当前Linux系统有几颗物理CPU和每颗CPU的核数?cat /proc/cpuinfo将CPU的总核数除以物理CPU的个数,得到每颗CPU的核数.2. 查看系统负载有两个常用的命令,是哪 ...
- FileShare文件读写锁解决“文件XXX正由另一进程使用,因此该进程无法访问此文件”(转)
开发过程中,我们往往需要大量与文件交互,读文件,写文件已成家常便饭,本地运行完美,但一上到投产环境,往往会出现很多令人措手不及的意外,或开发中的烦恼,因此,我对普通的C#文件操作做了一次总结,问题大部 ...
- ControlStyles(枚举)
指定控件的样式和行为. 此枚举有一个 FlagsAttribute 特性,通过该特性可使其成员值按位组合.属性: ContainerControl:如果为true,则控件是类似容器的控件. UserP ...
- Invalid content was found starting with element 'taglib'”
今天在使用struts-menu制作菜单,在web.xml中写入 <taglib> <taglib-uri>/WEB-INF/struts-menu.tld</ ...
- iOS9适配+warning消除
最近做了iOS 9的适配,程序出现大量警告也做了些处理,写出来分先给大家. 一.iOS 9适配 问题一: <Error>: CGContextSaveGState: invalid con ...
- 浅谈Windows Server APPFABRIC
hi,everyone !真的是好久好久没有update blog了,因为最近忙着备考,没有时间对<数据结构与算法>进行研究学习了.所以,blog一直未更新.today is Friday ...
- 2 MD5加密 java实现
百度百科对MD5的说明是: Message Digest Algorithm MD5(中文名为消息摘要算法第 五版)为计算机安全领域广泛使用的一种散列函数,用以提供消息的完整性保护. MD5即Mess ...
- Fedora下YouCompleteMe配置
需要在默认的.ycm_extra_conf.py 中添加(C++的路径可能需要根据版本号修改) '-isystem', '/usr/include', '-isystem', '/usr/includ ...
- Hadoop文件的基本操作
Hadoop提供了大量的API对文件系统中的文件进行操作,主要包括: (1)读取文件 (2)写文件 (3)读取文件属性 (4)列出文件 (5)删除文件 1、读取文件 以下示例中,将hdfs中的一个文件 ...