feature: user, project, channel and job offer create test flows and project, channel and job offer edit test flows
parent
e5e2815f0d
commit
8b84de7b37
@ -0,0 +1,4 @@ |
||||
{ |
||||
"username": "admin", |
||||
"password": "admin" |
||||
} |
@ -0,0 +1,58 @@ |
||||
/// <reference types="Cypress" />
|
||||
/* globals cy, expect */ |
||||
|
||||
context('Create Channel Browser Testing', () => { |
||||
let channelName = 'Test Channel ', |
||||
description = 'Test Description '; |
||||
before(() => { |
||||
cy.randomNum().then(num => { |
||||
channelName += num; |
||||
description += num; |
||||
}); |
||||
cy.clearLocalStorage({ domain: null }); |
||||
cy.clearCookies({ domain: null }); |
||||
}); |
||||
it('should visit user login screen', () => cy.userLogin()); |
||||
describe('Channel Creation process', () => { |
||||
it('should login', () => cy.login()); |
||||
it('should visit the channel creation screen', () => cy.naviagte('/admin/admin-circle-create')); |
||||
/*it('should enter incorrect channel data', () => { |
||||
cy.get('#admin-circle-create input[name="name"]').type('!"#$%&'); |
||||
cy.get('#admin-circle-create input[name="name"]').should('have.value', '!"#$%&'); |
||||
cy.get('#admin-circle-create input[name="description"]').type(description); |
||||
cy.get('#admin-circle-create input[name="description"]').should('have.value', description); |
||||
}); |
||||
it('should click on create channel button', () => { |
||||
cy.get('#admin-circle-create input[type="submit"]').click(); |
||||
}); |
||||
it('should provide errors about incorrect channel data', () => { |
||||
// TO-DO: Check for error messages
|
||||
cy.get('element') |
||||
.should('contain.text', 'Error message.'); |
||||
});*/ |
||||
it('should enter correct channel data', () => { |
||||
cy.get('#admin-circle-create input[name="name"]').clear().type(channelName); |
||||
cy.get('#admin-circle-create input[name="name"]').should('have.value', channelName); |
||||
cy.get('#admin-circle-create input[name="description"]').clear().type(description); |
||||
cy.get('#admin-circle-create input[name="description"]').should('have.value', description); |
||||
}); |
||||
it('should click on create channel button', () => { |
||||
cy.get('#admin-circle-create input[type="submit"]').click(); |
||||
}); |
||||
it('should land on channels list screen', () => { |
||||
cy.location().should((loc) => { |
||||
expect(loc.pathname).to.eq('/admin'); |
||||
}); |
||||
// Workaround - component reactivity bug
|
||||
cy.reload(); |
||||
cy.get('.accept-button').click(); |
||||
// End workaround
|
||||
}); |
||||
it('should land newly created channel on channels list screen', () => { |
||||
cy.contains('solid-display-value[name="circle.name"]', channelName).should("exist"); |
||||
cy.fixture('admin.json').then(admin => { |
||||
cy.contains('solid-display-value[name="username"]', admin.username).should("exist"); |
||||
}); |
||||
}); |
||||
}); |
||||
}); |
@ -0,0 +1,64 @@ |
||||
/// <reference types="Cypress" />
|
||||
/* globals cy, expect */ |
||||
|
||||
context('Create Job Offer Browser Testing', () => { |
||||
let jobDate = '', |
||||
jobTitle = 'Test Job Offer ', |
||||
description = 'Test Description '; |
||||
before(() => { |
||||
cy.nextYear(1).then(year => { |
||||
jobDate = year + '-12-31'; |
||||
}); |
||||
cy.randomNum().then(num => { |
||||
jobTitle += num; |
||||
description += num; |
||||
}); |
||||
cy.clearLocalStorage({ domain: null }); |
||||
cy.clearCookies({ domain: null }); |
||||
}); |
||||
it('should visit user login screen', () => cy.userLogin()); |
||||
describe('Job Offer Creation process', () => { |
||||
it('should login', () => cy.login()); |
||||
it('should visit the job offer creation screen', () => cy.naviagte('/job-offers/job-offers-create')); |
||||
/*it('should enter incorrect job offer data', () => { |
||||
cy.get('#job-offers-create input[name="closingDate"]').type('!"#$%&'); |
||||
cy.get('#job-offers-create input[name="closingDate"]').should('have.value', '!"#$%&'); |
||||
cy.get('#job-offers-create input[name="title"]').type('!"#$%&'); |
||||
cy.get('#job-offers-create input[name="title"]').should('have.value', '!"#$%&'); |
||||
cy.get('#job-offers-create textarea[name="description"]').type(description); |
||||
cy.get('#job-offers-create textarea[name="description"]').should('have.value', description); |
||||
}); |
||||
it('should click on create job offer button', () => { |
||||
cy.get('#job-offers-create input[type="submit"]').click(); |
||||
}); |
||||
it('should provide errors about incorrect job offer data', () => { |
||||
// TO-DO: Check for error messages
|
||||
cy.get('element') |
||||
.should('contain.text', 'Error message.'); |
||||
});*/ |
||||
it('should enter correct job offer data', () => { |
||||
cy.get('#job-offers-create input[name="closingDate"]').clear().type(jobDate); |
||||
cy.get('#job-offers-create input[name="closingDate"]').should('have.value', jobDate); |
||||
cy.get('#job-offers-create input[name="title"]').clear().type(jobTitle); |
||||
cy.get('#job-offers-create input[name="title"]').should('have.value', jobTitle); |
||||
cy.get('#job-offers-create textarea[name="description"]').clear().type(description); |
||||
cy.get('#job-offers-create textarea[name="description"]').should('have.value', description); |
||||
}); |
||||
it('should click on create job offer button', () => { |
||||
cy.get('#job-offers-create input[type="submit"]').click(); |
||||
}); |
||||
it('should land on job offers list screen', () => { |
||||
cy.location().should((loc) => { |
||||
expect(loc.pathname).to.eq('/job-offers'); |
||||
}); |
||||
// Workaround - component reactivity bug
|
||||
cy.reload(); |
||||
cy.get('.accept-button').click(); |
||||
// End workaround
|
||||
}); |
||||
it('should land newly created job offer on job offers list screen', () => { |
||||
cy.contains('solid-display-value[name="title"]', jobTitle).should("exist"); |
||||
cy.contains('solid-display-value[name="description"]', description).should("exist"); |
||||
}); |
||||
}); |
||||
}); |
@ -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"); |
||||
}); |
||||
}); |
||||
}); |
||||
}); |
@ -0,0 +1,58 @@ |
||||
/// <reference types="Cypress" />
|
||||
/* globals cy, expect */ |
||||
|
||||
context('Edit Channel Browser Testing', () => { |
||||
let channelName = 'Edited Test Channel ', |
||||
description = 'Edited Test Description ', |
||||
menuQuery = [ |
||||
'solid-display.circle-tab', |
||||
'solid-display:last-child', |
||||
'solid-display[order-by="name"]' |
||||
]; |
||||
before(() => { |
||||
cy.randomNum().then(num => { |
||||
channelName += num; |
||||
description += num; |
||||
}); |
||||
cy.clearLocalStorage({ domain: null }); |
||||
cy.clearCookies({ domain: null }); |
||||
}); |
||||
it('should visit user login screen', () => cy.userLogin()); |
||||
describe('Channel Edition process', () => { |
||||
it('should login', () => cy.login()); |
||||
it('should visit the channel list screen', () => cy.naviagte('/admin')); |
||||
it('should visit the last channel edit screen', () => { |
||||
cy.get(menuQuery.join(' ')) |
||||
.invoke('attr', 'data-src') |
||||
.then(url => cy.encodeUrl(url).then(id => { |
||||
cy.naviagte('/circle/@' + id + '/circle-information/circle-edit'); |
||||
})); |
||||
}); |
||||
it('should enter new channel data', () => { |
||||
cy.get('#circle-edit input[name="name"]').clear().type(channelName); |
||||
cy.get('#circle-edit input[name="name"]').should('have.value', channelName); |
||||
cy.get('#circle-edit input[name="description"]').clear().type(description); |
||||
cy.get('#circle-edit input[name="description"]').should('have.value', description); |
||||
}); |
||||
it('should click button to save the channel', () => { |
||||
cy.get('#circle-edit input[value="Enregistrer"]').click(); |
||||
}); |
||||
it('should land on channel information screen', () => { |
||||
cy.get(menuQuery.join(' ')) |
||||
.invoke('attr', 'data-src') |
||||
.then(url => cy.encodeUrl(url).then(id => { |
||||
cy.location().should((loc) => { |
||||
expect(loc.pathname).to.eq('/circle/@' + id + '/circle-information'); |
||||
}); |
||||
})); |
||||
// Workaround - component reactivity bug
|
||||
cy.reload(); |
||||
cy.get('.accept-button').click(); |
||||
// End workaround
|
||||
}); |
||||
it('should show edited channel data on channel information screen', () => { |
||||
cy.contains('solid-display-value[name="name"]', channelName).should("exist"); |
||||
cy.contains('solid-display-value[name="description"]', description).should("exist"); |
||||
}); |
||||
}); |
||||
}); |
@ -0,0 +1,59 @@ |
||||
/// <reference types="Cypress" />
|
||||
/* globals cy, expect */ |
||||
|
||||
context('Edit Job Offer Browser Testing', () => { |
||||
let jobDate = '', |
||||
jobTitle = 'Edited Test Job Offer ', |
||||
description = 'Edited Test Description ', |
||||
menuQuery = [ |
||||
'solid-display.job-board__list', |
||||
'solid-display:last-child' |
||||
]; |
||||
before(() => { |
||||
cy.nextYear(2).then(year => { |
||||
jobDate = year + '-12-31'; |
||||
}); |
||||
cy.randomNum().then(num => { |
||||
jobTitle += num; |
||||
description += num; |
||||
}); |
||||
cy.clearLocalStorage({ domain: null }); |
||||
cy.clearCookies({ domain: null }); |
||||
}); |
||||
it('should visit user login screen', () => cy.userLogin()); |
||||
describe('Job Offer Edition process', () => { |
||||
it('should login', () => cy.login()); |
||||
it('should visit the job offers list screen', () => cy.naviagte('/job-offers')); |
||||
it('should visit the last project edit screen', () => { |
||||
cy.get(menuQuery.join(' ')) |
||||
.invoke('attr', 'data-src') |
||||
.then(url => cy.encodeUrl(url).then(id => { |
||||
cy.naviagte('/job-offers/job-offers-edit/@' + id); |
||||
})); |
||||
}); |
||||
it('should enter new job offer data', () => { |
||||
cy.get('#job-offers-edit input[name="closingDate"]').clear().type(jobDate); |
||||
cy.get('#job-offers-edit input[name="closingDate"]').should('have.value', jobDate); |
||||
cy.get('#job-offers-edit input[name="title"]').clear().type(jobTitle); |
||||
cy.get('#job-offers-edit input[name="title"]').should('have.value', jobTitle); |
||||
cy.get('#job-offers-edit textarea[name="description"]').clear().type(description); |
||||
cy.get('#job-offers-edit textarea[name="description"]').should('have.value', description); |
||||
}); |
||||
it('should click button to save the job offer', () => { |
||||
cy.get('#job-offers-edit input[type="submit"]').click(); |
||||
}); |
||||
it('should land on job offers list screen', () => { |
||||
cy.location().should((loc) => { |
||||
expect(loc.pathname).to.eq('/job-offers'); |
||||
}); |
||||
// Workaround - component reactivity bug
|
||||
cy.reload(); |
||||
cy.get('.accept-button').click(); |
||||
// End workaround
|
||||
}); |
||||
it('should show edited project data on project information screen', () => { |
||||
cy.contains('solid-display-value[name="title"]', jobTitle).should("exist"); |
||||
cy.contains('solid-display-value[name="description"]', description).should("exist"); |
||||
}); |
||||
}); |
||||
}); |
@ -0,0 +1,62 @@ |
||||
/// <reference types="Cypress" />
|
||||
/* globals cy, expect */ |
||||
|
||||
context('Edit Project Browser Testing', () => { |
||||
let projectName = 'Edited Test Project ', |
||||
customerName = 'Edited Test Customer ', |
||||
description = 'Edited Test Description ', |
||||
menuQuery = [ |
||||
'solid-display.project-tab', |
||||
'solid-display:last-child', |
||||
'solid-display[order-by="customer.name"]' |
||||
]; |
||||
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 Edition process', () => { |
||||
it('should login', () => cy.login()); |
||||
it('should visit the project list screen', () => cy.naviagte('/admin/admin-projects')); |
||||
it('should visit the last project edit screen', () => { |
||||
cy.get(menuQuery.join(' ')) |
||||
.invoke('attr', 'data-src') |
||||
.then(url => cy.encodeUrl(url).then(id => { |
||||
cy.naviagte('/project/@' + id + '/project-information/project-edit'); |
||||
})); |
||||
}); |
||||
it('should enter new project data', () => { |
||||
cy.get('#project-edit input[name="customer.name"]').clear().type(customerName); |
||||
cy.get('#project-edit input[name="customer.name"]').should('have.value', customerName); |
||||
cy.get('#project-edit input[name="name"]').clear().type(projectName); |
||||
cy.get('#project-edit input[name="name"]').should('have.value', projectName); |
||||
cy.get('#project-edit textarea[name="description"]').clear().type(description); |
||||
cy.get('#project-edit textarea[name="description"]').should('have.value', description); |
||||
}); |
||||
it('should click button to save the project', () => { |
||||
cy.get('#project-edit input[value="Enregistrer"]').click(); |
||||
}); |
||||
it('should land on project information screen', () => { |
||||
cy.get(menuQuery.join(' ')) |
||||
.invoke('attr', 'data-src') |
||||
.then(url => cy.encodeUrl(url).then(id => { |
||||
cy.location().should((loc) => { |
||||
expect(loc.pathname).to.eq('/project/@' + id + '/project-information'); |
||||
}); |
||||
})); |
||||
// Workaround - component reactivity bug
|
||||
cy.reload(); |
||||
cy.get('.accept-button').click(); |
||||
// End workaround
|
||||
}); |
||||
it('should show edited project data on project information screen', () => { |
||||
cy.contains('solid-display-value[name="customer.name"]', customerName).should("exist"); |
||||
cy.contains('solid-display-value[name="name"]', projectName).should("exist"); |
||||
}); |
||||
}); |
||||
}); |
@ -0,0 +1,35 @@ |
||||
/// <reference types="Cypress" />
|
||||
/* globals cy, expect */ |
||||
|
||||
context('Retire Project Browser Testing', () => { |
||||
before(() => { |
||||
cy.clearLocalStorage({ domain: null }); |
||||
cy.clearCookies({ domain: null }); |
||||
}); |
||||
it('should visit user login screen', () => cy.userLogin()); |
||||
describe('Project Retirement process', () => { |
||||
it('should login', () => cy.login()); |
||||
it('should visit the project creation screen', () => cy.naviagte('/admin/admin-projects')); |
||||
it('should visit the last project edit screen', () => { |
||||
cy.get('solid-display[widget-project="hubl-menu-fix-url-project"][fields="project"]:last-child solid-display') |
||||
.invoke('attr', 'data-src') |
||||
.then(url => cy.encodeUrl(url).then(id => { |
||||
cy.naviagte('/project/@' + id + '/project-information/project-edit'); |
||||
})); |
||||
}); |
||||
it('should click button to retire the project', () => { |
||||
cy.scrollTo('bottom'); |
||||
cy.get('solid-delete[data-label="Retirer"] button').click(); |
||||
}); |
||||
it('should stay on project edit screen', () => { |
||||
cy.get('solid-display[widget-project="hubl-menu-fix-url-project"]:last-child solid-display') |
||||
.invoke('attr', 'data-src') |
||||
.then(url => cy.encodeUrl(url).then(id => { |
||||
cy.location().should((loc) => { |
||||
expect(loc.pathname).to.eq('/project/@' + id + '/project-information/project-edit'); |
||||
}); |
||||
})); |
||||
}); |
||||
// TO-DO: ceraify what needs to happen after and do the checks
|
||||
}); |
||||
}); |
Loading…
Reference in new issue