2017-04-21 83 views
0

我使用nightwatch上运行Chrome和Firefox的测试。是否有指定nightwatch Firefox的可执行文件路径的方法吗?

一切就像在Chrome魅力。我成功地在我们的服务器上运行Firefox的测试,但是我的机器上有问题。

目前,由于Marionnette不是很稳定,我们正在测试我们的软件Firefox ESR这是支持没有任何驱动程序的硒。

在我的Linux机器,我安装了火狐(最新)和Firefox(扩展支持版本)。

  • Firefox是在/usr/bin/firefox
  • 的Firefox ESR accssible是/usr/bin/firefox-es

用量角器,我可以使用名为firefox_path魔法属性触发该可执行文件。

但我还没有找到如何使nightwatch使用/usr/bin/firefox-esr

任何想法?

我的配置,如果你有兴趣:

const seleniumPath = /*computed value*/; 
module.exports = { 
    "src_folders": ["test/e2e"], 
    "output_folder": "reports/e2e", 
    "detailed_output": false, 
    "selenium": { 
    "start_process": true, 
    "server_path": seleniumPath, 
    "log_path": "", 
    "host": "127.0.0.1", 
    "port": 4444, 
    "cli_args": {}, 
    }, 
    "test_settings": { 
    "default": { 
     "launch_url": launchUrl, 
     "exclude": ["utils/**/*", "gulpfile.js", "nightwatch*.js"], 
     "selenium_port": 4444, 
     "selenium_host": "localhost", 
     "silent": true, 
     "screenshots": { 
     "enabled": true, 
     "path": "reports/e2e/screenshots", 
     }, 
     "desiredCapabilities": { 
     "browserName": "firefox", 
     "javascriptEnabled": true, 
     "acceptSslCerts": true, 
     }, 
    }, 
    "test_runner": { 
     "type": "mocha", 
     "options": { 
     "ui": "bdd", 
     "reporter": "spec", 
     }, 
    }, 
    } 
+0

你可能有运气设定'selenium.start_process'到'TRUE',让nightwatch决定如何运行。 –

回答

0

我没有多Firefox的安装尝试,但我希望cli_args采取webdriver.firefox.binary包含路径的属性。

这将是与其他Selenium Settings保持。当然,它的存在是在文档的webdriver的Firefox section的设置,同样的能力是有在GeckoDriver docs(虽然我很欣赏你没有使用)。

+0

感谢您的回答。不幸的是,它似乎没有工作。 – ghusse

0

尝试此解决方案,让我知道,如果它正在你身边

selenium: { 
    cli_args: { 
     'webdriver.gecko.driver': '/path/to/geckodriver' 
    } 
    }, 

    test_settings: { 
     default: { 
     desiredCapabilities: { 
      browserName: 'firefox', 
      marionette: true, 
      javascriptEnabled: true 
     } 
    } 
+0

感谢您的回答。不幸的是,我不想使用壁虎驱动程序。我使用的是旧版本的Firefox,它仍然支持,并且不需要Gecko驱动程序。针对这个版本的测试很有效,因为这是我们在Jenkins奴隶上使用的版本。 – ghusse

+0

@ghusse - 您如何期望在不使用网络驱动程序的情况下运行硒测试(哪个夜班人员在底层操作)? –

+0

Firefox版ESR不需要网络驱动程序:selenium本地支持它。 – ghusse

相关问题