|
|
@ -49,12 +49,12 @@ export function _advSettings(roleType, mode) { |
|
|
|
export function _editSchema(roleType, mode) { |
|
|
|
export function _editSchema(roleType, mode) { |
|
|
|
let columnName = "City"; |
|
|
|
let columnName = "City"; |
|
|
|
let validationString = |
|
|
|
let validationString = |
|
|
|
true == roles[roleType].validations.editSchema ? "exist" : "not.exist"; |
|
|
|
true === roles[roleType].validations.editSchema ? "exist" : "not.exist"; |
|
|
|
|
|
|
|
|
|
|
|
cy.openTableTab(columnName, 25); |
|
|
|
cy.openTableTab(columnName, 25); |
|
|
|
|
|
|
|
|
|
|
|
// create table
|
|
|
|
// create table
|
|
|
|
cy.get(`.nc-add-import-btn`).should(validationString); |
|
|
|
cy.get(`.nc-add-new-table`).should(validationString); |
|
|
|
|
|
|
|
|
|
|
|
// delete table option
|
|
|
|
// delete table option
|
|
|
|
cy.get(`.nc-project-tree-tbl-City`).should("exist").rightclick(); |
|
|
|
cy.get(`.nc-project-tree-tbl-City`).should("exist").rightclick(); |
|
|
@ -64,7 +64,8 @@ export function _editSchema(roleType, mode) { |
|
|
|
cy.getActiveMenu().find('[role="menuitem"]').contains("Delete").should("exist"); |
|
|
|
cy.getActiveMenu().find('[role="menuitem"]').contains("Delete").should("exist"); |
|
|
|
cy.getActiveMenu().find('[role="menuitem"]').contains("Rename").should("exist"); |
|
|
|
cy.getActiveMenu().find('[role="menuitem"]').contains("Rename").should("exist"); |
|
|
|
|
|
|
|
|
|
|
|
mainPage.getCell(columnName, 1).click(); |
|
|
|
// click on a cell to close table context menu
|
|
|
|
|
|
|
|
mainPage.getCell(columnName, 3).click(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// add new column option
|
|
|
|
// add new column option
|
|
|
@ -73,6 +74,15 @@ export function _editSchema(roleType, mode) { |
|
|
|
|
|
|
|
|
|
|
|
// update column (edit/ delete menu)
|
|
|
|
// update column (edit/ delete menu)
|
|
|
|
cy.get('.nc-ui-dt-dropdown').should(validationString) |
|
|
|
cy.get('.nc-ui-dt-dropdown').should(validationString) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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') |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export function _editData(roleType, mode) { |
|
|
|
export function _editData(roleType, mode) { |
|
|
@ -82,20 +92,17 @@ export function _editData(roleType, mode) { |
|
|
|
|
|
|
|
|
|
|
|
cy.openTableTab(columnName, 25); |
|
|
|
cy.openTableTab(columnName, 25); |
|
|
|
|
|
|
|
|
|
|
|
// add row
|
|
|
|
// add row button
|
|
|
|
cy.get('.nc-add-new-row-btn:visible').should(validationString); |
|
|
|
cy.get('.nc-add-new-row-btn:visible').should(validationString); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// add button at bottom of page
|
|
|
|
mainPage.getCell(columnName, 25).scrollIntoView(); |
|
|
|
mainPage.getCell(columnName, 25).scrollIntoView(); |
|
|
|
// cy.get('.nc-grid-add-new-cell').scrollIntoView();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cy.get('.nc-grid-add-new-cell:visible').should(validationString); |
|
|
|
cy.get('.nc-grid-add-new-cell:visible').should(validationString); |
|
|
|
|
|
|
|
|
|
|
|
// update row option (right click)
|
|
|
|
// update row option (right click)
|
|
|
|
//
|
|
|
|
//
|
|
|
|
mainPage.getCell("City", 5).rightclick(); |
|
|
|
mainPage.getCell("City", 5).rightclick(); |
|
|
|
|
|
|
|
cy.wait(100); |
|
|
|
cy.wait(1000); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cy.get(".ant-dropdown-content:visible").should(validationString); |
|
|
|
cy.get(".ant-dropdown-content:visible").should(validationString); |
|
|
|
|
|
|
|
|
|
|
|
if (validationString === "exist") { |
|
|
|
if (validationString === "exist") { |
|
|
@ -183,7 +190,7 @@ export function _editComment(roleType, mode) { |
|
|
|
.click(); |
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
|
|
cy.getActiveDrawer().find(".nc-comment-box").should('exist').type("Comment-1{enter}"); |
|
|
|
cy.getActiveDrawer().find(".nc-comment-box").should('exist').type("Comment-1{enter}"); |
|
|
|
cy.toastWait('Comment added successfully') |
|
|
|
// cy.toastWait('Comment added successfully')
|
|
|
|
cy.getActiveDrawer().find(".nc-toggle-comments").click(); |
|
|
|
cy.getActiveDrawer().find(".nc-toggle-comments").click(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -200,54 +207,57 @@ export function _editComment(roleType, mode) { |
|
|
|
export function _viewMenu(roleType, mode) { |
|
|
|
export function _viewMenu(roleType, mode) { |
|
|
|
let columnName = "City"; |
|
|
|
let columnName = "City"; |
|
|
|
|
|
|
|
|
|
|
|
// Download CSV, Excel
|
|
|
|
// Lock, Download, Upload
|
|
|
|
let actionsMenuItemsCnt = 2; |
|
|
|
let menuWithSubmenuCount = 3; |
|
|
|
|
|
|
|
|
|
|
|
cy.openTableTab(columnName, 25); |
|
|
|
// share view list, webhook
|
|
|
|
|
|
|
|
let menuWithoutSubmenuCount = 2; |
|
|
|
|
|
|
|
|
|
|
|
cy.wait(1000); |
|
|
|
cy.openTableTab(columnName, 25); |
|
|
|
|
|
|
|
|
|
|
|
// temporary!
|
|
|
|
|
|
|
|
cy.get('.nc-toggle-right-navbar').click(); |
|
|
|
cy.get('.nc-toggle-right-navbar').click(); |
|
|
|
cy.wait(1000); |
|
|
|
cy.wait(1000); |
|
|
|
|
|
|
|
|
|
|
|
let validationString = |
|
|
|
let validationString = |
|
|
|
true === roles[roleType].validations.shareView ? "exist" : "not.exist"; |
|
|
|
true === roles[roleType].validations.shareView ? "exist" : "not.exist"; |
|
|
|
|
|
|
|
|
|
|
|
if (roleType === "owner" || roleType === "creator") { |
|
|
|
if (roleType === "editor") { |
|
|
|
// Download CSV / Download XLSX / Upload CSV / Shared View List / Webhook
|
|
|
|
// Download / Upload CSV
|
|
|
|
actionsMenuItemsCnt = 5; |
|
|
|
menuWithSubmenuCount = 2; |
|
|
|
} else if (roleType == "editor") { |
|
|
|
menuWithoutSubmenuCount = 0 |
|
|
|
// Download CSV / Upload CSV / Download XLSX
|
|
|
|
} else if (roleType === "commenter" || roleType === "viewer") { |
|
|
|
actionsMenuItemsCnt = 2; |
|
|
|
// Download CSV & Download excel
|
|
|
|
|
|
|
|
menuWithSubmenuCount = 0; |
|
|
|
|
|
|
|
menuWithoutSubmenuCount = 2 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// view list field (default GRID view)
|
|
|
|
// view list field (default GRID view)
|
|
|
|
cy.get(`.nc-view-item`).should("exist"); |
|
|
|
cy.get(`.nc-view-item`).should("exist"); |
|
|
|
|
|
|
|
|
|
|
|
// view create option, exists only for owner/ creator
|
|
|
|
// view create option, exists only for owner/ creator
|
|
|
|
cy.get(`.nc-create-1-view`).should(validationString); |
|
|
|
cy.get(`.nc-create-grid-view`).should(validationString); |
|
|
|
cy.get(`.nc-create-2-view`).should(validationString); |
|
|
|
cy.get(`.nc-create-gallery-view`).should(validationString); |
|
|
|
cy.get(`.nc-create-3-view`).should(validationString); |
|
|
|
cy.get(`.nc-create-form-view`).should(validationString); |
|
|
|
|
|
|
|
|
|
|
|
// share view & automations, exists only for owner/creator
|
|
|
|
|
|
|
|
// cy.get(".nc-btn-share-view").should(validationString);
|
|
|
|
|
|
|
|
// cy.get(`.nc-webhook-btn`).should(validationString);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// share view permissions are role specific
|
|
|
|
// share view permissions are role specific
|
|
|
|
|
|
|
|
|
|
|
|
// actions menu (more), only download csv should be visible for non-previlaged users
|
|
|
|
// actions menu (more), only download csv should be visible for non-previlaged users
|
|
|
|
cy.get(".nc-actions-menu-btn").click(); |
|
|
|
cy.get(".nc-actions-menu-btn").click(); |
|
|
|
cy.getActiveMenu() |
|
|
|
cy.getActiveMenu() |
|
|
|
.find('.nc-project-menu-item') |
|
|
|
.find('.ant-dropdown-menu-submenu:visible') |
|
|
|
.should("have.length", actionsMenuItemsCnt); |
|
|
|
.should("have.length", menuWithSubmenuCount); |
|
|
|
|
|
|
|
cy.getActiveMenu() |
|
|
|
|
|
|
|
.find('.ant-dropdown-menu-item:visible') |
|
|
|
|
|
|
|
.should("have.length", menuWithoutSubmenuCount); |
|
|
|
|
|
|
|
// click again to close menu
|
|
|
|
|
|
|
|
cy.get(".nc-actions-menu-btn").click(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export function _topRightMenu(roleType, mode) { |
|
|
|
export function _topRightMenu(roleType, mode) { |
|
|
|
// kludge; download csv menu persists until clicked
|
|
|
|
// kludge; download csv menu persists until clicked
|
|
|
|
let columnName = "City"; |
|
|
|
let columnName = "City"; |
|
|
|
cy.closeTableTab(columnName); |
|
|
|
// cy.closeTableTab(columnName);
|
|
|
|
cy.openTableTab(columnName, 25); |
|
|
|
// cy.openTableTab(columnName, 25);
|
|
|
|
|
|
|
|
|
|
|
|
let validationString = |
|
|
|
let validationString = |
|
|
|
true == roles[roleType].validations.shareView ? "exist" : "not.exist"; |
|
|
|
true == roles[roleType].validations.shareView ? "exist" : "not.exist"; |
|
|
|