Workflow:
- Fork the repo.
- Clone your forked repository.
- Create a new branch
git checkout -b develop
. - Resolve tasks in the
cypress
/integration
/firstTest.spec.js
. - Create a pull request.
App for testing: https://react-redux.realworld.io
Your task is to automate the next test case:
- Visit "Sign in" page
- Fill login and password fields as valid data
- Click [Sign In] button
- Assert your username appeared in "Site navigation (Header)" menu
App for testing: https://react-redux.realworld.io
Your task is to automate the next test case:
Write your second test:
- Go to "Sign Up" page
- Fill username, email and password fields with
faker
plugin - Click on [Sign up] button
- 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>
});
});