Browse Source

test: fix local storage & tab handling in quickTest suite

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/3667/head
Raju Udava 2 years ago
parent
commit
4151b2dcb2
  1. 11
      scripts/cypress/integration/common/7b_import_from_airtable.js
  2. 27
      scripts/cypress/integration/common/9a_QuickTest.js

11
scripts/cypress/integration/common/7b_import_from_airtable.js

@ -18,12 +18,21 @@ export const genTest = (apiType, dbType) => {
loginPage.signIn(roles.owner.credentials);
projectsPage.createProject({ dbType: "none", apiType: "REST", name: "importSample" }, {})
cy.saveLocalStorage();
});
beforeEach(() => {
cy.restoreLocalStorage();
});
after(() => {
afterEach(() => {
cy.saveLocalStorage();
});
// after(() => {
// cy.saveLocalStorage();
// });
it("Import", () => {
cy.log(apiKey, sharedBase);

27
scripts/cypress/integration/common/9a_QuickTest.js

@ -81,8 +81,6 @@ export const genTest = (apiType, dbType, testMode) => {
}
before(() => {
cy.restoreLocalStorage();
if( testMode === 'CY_QUICK') {
// cy.task("copyFile")
loginPage.signIn(roles.owner.credentials);
@ -93,28 +91,31 @@ export const genTest = (apiType, dbType, testMode) => {
// close team & auth tab
cy.get('button.ant-tabs-tab-remove').should('exist').click();
cy.wait(1000);
cy.saveLocalStorage();
}
else {
cy.restoreLocalStorage();
}
cy.openTableTab("Film", 3)
cy.saveLocalStorage();
});
beforeEach(() => {
cy.restoreLocalStorage();
})
// afterEach(() => {
// cy.saveLocalStorage();
// })
afterEach(() => {
cy.saveLocalStorage();
})
after(() => {
cy.restoreLocalStorage();
// sign out
cy.signOut();
cy.saveLocalStorage();
});
it("Verify Schema", () => {
cy.openTableTab("Film", 3)
// verify if all tables exist
for(let i=0; i<tn.length; i++) {
@ -129,7 +130,6 @@ export const genTest = (apiType, dbType, testMode) => {
});
it("Verify Data types", () => {
cy.openTableTab("Film", 3);
// normal cells
for (let [key, value] of Object.entries(records)) {
@ -188,12 +188,9 @@ export const genTest = (apiType, dbType, testMode) => {
mainPage.getCell("Producer", cellIdx).find('.chip').eq(1).contains(records2.Producer[1]).should('exist')
}
cy.closeTableTab("Film");
});
it("Verify Views & Shared base", () => {
cy.openTableTab("Film", 3);
mainPage.toggleRightSidebar();
cy.get('.nc-form-view-item:visible')
.should('exist')
.eq(0)
@ -333,7 +330,6 @@ export const genTest = (apiType, dbType, testMode) => {
it("Verify Fields, Filter & Sort", () => {
cy.openTableTab("Actor", 25);
mainPage.toggleRightSidebar();
cy.get(".nc-grid-view-item").eq(1).click()
@ -387,7 +383,6 @@ export const genTest = (apiType, dbType, testMode) => {
if( testMode === 'CY_QUICK') {
cy.openTableTab("Producer", 3)
mainPage.toggleRightSidebar();
cy.get('.nc-grid-view-item').should('have.length', 4)
cy.get('.nc-form-view-item').should('have.length', 4)

Loading…
Cancel
Save