interview challenge for a company
have node.js installed
run npm install
run npm run test
run npm run open
I have decided to create tests increasing their complexity until I find a bug, so it took me 4.
For adding a computer with only the name, the expected result is the alert validation that it was created checking the name is displayed. I used a function to create random values for the name.
For the second one, the expected result is that the alert contains the name. I created a function to create date variables for today and next year.
I selected Compaq (because there is only one value). The expected Result is that the table displays at least one value with Compaq
The fourth one is a combination of all the previous test in only one, and the expected result is that the table displays the recently created computer. The recently created computer is not existant in the table, so that should be a bug.
1- valid string for the name. 2- Introduced date with format: yyyy-MM-dd. 3- Discontinued date with format: yyyy-MM-dd and after the introduced date.
1- navigate to https://computer-database.gatling.io/computers 2- click 'add a new computer' button 3- complete the form with all valid data (name: string, introduced: Date ('yyyy-MM-dd'), Discontinued Date ('yyyy-MM-dd'), Company: select value) and click 'Create this computer' 4- validate the name of the computer is displayed on the alert banner 5- enter the name of the computer in the search field and click the 'Filter by name' button.
The table displays the name of the computer with all the data entered
The table is empty.
- Another evidence is that the number of computers does not increase when you create a new computer.
- I have found an issue when opening the console, that there is a 404 error, Failed to load resource: the server responded with a status of 404 (Not Found), but I don't know what is the missing resource, this is when I open the console for the first time. I don't think is related to the bug I found.
I ended up using something similar to page object modal and cucumber. Any questions regarding the structure, you can find information in this medium playlist I created a while back: https://maugap.medium.com/list/cypress-for-dummies-01c3e8dca287