Browse Source

test: cleanup

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/3905/head
Raju Udava 2 years ago
parent
commit
cb0bf402f1
  1. 4
      scripts/cypress/integration/common/1b_table_column_operations.js
  2. 4
      scripts/cypress/integration/common/3c_lookup_column.js
  3. 4
      scripts/cypress/integration/common/3d_rollup_column.js
  4. 8
      scripts/cypress/integration/common/3e_duration_column.js
  5. 25
      scripts/cypress/integration/common/3f_link_to_another_record.js
  6. 6
      scripts/cypress/support/commands.js
  7. 8
      scripts/cypress/support/page_objects/navigation.js

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

@ -75,9 +75,7 @@ export const genTest = (apiType, dbType) => {
.find(".nc-column-edit")
.click();
// 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.inputHighlightRenderWait();
// change column type and verify
// cy.get(".nc-column-type-input").last().click();

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

@ -49,9 +49,7 @@ export const genTest = (apiType, dbType) => {
.contains("Lookup")
.click();
// 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.inputHighlightRenderWait();
// Configure Child table & column names
fetchParentFromLabel("Child table");

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

@ -54,9 +54,7 @@ export const genTest = (apiType, dbType) => {
.contains("Rollup")
.click();
// 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.inputHighlightRenderWait();
// Configure Child table & column names
fetchParentFromLabel("Child table");

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

@ -57,9 +57,7 @@ export const genTest = (apiType, dbType) => {
.contains("Duration")
.click();
// 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.inputHighlightRenderWait();
// Configure Duration format
fetchParentFromLabel("Duration Format");
@ -101,9 +99,7 @@ export const genTest = (apiType, dbType) => {
.clear()
.type(newName);
// 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.inputHighlightRenderWait();
// Configure Duration format
fetchParentFromLabel("Duration Format");

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

@ -185,7 +185,6 @@ export const genTest = (apiType, dbType) => {
// Click on `Add new row` button
cy.get(".nc-add-new-row-btn:visible").should("exist");
cy.get(".nc-add-new-row-btn").click();
cy.wait(waitTime);
// Title
cy.get(".nc-expand-col-Title")
@ -205,32 +204,26 @@ export const genTest = (apiType, dbType) => {
.find(".nc-action-icon")
.should("exist")
.click({ force: true });
cy.wait(waitTime);
cy.wait("@waitForCardLoad");
cy.getActiveModal(".nc-modal-link-record")
.find(".ant-card")
.should("exist")
.eq(0)
.click();
cy.wait(waitTime);
// MM
cy.get(".nc-expand-col-Sheet1.List").find(".ant-btn-primary").click();
cy.wait(waitTime);
cy.wait("@waitForCardLoad");
cy.getActiveModal(".nc-modal-link-record")
.find(".ant-card")
.should("exist")
.eq(0)
.click();
cy.wait(waitTime);
// HM
cy.get(".nc-expand-col-Link2-1hm").find(".ant-btn-primary").click();
cy.wait(waitTime);
cy.wait("@waitForCardLoad");
cy.getActiveModal().find(".ant-card").should("exist").eq(0).click();
cy.wait(waitTime);
// Save row
cy.getActiveDrawer(".nc-drawer-expanded-form")
@ -256,13 +249,11 @@ export const genTest = (apiType, dbType) => {
.getCell("Sheet1", 2)
.find(".nc-action-icon")
.click({ force: true });
cy.wait(waitTime);
cy.getActiveModal(".nc-modal-link-record")
.find(".ant-card")
.should("exist")
.eq(1)
.click();
cy.wait(waitTime);
// MM
mainPage
@ -270,13 +261,11 @@ export const genTest = (apiType, dbType) => {
.find(".nc-action-icon")
.last()
.click({ force: true });
cy.wait(waitTime);
cy.getActiveModal(".nc-modal-link-record")
.find(".ant-card")
.should("exist")
.eq(1)
.click();
cy.wait(waitTime);
// HM
mainPage
@ -284,13 +273,11 @@ export const genTest = (apiType, dbType) => {
.find(".nc-action-icon")
.last()
.click({ force: true });
cy.wait(waitTime);
cy.getActiveModal(".nc-modal-link-record")
.find(".ant-card")
.should("exist")
.eq(1)
.click();
cy.wait(waitTime);
});
// Existing row, expand record
@ -300,49 +287,37 @@ export const genTest = (apiType, dbType) => {
addRow(3, "2c");
cy.wait(waitTime);
cy.get(".nc-row-expand").eq(2).click({ force: true });
cy.wait(waitTime);
// wait for page render to complete
cy.get('button:contains("Save row"):visible').should("exist");
// BT
cy.wait(waitTime);
cy.get(".nc-expand-col-Sheet1")
.find(".nc-action-icon")
.should("exist")
.click({ force: true });
cy.wait(waitTime);
// cy.wait("@waitForCardLoad");
cy.getActiveModal(".nc-modal-link-record")
.find(".ant-card")
.should("exist")
.eq(2)
.click();
cy.wait(waitTime);
// MM
cy.get(".nc-expand-col-Sheet1.List").find(".ant-btn-primary").click();
cy.wait(waitTime);
// cy.wait("@waitForCardLoad");
cy.getActiveModal(".nc-modal-link-record")
.find(".ant-card")
.should("exist")
.eq(2)
.click();
cy.wait(waitTime);
// HM
cy.get(".nc-expand-col-Link2-1hm").find(".ant-btn-primary").click();
cy.wait(waitTime);
// cy.wait("@waitForCardLoad");
cy.getActiveModal(".nc-modal-link-record")
.find(".ant-card")
.should("exist")
.eq(2)
.click();
cy.wait(waitTime);
cy.getActiveDrawer(".nc-drawer-expanded-form")
.find("button")

6
scripts/cypress/support/commands.js

@ -410,6 +410,12 @@ Cypress.Commands.add("toastWait", (msg) => {
);
});
Cypress.Commands.add("inputHighlightRenderWait", (selector) => {
// 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);
});
// vn: view name
// rc: expected row count. validate row count if rc!=0
Cypress.Commands.add("openViewsTab", (vn, rc) => {

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

@ -139,9 +139,7 @@ export class _projectsPage {
cy.get(".nc-metadb-project-name").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.inputHighlightRenderWait();
// feed project name
cy.get(".nc-metadb-project-name", { timeout: 20000 })
@ -171,9 +169,7 @@ export class _projectsPage {
cy.get(".nc-extdb-proj-name").should("exist");
cy.get(".nc-extdb-btn-test-connection").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.inputHighlightRenderWait();
cy.get(".nc-extdb-proj-name").clear().type(projectName);

Loading…
Cancel
Save