- Fork the repo.
- Clone your forked repository.
- Clone this repo into you repo.
- Create a new branch
git checkout -b e2e_testing
. - Run the app (Local development with SQLite).
- Resolve tasks.
- Record a video of your running your tests (you can use Loom).
- Check yourself before submitting the task with a Cypress checklist.
- Create a pull request.
- Attach a link to your video to the PR description.
- Do not forget to click on
Re-request review
if you submit the homework after previous review.
Go to e2e
folder and cover listed functionality with e2e tests:
- updating bio;
- updating username;
- updating email;
- updating password.
- Clear all data from the database before the test.
- Add
data-cy
attributes for all elements you are working with in tests. - Use faker and custom methods to generate a fake data in tests.
- Use PageObject pattern for your tests:
- create a files with POM classes for your pages in
cypress
/support
/pages
. - use
PageObject.js
file for the common for the whole app elements.
- create a files with POM classes for your pages in
Observe an example in cypress
/e2e
/signIn.cy.js
.
Find and additinoanl about Page Object in the Cypress topic.
Hint
💡 Be mindful of data validation when generating test data for API requests. Some randomly generated values may not meet the API’s validation rules, causing tests to fail. To avoid flaky test behaviour, ensure that your data generation method produces valid values. You can adjust the data generation by using different `faker` methods or by passing different configuration options (if the method supports them).