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的更多相关文章

  1. appium(3)-Running Tests

    Running Tests   Preparing your app for test (iOS) Test apps run on the simulator have to be compiled ...

  2. [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 ...

  3. [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 ...

  4. 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 ...

  5. 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 ...

  6. JavaScript测试工具

    大家都知道Javascript的测试比较麻烦,一般是开发使用一些浏览器的插件比如IE develop bar或是firebug来调试,而测试往往需要通过页面展示后的js错误提示来定位.那么还有其他比较 ...

  7. selenium docs

    Note to the Reader - Docs Being Revised for Selenium 2.0! Introduction Test Automation for Web Appli ...

  8. vue单页面模板说明文档(1)

    Introduction This boilerplate is targeted towards large, serious projects and assumes you are somewh ...

  9. tox 试用

    安装 pip install tox tox 使用 tox 包含一个tox.ini 文件,此文件可以自动,或者手工编写 tox.ini 文件格式 # content of: tox.ini , put ...

随机推荐

  1. Oracle442个应用场景------------基础应用场景

    /////////////////基础知识////////////////// 应用场景178:最简单的select语句 SELECT * FROM Employees; 应用场景179:指定要查询的 ...

  2. RHEL-resolv.conf文件修改后重启被还原

    修改resolve.conf文件之后,reboot或service restart network时,修改的内容被还原.关闭NetworkManager即可.# chkconfig |grep Net ...

  3. ORA-24324、ORA-12560、ORA-12514

    SQL> startup ERROR: ORA-24324: 未初始化服务句柄 ORA-01041: 内部错误, hostdef 扩展名不存在. SQL> conn sys /nolog; ...

  4. silverlight visifire控件图表制作——silverlight 后台方法ControlChart.xaml.cs

    一.构造方法ControlChart 1.前台页面控件赋值 //时间下拉框赋值,下拉框赋选定值                for (int ii = DateTime.Today.Year; ii ...

  5. VC 串口通信类

    为了节省时间,我就贴出来吧 头文件 SerialPort.h /******************************************************************** ...

  6. DTO学习系列之AutoMapper(一)

    一.前言 DTO(Data Transfer Object)数据传输对象,注意关键字“数据”两个字,并不是对象传输对象(Object Transfer Object),所以只是传输数据,并不包含领域业 ...

  7. SSM框架搭建web服务器实现登录功能(Spring+SpringMVC+Mybatis)

    初学java EE,虽然知道使用框架会使开发更加便捷高效,但是对于初学者来说,感到使用框架比较迷惑,尤其是各种jar包的引用.各种框架的配置.注解的使用等等. 最好的学习方法就是实践,于是下载了一个现 ...

  8. uva11426 欧拉函数应用

    题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=121873#problem/F 题目大意:给你一个数n,让你输出(i=1-> ...

  9. 内存管理pbuf.c源码解析——LwIP学习

    声明:个人所写所有博客均为自己在学习中的记录与感想,或为在学习中总结他人学习成果,但因本人才疏学浅,如果大家在阅读过程中发现错误,欢迎大家指正. 本文自己尚有认为写的不完整的地方,源代码没有完全理清, ...

  10. 给定范围内产生N个不同的随机数

    void RandNumbs(int nLimts, int result[], int n)//给定范围内产生n个不同随机数(1-nLimts),并存储到result中 { int nNum = 0 ...