Skip to content

vlasiuksasha/qa_cypress_e2e_intro_adv

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cypress Inroduction: Advanced

Workflow

  1. Fork the repo.
  2. Clone your forked repository.
  3. Create a new branch git checkout -b testing.
  4. Resolve tasks in the cypress/e2e/signUp.cy.js.
  5. Create a pull request.
  6. Do not forget to click on Re-request review if you submit the homework after previous review.

Task

App for testing: https://react-redux.realworld.io

Your task is to automate the next flow:

  1. Go to "Sign Up" page.
  2. Fill in username, email, and password fields using generateUser method.
  3. Click on [Sign up] button.
  4. Assert your username appeared in site navigation (header) menu.

To install faker plugin, run the command: npm install faker@5.5.3. To use faker in your tests, go to support/generate.js file and write the next code:

const faker = require('faker');

function generateUser() {
  const random = Math.random().toString().slice(2, 6);
  const username = faker.internet.userName() + '_' + random;
  const email = `${username}@mail.com`;
  const password = '12345Qwert!';

  return { email, password, username };
}

module.exports = { generateUser };

Now, you can generate a new user in your tests:

const { generateUser } = require('../support/generate');

describe('Sign Up page', () => {
  it('should provide an ability to register new account', () => {
    const user = generateUser();
    
    <your_code>
  });
});

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%