NightwatchJS GUI implementation for executing tests and manage tests cron jobs
npm install nightwatchjs-guiRun tests, create and manage cronjobs for automatic e2e tests from GUI.
Backend uses express.
Frontend uses Vue.js
Start server from command line: nightwatchjs-gui from your project root folder.\node_modules/.bin/nightwatchjs-gui if the package is installed locally.\
Example:node_modules/.bin/nightwatchjs-gui --port=4600
Start from js script:
``javascript
const NightwatchJSGUI = require('nightwatchjs-gui');
var args = {
port: 4600,
configFilePath: '/var/www/html/e2e-tests/config.conf.js',
dbFilePath: '/var/www/html/e2e-tests/gui-db/gui.db',
cronjobCallback: (result, cronjob) => {
//Get predefined emails by cronjobs tags and send the results
let emails = getMailsByTags(cronjob.tags);
emailService.send(emails, result);
}
}
var nightwatchJSGUI = new NightwatchJSGUI(args);
`
#### configFilePath
Absolute path to your nightwatch project config file. This will be used to extract the paths to tests folders and testing environments (selenium etc.). Tests folders must be defined in this file although this property is optional for nightwatch, this is the way nightwatch-gui will know how to list your tests and tests groups.
#### cronjobCallback
Nightwatch GUI will call this function with the following arguments:\
* results - The test results parsed from stdout
* cronjob - The cronjob object that was executed
#### dbFilePath
Nightwatch GUI uses nedb library for DB management. The data will be saved to the file specified in this argument.
#### reporter
By default nightwatchjs-gui will save reports to db and parse them in reports page. You can set your own reporter as described in Nightwatchjs documentation. This argument will be used directly in the test command.
-d` flag. This will enable keeping nightwatchjs-gui alive after closing the command session.To stop the service run
`nightwatchjs-gui --stop`This package uses pm2 for running as a service. Checkout it's documentation for more options
Docker
This project is also available as a docker image in fishondor/nightwatchjs-gui.Running the server from docker container will require configuring testing environments for local selenium testing. Running tests remotely (browserstack, crosssbrowsertesting) will have no difference though.
To run the image, map desired port to 8080 and mount nightwtch project folder to
`/var/nightwatch`. Example: `docker run -p 8080:8080 -v "$(pwd)"/:/var/nightwatch fishondor/nightwatchjs-gui`.
Example for implementation with selenium-chrome-debug docker image using docker-compose, and nightwatch testing environment configuration can be found hereDevelopment
* Clone this repo (recommended into a nightwatch js project)
* run npm run start:local - this will start local server on port 8080 and vue.js project on port 4200
* Open localhost:4200`Simple implementation of firebase auth reverse proxy server can be found here