运行使用量角器multiCapabilities配置,但限制最大的webdriver实例端到端测试 [英] Running e2e tests using Protractor multiCapabilities config but limit max Webdriver instances

查看:203
本文介绍了运行使用量角器multiCapabilities配置,但限制最大的webdriver实例端到端测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上下文

我尝试了全新的量角器0.19.0与multiCapabilities配置选项。它实际上是在文档工作描述:

I am trying the brand new Protractor 0.19.0 with the multiCapabilities config option. It is actually working as described in the docs :


  1. 这使得在多个浏览器上运行测试更简单(无需呼噜声,也没有剧本,只有1个配置文件)。

  2. 这使得并行
  3. 运行测试

第二点对我来说是有问题的。我的一个应用程序不处理的数据的多个连接,这意味着测试失败。

The second point is problematic for me. One of my app doesn't handle multiple connection to the data, implying that the tests fail.

我的问题是:

是否有可能限制webdriver的实例的最大数量,以便为这个应用程序禁用并行测试?

Is it possible to limit the maximum number of instances of Webdriver in order to disable parallel testing for this app?

我试图

我在硒Webdriverjs GRID2维基中发现,有一个 maxSession 参数,它会完全适合我的情况!但是我试着将它添加在我的量角器的配置,没有成功。

I've found in Selenium Webdriverjs Grid2 wiki that there's a maxSession parameter that would perfectly fit to my case! But I tried to add it in my Protractor config, without success.

maxSession 也是在所需的能力。如果它的工作没有任何人知道?

maxSession is also in the Desired Capabilities. Anyone knows if it's working yet?

下面是链接到 multiCapabilities PR话题,我给出了评语那里。

Here is the link to the multiCapabilities PR topic, I left a comment there.

如果您需要更多的信息,随时问:)

If you need more info, feel free to ask :)

在此先感谢!

编辑: 问题

EDIT2:最近我尝试添加 seleniumArgs:['-maxSession = 1'] 我的量角器配置,unfortunaltely这不工作太...

I recently tried to add seleniumArgs: ['-maxSession=1'] to my Protractor config, unfortunaltely this doesn't work too...

推荐答案

这犯并在发布的0.24.0 (请参见量角器的changelog )。

Implemented in this commit and released in 0.24.0 (See Protractor changelog).

您需要添加一个 MAXSESSIONS 选项到你的量角器配置文件使用值> = 1(否则的 considered无限制 的)。

You need to add a maxSessions option into your protractor config file with a value >=1 (otherwise it is considered as unlimited).

protractor.config.js例如:

exports.config = {
  seleniumAddress: 'http://127.0.0.1:4444/wd/hub',

  specs: [
    '../e2e/**/*.js'
  ],

  multiCapabilities: [
    {'browserName': 'chrome'},
    {'browserName': 'firefox'},
    {'browserName': 'phantomjs'}
  ],

  maxSessions: 1,

  baseUrl: 'http://localhost:8000'
};

测试,并有望于我的情况下工作。

Tested and working as expected for my case.

这篇关于运行使用量角器multiCapabilities配置,但限制最大的webdriver实例端到端测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆