feature: Leave project test flow
This commit is contained in:
parent
9a6ea85bbb
commit
a9f86520bb
@ -23,6 +23,7 @@ build:
|
|||||||
stage: build
|
stage: build
|
||||||
before_script:
|
before_script:
|
||||||
- npm ci --cache .npm --prefer-offline --only=production
|
- npm ci --cache .npm --prefer-offline --only=production
|
||||||
|
- npm i cypress-localstorage-commands
|
||||||
script:
|
script:
|
||||||
- cp config.sample.json config.json
|
- cp config.sample.json config.json
|
||||||
- npm run build
|
- npm run build
|
||||||
|
50
cypress/integration/leave-project.spec.js
Normal file
50
cypress/integration/leave-project.spec.js
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
/// <reference types="Cypress" />
|
||||||
|
/* globals cy, expect */
|
||||||
|
|
||||||
|
context('Leave Project Browser Testing', () => {
|
||||||
|
let tableQuery = [
|
||||||
|
'solid-display.table-body',
|
||||||
|
'solid-display:last-child',
|
||||||
|
'hubl-admin-project-leave-button',
|
||||||
|
'solid-delete'
|
||||||
|
],
|
||||||
|
tableListQuery = [
|
||||||
|
'solid-display[nested-field="projects"]',
|
||||||
|
'div >',
|
||||||
|
'solid-display'
|
||||||
|
];
|
||||||
|
before(() => {
|
||||||
|
cy.clearLocalStorageSnapshot();
|
||||||
|
cy.clearLocalStorage({ domain: null });
|
||||||
|
cy.clearCookies({ domain: null });
|
||||||
|
});
|
||||||
|
beforeEach(() => cy.restoreLocalStorage());
|
||||||
|
afterEach(() => cy.saveLocalStorage());
|
||||||
|
it('should visit user login screend', () => cy.userLogin());
|
||||||
|
describe('Project Leaving process', () => {
|
||||||
|
it('should login', () => cy.login());
|
||||||
|
it('should visit the projects list screen', () => cy.naviagte('/admin/admin-projects'));
|
||||||
|
it('should click the last project leave button', () => {
|
||||||
|
cy.get(tableListQuery.join(' ')).its('length').as('projectsLength');
|
||||||
|
cy.get(tableQuery.join(' ')).click();
|
||||||
|
});
|
||||||
|
it('should check', () => {
|
||||||
|
cy.get(tableListQuery.join(' ')).its('length').should(length => {
|
||||||
|
expect(length).to.eq(this.projectsLength - 1);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
/*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');
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
});*/
|
||||||
|
});
|
||||||
|
});
|
@ -17,7 +17,7 @@ context('Retire Project Browser Testing', () => {
|
|||||||
it('should visit user login screend', () => cy.userLogin());
|
it('should visit user login screend', () => cy.userLogin());
|
||||||
describe('Project Retirement process', () => {
|
describe('Project Retirement process', () => {
|
||||||
it('should login', () => cy.login());
|
it('should login', () => cy.login());
|
||||||
it('should visit the project creation screen', () => cy.naviagte('/admin/admin-projects'));
|
it('should visit the projects list screen', () => cy.naviagte('/admin/admin-projects'));
|
||||||
it('should visit the last project edit screen', () => {
|
it('should visit the last project edit screen', () => {
|
||||||
cy.get(menuQuery.join(' '))
|
cy.get(menuQuery.join(' '))
|
||||||
.invoke('attr', 'data-src')
|
.invoke('attr', 'data-src')
|
||||||
|
Loading…
Reference in New Issue
Block a user