Skip to content

mate-academy/qa_cypress_e2e_project

Repository files navigation

Drash Example App

Workflow

  1. Fork the repo.
  2. Clone your forked repository.
  3. Run npm i.
  4. Create a new branch git checkout -b e2e_testing.
  5. Run the app.
  6. Resolve tasks.
  7. Check yourself before submitting the task with a Cypress checklist.
  8. Create a pull request.
  9. Do not forget to click on Re-request review if you submit the homework after previous review.

Task

Go to e2e folder and cover listed functionality with e2e tests:

  • creating an article;
  • editings an article;
  • deleting an article;
  • sign in (positive);
  • sign in (invalid credentials);
  • sign up (positive);
  • sign up (negative);
  • following/unfollowing the user;
  • updating bio;
  • updating username;
  • updating email;
  • updating password.

Basics level

  1. Clear all data from the database before the test.
  2. Add data-qa attributes for all elements you are working with in tests.
  3. Use faker and custom methods to generate a fake data in tests.

Advanced level

Use PageObject pattern for your tests:

  1. Create a files with POM classes for your pages in cypress/support/pages.
  2. Use PageObject.js file for the common for the whole app elements.

Observe an example in cypress/e2e/signIn.cy.js.
Find and additinoanl about Page Object in the Cypress topic.

Hint
💡 Usually, front-end tests rely on specific data-* attributes to locate elements on the page. However, there might be cases when these attributes are missing in the front-end application code, so you might need to add them yourself. If your tests fail because elements cannot be found, double-check that necessary attributes are added in the component files and that your latest changes are pushed to the repository.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published