Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solution #165

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions cypress/e2e/signUp.cy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
import { generateUser } from '../support/generate';

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

cy.visit('https://react-redux.realworld.io/#/register/');

cy.get('[placeholder="Username"]')
.type(user.username);

cy.get('[placeholder="Email"]')
.type(user.email);

cy.get('[placeholder="Password"]')
.type(user.password);

cy.contains('[type="submit"]', 'Sign in')
.click();

cy.contains('[class="nav-link"]', user.username);
});
});
12 changes: 12 additions & 0 deletions cypress/support/generate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
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 };
6,937 changes: 6,580 additions & 357 deletions package-lock.json

Large diffs are not rendered by default.