Browse Source

test: stability- wait for edit dialog to re-render on click

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/3655/head
Raju Udava 2 years ago
parent
commit
96d174909a
  1. 2
      scripts/cypress/integration/common/1b_table_column_operations.js
  2. 30
      scripts/cypress/integration/common/3c_lookup_column.js
  3. 38
      scripts/cypress/integration/common/3d_rollup_column.js

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

@ -73,7 +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
cy.wait(1000); cy.wait(500);
// change column type and verify // change column type and verify
// cy.get(".nc-column-type-input").last().click(); // cy.get(".nc-column-type-input").last().click();

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

@ -34,7 +34,7 @@ export const genTest = (apiType, dbType) => {
afterEach(() => { afterEach(() => {
cy.saveLocalStorage(); cy.saveLocalStorage();
}) });
// after(() => { // after(() => {
// cy.closeTableTab("City"); // cy.closeTableTab("City");
@ -43,42 +43,44 @@ export const genTest = (apiType, dbType) => {
// Routine to create a new look up column // Routine to create a new look up column
// //
const addLookUpColumn = (childTable, childCol) => { const addLookUpColumn = (childTable, childCol) => {
cy.get(".nc-grid tr > th:last .nc-icon").click({ cy.get(".nc-grid tr > th:last .nc-icon").click({
force: true, force: true,
}); });
cy.getActiveMenu(".nc-dropdown-grid-add-column") cy.getActiveMenu(".nc-dropdown-grid-add-column")
.find('input.nc-column-name-input') .find("input.nc-column-name-input")
.should('exist') .should("exist")
.clear() .clear()
.type(childCol); .type(childCol);
// cy.get(".nc-column-type-input").last().click().type("Lookup"); // cy.get(".nc-column-type-input").last().click().type("Lookup");
cy.getActiveMenu('.nc-dropdown-grid-add-column') cy.getActiveMenu(".nc-dropdown-grid-add-column")
.find(".nc-column-type-input") .find(".nc-column-type-input")
.last() .last()
.click() .click()
.type("Lookup"); .type("Lookup");
cy.getActiveSelection('.nc-dropdown-column-type') cy.getActiveSelection(".nc-dropdown-column-type")
.find('.ant-select-item-option') .find(".ant-select-item-option")
.contains("Lookup") .contains("Lookup")
.click(); .click();
// wait for re-rendering & title selection to re-appear
cy.wait(500);
// Configure Child table & column names // Configure Child table & column names
fetchParentFromLabel("Child table"); fetchParentFromLabel("Child table");
cy.getActiveSelection('.nc-dropdown-relation-table') cy.getActiveSelection(".nc-dropdown-relation-table")
.find('.ant-select-item-option') .find(".ant-select-item-option")
.contains(childTable) .contains(childTable)
.click(); .click();
fetchParentFromLabel("Child column"); fetchParentFromLabel("Child column");
cy.getActiveSelection('.nc-dropdown-relation-column') cy.getActiveSelection(".nc-dropdown-relation-column")
.find('.ant-select-item-option') .find(".ant-select-item-option")
.contains(childCol) .contains(childCol)
.click(); .click();
// cy.get(".ant-btn-primary").contains("Save").should('exist').click(); // cy.get(".ant-btn-primary").contains("Save").should('exist').click();
cy.getActiveMenu('.nc-dropdown-grid-add-column') cy.getActiveMenu(".nc-dropdown-grid-add-column")
.find(".ant-btn-primary:visible") .find(".ant-btn-primary:visible")
.contains("Save") .contains("Save")
.click(); .click();
@ -102,9 +104,7 @@ export const genTest = (apiType, dbType) => {
addLookUpColumn("Address", "PostalCode"); addLookUpColumn("Address", "PostalCode");
// Verify first entry, will be displayed as alias here 'childColumn (from childTable)' // Verify first entry, will be displayed as alias here 'childColumn (from childTable)'
mainPage.getCell("PostalCode", 1) mainPage.getCell("PostalCode", 1).contains("4166").should("exist");
.contains("4166")
.should("exist");
deleteColumnByName("PostalCode"); deleteColumnByName("PostalCode");

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

@ -31,11 +31,11 @@ export const genTest = (apiType, dbType) => {
beforeEach(() => { beforeEach(() => {
cy.restoreLocalStorage(); cy.restoreLocalStorage();
}) });
afterEach(() => { afterEach(() => {
cy.saveLocalStorage(); cy.saveLocalStorage();
}) });
// after(() => { // after(() => {
// cy.closeTableTab("Country"); // cy.closeTableTab("Country");
@ -49,48 +49,50 @@ export const genTest = (apiType, dbType) => {
childCol, childCol,
aggregateFunc aggregateFunc
) => { ) => {
cy.get(".nc-grid tr > th:last .nc-icon").click({ cy.get(".nc-grid tr > th:last .nc-icon").click({
force: true, force: true,
}); });
cy.getActiveMenu(".nc-dropdown-grid-add-column") cy.getActiveMenu(".nc-dropdown-grid-add-column")
.find('input.nc-column-name-input') .find("input.nc-column-name-input")
.should('exist') .should("exist")
.clear() .clear()
.type(columnName); .type(columnName);
// cy.get(".nc-column-type-input").last().click().type("RollUp"); // cy.get(".nc-column-type-input").last().click().type("RollUp");
cy.getActiveMenu('.nc-dropdown-grid-add-column') cy.getActiveMenu(".nc-dropdown-grid-add-column")
.find(".nc-column-type-input") .find(".nc-column-type-input")
.last() .last()
.click() .click()
.type("RollUp") .type("RollUp");
cy.getActiveSelection('.nc-dropdown-column-type') cy.getActiveSelection(".nc-dropdown-column-type")
.find('.ant-select-item-option') .find(".ant-select-item-option")
.contains("Rollup") .contains("Rollup")
.click(); .click();
// wait for re-rendering & title selection to re-appear
cy.wait(500);
// Configure Child table & column names // Configure Child table & column names
fetchParentFromLabel("Child table"); fetchParentFromLabel("Child table");
cy.getActiveSelection('.nc-dropdown-relation-table') cy.getActiveSelection(".nc-dropdown-relation-table")
.find('.ant-select-item-option') .find(".ant-select-item-option")
.contains(childTable) .contains(childTable)
.click(); .click();
fetchParentFromLabel("Child column"); fetchParentFromLabel("Child column");
cy.getActiveSelection('.nc-dropdown-relation-column') cy.getActiveSelection(".nc-dropdown-relation-column")
.find('.ant-select-item-option') .find(".ant-select-item-option")
.contains(childCol) .contains(childCol)
.click(); .click();
fetchParentFromLabel("Aggregate function"); fetchParentFromLabel("Aggregate function");
cy.getActiveSelection('.nc-dropdown-rollup-function') cy.getActiveSelection(".nc-dropdown-rollup-function")
.find('.ant-select-item-option') .find(".ant-select-item-option")
.contains(aggregateFunc) .contains(aggregateFunc)
.click(); .click();
// cy.get(".ant-btn-primary").contains("Save").should('exist').click(); // cy.get(".ant-btn-primary").contains("Save").should('exist').click();
cy.getActiveMenu('.nc-dropdown-grid-add-column') cy.getActiveMenu(".nc-dropdown-grid-add-column")
.find(".ant-btn-primary:visible") .find(".ant-btn-primary:visible")
.contains("Save") .contains("Save")
.click(); .click();
@ -138,9 +140,7 @@ export const genTest = (apiType, dbType) => {
// Verify first entry, will be displayed as alias here 'childColumn (from childTable)' // Verify first entry, will be displayed as alias here 'childColumn (from childTable)'
// intentionally verifying 4th item, as initial items are being masked out by list scroll down // intentionally verifying 4th item, as initial items are being masked out by list scroll down
mainPage.getCell("RollUpCol", 4) mainPage.getCell("RollUpCol", 4).contains("2").should("exist");
.contains("2")
.should("exist");
// editColumnByName("RollUpCol_2", "RollUpCol_New"); // editColumnByName("RollUpCol_2", "RollUpCol_New");
deleteColumnByName("RollUpCol"); deleteColumnByName("RollUpCol");

Loading…
Cancel
Save