Firefox не игнорирует функцию cucumber

#selenium #webdriver #selenium-firefoxdriver #webdriver-io #cucumberjs

#селен #webdriver #selenium-firefoxdriver #webdriver-io #cucumberjs

Вопрос:

У меня много проблем с запуском сценария Gherkin в firefox. Пример отлично работает в Chrome.

Возможности в моем wdio.conf.js

 capabilities: [{
    // maxInstances can get overwritten per capability. So if you have an in-house Selenium
    // grid with only 5 firefox instance available you can make sure that not more than
    // 5 instance gets started at a time.
    maxInstances: 5,
    //
    browserName: 'firefox',
    path: '/usr/local/lib/node_modules/selenium-standalone/.selenium/selenium-server/3.0.0-beta3-server.jar'
  }],
  

Я также использую firefox-profile и selenium-standalone server (сервисы в wdio.conf.js )

 services: ['selenium-standalone', 'firefox-profile'],
  firefoxProfile: {
    // extensions: ['/path/to/extensionA.xpi', '/path/to/extensionB.xpi'],
    'browser.startup.homepage': 'http://google.com',
    'plugin.state.npctrl': '2',
    'plugin.state.silverlight': '2'
  }
  

Настройка:

  • webdriverio: 4.2.16
  • wdio-cucumber-framework: 0.2.5
  • wdio-firefox-profile-service: 0.0.1
  • wdio-selenium-standalone-service: 0.0.7
  • cucumber (js): 1.2.0
  • selenium-server: 3.0.0-beta3
  • Firefox: 49.0.1
  • geckodriver: 0.10.0

Firefox открывается и переходит к google.com но он не запускает тест, я получаю следующий вывод:

 =======================================================================================
Selenium 2.0 / webdriver protocol bindings implementation with helper commands in nodejs.
For a complete list of commands, visit http://webdriver.io/api.html.
=======================================================================================

[18:09:10]  COMMAND POST     "/wd/hub/session"
[18:09:10]  DATA        {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"maxInstances":5,"browserName":"firefox","path":"/usr/local/lib/node_modules/selenium-standalone/.selenium/selenium-server/3.0.0-beta3-server.jar","firefox_profile":"[base64] 1236 bytes","loggingPrefs":{"browser":"ALL","driver":"ALL"},"requestOrigins":{"url":"http://webdriver.io","version":"4.2.16","name":"webdriverio"}}}


0 passing (48.90s)
  

В Chrome та же настройка получает (ожидаемый) следующий вывод:

 =======================================================================================
Selenium 2.0 / webdriver protocol bindings implementation with helper commands in nodejs.
For a complete list of commands, visit http://webdriver.io/api.html.
=======================================================================================

[18:13:49]  COMMAND POST     "/wd/hub/session"
[18:13:49]  DATA        {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"maxInstances":5,"browserName":"chrome","path":"/usr/local/lib/node_modules/selenium-standalone/.selenium/selenium-server/3.0.0-beta3-server.jar","loggingPrefs":{"browser":"ALL","driver":"ALL"},"requestOrigins":{"url":"http://webdriver.io","version":"4.2.16","name":"webdriverio"}}}

(...)

6 passing (14.40s)
  

Ответ №1:

Вероятно, это проблема совместимости версий, понижение до selenium server 2.53.1 и firefox до 43.0 позволяет ему работать идеально.