Browse Source

test: suite fix for locked view

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/3346/head
Raju Udava 2 years ago
parent
commit
d792ef8b1c
  1. 10
      scripts/cypress-v2/integration/common/4c_form_view_detailed.js
  2. 54
      scripts/cypress-v2/integration/common/4d_table_view_grid_locked.js

10
scripts/cypress-v2/integration/common/4c_form_view_detailed.js

@ -50,11 +50,11 @@ export const genTest = (apiType, dbType) => {
cy.fileHook();
mainPage.tabReset();
// kludge: wait for page load to finish
cy.wait(1000);
// close team & auth tab
cy.get('button.ant-tabs-tab-remove').should('exist').click();
cy.wait(1000);
// // kludge: wait for page load to finish
// cy.wait(1000);
// // close team & auth tab
// cy.get('button.ant-tabs-tab-remove').should('exist').click();
// cy.wait(1000);
// open a table to work on views
//

54
scripts/cypress-v2/integration/common/4d_table_view_grid_locked.js

@ -10,6 +10,13 @@ export const genTest = (apiType, dbType) => {
before(() => {
cy.fileHook();
mainPage.tabReset();
// kludge: wait for page load to finish
cy.wait(1000);
// close team & auth tab
cy.get('button.ant-tabs-tab-remove').should('exist').click();
cy.wait(1000);
// open a table to work on views
//
cy.openTableTab("Country", 25);
@ -26,26 +33,38 @@ export const genTest = (apiType, dbType) => {
const lockViewTest = (enabled) => {
it(`Grid: lock view set to ${enabled}: validation`, () => {
let vString = enabled ? "not." : "";
let menuOption = enabled ? 1 : 0;
let menuOption = enabled ? 'Locked View' : 'Collaborative View';
// on menu, collaboration view appears first (at index 0)
// followed by Locked view (at index 1)
cy.get(".nc-sidebar-lock-menu")
.click();
cy.getActiveMenu()
.find('.nc-menu-item:visible')
.eq(menuOption)
.click();
cy.get(".nc-actions-menu-btn").click();
cy.getActiveMenu().find('.ant-dropdown-menu-submenu').eq(0).click();
cy.wait(1000);
cy.get('.nc-locked-menu-item').contains(menuOption).should('exist').click();
// cy.get(".nc-sidebar-lock-menu")
// .click();
// cy.getActiveMenu()
// .find('.nc-menu-item:visible')
// .eq(menuOption)
// .click();
cy.toastWait('Successfully Switched to locked view')
if(enabled) {
cy.toastWait('Successfully Switched to locked view')
cy.get(".nc-icon-locked").should("exist");
} else {
cy.toastWait('Successfully Switched to collaborative view')
cy.get(".nc-icon-collaborative").should("exist");
}
// expected toolbar for Lock view: Only lock-view menu, reload, toggle-nav-drawer to be enabled
//
cy.get(".nc-sidebar-lock-menu:enabled")
.should("exist");
cy.get(".nc-sidebar-reload-btn:enabled")
// cy.get(".nc-sidebar-lock-menu:enabled")
// .should("exist");
cy.get(".nc-toolbar-reload-btn")
.should("exist");
cy.get("nc-sidebar-add-row-btn:enabled")
cy.get(".nc-add-new-row-btn > .cursor-pointer")
.should(`${vString}exist`);
cy.get(".nc-fields-menu-btn:enabled")
.should(`${vString}exist`);
@ -61,13 +80,6 @@ export const genTest = (apiType, dbType) => {
.find("input")
.should(`${vString}exist`);
// check if expand row option is available?
// cy.get("td")
// .find(".nc-row-expand-icon")
// .should(`${vString}exist`);
mainPage
.getRow(1)
.find('.nc-row-no').should('exist').eq(0).trigger('mouseover', { force: true })
cy.get(".nc-row-expand")
.should(`${vString}exist`);
@ -76,12 +88,12 @@ export const genTest = (apiType, dbType) => {
mainPage
.getCell("City List", 1)
.click()
.find("button.mdi-plus")
.find(".nc-action-icon.nc-plus")
.should(`${vString}exist`);
mainPage
.getCell("City List", 1)
.click()
.find("button.mdi-arrow-expand")
.find(".nc-action-icon.nc-arrow-expand")
.should(`${vString}exist`);
// update row option (right click) - should not be available for Lock view

Loading…
Cancel
Save