Browse Source

Merge pull request #3807 from nocodb/test/cy-cleanup

test: cy wait cleanup
pull/3809/head
Raju Udava 2 years ago committed by GitHub
parent
commit
be9bdc0dcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      scripts/cypress/integration/common/00_pre_configurations.js
  2. 5
      scripts/cypress/integration/common/1a_table_operations.js
  3. 1
      scripts/cypress/integration/common/1b_table_column_operations.js
  4. 2
      scripts/cypress/integration/common/2b_table_with_m2m_column.js
  5. 10
      scripts/cypress/integration/common/3a_filter_sort_fields_operations.js
  6. 6
      scripts/cypress/integration/common/3c_lookup_column.js
  7. 8
      scripts/cypress/integration/common/3d_rollup_column.js
  8. 4
      scripts/cypress/integration/common/3e_duration_column.js
  9. 7
      scripts/cypress/integration/common/3f_link_to_another_record.js
  10. 1
      scripts/cypress/integration/common/4a_table_view_grid_gallery_form.js
  11. 3
      scripts/cypress/integration/common/4c_form_view_detailed.js
  12. 3
      scripts/cypress/integration/common/4e_form_view_share.js
  13. 8
      scripts/cypress/integration/common/4f_pg_grid_view_share.js
  14. 10
      scripts/cypress/integration/common/5a_user_role.js
  15. 2
      scripts/cypress/integration/common/5b_preview_role.js
  16. 6
      scripts/cypress/integration/common/6f_attachments.js
  17. 1
      scripts/cypress/integration/common/6g_base_share.js
  18. 2
      scripts/cypress/integration/common/7a_create_project_from_excel.js
  19. 3
      scripts/cypress/integration/common/8a_webhook.js
  20. 274
      scripts/cypress/integration/spec/roleValidation.spec.js
  21. 1
      scripts/cypress/integration/test/explicitLogin.js
  22. 13
      scripts/cypress/support/commands.js
  23. 29
      scripts/cypress/support/page_objects/mainPage.js
  24. 13
      scripts/cypress/support/page_objects/navigation.js

5
scripts/cypress/integration/common/00_pre_configurations.js

@ -187,7 +187,6 @@ export const genTest = (apiType, dbType) => {
} }
} else { } else {
projectsPage.createProject(proj.basic, proj.config); projectsPage.createProject(proj.basic, proj.config);
// cy.wait(5000);
if (dbType === "xcdb") { if (dbType === "xcdb") {
// store base URL- to re-visit and delete form view later // store base URL- to re-visit and delete form view later
let projId; let projId;
@ -240,11 +239,9 @@ export const genTest = (apiType, dbType) => {
cy_createProjectBlock(proj, apiType, dbType); cy_createProjectBlock(proj, apiType, dbType);
} }
// kludge: wait for page load to finish
cy.wait(2000);
// close team & auth tab // close team & auth tab
cy.get("button.ant-tabs-tab-remove").should("exist").click(); cy.get("button.ant-tabs-tab-remove").should("exist").click();
cy.wait(1000); cy.get("button.ant-tabs-tab-remove").should("not.exist");
// first instance of updating local storage information // first instance of updating local storage information
cy.saveLocalStorage(); cy.saveLocalStorage();

5
scripts/cypress/integration/common/1a_table_operations.js

@ -44,13 +44,16 @@ export const genTest = (apiType, dbType) => {
}; };
it("Open Audit tab", () => { it("Open Audit tab", () => {
// http://localhost:8080/api/v1/db/meta/projects/p_bxp57hmks0n5o2/audits?offset=0&limit=25
cy.intercept("/**/audits?offset=*&limit=*").as("waitForPageLoad");
// mainPage.navigationDraw(mainPage.AUDIT).click(); // mainPage.navigationDraw(mainPage.AUDIT).click();
settingsPage.openMenu(settingsPage.AUDIT); settingsPage.openMenu(settingsPage.AUDIT);
// wait for column headers to appear // wait for column headers to appear
// //
cy.get("thead > tr > th.ant-table-cell").should("have.length", 5); cy.get("thead > tr > th.ant-table-cell").should("have.length", 5);
cy.wait(3000); cy.wait("@waitForPageLoad");
// Audit table entries // Audit table entries
// [Header] Operation Type, Operation Sub Type, Description, User, Created // [Header] Operation Type, Operation Sub Type, Description, User, Created

1
scripts/cypress/integration/common/1b_table_column_operations.js

@ -73,6 +73,7 @@ export const genTest = (apiType, dbType) => {
.click(); .click();
// fix me! wait till the modal rendering (input highlight) is completed // fix me! wait till the modal rendering (input highlight) is completed
// focus shifts back to the input field to select text after the dropdown is rendered
cy.wait(500); cy.wait(500);
// change column type and verify // change column type and verify

2
scripts/cypress/integration/common/2b_table_with_m2m_column.js

@ -107,8 +107,6 @@ export const genTest = (apiType, dbType) => {
.contains("ACADEMY DINOSAUR", { timeout: 2000 }) .contains("ACADEMY DINOSAUR", { timeout: 2000 })
.click() .click()
.then(() => { .then(() => {
// wait to ensure pop up appears before we proceed further
cy.wait(1000);
// Link card validation // Link card validation
cy.getActiveDrawer(".nc-drawer-expanded-form") cy.getActiveDrawer(".nc-drawer-expanded-form")
.find(".text-lg") .find(".text-lg")

10
scripts/cypress/integration/common/3a_filter_sort_fields_operations.js

@ -46,9 +46,13 @@ export const genTest = (apiType, dbType) => {
// create new row using + button in header // create new row using + button in header
// //
it("Add row using tool header button", () => { it("Add row using tool header button", () => {
// http://localhost:8080/api/v1/db/meta/audits/comments/count?ids[]=101&ids[]=102&ids[]=103&ids[]=104&ids[]=105&ids[]=106&ids[]=107&ids[]=108&ids[]=109&fk_model_id=md_zfkb9v3mzky958
cy.intercept("/api/v1/db/meta/audits/comments/count*").as(
"waitForPageLoad"
);
// add a row to end of Country table // add a row to end of Country table
cy.get(".nc-add-new-row-btn").click(); cy.get(".nc-add-new-row-btn").click();
cy.wait(1000);
cy.get(".nc-expand-col-Country") cy.get(".nc-expand-col-Country")
.find(".nc-cell > input") .find(".nc-cell > input")
.first() .first()
@ -73,8 +77,8 @@ export const genTest = (apiType, dbType) => {
// verify // verify
mainPage.getPagination(5).click(); mainPage.getPagination(5).click();
// kludge: flicker on load cy.wait("@waitForPageLoad");
cy.wait(3000);
mainPage.getCell("Country", 10).contains("Test Country").should("exist"); mainPage.getCell("Country", 10).contains("Test Country").should("exist");
}); });

6
scripts/cypress/integration/common/3c_lookup_column.js

@ -19,11 +19,8 @@ export const genTest = (apiType, dbType) => {
// // open a table to work on views // // open a table to work on views
// // // //
// //
// // // kludge: wait for page load to finish
// // cy.wait(1000);
// // // close team & auth tab // // // close team & auth tab
// // cy.get('button.ant-tabs-tab-remove').should('exist').click(); // // cy.get('button.ant-tabs-tab-remove').should('exist').click();
// // cy.wait(1000);
// //
// cy.openTableTab("City", 25); // cy.openTableTab("City", 25);
// }); // });
@ -63,7 +60,8 @@ export const genTest = (apiType, dbType) => {
.contains("Lookup") .contains("Lookup")
.click(); .click();
// wait for re-rendering & title selection to re-appear // fix me! wait till the modal rendering (input highlight) is completed
// focus shifts back to the input field to select text after the dropdown is rendered
cy.wait(500); cy.wait(500);
// Configure Child table & column names // Configure Child table & column names

8
scripts/cypress/integration/common/3d_rollup_column.js

@ -9,7 +9,6 @@ export const genTest = (apiType, dbType) => {
// //
const fetchParentFromLabel = (label) => { const fetchParentFromLabel = (label) => {
cy.get("label").contains(label).parents(".ant-row").click(); cy.get("label").contains(label).parents(".ant-row").click();
cy.wait(500);
}; };
// Run once before test- create project (rest/graphql) // Run once before test- create project (rest/graphql)
@ -18,12 +17,8 @@ export const genTest = (apiType, dbType) => {
// cy.fileHook(); // cy.fileHook();
// mainPage.tabReset(); // mainPage.tabReset();
// //
// // // kludge: wait for page load to finish
// // cy.wait(1000);
// // // close team & auth tab // // // close team & auth tab
// // cy.get('button.ant-tabs-tab-remove').should('exist').click(); // // cy.get('button.ant-tabs-tab-remove').should('exist').click();
// // cy.wait(1000);
//
// // open a table to work on views // // open a table to work on views
// // // //
// cy.openTableTab("Country", 25); // cy.openTableTab("Country", 25);
@ -69,7 +64,8 @@ export const genTest = (apiType, dbType) => {
.contains("Rollup") .contains("Rollup")
.click(); .click();
// wait for re-rendering & title selection to re-appear // fix me! wait till the modal rendering (input highlight) is completed
// focus shifts back to the input field to select text after the dropdown is rendered
cy.wait(500); cy.wait(500);
// Configure Child table & column names // Configure Child table & column names

4
scripts/cypress/integration/common/3e_duration_column.js

@ -18,11 +18,8 @@ export const genTest = (apiType, dbType) => {
before(() => { before(() => {
mainPage.tabReset(); mainPage.tabReset();
// // kludge: wait for page load to finish
// cy.wait(1000);
// // close team & auth tab // // close team & auth tab
// cy.get('button.ant-tabs-tab-remove').should('exist').click(); // cy.get('button.ant-tabs-tab-remove').should('exist').click();
// cy.wait(1000);
cy.createTable(tableName); cy.createTable(tableName);
}); });
@ -126,7 +123,6 @@ export const genTest = (apiType, dbType) => {
) => { ) => {
if (isNewRow) { if (isNewRow) {
cy.get(".nc-add-new-row-btn:visible").should("exist"); cy.get(".nc-add-new-row-btn:visible").should("exist");
cy.wait(500);
cy.get(".nc-add-new-row-btn").click(); cy.get(".nc-add-new-row-btn").click();
} else { } else {
// mainPage.getRow(index).find(".nc-row-expand-icon").click({ force: true }); // mainPage.getRow(index).find(".nc-row-expand-icon").click({ force: true });

7
scripts/cypress/integration/common/3f_link_to_another_record.js

@ -94,6 +94,11 @@ export const genTest = (apiType, dbType) => {
// Unlink LTAR cell // Unlink LTAR cell
// //
function ltarUnlink(columnName, index) { function ltarUnlink(columnName, index) {
// http://localhost:8080/api/v1/db/meta/audits/comments/count?ids[]=1&fk_model_id=md_f4y7jp89pe8vkt
cy.intercept("GET", `/api/v1/db/meta/audits/comments/count?**`).as(
"unlinkCount"
);
// Click on cell to enable unlink icon // Click on cell to enable unlink icon
cy.get(`:nth-child(${index}) > [data-title="${columnName}"]`) cy.get(`:nth-child(${index}) > [data-title="${columnName}"]`)
.last() .last()
@ -107,7 +112,7 @@ export const genTest = (apiType, dbType) => {
.click(); .click();
// Glitch; hence wait // Glitch; hence wait
cy.wait(1000); cy.wait("@unlinkCount");
} }
// before(() => { // before(() => {

1
scripts/cypress/integration/common/4a_table_view_grid_gallery_form.js

@ -77,7 +77,6 @@ export const genTest = (apiType, dbType) => {
// click on delete icon (becomes visible on hovering mouse) // click on delete icon (becomes visible on hovering mouse)
cy.get(".nc-view-delete-icon").click({ force: true }); cy.get(".nc-view-delete-icon").click({ force: true });
cy.wait(300);
cy.getActiveModal(".nc-modal-view-delete") cy.getActiveModal(".nc-modal-view-delete")
.find(".ant-btn-dangerous") .find(".ant-btn-dangerous")
.click(); .click();

3
scripts/cypress/integration/common/4c_form_view_detailed.js

@ -324,7 +324,6 @@ export const genTest = (apiType, dbType) => {
// open form view & enable "email me" option // open form view & enable "email me" option
cy.openTableTab("Country", 25); cy.openTableTab("Country", 25);
cy.wait(1000);
cy.get(`.nc-view-item.nc-${viewType}-view-item`) cy.get(`.nc-view-item.nc-${viewType}-view-item`)
.contains("Form-1") .contains("Form-1")
@ -338,7 +337,6 @@ export const genTest = (apiType, dbType) => {
settingsPage.openMenu(settingsPage.APPSTORE); settingsPage.openMenu(settingsPage.APPSTORE);
mainPage.resetSMTP(); mainPage.resetSMTP();
cy.wait(300);
cy.openTableTab("Country", 25); cy.openTableTab("Country", 25);
}); });
@ -383,7 +381,6 @@ export const genTest = (apiType, dbType) => {
// click on delete icon (becomes visible on hovering mouse) // click on delete icon (becomes visible on hovering mouse)
cy.get(".nc-view-delete-icon").click({ force: true }); cy.get(".nc-view-delete-icon").click({ force: true });
cy.wait(1000);
cy.getActiveModal(".nc-modal-view-delete") cy.getActiveModal(".nc-modal-view-delete")
.find(".ant-btn-dangerous") .find(".ant-btn-dangerous")
.click(); .click();

3
scripts/cypress/integration/common/4e_form_view_share.js

@ -112,7 +112,6 @@ export const genTest = (apiType, dbType) => {
cy.visit(linkText, { cy.visit(linkText, {
baseUrl: null, baseUrl: null,
}); });
// cy.wait(5000);
cy.wait(["@waitForPageLoad"], { times: 2 }); cy.wait(["@waitForPageLoad"], { times: 2 });
// wait for share view page to load! // wait for share view page to load!
@ -208,8 +207,6 @@ export const genTest = (apiType, dbType) => {
// // clean up newly added rows into Country table operations // // clean up newly added rows into Country table operations
// // this auto verifies successfull addition of rows to table as well // // this auto verifies successfull addition of rows to table as well
// mainPage.getPagination(25).click(); // mainPage.getPagination(25).click();
// // kludge: flicker on load
// cy.wait(3000)
// //
// cy.get(".nc-grid-row").should("have.length", 1); // cy.get(".nc-grid-row").should("have.length", 1);
// cy.get(".ant-checkbox").should('exist').eq(1).click({ force: true }); // cy.get(".ant-checkbox").should('exist').eq(1).click({ force: true });

8
scripts/cypress/integration/common/4f_pg_grid_view_share.js

@ -22,8 +22,6 @@ export const genTest = (apiType, dbType) => {
// .click(); // .click();
mainPage.shareView().click({ force: true }); mainPage.shareView().click({ force: true });
cy.wait(5000);
// wait, as URL initially will be /undefined // wait, as URL initially will be /undefined
cy.getActiveModal(".nc-modal-share-view") cy.getActiveModal(".nc-modal-share-view")
.find(".share-link-box") .find(".share-link-box")
@ -136,7 +134,6 @@ export const genTest = (apiType, dbType) => {
cy.visit(viewURL["combined"], { cy.visit(viewURL["combined"], {
baseUrl: null, baseUrl: null,
}); });
cy.wait(5000);
// wait for page rendering to complete // wait for page rendering to complete
cy.get(".nc-grid-row").should("have.length", 18); cy.get(".nc-grid-row").should("have.length", 18);
@ -353,7 +350,6 @@ export const genTest = (apiType, dbType) => {
cy.visit(storedURL, { cy.visit(storedURL, {
baseUrl: null, baseUrl: null,
}); });
cy.wait(5000);
// number of view entries should be 2 before we delete // number of view entries should be 2 before we delete
cy.get(".nc-view-item").its("length").should("eq", 2); cy.get(".nc-view-item").its("length").should("eq", 2);
@ -390,12 +386,9 @@ export const genTest = (apiType, dbType) => {
cy.visit(storedURL, { cy.visit(storedURL, {
baseUrl: null, baseUrl: null,
}); });
cy.wait(5000);
// delete row // delete row
mainPage.getPagination(5).click(); mainPage.getPagination(5).click();
// kludge: flicker on load
cy.wait(3000);
// wait for page rendering to complete // wait for page rendering to complete
cy.get(".nc-grid-row").should("have.length", 10); cy.get(".nc-grid-row").should("have.length", 10);
@ -439,7 +432,6 @@ export const genTest = (apiType, dbType) => {
cy.visit(viewURL["rowColUpdate"], { cy.visit(viewURL["rowColUpdate"], {
baseUrl: null, baseUrl: null,
}); });
cy.wait(5000);
//5 //5
// wait for public view page to load! // wait for public view page to load!

10
scripts/cypress/integration/common/5a_user_role.js

@ -116,7 +116,6 @@ export const genTest = (apiType, dbType) => {
before(() => { before(() => {
cy.restoreLocalStorage(); cy.restoreLocalStorage();
cy.visit(mainPage.roleURL[roleType]); cy.visit(mainPage.roleURL[roleType]);
// cy.wait(5000);
cy.get('button:contains("SIGN UP"):visible').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(
@ -126,9 +125,6 @@ export const genTest = (apiType, dbType) => {
roles[roleType].credentials.password roles[roleType].credentials.password
); );
cy.get('button:contains("SIGN UP")').click(); cy.get('button:contains("SIGN UP")').click();
// cy.wait(3000);
cy.get(`.nc-project-page-title:contains("My Projects"):visible`).should( cy.get(`.nc-project-page-title:contains("My Projects"):visible`).should(
"exist" "exist"
); );
@ -277,9 +273,9 @@ export const genTest = (apiType, dbType) => {
}); });
it(`[${roles[roleType].name}] App store accessibility`, () => { it(`[${roles[roleType].name}] App store accessibility`, () => {
cy.visit("/#/apps").then(r =>{ cy.visit("/#/apps").then((r) => {
cy.toastWait('You don\'t have enough permission to access the page.') cy.toastWait("You don't have enough permission to access the page.");
}) });
}); });
}); });
}; };

2
scripts/cypress/integration/common/5b_preview_role.js

@ -59,8 +59,6 @@ export const genTest = (apiType, dbType, roleType) => {
after(() => { after(() => {
// cy.get(".nc-preview-reset").click({ force: true }); // cy.get(".nc-preview-reset").click({ force: true });
cy.get(".mdi-exit-to-app").click(); cy.get(".mdi-exit-to-app").click();
// cy.wait(20000)
// wait for page rendering to complete // wait for page rendering to complete
cy.get(".nc-grid-row", { timeout: 25000 }).should("have.length", 25); cy.get(".nc-grid-row", { timeout: 25000 }).should("have.length", 25);

6
scripts/cypress/integration/common/6f_attachments.js

@ -31,9 +31,6 @@ export const genTest = (apiType, dbType) => {
// wait for page rendering to complete // wait for page rendering to complete
cy.get(".nc-grid-row").should("have.length", 10); cy.get(".nc-grid-row").should("have.length", 10);
// kludge: flicker on load
// cy.wait(3000);
mainPage.getCell("Country", 10).rightclick(); mainPage.getCell("Country", 10).rightclick();
cy.getActiveMenu(".nc-dropdown-grid-context-menu") cy.getActiveMenu(".nc-dropdown-grid-context-menu")
.contains("Delete Row") .contains("Delete Row")
@ -74,8 +71,6 @@ export const genTest = (apiType, dbType) => {
mainPage.shareView().click(); mainPage.shareView().click();
// cy.wait(5000);
// copy link text, visit URL // copy link text, visit URL
cy.getActiveModal(".nc-modal-share-view") cy.getActiveModal(".nc-modal-share-view")
.find(".share-link-box") .find(".share-link-box")
@ -94,7 +89,6 @@ export const genTest = (apiType, dbType) => {
cy.visit(linkText, { cy.visit(linkText, {
baseUrl: null, baseUrl: null,
}); });
// cy.wait(5000);
cy.wait(["@waitForSharedViewLoad"]); cy.wait(["@waitForSharedViewLoad"]);
// wait for share view page to load! // wait for share view page to load!

1
scripts/cypress/integration/common/6g_base_share.js

@ -29,7 +29,6 @@ export const genTest = (apiType, dbType) => {
baseUrl: null, baseUrl: null,
}); });
cy.wait(["@waitForPageLoad"]); cy.wait(["@waitForPageLoad"]);
// cy.wait(5000);
}); });
it(`${roleType}: Validate access permissions: advance menu`, () => { it(`${roleType}: Validate access permissions: advance menu`, () => {

2
scripts/cypress/integration/common/7a_create_project_from_excel.js

@ -92,7 +92,6 @@ export const genTest = (apiType, dbType) => {
{ dbType: "none", apiType: "REST", name: "importSample" }, { dbType: "none", apiType: "REST", name: "importSample" },
{} {}
); );
// cy.wait(4000);
cy.saveLocalStorage(); cy.saveLocalStorage();
}); });
@ -176,7 +175,6 @@ export const genTest = (apiType, dbType) => {
cy.getActiveModal().find(".ant-btn-primary").click(); cy.getActiveModal().find(".ant-btn-primary").click();
// wait for page to get loaded (issue observed in CI-CD) // wait for page to get loaded (issue observed in CI-CD)
// cy.wait(5000);
cy.wait("@waitForPageLoad"); cy.wait("@waitForPageLoad");
}); });

3
scripts/cypress/integration/common/8a_webhook.js

@ -116,7 +116,6 @@ function configureWebhook(hook, test) {
.contains(new RegExp("^" + hook.condition.column + "$", "g")) .contains(new RegExp("^" + hook.condition.column + "$", "g"))
.should("exist") .should("exist")
.click(); .click();
// cy.wait(1000);
cy.get(".nc-filter-operation-select").should("exist").last().click(); cy.get(".nc-filter-operation-select").should("exist").last().click();
cy.get(".ant-select-dropdown:visible") cy.get(".ant-select-dropdown:visible")
@ -163,8 +162,6 @@ function addNewRow(index, cellValue) {
cy.get(".nc-add-new-row-btn:visible").should("exist"); cy.get(".nc-add-new-row-btn:visible").should("exist");
cy.get(".nc-add-new-row-btn").click(); cy.get(".nc-add-new-row-btn").click();
// cy.wait(1000);
cy.get(".nc-expand-col-Title") cy.get(".nc-expand-col-Title")
.should("exist") .should("exist")
.find(".nc-cell > input") .find(".nc-cell > input")

274
scripts/cypress/integration/spec/roleValidation.spec.js

@ -1,5 +1,5 @@
import { mainPage, settingsPage } from '../../support/page_objects/mainPage'; import { mainPage, settingsPage } from "../../support/page_objects/mainPage";
import { roles } from '../../support/page_objects/projectConstants'; import { roles } from "../../support/page_objects/projectConstants";
// Left hand navigation bar, validation for // Left hand navigation bar, validation for
// 1. Audit menu // 1. Audit menu
@ -9,62 +9,62 @@ import { roles } from '../../support/page_objects/projectConstants';
export function _advSettings(roleType, mode) { export function _advSettings(roleType, mode) {
cy.log(roleType, mode); cy.log(roleType, mode);
if (mode === 'baseShare') { if (mode === "baseShare") {
// open modal // open modal
cy.get('.nc-project-menu').should('exist').click(); cy.get(".nc-project-menu").should("exist").click();
cy.getActiveMenu('.nc-dropdown-project-menu') cy.getActiveMenu(".nc-dropdown-project-menu")
.find(`[data-menu-id="language"]`) .find(`[data-menu-id="language"]`)
.should('exist'); .should("exist");
// click again to close modal // click again to close modal
cy.get('.nc-project-menu').should('exist').click(); cy.get(".nc-project-menu").should("exist").click();
return; return;
} }
let validationString = let validationString =
true == roles[roleType].validations.advSettings ? 'exist' : 'not.exist'; true == roles[roleType].validations.advSettings ? "exist" : "not.exist";
// cy.get(".nc-team-settings").should(validationString); // cy.get(".nc-team-settings").should(validationString);
cy.get('.nc-project-menu').should('exist').click(); cy.get(".nc-project-menu").should("exist").click();
cy.getActiveMenu('.nc-dropdown-project-menu') cy.getActiveMenu(".nc-dropdown-project-menu")
.find(`[data-menu-id="preview-as"]`) .find(`[data-menu-id="preview-as"]`)
.should(validationString); .should(validationString);
cy.getActiveMenu('.nc-dropdown-project-menu') cy.getActiveMenu(".nc-dropdown-project-menu")
.find(`[data-menu-id="teamAndSettings"]:visible`) .find(`[data-menu-id="teamAndSettings"]:visible`)
.should(validationString); .should(validationString);
if (true === roles[roleType].validations.advSettings) { if (true === roles[roleType].validations.advSettings) {
cy.getActiveMenu('.nc-dropdown-project-menu') cy.getActiveMenu(".nc-dropdown-project-menu")
.find(`[data-menu-id="teamAndSettings"]:visible`) .find(`[data-menu-id="teamAndSettings"]:visible`)
.should(validationString) .should(validationString)
.click(); .click();
cy.get(`[data-menu-id="teamAndAuth"]`).should('exist'); cy.get(`[data-menu-id="teamAndAuth"]`).should("exist");
if (roleType === 'owner') if (roleType === "owner")
cy.get(`[data-menu-id="appStore"]`).should('exist'); cy.get(`[data-menu-id="appStore"]`).should("exist");
cy.get(`[data-menu-id="projMetaData"]`).should('exist'); cy.get(`[data-menu-id="projMetaData"]`).should("exist");
cy.get(`[data-menu-id="audit"]`).should('exist'); cy.get(`[data-menu-id="audit"]`).should("exist");
settingsPage.closeMenu(); settingsPage.closeMenu();
} else { } else {
cy.get('.nc-project-menu').should('exist').click(); cy.get(".nc-project-menu").should("exist").click();
} }
// float menu in preview mode // float menu in preview mode
if ('preview' === mode) { if ("preview" === mode) {
cy.get('.nc-floating-preview-btn').should('exist'); cy.get(".nc-floating-preview-btn").should("exist");
cy.get('.nc-floating-preview-btn') cy.get(".nc-floating-preview-btn")
.find(`[type="radio"][value="${roles[roleType].name}"]`) .find(`[type="radio"][value="${roles[roleType].name}"]`)
.should('be.checked'); .should("be.checked");
} }
// cy.get("body").click("bottomRight"); // cy.get("body").click("bottomRight");
} }
export function _editSchema(roleType, mode) { export function _editSchema(roleType, mode) {
let columnName = 'City'; let columnName = "City";
let validationString = let validationString =
true === roles[roleType].validations.editSchema ? 'exist' : 'not.exist'; true === roles[roleType].validations.editSchema ? "exist" : "not.exist";
cy.openTableTab(columnName, 25); cy.openTableTab(columnName, 25);
@ -72,18 +72,18 @@ export function _editSchema(roleType, mode) {
cy.get(`.nc-add-new-table`).should(validationString); cy.get(`.nc-add-new-table`).should(validationString);
// delete table option // delete table option
cy.get(`.nc-project-tree-tbl-City`).should('exist').rightclick(); cy.get(`.nc-project-tree-tbl-City`).should("exist").rightclick();
cy.get('.ant-dropdown-content:visible').should(validationString); cy.get(".ant-dropdown-content:visible").should(validationString);
if (validationString === 'exist') { if (validationString === "exist") {
cy.getActiveMenu('.nc-dropdown-tree-view-context-menu') cy.getActiveMenu(".nc-dropdown-tree-view-context-menu")
.find('[role="menuitem"]') .find('[role="menuitem"]')
.contains('Delete') .contains("Delete")
.should('exist'); .should("exist");
cy.getActiveMenu('.nc-dropdown-tree-view-context-menu') cy.getActiveMenu(".nc-dropdown-tree-view-context-menu")
.find('[role="menuitem"]') .find('[role="menuitem"]')
.contains('Rename') .contains("Rename")
.should('exist'); .should("exist");
// click on a cell to close table context menu // click on a cell to close table context menu
mainPage.getCell(columnName, 3).click(); mainPage.getCell(columnName, 3).click();
@ -91,104 +91,104 @@ export function _editSchema(roleType, mode) {
// add new column option // add new column option
// //
cy.get('.nc-column-add').should(validationString); cy.get(".nc-column-add").should(validationString);
// update column (edit/ delete menu) // update column (edit/ delete menu)
cy.get('.nc-ui-dt-dropdown').should(validationString); cy.get(".nc-ui-dt-dropdown").should(validationString);
if (validationString === 'exist') { if (validationString === "exist") {
cy.get('.nc-import-menu').should('exist').click(); cy.get(".nc-import-menu").should("exist").click();
cy.getActiveMenu('.nc-dropdown-import-menu').should('exist'); cy.getActiveMenu(".nc-dropdown-import-menu").should("exist");
cy.getActiveMenu('.nc-dropdown-import-menu') cy.getActiveMenu(".nc-dropdown-import-menu")
.find('.ant-dropdown-menu-item') .find(".ant-dropdown-menu-item")
.contains('Airtable'); .contains("Airtable");
cy.getActiveMenu('.nc-dropdown-import-menu') cy.getActiveMenu(".nc-dropdown-import-menu")
.find('.ant-dropdown-menu-item') .find(".ant-dropdown-menu-item")
.contains('CSV file'); .contains("CSV file");
cy.getActiveMenu('.nc-dropdown-import-menu') cy.getActiveMenu(".nc-dropdown-import-menu")
.find('.ant-dropdown-menu-item') .find(".ant-dropdown-menu-item")
.contains('JSON file'); .contains("JSON file");
cy.getActiveMenu('.nc-dropdown-import-menu') cy.getActiveMenu(".nc-dropdown-import-menu")
.find('.ant-dropdown-menu-item') .find(".ant-dropdown-menu-item")
.contains('Microsoft Excel'); .contains("Microsoft Excel");
} }
} }
export function _editData(roleType, mode) { export function _editData(roleType, mode) {
let columnName = 'City'; let columnName = "City";
let validationString = let validationString =
true === roles[roleType].validations.editData ? 'exist' : 'not.exist'; true === roles[roleType].validations.editData ? "exist" : "not.exist";
cy.openTableTab(columnName, 25); cy.openTableTab(columnName, 25);
// add row button // add row button
cy.get('.nc-add-new-row-btn:visible').should(validationString); cy.get(".nc-add-new-row-btn:visible").should(validationString);
// add button at bottom of page // add button at bottom of page
mainPage.getCell(columnName, 25).scrollIntoView(); mainPage.getCell(columnName, 25).scrollIntoView();
cy.get('.nc-grid-add-new-cell:visible').should(validationString); cy.get(".nc-grid-add-new-cell:visible").should(validationString);
// update row option (right click) // update row option (right click)
// //
mainPage.getCell('City', 5).rightclick(); mainPage.getCell("City", 5).rightclick();
cy.wait(100); cy.wait(100);
cy.get('.ant-dropdown-content:visible').should(validationString); cy.get(".ant-dropdown-content:visible").should(validationString);
if (validationString === 'exist') { if (validationString === "exist") {
// right click options will exist (only for 'exist' case) // right click options will exist (only for 'exist' case)
// //
cy.getActiveMenu('.nc-dropdown-grid-context-menu') cy.getActiveMenu(".nc-dropdown-grid-context-menu")
.contains('Insert New Row') .contains("Insert New Row")
.should(validationString); .should(validationString);
cy.getActiveMenu('.nc-dropdown-grid-context-menu') cy.getActiveMenu(".nc-dropdown-grid-context-menu")
.contains('Clear cell') .contains("Clear cell")
.should(validationString); .should(validationString);
cy.getActiveMenu('.nc-dropdown-grid-context-menu') cy.getActiveMenu(".nc-dropdown-grid-context-menu")
.contains('Delete Row') .contains("Delete Row")
.should(validationString); .should(validationString);
cy.getActiveMenu('.nc-dropdown-grid-context-menu') cy.getActiveMenu(".nc-dropdown-grid-context-menu")
.contains('Delete Selected Rows') .contains("Delete Selected Rows")
.should(validationString); .should(validationString);
// cy.get("body").type("{esc}"); // cy.get("body").type("{esc}");
mainPage.getCell('City', 13).click(); mainPage.getCell("City", 13).click();
// update cell contents option using row expander should be enabled // update cell contents option using row expander should be enabled
// //
mainPage mainPage
.getRow(1) .getRow(1)
.find('.nc-row-no') .find(".nc-row-no")
.should('exist') .should("exist")
.eq(0) .eq(0)
.trigger('mouseover', { force: true }); .trigger("mouseover", { force: true });
cy.get('.nc-row-expand').should('exist').eq(10).click({ force: true }); cy.get(".nc-row-expand").should("exist").eq(10).click({ force: true });
cy.getActiveDrawer('.nc-drawer-expanded-form') cy.getActiveDrawer(".nc-drawer-expanded-form")
.find('button') .find("button")
.contains('Save row') .contains("Save row")
.should('exist'); .should("exist");
cy.getActiveDrawer('.nc-drawer-expanded-form') cy.getActiveDrawer(".nc-drawer-expanded-form")
.find('button') .find("button")
.contains('Cancel') .contains("Cancel")
.should('exist') .should("exist")
.click(); .click();
} else { } else {
// update cell contents option using row expander should be disabled // update cell contents option using row expander should be disabled
// //
cy.get('.nc-row-expand').should('exist').eq(10).click({ force: true }); cy.get(".nc-row-expand").should("exist").eq(10).click({ force: true });
cy.getActiveDrawer('.nc-drawer-expanded-form') cy.getActiveDrawer(".nc-drawer-expanded-form")
.find('button:disabled') .find("button:disabled")
.contains('Save row') .contains("Save row")
.should('exist'); .should("exist");
cy.getActiveDrawer('.nc-drawer-expanded-form') cy.getActiveDrawer(".nc-drawer-expanded-form")
.find('button') .find("button")
.contains('Cancel') .contains("Cancel")
.should('exist') .should("exist")
.click(); .click();
} }
// double click cell entries to edit // double click cell entries to edit
// //
mainPage.getCell('City', 5).dblclick().find('input').should(validationString); mainPage.getCell("City", 5).dblclick().find("input").should(validationString);
} }
// read &/ update comment // read &/ update comment
@ -196,53 +196,49 @@ export function _editData(roleType, mode) {
// Everyone else: read &/ update // Everyone else: read &/ update
// //
export function _editComment(roleType, mode) { export function _editComment(roleType, mode) {
let columnName = 'City'; let columnName = "City";
let validationString = let validationString =
true === roles[roleType].validations.editComment true === roles[roleType].validations.editComment
? 'Comment added successfully' ? "Comment added successfully"
: 'Not allowed'; : "Not allowed";
cy.openTableTab(columnName, 25); cy.openTableTab(columnName, 25);
// cy.wait(1000);
// click on comment icon & type comment // click on comment icon & type comment
// //
cy.get('.nc-row-expand').should('exist').eq(10).click({ force: true }); cy.get(".nc-row-expand").should("exist").eq(10).click({ force: true });
// Expected response: // Expected response:
// Viewer: Not able to see comment option // Viewer: Not able to see comment option
// Everyone else: Comment added/read successfully // Everyone else: Comment added/read successfully
// //
// cy.wait(3000); if ("viewer" === roleType) {
cy.getActiveDrawer(".nc-drawer-expanded-form")
if ('viewer' === roleType) { .should("exist")
cy.getActiveDrawer('.nc-drawer-expanded-form') .find(".nc-toggle-comments")
.should('exist') .should("not.exist");
.find('.nc-toggle-comments')
.should('not.exist');
} else { } else {
cy.getActiveDrawer('.nc-drawer-expanded-form') cy.getActiveDrawer(".nc-drawer-expanded-form")
.should('exist') .should("exist")
.find('.nc-toggle-comments') .find(".nc-toggle-comments")
.should('exist') .should("exist")
.click(); .click();
cy.getActiveDrawer('.nc-drawer-expanded-form') cy.getActiveDrawer(".nc-drawer-expanded-form")
.find('.nc-comment-box') .find(".nc-comment-box")
.should('exist') .should("exist")
.type('Comment-1{enter}'); .type("Comment-1{enter}");
// cy.toastWait('Comment added successfully') // cy.toastWait('Comment added successfully')
cy.getActiveDrawer('.nc-drawer-expanded-form') cy.getActiveDrawer(".nc-drawer-expanded-form")
.find('.nc-toggle-comments') .find(".nc-toggle-comments")
.click(); .click();
} }
cy.getActiveDrawer('.nc-drawer-expanded-form') cy.getActiveDrawer(".nc-drawer-expanded-form")
.find('button') .find("button")
.contains('Cancel') .contains("Cancel")
.should('exist') .should("exist")
.click(); .click();
} }
@ -250,7 +246,7 @@ export function _editComment(roleType, mode) {
// Editor/Viewer/Commenter : can only view 'existing' views // Editor/Viewer/Commenter : can only view 'existing' views
// Rest: can create/edit // Rest: can create/edit
export function _viewMenu(roleType, mode) { export function _viewMenu(roleType, mode) {
let columnName = 'City'; let columnName = "City";
// Lock, Download, Upload // Lock, Download, Upload
let menuWithSubmenuCount = 3; let menuWithSubmenuCount = 3;
@ -261,16 +257,16 @@ export function _viewMenu(roleType, mode) {
cy.openTableTab(columnName, 25); cy.openTableTab(columnName, 25);
let validationString = let validationString =
true === roles[roleType].validations.shareView ? 'exist' : 'not.exist'; true === roles[roleType].validations.shareView ? "exist" : "not.exist";
if (roleType === 'editor') { if (roleType === "editor") {
// Download / Upload CSV // Download / Upload CSV
menuWithSubmenuCount = 2; menuWithSubmenuCount = 2;
// Get API Snippet and ERD // Get API Snippet and ERD
menuWithoutSubmenuCount = 2; menuWithoutSubmenuCount = 2;
// ERD // ERD
if (mode === 'baseShare') menuWithoutSubmenuCount = 1; if (mode === "baseShare") menuWithoutSubmenuCount = 1;
} else if (roleType === 'commenter' || roleType === 'viewer') { } else if (roleType === "commenter" || roleType === "viewer") {
// Download CSV & Download excel // Download CSV & Download excel
menuWithSubmenuCount = 0; menuWithSubmenuCount = 0;
// Get API Snippet and ERD // Get API Snippet and ERD
@ -278,7 +274,7 @@ export function _viewMenu(roleType, mode) {
} }
// view list field (default GRID view) // view list field (default GRID view)
cy.get(`.nc-view-item`).should('exist'); cy.get(`.nc-view-item`).should("exist");
// view create option, exists only for owner/ creator // view create option, exists only for owner/ creator
cy.get(`.nc-create-grid-view`).should(validationString); cy.get(`.nc-create-grid-view`).should(validationString);
@ -288,47 +284,47 @@ export function _viewMenu(roleType, mode) {
// share view permissions are role specific // share view permissions are role specific
// actions menu (more), only download csv should be visible for non-previlaged users // actions menu (more), only download csv should be visible for non-previlaged users
cy.get('.nc-actions-menu-btn').click(); cy.get(".nc-actions-menu-btn").click();
cy.getActiveMenu('.nc-dropdown-actions-menu') cy.getActiveMenu(".nc-dropdown-actions-menu")
.find('.ant-dropdown-menu-submenu:visible') .find(".ant-dropdown-menu-submenu:visible")
.should('have.length', menuWithSubmenuCount); .should("have.length", menuWithSubmenuCount);
cy.getActiveMenu('.nc-dropdown-actions-menu') cy.getActiveMenu(".nc-dropdown-actions-menu")
.find('.ant-dropdown-menu-item:visible') .find(".ant-dropdown-menu-item:visible")
.should('have.length', menuWithoutSubmenuCount); .should("have.length", menuWithoutSubmenuCount);
// click again to close menu // click again to close menu
cy.get('.nc-actions-menu-btn').click(); cy.get(".nc-actions-menu-btn").click();
} }
export function _topRightMenu(roleType, mode) { export function _topRightMenu(roleType, mode) {
// kludge; download csv menu persists until clicked // kludge; download csv menu persists until clicked
let columnName = 'City'; let columnName = "City";
// cy.closeTableTab(columnName); // cy.closeTableTab(columnName);
// cy.openTableTab(columnName, 25); // cy.openTableTab(columnName, 25);
let validationString = let validationString =
true == roles[roleType].validations.shareView ? 'exist' : 'not.exist'; true == roles[roleType].validations.shareView ? "exist" : "not.exist";
cy.get(`.nc-share-base`).should(validationString); cy.get(`.nc-share-base`).should(validationString);
cy.get('.nc-menu-translate').should('exist'); cy.get(".nc-menu-translate").should("exist");
cy.get('.nc-menu-accounts').should('exist'); cy.get(".nc-menu-accounts").should("exist");
} }
// Access control list // Access control list
// //
export function disableTableAccess(tbl, role) { export function disableTableAccess(tbl, role) {
const cls = `.nc-acl-${tbl}-${role}-chkbox`; const cls = `.nc-acl-${tbl}-${role}-chkbox`;
cy.get(cls).find('input').should('be.checked').click({ force: true }); cy.get(cls).find("input").should("be.checked").click({ force: true });
cy.get(cls).find('input').should('not.be.checked'); cy.get(cls).find("input").should("not.be.checked");
} }
export function enableTableAccess(tbl, role) { export function enableTableAccess(tbl, role) {
const cls = `.nc-acl-${tbl}-${role}-chkbox`; const cls = `.nc-acl-${tbl}-${role}-chkbox`;
cy.get(cls).find('input').should('not.be.checked').click({ force: true }); cy.get(cls).find("input").should("not.be.checked").click({ force: true });
cy.get(cls).find('input').should('be.checked'); cy.get(cls).find("input").should("be.checked");
} }
export function _accessControl(roleType, previewMode) { export function _accessControl(roleType, previewMode) {
let validationString = roleType === 'creator' ? 'exist' : 'not.exist'; let validationString = roleType === "creator" ? "exist" : "not.exist";
cy.get(`.nc-project-tree-tbl-Language`).should(validationString); cy.get(`.nc-project-tree-tbl-Language`).should(validationString);
cy.get(`.nc-project-tree-tbl-CustomerList`).should(validationString); cy.get(`.nc-project-tree-tbl-CustomerList`).should(validationString);

1
scripts/cypress/integration/test/explicitLogin.js

@ -27,7 +27,6 @@ export const genTest = (apiType, dbType) => {
.then(() => { .then(() => {
let query = `ALTER TABLE "actor" RENAME TO "${projId}actor"`; let query = `ALTER TABLE "actor" RENAME TO "${projId}actor"`;
cy.task("sqliteExec", query); cy.task("sqliteExec", query);
cy.wait(1000);
}); });
}); });
}); });

13
scripts/cypress/support/commands.js

@ -47,16 +47,12 @@ Cypress.Commands.add("signinOrSignup", (_args) => {
_args _args
); );
cy.wait(1000);
// signin/signup // signin/signup
cy.get("body").then(($body) => { cy.get("body").then(($body) => {
// cy.wait(1000)
cy.url().then((url) => { cy.url().then((url) => {
if (!url.includes("/projects")) { if (!url.includes("/projects")) {
// handle initial load // handle initial load
if ($body.find(".welcome-page").length > 0) { if ($body.find(".welcome-page").length > 0) {
cy.wait(8000);
cy.get("body").trigger("mousemove"); cy.get("body").trigger("mousemove");
cy.snip("LetsBegin"); cy.snip("LetsBegin");
cy.contains("Let's Begin").click(); cy.contains("Let's Begin").click();
@ -288,9 +284,7 @@ Cypress.Commands.add("getActivePicker", (dropdownSelector) => {
Cypress.Commands.add("createTable", (name) => { Cypress.Commands.add("createTable", (name) => {
cy.task("log", `[createTableTab] ${name}`); cy.task("log", `[createTableTab] ${name}`);
cy.wait(1000);
cy.get(".nc-add-new-table").should("exist").click(); cy.get(".nc-add-new-table").should("exist").click();
cy.wait(1000);
cy.getActiveModal(".nc-modal-table-create") cy.getActiveModal(".nc-modal-table-create")
.find(`input[type="text"]:visible`) .find(`input[type="text"]:visible`)
.click() .click()
@ -300,12 +294,9 @@ Cypress.Commands.add("createTable", (name) => {
cy.getActiveModal(".nc-modal-table-create") cy.getActiveModal(".nc-modal-table-create")
.find("button.ant-btn-primary:visible") .find("button.ant-btn-primary:visible")
.click(); .click();
cy.wait(1000);
cy.get(".xc-row-table.nc-grid").should("exist"); cy.get(".xc-row-table.nc-grid").should("exist");
// cy.get('.ant-tabs-tab-active > .ant-tabs-tab-btn').contains(name).should("exist");
cy.url().should("contain", `table/${name}`); cy.url().should("contain", `table/${name}`);
cy.get(`.nc-project-tree-tbl-${name}`).should("exist"); cy.get(`.nc-project-tree-tbl-${name}`).should("exist");
cy.wait(1000);
}); });
Cypress.Commands.add("deleteTable", (name, dbType) => { Cypress.Commands.add("deleteTable", (name, dbType) => {
@ -426,7 +417,6 @@ Cypress.Commands.add("snip", (filename) => {
) { ) {
let storeName = `${screenShotDb.length}_${filename}`; let storeName = `${screenShotDb.length}_${filename}`;
screenShotDb.push(filename); screenShotDb.push(filename);
cy.wait(1000);
cy.screenshot(storeName, { overwrite: true }); cy.screenshot(storeName, { overwrite: true });
} }
}); });
@ -439,7 +429,6 @@ Cypress.Commands.add("snipActiveModal", (filename) => {
) { ) {
let storeName = `${screenShotDb.length}_${filename}`; let storeName = `${screenShotDb.length}_${filename}`;
screenShotDb.push(filename); screenShotDb.push(filename);
cy.wait(1000);
// cy.getActiveModal().screenshot(filename, { // cy.getActiveModal().screenshot(filename, {
// padding: 0, // padding: 0,
// overwrite: true, // overwrite: true,
@ -456,7 +445,6 @@ Cypress.Commands.add("snipActiveMenu", (filename) => {
) { ) {
let storeName = `${screenShotDb.length}_${filename}`; let storeName = `${screenShotDb.length}_${filename}`;
screenShotDb.push(filename); screenShotDb.push(filename);
cy.wait(1000);
// cy.getActiveMenu().screenshot(filename, { // cy.getActiveMenu().screenshot(filename, {
// padding: 0, // padding: 0,
// overwrite: true, // overwrite: true,
@ -482,7 +470,6 @@ Cypress.Commands.add("signOut", () => {
.last() .last()
.click(); .click();
// cy.wait(5000);
cy.get('button:contains("SIGN IN")').should("exist"); cy.get('button:contains("SIGN IN")').should("exist");
}); });

29
scripts/cypress/support/page_objects/mainPage.js

@ -119,18 +119,22 @@ export class _mainPage {
); );
// click on New User button, feed details // click on New User button, feed details
cy.get("button.nc-invite-team").click(); cy.getActiveModal(".nc-modal-settings")
.find("button.nc-invite-team")
.click();
// additional wait to ensure the modal is fully loaded // additional wait to ensure the modal is fully loaded
cy.getActiveModal(".nc-modal-invite-user-and-share-base").should("exist"); cy.getActiveModal(".nc-modal-invite-user-and-share-base").should("exist");
cy.getActiveModal(".nc-modal-invite-user-and-share-base") cy.getActiveModal(".nc-modal-invite-user-and-share-base")
.find('input[placeholder="E-mail"]') .find('input[placeholder="E-mail"]')
.should("exist"); .should("exist");
cy.wait(1000);
cy.get('input[placeholder="E-mail"]').type(userCred.username);
cy.get(".ant-select.nc-user-roles").click(); cy.getActiveModal(".nc-modal-invite-user-and-share-base")
.find('input[placeholder="E-mail"]')
.type(userCred.username);
cy.getActiveModal(".nc-modal-invite-user-and-share-base")
.find(".ant-select.nc-user-roles")
.click();
// opt-in requested role & submit // opt-in requested role & submit
// cy.getActiveSelection().contains(roleType).click({force: true}); // cy.getActiveSelection().contains(roleType).click({force: true});
@ -256,16 +260,13 @@ export class _mainPage {
.trigger("mouseover", { force: true }) .trigger("mouseover", { force: true })
.click({ force: true }); .click({ force: true });
// cy.wait(500);
// cy.get(".nc-column-delete").click(); // cy.get(".nc-column-delete").click();
cy.getActiveMenu(".nc-dropdown-column-operations") cy.getActiveMenu(".nc-dropdown-column-operations")
.find(".nc-column-delete") .find(".nc-column-delete")
.click(); .click();
// cy.wait(500);
// cy.get(".nc-column-delete").should("not.be.visible"); // cy.get(".nc-column-delete").should("not.be.visible");
// cy.get(".ant-btn-dangerous:visible").contains("Delete").click(); // cy.get(".ant-btn-dangerous:visible").contains("Delete").click();
// cy.wait(500);
cy.getActiveModal(".nc-modal-column-delete") cy.getActiveModal(".nc-modal-column-delete")
.find(".ant-btn-dangerous:visible") .find(".ant-btn-dangerous:visible")
@ -518,9 +519,7 @@ export class _mainPage {
.find(".nc-project-menu-item") .find(".nc-project-menu-item")
.contains("Download") .contains("Download")
.click(); .click();
cy.wait(1000); cy.get(".nc-project-menu-item:contains('Download as CSV')")
cy.get(".nc-project-menu-item")
.contains("Download as CSV")
.should("exist") .should("exist")
.click(); .click();
} }
@ -593,9 +592,13 @@ export class _mainPage {
} }
metaSyncValidate(tbl, msg) { metaSyncValidate(tbl, msg) {
// http://localhost:8080/api/v1/db/meta/projects/p_bxp57hmks0n5o2/meta-diff
cy.intercept("GET", "/api/v1/db/meta/projects/**").as("metaSync");
cy.get(".nc-btn-metasync-reload").should("exist").click(); cy.get(".nc-btn-metasync-reload").should("exist").click();
cy.wait(2000); cy.wait("@metaSync");
cy.get(`.nc-metasync-row-${tbl}`).contains(msg).should("exist");
cy.get(`.nc-metasync-row-${tbl}:contains(${msg})`).should("exist");
cy.get(".nc-btn-metasync-sync-now") cy.get(".nc-btn-metasync-sync-now")
.should("exist") .should("exist")
.click() .click()

13
scripts/cypress/support/page_objects/navigation.js

@ -78,11 +78,8 @@ export class _loginPage {
// projectsPage.openProject(staticProjects.pgExternalREST.basic.name); // projectsPage.openProject(staticProjects.pgExternalREST.basic.name);
// } // }
// //
// // kludge: wait for page load to finish
// cy.wait(2000);
// // close team & auth tab // // close team & auth tab
// cy.get('button.ant-tabs-tab-remove').should('exist').click(); // cy.get('button.ant-tabs-tab-remove').should('exist').click();
// cy.wait(1000);
} }
} }
@ -108,13 +105,11 @@ export class _projectsPage {
projectsPage.openProject(staticProjects.pgExternalREST.basic.name); projectsPage.openProject(staticProjects.pgExternalREST.basic.name);
} }
// kludge: wait for page load to finish
// cy.wait(4000);
cy.wait("@waitForPageLoad"); cy.wait("@waitForPageLoad");
// close team & auth tab // close team & auth tab
cy.get("button.ant-tabs-tab-remove").should("exist").click(); cy.get("button.ant-tabs-tab-remove").should("exist").click();
cy.wait(1000); cy.get("button.ant-tabs-tab-remove").should("not.exist");
} }
// Open existing project // Open existing project
@ -155,6 +150,8 @@ export class _projectsPage {
cy.get(".nc-metadb-project-name").should("exist"); cy.get(".nc-metadb-project-name").should("exist");
cy.contains("button", "Create").should("exist"); cy.contains("button", "Create").should("exist");
// fix me! wait till the modal rendering (input highlight) is completed
// focus shifts back to the input field to select text after the dropdown is rendered
cy.wait(1000); cy.wait(1000);
// feed project name // feed project name
@ -185,7 +182,8 @@ export class _projectsPage {
cy.get(".nc-extdb-proj-name").should("exist"); cy.get(".nc-extdb-proj-name").should("exist");
cy.get(".nc-extdb-btn-test-connection").should("exist"); cy.get(".nc-extdb-btn-test-connection").should("exist");
// CY goes too fast at times, so wait for the page to load // fix me! wait till the modal rendering (input highlight) is completed
// focus shifts back to the input field to select text after the dropdown is rendered
cy.wait(1000); cy.wait(1000);
cy.get(".nc-extdb-proj-name").clear().type(projectName); cy.get(".nc-extdb-proj-name").clear().type(projectName);
@ -208,7 +206,6 @@ export class _projectsPage {
// Create project // Create project
cy.contains("Ok & Save Project", { timeout: 20000 }).click(); cy.contains("Ok & Save Project", { timeout: 20000 }).click();
cy.wait(5000);
// takes a while to load project // takes a while to load project
this.waitHomePageLoad(); this.waitHomePageLoad();

Loading…
Cancel
Save