|
|
@ -110,13 +110,15 @@ export const genTest = (apiType, dbType) => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const roleValidation = (roleType) => { |
|
|
|
const roleValidation = (roleType) => { |
|
|
|
|
|
|
|
let clear; |
|
|
|
|
|
|
|
|
|
|
|
describe(`User role validation`, () => { |
|
|
|
describe(`User role validation`, () => { |
|
|
|
before(() => { |
|
|
|
before(() => { |
|
|
|
cy.restoreLocalStorage(); |
|
|
|
cy.restoreLocalStorage(); |
|
|
|
cy.visit(mainPage.roleURL[roleType]); |
|
|
|
cy.visit(mainPage.roleURL[roleType]); |
|
|
|
cy.wait(5000); |
|
|
|
// cy.wait(5000);
|
|
|
|
|
|
|
|
|
|
|
|
cy.get('button:contains("SIGN UP")').should("exist"); |
|
|
|
cy.get('button:contains("SIGN UP"):visible').should("exist"); |
|
|
|
cy.get('input[type="text"]', { timeout: 20000 }).type( |
|
|
|
cy.get('input[type="text"]', { timeout: 20000 }).type( |
|
|
|
roles[roleType].credentials.username |
|
|
|
roles[roleType].credentials.username |
|
|
|
); |
|
|
|
); |
|
|
@ -125,11 +127,11 @@ export const genTest = (apiType, dbType) => { |
|
|
|
); |
|
|
|
); |
|
|
|
cy.get('button:contains("SIGN UP")').click(); |
|
|
|
cy.get('button:contains("SIGN UP")').click(); |
|
|
|
|
|
|
|
|
|
|
|
cy.wait(3000); |
|
|
|
// cy.wait(3000);
|
|
|
|
|
|
|
|
|
|
|
|
cy.get(".nc-project-page-title") |
|
|
|
cy.get(`.nc-project-page-title:contains("My Projects"):visible`).should( |
|
|
|
.contains("My Projects") |
|
|
|
"exist" |
|
|
|
.should("be.visible"); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
if (dbType === "xcdb") { |
|
|
|
if (dbType === "xcdb") { |
|
|
|
if ("rest" == apiType) |
|
|
|
if ("rest" == apiType) |
|
|
@ -149,12 +151,15 @@ export const genTest = (apiType, dbType) => { |
|
|
|
if (roleType === "creator") { |
|
|
|
if (roleType === "creator") { |
|
|
|
// kludge: wait for page load to finish
|
|
|
|
// kludge: wait for page load to finish
|
|
|
|
// close team & auth tab
|
|
|
|
// close team & auth tab
|
|
|
|
cy.wait(2000); |
|
|
|
cy.wait(500); |
|
|
|
cy.get("button.ant-tabs-tab-remove").should("exist").click(); |
|
|
|
cy.get("button.ant-tabs-tab-remove").should("exist").click(); |
|
|
|
cy.wait(1000); |
|
|
|
cy.wait(500); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
cy.saveLocalStorage(); |
|
|
|
cy.saveLocalStorage(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
clear = Cypress.LocalStorage.clear; |
|
|
|
|
|
|
|
Cypress.LocalStorage.clear = () => {}; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
beforeEach(() => { |
|
|
|
beforeEach(() => { |
|
|
@ -169,6 +174,8 @@ export const genTest = (apiType, dbType) => { |
|
|
|
cy.restoreLocalStorage(); |
|
|
|
cy.restoreLocalStorage(); |
|
|
|
cy.signOut(); |
|
|
|
cy.signOut(); |
|
|
|
cy.saveLocalStorage(); |
|
|
|
cy.saveLocalStorage(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Cypress.LocalStorage.clear = clear; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////
|
|
|
|
///////////////////////////////////////////////////////
|
|
|
|