feature: user, project, channel and job offer create test flows and project, channel and job offer edit test flows
This commit is contained in:
64
cypress/integration/create-project.spec.js
Normal file
64
cypress/integration/create-project.spec.js
Normal file
@ -0,0 +1,64 @@
|
||||
/// <reference types="Cypress" />
|
||||
/* globals cy, expect */
|
||||
|
||||
context('Create Project Browser Testing', () => {
|
||||
let projectName = 'Test Project ',
|
||||
customerName = 'Test Customer ',
|
||||
description = 'Test Description ';
|
||||
before(() => {
|
||||
cy.randomNum().then(num => {
|
||||
projectName += num;
|
||||
customerName += num;
|
||||
description += num;
|
||||
});
|
||||
cy.clearLocalStorage({ domain: null });
|
||||
cy.clearCookies({ domain: null });
|
||||
});
|
||||
it('should visit user login screen', () => cy.userLogin());
|
||||
describe('Project Creation process', () => {
|
||||
it('should login', () => cy.login());
|
||||
it('should visit the project creation screen', () => cy.naviagte('/admin/admin-projects/admin-project-create'));
|
||||
/*it('should enter incorrect project data', () => {
|
||||
cy.get('#admin-project-create input[name="customer.name"]').type('!"#$%&');
|
||||
cy.get('#admin-project-create input[name="customer.name"]').should('have.value', '!"#$%&');
|
||||
cy.get('#admin-project-create input[name="name"]').type('!"#$%&');
|
||||
cy.get('#admin-project-create input[name="name"]').should('have.value', '!"#$%&');
|
||||
cy.get('#admin-project-create textarea[name="description"]').type(description);
|
||||
cy.get('#admin-project-create textarea[name="description"]').should('have.value', description);
|
||||
});
|
||||
it('should click on create project button', () => {
|
||||
cy.get('#admin-project-create input[type="submit"]').click();
|
||||
});
|
||||
it('should provide errors about incorrect project data', () => {
|
||||
// TO-DO: Check for error messages
|
||||
cy.get('element')
|
||||
.should('contain.text', 'Error message.');
|
||||
});*/
|
||||
it('should enter correct project data', () => {
|
||||
cy.get('#admin-project-create input[name="customer.name"]').clear().type(customerName);
|
||||
cy.get('#admin-project-create input[name="customer.name"]').should('have.value', customerName);
|
||||
cy.get('#admin-project-create input[name="name"]').clear().type(projectName);
|
||||
cy.get('#admin-project-create input[name="name"]').should('have.value', projectName);
|
||||
cy.get('#admin-project-create textarea[name="description"]').clear().type(description);
|
||||
cy.get('#admin-project-create textarea[name="description"]').should('have.value', description);
|
||||
});
|
||||
it('should click on create project button', () => {
|
||||
cy.get('#admin-project-create input[type="submit"]').click();
|
||||
});
|
||||
it('should land on projects list screen', () => {
|
||||
cy.location().should((loc) => {
|
||||
expect(loc.pathname).to.eq('/admin/admin-projects');
|
||||
});
|
||||
// Workaround - component reactivity bug
|
||||
cy.reload();
|
||||
cy.get('.accept-button').click();
|
||||
// End workaround
|
||||
});
|
||||
it('should land newly created project on projects list screen', () => {
|
||||
cy.contains('solid-display-value[name="project.name"]', projectName).should("exist");
|
||||
cy.fixture('admin.json').then(admin => {
|
||||
cy.contains('solid-display-value[name="username"]', admin.username).should("exist");
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user