This contains the instructions and assumptions made for building and running the code challenge algorithm.
- Please setup your git config and clone the repository onto your local machine (IDE, preferred VSCode)
- Make sure that you have the follow versions:
- Npm package manager is version 10.7.0 or above. If not installed, please do so. You can do
npm -vin terminal to check. - Node version is 20.15.0 or greater. You can do
node -vin terminal to check.
- Npm package manager is version 10.7.0 or above. If not installed, please do so. You can do
- Do a
npm installin the terminal and you should be ready to do step 4- Note that if you are prompted to with an error from playwright, you can always following the Installing Playwright guide.
- try
npm run testand you should see tests running.- To run each individual tests, you can just go the the code-challenge-test.spec.ts file and comment out a lines or install the playwright test in vscode plugin to run each individual in the testing section from the testing flask icon.
Below are some key assumptions made from the challenge when making the best algorithm:
- The left and right bowls table cell positions does not matter as long as there are numbers insert to compare.
- Algorithm will always require 3 sets with equal number of elements and 9 uniques numbers ranging from 0 to 8.
- left and right bowls cells cannot insert negative or decimal numbers.
- program will change the position of fake gold when refreshed.
- test is currently only executed in headless chrome with 1 worker as no indication of which browser was needed to run.
- In the event of needing scale the program, PageObject model has been implemented to better organize code and methods. Environment variables and fixtures are implemented as well for the same reason.
- Output values are sent out to the console terminal
- Comments and documentation are added throughout the project code for reability and for new people.