feature: user, project, channel and job offer create test flows and project, channel and job offer edit test flows

This commit is contained in:
Jure Ursic
2020-07-03 19:25:23 +02:00
parent e5e2815f0d
commit 8b84de7b37
13 changed files with 533 additions and 89 deletions

View File

@ -1,27 +1,24 @@
/// <reference types="Cypress" />
/* globals cy, expect */
/* globals cy */
context('Signup Browser Testing', () => {
const username = 'testuser_signup_' + Math.floor(1000 + Math.random() * 9000),
email = username + '@testemail.com',
password = 'testpwd';
let username = 'testuser_creation_',
email = '',
password = 'testpwd';
before(() => {
cy.randomNum().then(num => {
username += num;
email = username + '@testemail.com';
});
cy.clearLocalStorage({ domain: null });
cy.clearCookies({ domain: null });
});
it('visit the homepage', () => {
cy.visit('/');
});
it('should await for an user login', () => {
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/auth/login/');
});
});
it('should visit user login screen', () => cy.userLogin());
describe('Signup process', () => {
it('should click on signup page link', () => {
cy.get('.sib-link.sib-register-link').click();
});
it('should write erroneous user data', () => {
it('should write incorrect user data', () => {
cy.get('#id_username').type('!"#$%&');
cy.get('#id_username').should('have.value', '!"#$%&');
cy.get('#id_email').type(email.split('.')[0]);
@ -34,7 +31,7 @@ context('Signup Browser Testing', () => {
it('should click on signup button', () => {
cy.get('.sib-registration-btn').click();
});
it('should provide errors about erroneous user data', () => {
it('should provide errors about incorrect user data', () => {
cy.get('tbody tr:nth-child(1) ul.errorlist li')
.should('contain.text', 'Enter a valid username. This value may contain only letters, numbers, and ./+/-/_ characters.');
cy.get('tbody tr:nth-child(2) ul.errorlist li')
@ -55,5 +52,9 @@ context('Signup Browser Testing', () => {
it('should click on signup button', () => {
cy.get('.sib-registration-btn').click();
});
it('should show email confirmation dialog', () => {
cy.contains('h1.text-center', 'Un e-mail d\'activation a été envoyé.').should("exist");
cy.contains('p.text-center', 'Vérifie ta boite mail et clique sur le lien pour activer ton compte.').should("exist");
});
});
});