0

我有一套測試使用本地驅動程序建立與守夜。效果很好。nightwatch.js可以使用selenium-webdriver中的usingServer嗎?

我正在使用PERFECTO移動和硒webdriver的一個基本的測試。它適用於這個例子。(https://community.perfectomobile.com/series/20208/posts/1002862

我想連接我的套件nightwatch測試perfecto,但不能啓動硒。如果這是硒服務器的網址。

var url = "https://mobilecloud.perfectomobile.com/nexperience/perfectomobile/wd/hub"; 

我嘗試了幾種方法在nightwatch config下設置它,但無法使其工作。

"selenium" : { 
    "start_process" : true, 
    "host" : "mobilecloud.perfectomobile.com/nexperience/perfectomobile/wd/hub" 
} 

是否有一個相當於usingServer在nightwatch?我在文檔中沒有看到任何內容。

driver = new webdriver.Builder(). 
    usingServer(url). 
    withCapabilities(capabilities). 
    build(); 

回答

0

原來這是需要的設置。

"test_settings" : { 
    "perfecto" : { 
    "use_ssl": true, 
    "default_path_prefix": "/nexperience/perfectomobile/wd/hub", 
    "selenium_port" : 443, 
    "selenium_host" : "mobilecloud.perfectomobile.com", 
    "desiredCapabilities": { 
     "browserName": "xxx", 
     "deviceName": "xxx", 
     "user": "[email protected]", 
     "password": "xxx", 
     "platformName": "xxx" 
    } 
    } 
} 

未在寫這個問題的時候工作的重要部分:default_path_prefix沒有定製。

/WD /集線器是缺省前綴。但我真的需要/nexperience/perfectomobile/wd/hub

兩天後,此承諾被引入。它在0.9.5版本中可用。

https://github.com/nightwatchjs/nightwatch/commit/aa24c2c2334c42388318498f654d8fe2957967d1