Cypress Testing Tasks

Complete these tasks using Cypress to practice your testing skills. Click on "Show Solution" to reveal a possible implementation for each task.

Task 1: Navigation Test

Write a test to verify that clicking on each navigation link takes you to the correct page.

Task 2: Form Submission

Create a test that fills out the form on the Form page and submits it. Verify that the submitted data is displayed correctly.

Task 3: Table Interaction

Write a test that clicks the "Edit" button for a specific user in the table and verifies that the correct message is displayed.

Task 4: Dynamic Content Loading

Test the "Load Data" button functionality on the Dynamic Content page. Verify that the correct data is loaded and displayed.

Task 5: Color Change Test

Write a test for the "Change Background Color" button on the Dynamic Content page. Verify that the color changes correctly with each click.

Task 6: Add and Delete User Test

Create a test that adds a new random user to the table, verifies its presence, then deletes the user and confirms its removal.

Task 7: Toggle Message Visibility Test

On the Dynamic Content page, create a test that toggles the message visibility multiple times and verifies its state after each toggle.

Task 8: Cross-Page Navigation and State Test

Create a test that navigates through multiple pages, performs actions on each, and verifies that the state is maintained or updated correctly.

Task 9: Performance Test

Create a test that measures the load time of each page and ensures it's below a certain threshold.

Task 10: Custom Command Test

Create a custom Cypress command to fill out the form, and then use it in a test to submit the form multiple times with different data.