2016-07-26 97 views

回答

3

它涉及到適當的環境設置如果有什麼關你會有誤差。我寫了關於測試的iOS瀏覽器與Nightwatch和Appium一個完整的博客,這是非常近(08/2016)

http://www.shaneofalltrades.com/2016/08/26/Mobile-Web-Testing-Using-Nightwatchjs-part-1/

如果您有任何問題,請隨時問這裏或評論。基本上使用默認的Nightwatch谷歌測試,所以你可以確定它不是你的測試失敗,但配置如果有的話。這是我的配置示例...

"ios" : { 
    "selenium_start_process": false, 
    "selenium_port" : 4723, 
    "selenium_host" : "127.0.0.1", 
    "silent": true, 
    "desiredCapabilities" : { 
    "browserName" : "Safari", 
    "platformName" : "iOS", 
    "platformVersion" : "9.3", 
    "deviceName" : "iPhone 6s Plus" 
    } 
}, 

但請仔細閱讀並按照文檔,有一些重要的獨特步驟。

0

試試這個設置(Nightwatch.js文件),它爲我工作

var path = require('path'); 

var appPath = path.join(process.cwd(), '<your app path>');// .app file 


module.exports = { 
    "src_folders": ["./tests/"], 
    "globals_path": './lib/globals/Globals.js', 

    "selenium": { 
     "start_process": true, 
     "server_path": "node_modules/selenium-server/lib/runner/selenium-server-standalone.jar", 
     "log_path": "./results", 
     "host": "127.0.0.1", 
     "port": 4444, 
     "cli_args": { 
      "webdriver.chrome.driver": "./node_modules/.bin/chromedriver" 
     } 
    }, 

    "test_settings": { 
     "default": { 
      "globals" : { 
       "waitForConditionTimeout" : 20000, 
      }, 
      "launch_url": "http://localhost:4723/wd/hub", 
      "selenium_host": "localhost", 
      "selenium_port": 4723, 
      "silent": true, 
      "output": true, 
      "screenshots": { 
       "enabled": false, 
       "path": "" 
      }, 
      "exclude": ['nightwatch-config.js', 'pageObjects'] 
     }, 
     "ios-sim": { 
      "desiredCapabilities": { 
       "fullReset": false, 
       "app": appPath, 
       "platformName": "iOS", 
       "platformVersion": "9.0", 
       "deviceName": "iPhone 5s" 
      } 
     } 
    } 
}; 
相關問題