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. [Redux] Extracting Presentational Components -- Footer, FilterLink

    Code to be refactored: let nextTodoId = 0; class TodoApp extends Component { render() { const { todo ...

  2. springmvc4+hibernate4分页查询功能

    Springmvc+hibernate成为现在很多人用的框架整合,最近自己也在学习摸索,由于我们在开发项目中很多项目都用到列表分页功能,在此参考网上一些资料,以springmvc4+hibnerate ...

  3. Sublime text3配置LiveReload

    Tip: LiveReload是很棒的插件,可以在浏览器中实时预览,但是在Sublime text3里,从Package Control中安装的LiveReload是无法使用的,但是可以选择手动安装解 ...

  4. C#用注册表开机自动启动某某软件

    代码如下: public static void chkAutoRun(bool isRun) { if (isRun)//开机自动启动 { try { RegistryKey runKey = Re ...

  5. update-database时出现Cannot attach the file

    在进行Migrations时,如果直接删除了Db文件,在使用update-database时会出现Cannot attach the file发问题 解决方案:

  6. 光盘自动运行HTML页,Autorun文件写法

    1.把你的网页放在一个根目录下面,起名为index.html 2.在目录新建一个autorun.inf的文件,打开后编辑为以下内容: 代码如下: [autorun]icon=***.ico(加图标) ...

  7. linux虚拟机centos64位_6.5+VM10安装oracle11g图文详解

    注意: vi基本命令:i--编辑状态  退出编辑并保存时先按ESC键,再按符合“:wq”或者":x"即可注意每个步骤时的当前用户,是root还是oracle 以root用户登录虚机 ...

  8. 委托,匿名方法,Lambda,泛型委托,表达式树

    一.委托:完成一个委托应分三个步骤://step01:首先用delegate定义一个委托;public delegate int CalculatorAdd(int x, int y);//step0 ...

  9. 6 log4j -- 一个笨的使用方法

    log4j的说明: Log4j是Apache的一个开源项目,通过使用Log4j,我们可以控制日志信息输送的目的地是控制台.文件.GUI组件,甚至是套接口服务器.NT的事件记录器.UNIX Syslog ...

  10. Oracle11g R2学习系列 之一安装篇

    前言 最近想去前同事推荐的一个Oracle相关的岗位竞争一下,由于之前没有使用Oracle的相关经验,所以决定学习一下,就算最终岗位应聘不成,至少也有了一些Oracle经验了,说不定哪天就用上了.再说 ...