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. DEV PivotGridControl 全选行或列

    foreach (string item in fieldProductName.FilterValues.Values) { pivotGridControl.Cells.SetSelectionB ...

  2. (转)CSS 禁止浏览器滚动条的方法

    1.完全隐藏 在里加入scroll="no",可隐藏滚动条:    这个我用的时候完全没效果,不知道是什么原因!不过好多人说这么用可以,大概是用的位置不一样吧   2.在不需要时隐 ...

  3. VS2010不能打开预编译的网站源码的原因是什么?(转之csdn)

    原问题: 今天将写好的一个网站源码目录拷贝到另一台电脑上,但打开时提示:    你要打开一个预编译的网站,你可以查看该站点,但对它进行更改可能会造成该网站停止运行,若要修改站点,建议先编辑原始网站中的 ...

  4. Tomcat项目部署方式

    一.静态部署 1.直接将web项目文件件拷贝到webapps 目录中      Tomcat的Webapps目录是Tomcat默认的应用目录,当服务器启动时,会加载所有这个目录下的应用.所以可以将JS ...

  5. .net安装windows服务配置文件config

    .net安装windows服务 : 在windows服务的项目(WindowsService1)代码文件中有一个app.config 配置文件,可以通过此文件进行时间等的更改而无需重新生成项目:那我们 ...

  6. silverlight visifire控件图表制作——silverlight 后台方法打印

    一.后台方法 1.添加引用:using System.Windows.Printing; 2.全局变量://定义图片和文本打印变量  PrintDocument printImage; 3.构造方法体 ...

  7. Homebrew -- Mac软件管家(套件管理yun……)

    也许是之前使用linux系统的时候总是习惯使用wget 在mac中只有curl,有点略显不习惯 于是乎某天在搜索mac开发者的时候发现了Homebrew这个东西 ok,是那么句话--惰性是人的天性 有 ...

  8. 影响MySQL性能的五大配置参数

    我们今天主要和大家分享的是对MySQL性能影响关系紧密的五大配置参数,以下就是文章的具体内容描述,希望会给你带来一些帮助在此方面. 以下的文章主要是对MySQL性能影响关系紧密的五大配置参数的介绍,我 ...

  9. Spring技术_邮箱注册_激活_获取验证码

    项目结构 项目中用到的sql: create database hrSystem; use hrSystem; CREATE TABLE `emailverificationcode` ( `id` ...

  10. jquery validate form 异步提交

    jQuery取得select选中的值 jQuery("#select1  option:selected").text(); 相信很多人都用过jquery validate插件,非 ...