GithubHelp home page GithubHelp logo

qa_cypress_e2e_intro_adv's Introduction

Cypress Inroduction: Advanced

Workflow

  1. Fork the repo.
  2. Clone your forked repository.
  3. Run the command npm i -D @types/cypress@latest.
  4. Create a new branch git checkout -b testing.
  5. Resolve tasks in the cypress/e2e/signUp.cy.js.
  6. Create a pull request.
  7. 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 [email protected]. 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>
  });
});

qa_cypress_e2e_intro_adv's People

Contributors

ibrianwarner avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.