This is a high level browser automated program for monitoring DSLogon for uptime.
Instructions to install NodeJS version manager, nvm.
Install nodejs version 8 or above by running:
nvm install 8
or nvm install 10
nvm use 8
or nvm use 10
.Git clone the code: git clone git@github.com:fartbagxp/monitor-dslogon.git
.
Install all third party libraries: npm install
.
Copy .env.sample
to .env
: cp .env.sample .env
.
Fill out the environment variables in the .env
file.
I use vs-code with a prettier extension.
Puppeteer is a NodeJS library which provides a high level API to automate Google Chrome. By simulating Chrome, we have the full ability of viewing a particular user's experience when logging in.
# Simple Test run with screenshots saved to debug folder.
npm run start-dev
# Simulate a production run
npm start
# Running tests
npm test
We take screenshots and validate the HTML provided to ensure that end users experience are what we expect them to be.
npm run start-dev
, and the resulting screenshot and HTML will appear in the debug
folder.We also verify the HTML for correctness, by verifying certain key terms such as logged in
, to verify that the user has been logged in properly.
We should verify that all HTTP request calls were completely properly, and that no error was captured in the Chrome console.