Skip to content

Docker上のSeleniumGridを使ってNightwatchでE2Eテストをするサンプルです

Notifications You must be signed in to change notification settings

treetips/selenium-grid-nightwatch-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example for E2E test for use nightwatch by selenium-grid on docker.

Environment

  • node.js v7.2.0
  • docker v1.12.1
  • nightwatch v0.9.9

Install docker for mac or windows

Install docker for mac or windows.

[mac] https://docs.docker.com/docker-for-mac/

[windows] https://docs.docker.com/docker-for-windows/

Create docker-machine host for selenium

Create selenium docker host.

$ docker-machine create -d virtualbox selenium

Set environment.

$ eval $(docker-machine env selenium)

Clone this repository

git clone https://github.com/treetips/selenium-grid-nightwatch-example.git

Create and start selenium-hub and firefox-container and chrome container

$ docker-compose up -d

Usage

Install npm dependencies

$ npm install

Edit selenium host

You can check the docker-host with the docker-machine ip command.

$ docker-machine ip selenium
172.16.53.136

Open nightwatch.conf.js and edit selenium_host.

let DEFAULT_CONFIGURATION = {
	launch_url: "http://localhost",
	selenium_port: 4444,
	selenium_host: "172.16.53.136",

Run e2e test for local

If execute 'npm run local', start up local chrome or firefox by standalone-selenium without docker and selenium-grid.

# test for chrome
$ npm run local-chrome

# test for firefox
$ npm run local-firefox

# test for chrome and firefox
$ npm run local

Run e2e test for selenium-grid

If execute 'npm run grid', parallel start up chrome or firefox by selenium-grid on docker

$ npm run grid

Edit test suite

Edit src/test.js.

About

Docker上のSeleniumGridを使ってNightwatchでE2Eテストをするサンプルです

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published