Skip to content

Tony427/NightwatchWin10Sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nightwatchWin10Sample

Clean project running nightwatch js under Win 10 environment

Environment

  • install jdk for running selenium server
  • install node.js
  • install python (2.x version)
  • install Visual Studio and create and C++ project to install the necessary packages.(see the Install issue with NPM below.)
  • download selenium standalone server
  • download webdriver (chrome, firefox, IE)

Step1 Install package

$ npm install socket.io
$ npm install -g npm
$ npm install -g nightwatch

Step2 Create Repo

  1. Create MyRepoName
  2. Copy npm & nightwatch folders into MyRepoName
  3. Create folders
  • selenium (for seleunim standalone jar file)
  • reports (for test reports )
  • webdriver (where you place the webdriver files)
  • tests (where you place your test scripts)

Step3 Set Config

  1. copy nightwatch.json from nightwatch/bin into MyRepoName.
  2. touch a file nightwatch.js points to runner.js
require('C:/MyRepoName/nightwatch/bin/runner.js');
  1. set selenium server
  • start_process as true will automatically launch the selenium server. Otherwise you have to launch the selenium server manually by using command.
$ java -jar selenium/selenium-server-standalone.jar
  • set server_path where you place the selenium standalone server file
"selenium": {
    "start_process": true,
    "server_path": "selenium/selenium-server-standalone.jar",
    "log_path": "",
    "host": "127.0.0.1",
    "port": 4444,
    "cli_args": {
        "webdriver.chrome.driver": "webdriver/chromedriver.exe",
        "webdriver.ie.driver": "",
        "webdriver.firefox.profile": ""
    }
},
  1. set browser as chrome
"desiredCapabilities" : {
  "browserName" : "chrome",
  "javascriptEnabled" : true,
  "acceptSslCerts" : true,
  "chromeOptions" : {
    "args" : ["start-fullscreen"]
  }
}
  1. for more browswer settings. please refereance [camel's Blog] Nightwatch.js debug 血淚史.

Step4 Run test

Copy google.js as test script from nightwatch\examples\tests to tests folder.

$ nightwatch tests/google.js

Version Information

  • windows 10
  • Visual Studio 2015
  • python v2.7.13
  • npm 5.3.0
  • nightwatch v0.9.16
  • nodejs v8.0.0

Reference

Nightwatch.js installation on Windows 10

[camel's Blog] Nightwatch.js debug 血淚史

Install issue with NPM

About

clean project running nightwatch js under win 10 env

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published