North-Seattle-College / ad440-winter2021-thursday-repo

NSC AD 440 Winter 2021 Thursday cohort practicum repo
Apache License 2.0
2 stars 27 forks source link

Sg UI test- /users/{userid}/tasks #247

Closed gillilands19 closed 3 years ago

gillilands19 commented 3 years ago

What is it?

A Ui test runner using puppeteer with headless chrome.

Description

This pull request implements a series of functions and JS scripts using the puppeteer UI automation library to test our react app. Currently the public URL for our react app does not allow us to go directly to the endpoint we want to test by typing it in the browser. This PR traverses our React app simulating user input and fires React onChange events in order for input validation and propagation of state to our Components.

How To Test/Run

In your terminal:

$ cd test/ui $ npm install --save-dev

This should install the necessary packages to run the puppeteer test. You can run the test by typing the following: npm run ui-tests

Screen Shot 2021-03-07 at 3 27 55 PM

You will see similar output to the above. All screenshots of the UI are saved in the following directory:

/test/results/ui-test-results

For API documentation please see the following JSDoc here:

/test/ui/out/

Screen Shot 2021-03-07 at 3 33 54 PM
DATE ACTIVITY TIME
3/2 Set up Environment. Write basic puppeteer test 1 hours
3/3 Expanded test script to get element text for output 1 hour
3/5 Debugging inability to enter values and click through to next page 2 hours
3/6 Expanded Test functions further and refactored code for reusability 4 hours
3/6 More debugging. Could not get events to fire in UI or DOM 2 hours
3/7 Fixed problem with Events and passing programatically input values to React state. Further Refactoring of code to iterate through tests and endpoints. Code documentation and generating JSDoc 4 hours