YevhS / cypress_fourth_hw

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Workflow:

  1. Fork the repo.
  2. Clone your forked repository.
  3. Create a new branch git checkout -b develop.
  4. Resolve tasks in the cypress/integration/signIn.spec.js.
  5. Create a pull request.

Basic level

App for testing: https://demoqa.com/login

Create your account before tests register page. Note: that action you should perform only once. Do not automate it!

Your task is to automate the next test cases:

  1. Login as your registered account
  2. Check your username after login username
  3. Navigate to books list
  4. Type into search field "Speaking JavaScript"
  5. Click on 'Speaking JavaScript' link
  6. Click on [Add To Your Collection] button on Speaking JavaScript preview page
  7. Confirm popup. You can do it with cy.on()
cy.on('window:alert', (str) => {
    expect(str).to.equal(`Book added to your collection.`)
})
  1. Open your profile page
  2. Assert 'Speaking JavaScript' in your shopping list
  3. Delete Speaking JavaScript book from your list

In order to be logged in before each test, do the following:

  1. Create beforeEach method for login before your tests
  2. Add custom cypress cy.login(email, password) command (In this step you should not use cy.request)
  3. Move beforeEach method to support/index.js file and run login before each IT

Advanced level

  1. Rewrite Login method using cy.request().then((resp) => {resp.body.token ....})
  2. Add cookies to defaults
Cypress.Cookies.defaults({
    preserve: [...]
})

About


Languages

Language:JavaScript 100.0%