├── .github # Github Actions config file.
├── api_tests # Postman Enviroment collection & environment files.
├── test # Main Page Object Model folder.
│ ├── data # Data providers, Roles, data Test and users.
│ ├── pages # All the pages, including the Common/Base page.
│ ├── steps # All the steps, including the workarround steps.
│ ├── tests # All Test files.
└── report # Visual report folders to save JSON & HTML files.
│ ├── HTMLReport
│ ├── JSONreport
└── .env # Follow the 3th & 4th steps to create the file.
└── nightwatch.conf.json # Nightwatch config file.
└── package.json # Config main Dependencies.
└── report-generator.js # HTML Visual report config file.
-
Clone the project:
git clone https://github.com/CarlosCerv/Nigthwatch-Suite.git
-
Open the project and run the next command in the terminal to install the libraries from package.json:
npm install
-
In the root folder create a new file with the next name:
.env
-
Open the .env file and add the next variables. In BASE_URL add the home page url, in USER_SUCCESS and PASSWORD_SUCCESS add a valid email and password to login successfully in the todoist application:
BASE_URL=https://baseurl.com/
USER_SUCCESS=validuser@email.com
PASSWORD_SUCCESS=validpassword
-
Open the terminal and add the next commands to run the test scripts:
npm run TEST:001_TODOIST_USER_LOGIN_SUCCESS
: run all the test scriptsTEST:002_TODOIST_USER_LOGIN_INCORRECT_EMAIL
: run the login form test casesTEST:003_TODOIST_USER_LOGIN_INCORRECT_PASSWORD
: run the creation of tasks test cases
-
First, run the next command to generate a JSON file with the data provided:
npm run TEST:003_TODOIST_USER_LOGIN_INCORRECT_PASSWORD --reporter html-reporter.js
-
Second, to open the HTML report run the next command. It going to open a browser to shows the assertions and results:
npm run Test:Login --reporter html-reporter-statistics.js
-
To analyzes the JavaScript code and quickly find problems on libraries, run the next command:
npm fund fix
-
To run the API tests use the next command:
npm run test-api
- To run the tests with notifications eneable use the next command:
npm install --save-dev nightwatch-slack-reporter
You can configure Slack reporter options in [test globals] or [configuration file].
options = {
slack_message: function(results, options) { // function or message string
return {
text: 'Test completed, passed ' + results.passed + ', failed ' + results.failed,
username: 'Nightwatch',
icon_emoji: ':ghost:'
} // Message payload or string
},
slack_webhook_url: 'https://hooks.slack.com/services/...'
// This can be specified with SLACK_WEBHOOK_URL environment variable
}
[Carlos Eduardo Cervantes Arteaga]
- nightwatch
- postman (API)
- dotenv
- html-reporter-handlebars
- slack integration