Browse Source

test: active menu access using class name

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/3597/head
Raju Udava 2 years ago committed by Pranav C
parent
commit
ab9a2aa06c
  1. 2
      packages/nc-gui/components/smartsheet-header/VirtualCell.vue
  2. 2
      packages/nc-gui/components/smartsheet-toolbar/FieldsMenu.vue
  3. 6
      scripts/cypress/integration/common/1b_table_column_operations.js
  4. 8
      scripts/cypress/integration/common/3a_filter_sort_fields_operations.js
  5. 15
      scripts/cypress/integration/common/3b_formula_column.js
  6. 4
      scripts/cypress/integration/common/3c_lookup_column.js
  7. 2
      scripts/cypress/integration/common/3d_rollup_column.js
  8. 5
      scripts/cypress/integration/common/3e_duration_column.js
  9. 4
      scripts/cypress/integration/common/3f_link_to_another_record.js
  10. 2
      scripts/cypress/integration/common/4c_form_view_detailed.js
  11. 2
      scripts/cypress/integration/common/4d_table_view_grid_locked.js
  12. 2
      scripts/cypress/integration/common/4f_grid_view_share.js
  13. 2
      scripts/cypress/integration/common/4f_pg_grid_view_share.js
  14. 2
      scripts/cypress/integration/common/5b_preview_role.js
  15. 4
      scripts/cypress/integration/common/6d_language_validation.js
  16. 2
      scripts/cypress/integration/common/6f_attachments.js
  17. 2
      scripts/cypress/integration/common/6g_base_share.js
  18. 2
      scripts/cypress/integration/common/7a_create_project_from_excel.js
  19. 2
      scripts/cypress/integration/common/7b_import_from_airtable.js
  20. 8
      scripts/cypress/integration/common/8a_webhook.js
  21. 12
      scripts/cypress/integration/common/9a_QuickTest.js
  22. 34
      scripts/cypress/integration/spec/roleValidation.spec.js
  23. 8
      scripts/cypress/support/commands.js
  24. 66
      scripts/cypress/support/page_objects/mainPage.js

2
packages/nc-gui/components/smartsheet-header/VirtualCell.vue

@ -120,7 +120,7 @@ const tooltipMsg = computed(() => {
class="h-full"
:trigger="['click']"
placement="bottomRight"
overlay-class-name="nc-dropdown"
overlay-class-name="nc-dropdown-edit-column"
>
<div />
<template #overlay>

2
packages/nc-gui/components/smartsheet-toolbar/FieldsMenu.vue

@ -116,7 +116,7 @@ const getIcon = (c: ColumnType) =>
</script>
<template>
<a-dropdown :trigger="['click']" overlay-class-name="nc-dropdown-nc-fields-menu">
<a-dropdown :trigger="['click']" overlay-class-name="nc-dropdown-fields-menu">
<div :class="{ 'nc-badge nc-active-btn': isAnyFieldHidden }">
<a-button v-t="['c:fields']" class="nc-fields-menu-btn nc-toolbar-btn" :disabled="isLocked">
<div class="flex items-center gap-1">

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

@ -83,7 +83,7 @@ export const genTest = (apiType, dbType) => {
cy.get(".nc-column-edit").should("not.be.visible");
// rename column and verify
cy.getActiveMenu().find('input.nc-column-name-input', { timeout: 3000 })
cy.getActiveMenu(".nc-dropdown-edit-column").find('input.nc-column-name-input', { timeout: 3000 })
.should('exist')
.clear()
.type(updatedColName);
@ -140,7 +140,7 @@ export const genTest = (apiType, dbType) => {
.rightclick({ force: true });
// delete row
cy.getActiveMenu()
cy.getActiveMenu(".nc-dropdown-grid-context-menu")
.find('.ant-dropdown-menu-item:contains("Delete Row")')
.first()
.click({ force: true });
@ -161,7 +161,7 @@ export const genTest = (apiType, dbType) => {
// delete selected rows
mainPage.getCell("Title", 3).rightclick({ force: true });
cy.getActiveMenu()
cy.getActiveMenu(".nc-dropdown-grid-context-menu")
.contains("Delete Selected Rows")
.click({ force: true });

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

@ -82,7 +82,7 @@ export const genTest = (apiType, dbType) => {
it("Delete Row", () => {
// delete row added in previous step
mainPage.getCell("Country", 10).rightclick();
cy.getActiveMenu().contains("Delete Row").click();
cy.getActiveMenu(".nc-dropdown-grid-context-menu").contains("Delete Row").click();
// cy.toastWait('Deleted row successfully')
@ -99,7 +99,7 @@ export const genTest = (apiType, dbType) => {
mainPage.getPagination(5).click();
mainPage.getCell("Country", 9).rightclick({ force: true });
cy.getActiveMenu()
cy.getActiveMenu(".nc-dropdown-grid-context-menu")
.contains("Insert New Row")
.click({ force: true });
mainPage
@ -109,7 +109,7 @@ export const genTest = (apiType, dbType) => {
.type("Test Country-1{enter}");
mainPage.getCell("Country", 10).rightclick({ force: true });
cy.getActiveMenu()
cy.getActiveMenu(".nc-dropdown-grid-context-menu")
.contains("Insert New Row")
.click({ force: true });
mainPage
@ -142,7 +142,7 @@ export const genTest = (apiType, dbType) => {
.eq(11).click({ force: true });
mainPage.getCell("Country", 10).rightclick({ force: true });
cy.getActiveMenu()
cy.getActiveMenu(".nc-dropdown-grid-context-menu")
.contains("Delete Selected Rows")
.click({ force: true });

15
scripts/cypress/integration/common/3b_formula_column.js

@ -13,17 +13,6 @@ export const genTest = (apiType, dbType) => {
//
before(() => {
// loginPage.loginAndOpenProject(apiType, dbType)
mainPage.tabReset();
// open a table to work on views
//
// // 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);
cy.openTableTab("City", 25);
});
@ -59,7 +48,7 @@ export const genTest = (apiType, dbType) => {
force: true,
});
cy.getActiveMenu().find('input.nc-column-name-input', { timeout: 3000 })
cy.getActiveMenu(".nc-dropdown-grid-add-column").find('input.nc-column-name-input', { timeout: 3000 })
.should('exist')
.clear()
.type(columnName);
@ -91,7 +80,7 @@ export const genTest = (apiType, dbType) => {
cy.get(".nc-column-edit").click();
cy.get(".nc-column-edit").should("not.be.visible");
cy.getActiveMenu().find('input.nc-column-name-input', { timeout: 3000 })
cy.getActiveMenu(".nc-dropdown-edit-column").find('input.nc-column-name-input', { timeout: 3000 })
.should('exist')
.clear()
.type(newName);

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

@ -44,7 +44,7 @@ export const genTest = (apiType, dbType) => {
force: true,
});
cy.getActiveMenu().find('input.nc-column-name-input', { timeout: 3000 })
cy.getActiveMenu(".nc-dropdown-grid-add-column").find('input.nc-column-name-input', { timeout: 3000 })
.should('exist')
.clear()
.type(childCol);
@ -54,11 +54,9 @@ export const genTest = (apiType, dbType) => {
// Configure Child table & column names
fetchParentFromLabel("Child table");
cy.getActiveSelection().find('.ant-select-item-option').contains(childTable).click();
// cy.getActiveMenu().contains(childTable).click();
fetchParentFromLabel("Child column");
cy.getActiveSelection().find('.ant-select-item-option').contains(childCol).click();
// cy.getActiveMenu().contains(childCol).click();
cy.get(".ant-btn-primary").contains("Save").should('exist').click();
cy.toastWait(`Column created`);

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

@ -50,7 +50,7 @@ export const genTest = (apiType, dbType) => {
force: true,
});
cy.getActiveMenu().find('input.nc-column-name-input', { timeout: 3000 })
cy.getActiveMenu(".nc-dropdown-grid-add-column").find('input.nc-column-name-input', { timeout: 3000 })
.should('exist')
.clear()
.type(columnName);

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

@ -44,7 +44,7 @@ export const genTest = (apiType, dbType) => {
force: true,
});
cy.getActiveMenu().find('input.nc-column-name-input', { timeout: 3000 })
cy.getActiveMenu(".nc-dropdown-grid-add-column").find('input.nc-column-name-input', { timeout: 3000 })
.should('exist')
.clear()
.type(columnName);
@ -54,7 +54,6 @@ export const genTest = (apiType, dbType) => {
// Configure Duration format
fetchParentFromLabel("Duration Format");
cy.getActiveSelection().find('.ant-select-item-option').contains(durationFormat).click();
// cy.getActiveMenu().contains(durationFormat).click();
cy.get(".ant-btn-primary").contains("Save").should('exist').click();
cy.toastWait(`Column created`);
@ -80,7 +79,7 @@ export const genTest = (apiType, dbType) => {
cy.get(".nc-column-edit").should("not.be.visible");
// rename column and verify
cy.getActiveMenu().find('input.nc-column-name-input', { timeout: 3000 })
cy.getActiveMenu(".nc-dropdown-column-operations").find('input.nc-column-name-input', { timeout: 3000 })
.should('exist')
.clear()
.type(newName);

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

@ -5,7 +5,7 @@ import { isTestSuiteActive } from "../../support/page_objects/projectConstants";
export const genTest = (apiType, dbType) => {
if (!isTestSuiteActive(apiType, dbType)) return;
describe(`${apiType.toUpperCase()} api - RollUp column`, () => {
describe(`${apiType.toUpperCase()} api - Link to another record`, () => {
function fetchParentFromLabel(label) {
cy.get("label").contains(label).parents(".ant-row").click();
@ -31,7 +31,7 @@ export const genTest = (apiType, dbType) => {
cy.get(".nc-grid tr > th:last .nc-icon").click();
// Column name
cy.getActiveMenu().find('input.nc-column-name-input', { timeout: 3000 })
cy.getActiveMenu(".nc-dropdown-grid-add-column").find('input.nc-column-name-input', { timeout: 3000 })
.should('exist')
.clear()
.type(columnName);

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

@ -437,7 +437,7 @@ export const genTest = (apiType, dbType) => {
cy.get(".ant-checkbox").should('exist').eq(13).click({ force: true });
mainPage.getCell("Country", 10).rightclick({ force: true });
cy.getActiveMenu()
cy.getActiveMenu(".nc-dropdown-grid-context-menu")
.contains("Delete Selected Rows")
.click({ force: true });
});

2
scripts/cypress/integration/common/4d_table_view_grid_locked.js

@ -37,7 +37,7 @@ export const genTest = (apiType, dbType) => {
// on menu, collaboration view appears first (at index 0)
// followed by Locked view (at index 1)
cy.get(".nc-actions-menu-btn").click();
cy.getActiveMenu().find('.ant-dropdown-menu-submenu').eq(0).click();
cy.getActiveMenu(".nc-dropdown-actions-menu").find('.ant-dropdown-menu-submenu').eq(0).click();
cy.wait(1000);
cy.get('.nc-locked-menu-item').contains(menuOption).should('exist').click();

2
scripts/cypress/integration/common/4f_grid_view_share.js

@ -424,7 +424,7 @@ export const genTest = (apiType, dbType) => {
// wait for page rendering to complete
cy.get(".nc-grid-row").should("have.length", 10);
mainPage.getCell("Country", 10).rightclick();
cy.getActiveMenu()
cy.getActiveMenu(".nc-dropdown-grid-context-menu")
.find('.ant-dropdown-menu-item:contains("Delete Row")')
.first()
.click();

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

@ -404,7 +404,7 @@ export const genTest = (apiType, dbType) => {
.find(".mdi-checkbox-blank-outline")
.click({ force: true });
mainPage.getCell("Country", 10).rightclick();
cy.getActiveMenu().contains("Delete Selected Row").click();
cy.getActiveMenu(".nc-dropdown-grid-context-menu").contains("Delete Selected Row").click();
// delete column
cy.get(`th:contains('dummy') .mdi-menu-down`)

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

@ -35,7 +35,7 @@ export const genTest = (apiType, dbType, roleType) => {
cy.wait(3000);
settingsPage.openProjectMenu();
cy.getActiveMenu().find(`[data-submenu-id="preview-as"]`).should('exist').click()
cy.getActiveMenu(".nc-dropdown-project-menu").find(`[data-submenu-id="preview-as"]`).should('exist').click()
cy.wait(1000)
cy.get('.ant-dropdown-menu-submenu').eq(4).find(`[data-menu-id="editor"]`).should('exist').click()

4
scripts/cypress/integration/common/6d_language_validation.js

@ -24,7 +24,7 @@ export const genTest = (apiType, dbType) => {
after(() => {
cy.get('.nc-menu-accounts').should('exist').click();
cy.getActiveMenu().find('.ant-dropdown-menu-item').eq(1).click();
cy.getActiveMenu('.nc-dropdown-user-accounts-menu').find('.ant-dropdown-menu-item').eq(1).click();
cy.wait(5000);
cy.get('button:contains("SIGN")').should('exist')
@ -39,7 +39,7 @@ export const genTest = (apiType, dbType) => {
// toggle menu as per index
cy.get(".nc-menu-translate").should('exist').last().click();
cy.wait(500);
cy.getActiveMenu().find(".ant-dropdown-menu-item").eq(idx).click();
cy.getActiveMenu(".nc-dropdown-menu-translate").find(".ant-dropdown-menu-item").eq(idx).click();
cy.wait(200);
// basic validations

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

@ -41,7 +41,7 @@ export const genTest = (apiType, dbType) => {
// .click({ force: true });
mainPage.getCell("Country", 10).rightclick();
cy.getActiveMenu().contains("Delete Row").click();
cy.getActiveMenu(".nc-dropdown-grid-context-menu").contains("Delete Row").click();
cy.closeTableTab("Country");
});

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

@ -77,7 +77,7 @@ export const genTest = (apiType, dbType) => {
// Click on readonly base text
cy.getActiveModal().find(".nc-disable-shared-base").click();
cy.getActiveMenu()
cy.getActiveMenu(".nc-dropdown-shared-base-toggle")
.find(".ant-dropdown-menu-title-content")
.contains("Anyone with the link")
.click();

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

@ -106,7 +106,7 @@ export const genTest = (apiType, dbType) => {
cy.get('.nc-add-new-table').should('exist').trigger('mouseover')
cy.get('.nc-import-menu').should('exist').click()
cy.getActiveMenu().find('.ant-dropdown-menu-item').contains('Microsoft Excel').click()
cy.getActiveMenu(".nc-dropdown-import-menu").find('.ant-dropdown-menu-item').contains('Microsoft Excel').click()
cy.get(".nc-input-import").should('exist').find('input').attachFile(filepath);
cy.toastWait("Uploaded file simple.xlsx successfully");

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

@ -30,7 +30,7 @@ export const genTest = (apiType, dbType) => {
// trigger import
cy.get('.nc-add-new-table').should('exist').trigger('mouseover')
cy.get('.nc-import-menu').should('exist').click()
cy.getActiveMenu().find('.ant-dropdown-menu-item').contains('Airtable').click()
cy.getActiveMenu(".nc-dropdown-import-menu").find('.ant-dropdown-menu-item').contains('Airtable').click()
cy.getActiveModal().find(".nc-input-api-key").should('exist').clear().type(apiKey)
cy.getActiveModal().find(".nc-input-shared-base").should('exist').clear().type(sharedBase)

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

@ -7,7 +7,7 @@ let hookPath = "http://localhost:9090/hook";
function createWebhook(hook, test) {
cy.get('.nc-actions-menu-btn').should('exist').click();
cy.getActiveMenu().find('.ant-dropdown-menu-title-content').contains('Webhooks').click()
cy.getActiveMenu(".nc-dropdown-webhook").find('.ant-dropdown-menu-title-content').contains('Webhooks').click()
// cy.get(".nc-btn-webhook").should("exist").click();
cy.get(".nc-btn-create-webhook").should("exist").click();
@ -51,7 +51,7 @@ function createWebhook(hook, test) {
function deleteWebhook(index) {
cy.get('.nc-actions-menu-btn').should('exist').click();
cy.getActiveMenu().find('.ant-dropdown-menu-title-content').contains('Webhooks').click()
cy.getActiveMenu(".nc-dropdown-actions-menu").find('.ant-dropdown-menu-title-content').contains('Webhooks').click()
cy.get(".nc-hook-delete-icon").eq(index).click({ force: true });
cy.toastWait("Hook deleted successfully");
@ -60,7 +60,7 @@ function deleteWebhook(index) {
function openWebhook(index) {
cy.get('.nc-actions-menu-btn').should('exist').click();
cy.getActiveMenu().find('.ant-dropdown-menu-title-content').contains('Webhooks').click()
cy.getActiveMenu(".nc-dropdown-actions-menu").find('.ant-dropdown-menu-title-content').contains('Webhooks').click()
cy.get(".nc-hook").eq(index).click({ force: true });
}
@ -216,7 +216,7 @@ function deleteRow(index) {
.rightclick();
// delete row
cy.getActiveMenu()
cy.getActiveMenu(".nc-dropdown-grid-context-menu")
.find('.ant-dropdown-menu-item:contains("Delete Row")')
.first()
.click({ force: true });

12
scripts/cypress/integration/common/9a_QuickTest.js

@ -40,7 +40,7 @@ let cn = [ "Name", "Notes", "Status", "Tags", "Done", "Date", "Phone",
function openWebhook(index) {
cy.get('.nc-actions-menu-btn').should('exist').click();
cy.getActiveMenu().find('.ant-dropdown-menu-title-content').contains('Webhooks').click()
cy.getActiveMenu(".nc-dropdown-actions-menu").find('.ant-dropdown-menu-title-content').contains('Webhooks').click()
cy.get(".nc-hook").eq(index).click();
}
@ -348,11 +348,11 @@ export const genTest = (apiType, dbType, testMode) => {
cy.wait(2000);
cy.get(".nc-fields-menu-btn").click()
cy.getActiveMenu().find(`[type="checkbox"]`).eq(0).should('be.checked')
cy.getActiveMenu().find(`[type="checkbox"]`).eq(1).should('be.checked')
cy.getActiveMenu().find(`[type="checkbox"]`).eq(2).should('not.be.checked')
cy.getActiveMenu().find(`[type="checkbox"]`).eq(3).should('be.checked')
cy.getActiveMenu().find(`[type="checkbox"]`).eq(4).should('be.checked')
cy.getActiveMenu(".nc-dropdown-fields-menu").find(`[type="checkbox"]`).eq(0).should('be.checked')
cy.getActiveMenu(".nc-dropdown-fields-menu").find(`[type="checkbox"]`).eq(1).should('be.checked')
cy.getActiveMenu(".nc-dropdown-fields-menu").find(`[type="checkbox"]`).eq(2).should('not.be.checked')
cy.getActiveMenu(".nc-dropdown-fields-menu").find(`[type="checkbox"]`).eq(3).should('be.checked')
cy.getActiveMenu(".nc-dropdown-fields-menu").find(`[type="checkbox"]`).eq(4).should('be.checked')
cy.get(".nc-fields-menu-btn").click();
cy.get(".nc-sort-menu-btn").click();

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

@ -13,7 +13,7 @@ export function _advSettings(roleType, mode) {
// open modal
cy.get('.nc-project-menu').should('exist').click()
cy.getActiveMenu().find(`[data-menu-id="language"]`).should('exist')
cy.getActiveMenu(".nc-dropdown-project-menu").find(`[data-menu-id="language"]`).should('exist')
// click again to close modal
cy.get('.nc-project-menu').should('exist').click()
@ -25,11 +25,11 @@ export function _advSettings(roleType, mode) {
// cy.get(".nc-team-settings").should(validationString);
cy.get('.nc-project-menu').should('exist').click()
cy.getActiveMenu().find(`[data-menu-id="preview-as"]`).should(validationString)
cy.getActiveMenu().find(`[data-menu-id="teamAndSettings"]:visible`).should(validationString)
cy.getActiveMenu(".nc-dropdown-project-menu").find(`[data-menu-id="preview-as"]`).should(validationString)
cy.getActiveMenu(".nc-dropdown-project-menu").find(`[data-menu-id="teamAndSettings"]:visible`).should(validationString)
if (true === roles[roleType].validations.advSettings) {
cy.getActiveMenu().find(`[data-menu-id="teamAndSettings"]:visible`).should(validationString).click()
cy.getActiveMenu(".nc-dropdown-project-menu").find(`[data-menu-id="teamAndSettings"]:visible`).should(validationString).click()
cy.get(`[data-menu-id="teamAndAuth"]`).should('exist')
cy.get(`[data-menu-id="appStore"]`).should('exist')
@ -67,8 +67,8 @@ export function _editSchema(roleType, mode) {
cy.get(".ant-dropdown-content:visible").should(validationString);
if(validationString === "exist"){
cy.getActiveMenu().find('[role="menuitem"]').contains("Delete").should("exist");
cy.getActiveMenu().find('[role="menuitem"]').contains("Rename").should("exist");
cy.getActiveMenu(".nc-dropdown-tree-view-context-menu").find('[role="menuitem"]').contains("Delete").should("exist");
cy.getActiveMenu(".nc-dropdown-tree-view-context-menu").find('[role="menuitem"]').contains("Rename").should("exist");
// click on a cell to close table context menu
mainPage.getCell(columnName, 3).click();
@ -83,11 +83,11 @@ export function _editSchema(roleType, mode) {
if(validationString === "exist"){
cy.get('.nc-import-menu').should('exist').click();
cy.getActiveMenu().should('exist')
cy.getActiveMenu().find('.ant-dropdown-menu-item').contains('Airtable')
cy.getActiveMenu().find('.ant-dropdown-menu-item').contains('CSV file')
cy.getActiveMenu().find('.ant-dropdown-menu-item').contains('JSON file')
cy.getActiveMenu().find('.ant-dropdown-menu-item').contains('Microsoft Excel')
cy.getActiveMenu(".nc-dropdown-import-menu").should('exist')
cy.getActiveMenu(".nc-dropdown-import-menu").find('.ant-dropdown-menu-item').contains('Airtable')
cy.getActiveMenu(".nc-dropdown-import-menu").find('.ant-dropdown-menu-item').contains('CSV file')
cy.getActiveMenu(".nc-dropdown-import-menu").find('.ant-dropdown-menu-item').contains('JSON file')
cy.getActiveMenu(".nc-dropdown-import-menu").find('.ant-dropdown-menu-item').contains('Microsoft Excel')
}
}
@ -114,10 +114,10 @@ export function _editData(roleType, mode) {
if (validationString === "exist") {
// right click options will exist (only for 'exist' case)
//
cy.getActiveMenu().contains("Insert New Row").should(validationString);
cy.getActiveMenu().contains("Clear cell").should(validationString);
cy.getActiveMenu().contains("Delete Row").should(validationString);
cy.getActiveMenu().contains("Delete Selected Rows").should(validationString);
cy.getActiveMenu(".nc-dropdown-grid-context-menu").contains("Insert New Row").should(validationString);
cy.getActiveMenu(".nc-dropdown-grid-context-menu").contains("Clear cell").should(validationString);
cy.getActiveMenu(".nc-dropdown-grid-context-menu").contains("Delete Row").should(validationString);
cy.getActiveMenu(".nc-dropdown-grid-context-menu").contains("Delete Selected Rows").should(validationString);
// cy.get("body").type("{esc}");
mainPage.getCell("City", 13).click();
@ -255,10 +255,10 @@ export function _viewMenu(roleType, mode) {
// actions menu (more), only download csv should be visible for non-previlaged users
cy.get(".nc-actions-menu-btn").click();
cy.getActiveMenu()
cy.getActiveMenu(".nc-dropdown-actions-menu")
.find('.ant-dropdown-menu-submenu:visible')
.should("have.length", menuWithSubmenuCount);
cy.getActiveMenu()
cy.getActiveMenu(".nc-dropdown-actions-menu")
.find('.ant-dropdown-menu-item:visible')
.should("have.length", menuWithoutSubmenuCount);
// click again to close menu

8
scripts/cypress/support/commands.js

@ -141,7 +141,7 @@ Cypress.Commands.add('refreshTableTab', () => {
.first()
.rightclick({ force: true });
cy.getActiveMenu()
cy.getActiveMenu(".nc-dropdown-tree-view-context-menu")
.find('[role="menuitem"]')
.contains('Tables Refresh')
.should('exist')
@ -342,7 +342,7 @@ Cypress.Commands.add('createTable', (name) => {
Cypress.Commands.add('deleteTable', (name, dbType) => {
cy.get(`.nc-project-tree-tbl-${name}`).should('exist').rightclick();
cy.getActiveMenu().find('[role="menuitem"]').contains('Delete').click();
cy.getActiveMenu(".nc-dropdown-tree-view-context-menu").find('[role="menuitem"]').contains('Delete').click();
cy.getActiveModal().find('button').contains('Yes').click();
cy.toastWait(`Deleted table successfully`);
@ -357,7 +357,7 @@ Cypress.Commands.add('renameTable', (oldName, newName) => {
.rightclick();
// choose rename option from menu
cy.getActiveMenu()
cy.getActiveMenu(".nc-dropdown-tree-view-context-menu")
.find('[role="menuitem"]')
.contains('Rename')
.click({ force: true });
@ -495,7 +495,7 @@ Cypress.Commands.add('signOut', () => {
cy.visit(`/`);
cy.get('.nc-project-page-title', { timeout: 30000 }).contains('My Projects').should('be.visible');
cy.get('.nc-menu-accounts', { timeout: 30000 }).should('exist').click();
cy.getActiveMenu().find('.ant-dropdown-menu-item').eq(1).click();
cy.getActiveMenu(".nc-dropdown-user-accounts-menu").find('.ant-dropdown-menu-item').eq(1).click();
cy.wait(5000);
cy.get('button:contains("SIGN")').should('exist');

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

@ -33,7 +33,7 @@ export class _settingsPage {
// cy.get('.nc-team-settings').should('exist').click()
// cy.get(`[data-menu-id=${menuId}]`).should('exist').click()
cy.get('.nc-project-menu').should('exist').click()
cy.getActiveMenu().find(`[data-menu-id="teamAndSettings"]`).should('exist').click()
cy.getActiveMenu(".nc-dropdown-project-menu").find(`[data-menu-id="teamAndSettings"]`).should('exist').click()
cy.get(`[data-menu-id=${menuId}]`).should('exist').click()
}
@ -89,7 +89,7 @@ export class _mainPage {
navigationDraw(item) {
// open settings tab
cy.get('.nc-project-menu').should('exist').click()
cy.getActiveMenu().find(`[data-menu-id="teamAndSettings"]`).should('exist').click()
cy.getActiveMenu(".nc-dropdown-project-menu").find(`[data-menu-id="teamAndSettings"]`).should('exist').click()
switch (item) {
case this.AUDIT:
@ -136,26 +136,26 @@ export class _mainPage {
});
};
addExistingUserToProject = (emailId, role) => {
cy.get('.v-list-item:contains("Team & Auth")').click();
cy.get(`tr:contains(${emailId})`)
.find(".mdi-plus", { timeout: 2000 })
.click();
cy.get(`tr:contains(${emailId})`)
.find(".mdi-pencil-outline", { timeout: 2000 })
.click();
cy.get("label:contains(Select User Role)").click();
// opt-in requested role & submit
//
cy.getActiveMenu().contains(role).click();
cy.get(".nc-invite-or-save-btn").click();
cy.toastWait("Successfully updated the user details");
this.roleURL[role] =
"http://localhost:3000/#/user/authentication/signin";
};
// addExistingUserToProject = (emailId, role) => {
// cy.get('.v-list-item:contains("Team & Auth")').click();
// cy.get(`tr:contains(${emailId})`)
// .find(".mdi-plus", { timeout: 2000 })
// .click();
// cy.get(`tr:contains(${emailId})`)
// .find(".mdi-pencil-outline", { timeout: 2000 })
// .click();
//
// cy.get("label:contains(Select User Role)").click();
//
// // opt-in requested role & submit
// //
// cy.getActiveMenu().contains(role).click();
// cy.get(".nc-invite-or-save-btn").click();
// cy.toastWait("Successfully updated the user details");
//
// this.roleURL[role] =
// "http://localhost:3000/#/user/authentication/signin";
// };
getCell = (columnHeader, cellNumber) => {
return cy.get(
@ -183,7 +183,7 @@ export class _mainPage {
force: true,
});
cy.getActiveMenu().find('input.nc-column-name-input', { timeout: 3000 })
cy.getActiveMenu(".nc-dropdown-grid-add-column").find('input.nc-column-name-input', { timeout: 3000 })
.should('exist')
.clear()
.type(colName);
@ -197,7 +197,7 @@ export class _mainPage {
force: true,
});
cy.getActiveMenu().find('input.nc-column-name-input', { timeout: 3000 })
cy.getActiveMenu(".nc-dropdown-grid-add-column").find('input.nc-column-name-input', { timeout: 3000 })
.should('exist')
.clear()
.type(colName);
@ -265,34 +265,34 @@ export class _mainPage {
shareViewList = () => {
cy.get(".nc-actions-menu-btn").should('exist').click();
return cy.getActiveMenu().find('.ant-dropdown-menu-item').contains('Shared View List');
return cy.getActiveMenu(".nc-dropdown-actions-menu").find('.ant-dropdown-menu-item').contains('Shared View List');
};
downloadCsv = () => {
cy.get(".nc-actions-menu-btn").should('exist').click();
return cy.getActiveMenu().find('.ant-dropdown-menu-item').contains('Download as CSV');
return cy.getActiveMenu(".nc-dropdown-actions-menu").find('.ant-dropdown-menu-item').contains('Download as CSV');
};
downloadExcel = () => {
cy.get(".nc-actions-menu-btn").should('exist').click();
return cy.getActiveMenu().find('.ant-dropdown-menu-item').contains('Download as XLSX');
return cy.getActiveMenu(".nc-dropdown-actions-menu").find('.ant-dropdown-menu-item').contains('Download as XLSX');
};
uploadCsv = () => {
cy.get(".nc-actions-menu-btn").should('exist').click();
return cy.getActiveMenu().find('.ant-dropdown-menu-item').contains('Upload CSV');
return cy.getActiveMenu(".nc-dropdown-actions-menu").find('.ant-dropdown-menu-item').contains('Upload CSV');
};
automations = () => {
cy.get(".nc-actions-menu-btn").should('exist').click();
return cy.getActiveMenu().find('.ant-dropdown-menu-item').contains('Webhooks');
return cy.getActiveMenu(".nc-dropdown-actions-menu").find('.ant-dropdown-menu-item').contains('Webhooks');
};
hideField = (field) => {
cy.get(`th[data-title="${field}"]`).should("be.visible");
cy.get(".nc-fields-menu-btn").click();
cy.wait(500)
cy.getActiveMenu().find(`.nc-fields-list label:contains(${field}):visible`).click();
cy.getActiveMenu(".nc-dropdown-fields-menu").find(`.nc-fields-list label:contains(${field}):visible`).click();
cy.wait(500)
cy.get(".nc-fields-menu-btn").click();
cy.wait(500)
@ -303,7 +303,7 @@ export class _mainPage {
cy.get(`th[data-title="${field}"]`).should("not.exist");
cy.get(".nc-fields-menu-btn").click();
cy.wait(500)
cy.getActiveMenu().find(`.nc-fields-list label:contains(${field}):visible`).click();
cy.getActiveMenu(".nc-dropdown-fields-menu").find(`.nc-fields-list label:contains(${field}):visible`).click();
cy.wait(500)
cy.get(".nc-fields-menu-btn").click();
cy.wait(500)
@ -411,10 +411,10 @@ export class _mainPage {
if(role === 'commenter' || role === 'viewer') {
cy.get(".nc-actions-menu-btn").click();
cy.getActiveMenu().find('.nc-project-menu-item').contains('Download as CSV').click();
cy.getActiveMenu(".nc-dropdown-actions-menu").find('.nc-project-menu-item').contains('Download as CSV').click();
} else {
cy.get(".nc-actions-menu-btn").click();
cy.getActiveMenu().find('.nc-project-menu-item').contains('Download').click();
cy.getActiveMenu(".nc-dropdown-actions-menu").find('.nc-project-menu-item').contains('Download').click();
cy.wait(1000);
cy.get('.nc-project-menu-item').contains('Download as CSV').should('exist').click();
}

Loading…
Cancel
Save