Code Monkey home page Code Monkey logo

cypress_first_hw-1's Introduction

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/firstTest.spec.js.
  5. Create a pull request.

Basic level

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

Your task is to automate the next test case:

  1. Visit "Sign in" page
  2. Fill login and password fields as valid data
  3. Click [Sign In] button
  4. Assert your username appeared in "Site navigation (Header)" menu

Advanced level

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

Your task is to automate the next test case:

Write your second test:

  1. Go to "Sign Up" page
  2. Fill username, email and password fields with faker plugin
  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('Your Second Test', () => {
  it('Sign up with faker', () => {
    const user = generateUser();
    
    <your_code>
  });
});

cypress_first_hw-1's People

Contributors

ibrianwarner avatar mgrinko avatar

Watchers

 avatar  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.