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

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

@ -31,11 +31,11 @@ export const genTest = (apiType, dbType) => {
beforeEach(() => {
cy.restoreLocalStorage();
})
});
afterEach(() => {
cy.saveLocalStorage();
})
});
// after(() => {
// cy.closeTableTab("Country");
@ -49,48 +49,50 @@ export const genTest = (apiType, dbType) => {
childCol,
aggregateFunc
) => {
cy.get(".nc-grid tr > th:last .nc-icon").click({
force: true,
});
cy.getActiveMenu(".nc-dropdown-grid-add-column")
.find('input.nc-column-name-input')
.should('exist')
.find("input.nc-column-name-input")
.should("exist")
.clear()
.type(columnName);
// 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")
.last()
.click()
.type("RollUp")
cy.getActiveSelection('.nc-dropdown-column-type')
.find('.ant-select-item-option')
.type("RollUp");
cy.getActiveSelection(".nc-dropdown-column-type")
.find(".ant-select-item-option")
.contains("Rollup")
.click();
// wait for re-rendering & title selection to re-appear
cy.wait(500);
// Configure Child table & column names
fetchParentFromLabel("Child table");
cy.getActiveSelection('.nc-dropdown-relation-table')
.find('.ant-select-item-option')
cy.getActiveSelection(".nc-dropdown-relation-table")
.find(".ant-select-item-option")
.contains(childTable)
.click();
fetchParentFromLabel("Child column");
cy.getActiveSelection('.nc-dropdown-relation-column')
.find('.ant-select-item-option')
cy.getActiveSelection(".nc-dropdown-relation-column")
.find(".ant-select-item-option")
.contains(childCol)
.click();
fetchParentFromLabel("Aggregate function");
cy.getActiveSelection('.nc-dropdown-rollup-function')
.find('.ant-select-item-option')
cy.getActiveSelection(".nc-dropdown-rollup-function")
.find(".ant-select-item-option")
.contains(aggregateFunc)
.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")
.contains("Save")
.click();
@ -138,9 +140,7 @@ export const genTest = (apiType, dbType) => {
// 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
mainPage.getCell("RollUpCol", 4)
.contains("2")
.should("exist");
mainPage.getCell("RollUpCol", 4).contains("2").should("exist");
// editColumnByName("RollUpCol_2", "RollUpCol_New");
deleteColumnByName("RollUpCol");

Loading…
Cancel
Save