- Fork the repo.
- Clone your forked repository.
- Run the command
npm i
. - Create a new branch
git checkout -b testing
. - Resolve tasks in the
cypress
/e2e
/signUp.cy.js
. - Check yourself before submitting the task with a Cypress checklist.
- Create a pull request.
- Do not forget to click on
Re-request review
if you submit the homework after previous review.
App for testing: https://react-redux.realworld.io
Your task is to automate the next flow:
- Go to "Sign Up" page.
- Fill in username, email, and password fields using
generateUser
method. - Click on [Sign up] button.
- Assert your username appeared in site navigation (header) menu.
To use faker
in your tests, go to support
/generate.js
file and write the next code:
import { faker } from '@faker-js/faker';
function generateUser() {
const randomNumber = Math.random().toString().slice(2, 6);
const username = faker.internet.userName() + '_' + randomNumber;
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:
import { generateUser } from '../support/generate';
describe('Sign Up page', () => {
it('should provide an ability to register new account', () => {
const user = generateUser();
<your_code>
});
});