hubl/cypress/integration/retire-project.spec.js

41 lines
1.4 KiB
JavaScript

/// <reference types="Cypress" />
/* globals cy, expect */
context('Retire Project Browser Testing', () => {
let menuQuery = [
'solid-display.project-tab',
'solid-display:last-child',
'solid-display[order-by="customer.name"]'
];;
before(() => {
cy.clearLocalStorage({ domain: null });
cy.clearCookies({ domain: null });
});
it('should visit user login screend', () => 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(menuQuery.join(' '))
.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(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/project-edit');
});
}));
});
// TO-DO: clearify what needs to happen after and do the checks
});
});