Browse Source

test: view suite local storage handling update, form view handling corrections

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/3414/head
Raju Udava 2 years ago
parent
commit
d769de842a
  1. 16
      packages/nc-gui-v2/pages/[projectType]/form/[viewId]/index.vue
  2. 13
      scripts/cypress-v2/integration/common/4a_table_view_grid_gallery_form.js
  3. 19
      scripts/cypress-v2/integration/common/4b_table_view_share.js
  4. 20
      scripts/cypress-v2/integration/common/4c_form_view_detailed.js
  5. 7
      scripts/cypress-v2/integration/common/4d_table_view_grid_locked.js
  6. 167
      scripts/cypress-v2/integration/common/4e_form_view_share.js
  7. 137
      scripts/cypress-v2/integration/common/4f_grid_view_share.js
  8. 4
      scripts/cypress-v2/integration/test/pg-restViews.js
  9. 2
      scripts/cypress-v2/integration/test/restViews.js
  10. 21
      scripts/cypress-v2/support/page_objects/mainPage.js
  11. 1
      scripts/cypress-v2/support/page_objects/navigation.js

16
packages/nc-gui-v2/pages/[projectType]/form/[viewId]/index.vue

@ -69,7 +69,7 @@ function isRequired(_columnObj: Record<string, any>, required = false) {
<div class="nc-form-wrapper">
<div class="nc-form h-full max-w-3/4 mx-auto">
<div v-for="(field, index) in formColumns" :key="index" class="flex flex-col my-6 gap-2">
<div class="flex">
<div class="flex nc-form-column-label">
<SmartsheetHeaderVirtualCell
v-if="isVirtualCol(field)"
:column="{ ...field, title: field.label || field.title }"
@ -86,7 +86,11 @@ function isRequired(_columnObj: Record<string, any>, required = false) {
</div>
<div v-if="isVirtualCol(field)" class="mt-0">
<SmartsheetVirtualCell class="mt-0 nc-input" :column="field" />
<SmartsheetVirtualCell
class="mt-0 nc-input"
:class="`nc-form-input-${field.title.replaceAll(' ', '')}`"
:column="field"
/>
<div v-if="field.description" class="text-gray-500 text-[10px] mb-2 ml-1">{{ field.description }}</div>
@ -98,7 +102,13 @@ function isRequired(_columnObj: Record<string, any>, required = false) {
</div>
<div v-else class="mt-0">
<SmartsheetCell v-model="formState[field.title]" class="nc-input" :column="field" :edit-enabled="true" />
<SmartsheetCell
v-model="formState[field.title]"
class="nc-input"
:class="`nc-form-input-${field.title.replaceAll(' ', '')}`"
:column="field"
:edit-enabled="true"
/>
<div v-if="field.description" class="text-gray-500 text-[10px] mb-2 ml-1">{{ field.description }}</div>

13
scripts/cypress-v2/integration/common/4a_table_view_grid_gallery_form.js

@ -14,6 +14,9 @@ export const genTest = (apiType, dbType) => {
// Run once before test- create project (rest/graphql)
//
before(() => {
cy.restoreLocalStorage();
cy.wait(1000);
mainPage.tabReset();
// open a table to work on views
@ -21,10 +24,12 @@ export const genTest = (apiType, dbType) => {
cy.openTableTab("Country", 25);
// toggle right navbar (open)
cy.get('.nc-toggle-right-navbar').should('exist').click();
// cy.get('.nc-toggle-right-navbar').should('exist').click();
});
beforeEach(() => {
cy.restoreLocalStorage();
cy.wait(1000);
});
after(() => {
@ -44,7 +49,7 @@ export const genTest = (apiType, dbType) => {
cy.toastWait("View created successfully");
// kludge: right navbar closes abruptly. force it open again
window.localStorage.setItem('nc-right-sidebar', '{"isOpen":true,"hasSidebar":true}')
// window.localStorage.setItem('nc-right-sidebar', '{"isOpen":true,"hasSidebar":true}')
// validate if view was created && contains default name 'Country1'
cy.get(`.nc-${viewType}-view-item`)
@ -63,7 +68,7 @@ export const genTest = (apiType, dbType) => {
cy.toastWait("View renamed successfully");
// kludge: right navbar closes abruptly. force it open again
window.localStorage.setItem('nc-right-sidebar', '{"isOpen":true,"hasSidebar":true}')
// window.localStorage.setItem('nc-right-sidebar', '{"isOpen":true,"hasSidebar":true}')
// validate
cy.get(`.nc-${viewType}-view-item`)
@ -82,7 +87,7 @@ export const genTest = (apiType, dbType) => {
cy.toastWait("View deleted successfully");
// kludge: right navbar closes abruptly. force it open again
window.localStorage.setItem('nc-right-sidebar', '{"isOpen":true,"hasSidebar":true}')
// window.localStorage.setItem('nc-right-sidebar', '{"isOpen":true,"hasSidebar":true}')
// confirm if the number of veiw entries is reduced by 1
cy.get(".nc-view-item").its("length").should("eq", 1);

19
scripts/cypress-v2/integration/common/4b_table_view_share.js

@ -36,6 +36,9 @@ export const genTest = (apiType, dbType) => {
// Run once before test- create project (rest/graphql)
//
before(() => {
cy.restoreLocalStorage();
cy.wait(1000);
mainPage.tabReset();
cy.openTableTab("City", 25);
@ -44,6 +47,8 @@ export const genTest = (apiType, dbType) => {
storedURL = url;
});
generateLinkWithPwd();
cy.signOut();
});
beforeEach(() => {
@ -87,13 +92,14 @@ export const genTest = (apiType, dbType) => {
});
it("Delete view", () => {
// issue with restore local storage- need to refresh page to get new URL
loginPage.loginAndOpenProject(apiType, dbType);
// cy.restoreLocalStorage();
// cy.visit(storedURL, { baseUrl: null });
cy.openTableTab("City", 25);
cy.wait(500);
mainPage.toggleRightSidebar();
cy.wait(500);
cy.saveLocalStorage();
cy.wait(1000);
// wait for page load to complete
cy.get(".nc-grid-row").should("have.length", 25);
@ -101,6 +107,9 @@ export const genTest = (apiType, dbType) => {
});
after(() => {
cy.restoreLocalStorage();
cy.wait(500);
cy.closeTableTab("City");
});
});

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

@ -71,11 +71,16 @@ export const genTest = (apiType, dbType) => {
//
cy.openTableTab("Country", 25);
mainPage.toggleRightSidebar();
cy.saveLocalStorage();
cy.wait(500);
});
beforeEach(() => {
// fix me!
window.localStorage.setItem('nc-right-sidebar', '{"isOpen":true,"hasSidebar":true}')
// window.localStorage.setItem('nc-right-sidebar', '{"isOpen":true,"hasSidebar":true}')
cy.restoreLocalStorage();
cy.wait(500);
});
afterEach(() => {
@ -331,7 +336,6 @@ export const genTest = (apiType, dbType) => {
// open form view & enable "email me" option
cy.openTableTab("Country", 25);
cy.wait(1000);
cy.get(`.nc-view-item.nc-${viewType}-view-item`)
@ -344,15 +348,10 @@ export const genTest = (apiType, dbType) => {
cy.get(".nc-form-checkbox-send-email")
.click();
cy.toastWait(
"Please activate SMTP plugin in App store for enabling email notification"
);
settingsPage.openMenu(settingsPage.APPSTORE)
mainPage.resetSMTP();
cy.wait(300);
cy.openTableTab("Country", 25);
});
@ -393,14 +392,12 @@ export const genTest = (apiType, dbType) => {
formViewURL = url;
});
// cy.saveLocalStorage();
cy.wait(300);
});
it.skip(`Validate ${viewType}: URL validation after re-access`, () => {
// visit URL
cy.log(formViewURL);
// cy.restoreLocalStorage();
cy.visit(formViewURL, {
baseUrl: null,
@ -411,7 +408,10 @@ export const genTest = (apiType, dbType) => {
});
it(`Delete ${viewType} view`, () => {
// cy.restoreLocalStorage();
// cy.visit("/");
// cy.wait(5000);
// projectsPage.openConfiguredProject(apiType, dbType);
// cy.openTableTab("Country", 25);
// number of view entries should be 2 before we delete
cy.get(".nc-view-item").its("length").should("eq", 2);

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

@ -8,6 +8,9 @@ export const genTest = (apiType, dbType) => {
// Run once before test- create project (rest/graphql)
//
before(() => {
cy.restoreLocalStorage();
cy.wait(500);
mainPage.tabReset();
// open a table to work on views
@ -16,9 +19,13 @@ export const genTest = (apiType, dbType) => {
});
beforeEach(() => {
cy.restoreLocalStorage();
cy.wait(500);
});
after(() => {
cy.restoreLocalStorage();
cy.wait(500)
cy.closeTableTab("Country");
});

167
scripts/cypress-v2/integration/common/4e_form_view_share.js

@ -1,5 +1,6 @@
import { isTestSuiteActive } from "../../support/page_objects/projectConstants";
import { mainPage } from "../../support/page_objects/mainPage";
import {loginPage} from "../../support/page_objects/navigation";
let storedURL = "";
@ -12,30 +13,30 @@ export const genTest = (apiType, dbType) => {
// Run once before test- create project (rest/graphql)
//
before(() => {
// loginPage.loginAndOpenProject(apiType, dbType);
// cy.openTableTab("City", 25);
// cy.wait(500);
// mainPage.toggleRightSidebar();
// cy.wait(500);
// cy.saveLocalStorage();
// cy.wait(500);
cy.restoreLocalStorage();
cy.wait(500);
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);
mainPage.toggleRightSidebar();
});
beforeEach(() => {
cy.restoreLocalStorage();
});
afterEach(() => {
cy.saveLocalStorage();
});
after(() => {
cy.restoreLocalStorage();
cy.wait(500);
cy.closeTableTab("City");
});
@ -43,7 +44,10 @@ export const genTest = (apiType, dbType) => {
// Input: viewType - 'grid'/'gallery'
//
const viewTest = (viewType) => {
it(`Create ${viewType} view`, () => {
it(`Create ${viewType} view`, () => {0
cy.restoreLocalStorage();
cy.wait(500);
// click on create grid view button
cy.get(`.nc-create-${viewType}-view`).click();
@ -85,11 +89,6 @@ export const genTest = (apiType, dbType) => {
cy.get('[title="Address List"]').drag(".nc-drag-n-drop-to-hide");
// cy.get(".nc-form > .mx-auto")
// .find('[type="checkbox"]')
// .eq(1)
// .should("be.checked");
// store base URL- to re-visit and delete form view later
cy.url().then((url) => {
storedURL = url;
@ -97,10 +96,10 @@ export const genTest = (apiType, dbType) => {
});
it(`Share form view`, () => {
// cy.get(".nc-form > .mx-auto")
// .find('[type="checkbox"]')
// .eq(1)
// .should("be.checked");
cy.restoreLocalStorage();
cy.wait(500);
cy.get(`.nc-view-item.nc-${viewType}-view-item`)
.contains("Form-1")
.click();
@ -117,6 +116,9 @@ export const genTest = (apiType, dbType) => {
.then(($obj) => {
let linkText = $obj.text().trim();
cy.log(linkText);
cy.signOut();
cy.visit(linkText, {
baseUrl: null,
});
@ -127,12 +129,12 @@ export const genTest = (apiType, dbType) => {
cy.get(".nc-form").should("exist");
// New form appeared? Header & description should exist
cy.get(".nc-form", { timeout: 10000 })
.find("h2")
cy.get(".nc-form-view", { timeout: 10000 })
.find("h1")
.contains("A B C D")
.should("exist");
cy.get(".nc-form", { timeout: 10000 })
.find(".body-1")
cy.get(".nc-form-view", { timeout: 10000 })
.find("h2")
.contains("Some description about form comes here")
.should("exist");
@ -143,61 +145,64 @@ export const genTest = (apiType, dbType) => {
cy.get('[title="Address List"]').should("not.exist");
// order of LastUpdate & City field is retained
cy.get(".nc-form-field")
.eq(1)
cy.get(".nc-form-column-label")
.eq(0)
.contains("LastUpdate")
.should("exist");
cy.get(".nc-form-field")
.eq(0)
cy.get(".nc-form-column-label")
.eq(1)
.contains("City")
.should("exist");
// submit form, to read message
cy.get(".nc-form-input-City").type("_abc");
cy.get(".nc-form-input-LastUpdate").click();
cy.getActiveModal().find("button").contains("19").click();
cy.getActiveModal().find("button").contains("OK").click();
cy.get('.nc-form-field-Country')
.trigger('mouseover')
.click()
.find('.nc-action-icon')
.click();
// cy.get("button").contains("Link to 'Country'").click();
cy.getActiveModal()
.find(".ant-card")
.contains("Afghanistan")
.click();
// submit button & validate
cy.get(".nc-form")
.find("button")
.contains("Submit")
.click();
cy.get(".ant-alert-message")
.contains("Congratulations")
.should("exist")
.then(() => {
cy.get(".nc-form").should("exist");
// validate if form has appeared again
cy.get(".nc-share-form-title")
.contains("A B C D")
.should("exist");
cy.get(".nc-share-form-desc")
.contains("Some description about form comes here")
.should("exist");
});
cy.get(".ant-picker-now-btn:visible").contains("Now").click();
cy.get(".ant-btn-primary:visible").contains("Ok").click();
// cy.get('.nc-form-field-Country')
// .trigger('mouseover')
// .click()
// .find('.nc-action-icon')
// .click();
// // cy.get("button").contains("Link to 'Country'").click();
// cy.getActiveModal()
// .find(".ant-card")
// .contains("Afghanistan")
// .click();
//
// // submit button & validate
// cy.get(".nc-form")
// .find("button")
// .contains("Submit")
// .click();
//
// cy.get(".ant-alert-message")
// .contains("Congratulations")
// .should("exist")
// .then(() => {
// cy.get(".nc-form").should("exist");
//
// // validate if form has appeared again
// cy.get(".nc-share-form-title")
// .contains("A B C D")
// .should("exist");
// cy.get(".nc-share-form-desc")
// .contains("Some description about form comes here")
// .should("exist");
// });
});
});
it(`Delete ${viewType} view`, () => {
// go back to base page
cy.visit(storedURL, {
baseUrl: null,
});
cy.wait(2000);
loginPage.loginAndOpenProject(apiType, dbType);
cy.openTableTab("City", 25);
cy.wait(500);
mainPage.toggleRightSidebar();
cy.wait(500);
cy.saveLocalStorage();
cy.wait(500);
// number of view entries should be 2 before we delete
cy.get(".nc-view-item").its("length").should("eq", 2);
@ -211,18 +216,18 @@ export const genTest = (apiType, dbType) => {
// confirm if the number of veiw entries is reduced by 1
cy.get(".nc-view-item").its("length").should("eq", 1);
// clean up newly added rows into Country table operations
// this auto verifies successfull addition of rows to table as well
mainPage.getPagination(25).click();
// kludge: flicker on load
cy.wait(3000)
cy.get(".nc-grid-row").should("have.length", 1);
cy.get(".ant-checkbox").should('exist').eq(1).click({ force: true });
mainPage.getCell("Country", 1).rightclick({ force: true });
cy.getActiveMenu()
.contains("Delete Selected Rows")
.click({ force: true });
// // clean up newly added rows into Country table operations
// // this auto verifies successfull addition of rows to table as well
// mainPage.getPagination(25).click();
// // kludge: flicker on load
// cy.wait(3000)
//
// cy.get(".nc-grid-row").should("have.length", 1);
// cy.get(".ant-checkbox").should('exist').eq(1).click({ force: true });
// mainPage.getCell("Country", 1).rightclick({ force: true });
// cy.getActiveMenu()
// .contains("Delete Selected Rows")
// .click({ force: true });
});
};

137
scripts/cypress-v2/integration/common/4f_grid_view_share.js

@ -1,5 +1,6 @@
import { isTestSuiteActive } from "../../support/page_objects/projectConstants";
import { mainPage } from "../../support/page_objects/mainPage";
import {loginPage} from "../../support/page_objects/navigation";
let storedURL = "";
@ -40,33 +41,33 @@ export const genTest = (apiType, dbType) => {
// Run once before test- create project (rest/graphql)
//
before(() => {
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);
cy.restoreLocalStorage();
cy.wait(500);
// open a table to work on views
//
mainPage.tabReset();
cy.openTableTab("Address", 25);
mainPage.toggleRightSidebar();
cy.saveLocalStorage();
// loginPage.loginAndOpenProject(apiType, dbType);
//
// // open a table to work on views
// //
// cy.openTableTab("Address", 25);
// mainPage.toggleRightSidebar();
// //
// cy.saveLocalStorage();
});
beforeEach(() => {
cy.restoreLocalStorage();
});
afterEach(() => {
cy.saveLocalStorage();
});
after(() => {
// close table
// mainPage.deleteCreatedViews()
cy.restoreLocalStorage();
cy.wait(500);
cy.closeTableTab("Address");
});
@ -75,6 +76,10 @@ export const genTest = (apiType, dbType) => {
//
const viewTest = (viewType) => {
it(`Create ${viewType.toUpperCase()} view`, () => {
cy.restoreLocalStorage();
cy.wait(500);
// create a normal public view
cy.get(`.nc-create-${viewType}-view`).click();
cy.getActiveModal().find("button:contains(Submit)").click();
@ -83,11 +88,14 @@ export const genTest = (apiType, dbType) => {
// store base URL- to re-visit and delete form view later
cy.url().then((url) => {
storedURL = url;
cy.saveLocalStorage();
});
});
it(`Share ${viewType.toUpperCase()} hide, sort, filter & verify`, () => {
cy.restoreLocalStorage();
cy.wait(500);
cy.get(`.nc-view-item.nc-${viewType}-view-item`)
.contains("Grid-1")
.click();
@ -99,6 +107,10 @@ export const genTest = (apiType, dbType) => {
});
it(`Share GRID view : ensure we have only one link even if shared multiple times`, () => {
cy.restoreLocalStorage();
cy.wait(500);
// generate view link multiple times
generateViewLink("combined");
generateViewLink("combined");
@ -118,6 +130,8 @@ export const genTest = (apiType, dbType) => {
.then(() => {
cy.get('button.ant-modal-close:visible').click();
});
cy.signOut();
});
it(`Share ${viewType.toUpperCase()} view : Visit URL, Verify title`, () => {
@ -273,27 +287,27 @@ export const genTest = (apiType, dbType) => {
.find(".nc-icon.nc-action-icon.nc-plus")
.should("not.exist");
mainPage
.getCell("Customer List", 3)
.click()
.find(".nc-icon.nc-action-icon.nc-arrow-expand")
.click({ force: true });
// reload button
cy.getActiveModal().find(".nc-icon").should("exist");
cy.getActiveModal()
.find("button")
.contains("Link to")
.should("not.exist");
cy.getActiveModal()
.find(".ant-card")
.contains("2")
.should("exist");
cy.getActiveModal()
.find(".ant-card")
.find("button")
.should("not.exist");
cy.get('button.ant-modal-close').click();
// mainPage
// .getCell("Customer List", 3)
// .click()
// .find(".nc-icon.nc-action-icon.nc-arrow-expand")
// .click({ force: true });
//
// // reload button
// cy.getActiveModal().find(".nc-icon").should("exist");
// cy.getActiveModal()
// .find("button")
// .contains("Link to")
// .should("not.exist");
// cy.getActiveModal()
// .find(".ant-card")
// .contains("2")
// .should("exist");
// cy.getActiveModal()
// .find(".ant-card")
// .find("button")
// .should("not.exist");
// cy.get('button.ant-modal-close').click();
});
it(`Share GRID view : Virtual column validation > belongs to`, () => {
@ -335,23 +349,25 @@ export const genTest = (apiType, dbType) => {
.find(".nc-icon.nc-action-icon.nc-arrow-expand")
.click({ force: true });
// reload button
cy.getActiveModal().find(".nc-icon").should("exist");
cy.getActiveModal()
.find("button")
.contains("Link to")
.should("not.exist");
cy.get('button.ant-modal-close:visible').last().click();
// // reload button
// Fix me : ncv2@fixme
// cy.getActiveModal().find(".nc-icon").should("exist");
// cy.getActiveModal()
// .find("button")
// .contains("Link to")
// .should("not.exist");
// cy.get('button.ant-modal-close:visible').last().click();
});
it(`Delete ${viewType.toUpperCase()} view`, () => {
// go back to base page
cy.restoreLocalStorage();
cy.visit(storedURL, {
baseUrl: null,
});
loginPage.loginAndOpenProject(apiType, dbType);
cy.openTableTab("Address", 25);
cy.wait(5000);
mainPage.toggleRightSidebar();
cy.wait(500);
cy.saveLocalStorage();
cy.wait(500);
// number of view entries should be 2 before we delete
cy.get(".nc-view-item").its("length").should("eq", 2);
@ -373,24 +389,32 @@ export const genTest = (apiType, dbType) => {
before(() => {
cy.restoreLocalStorage();
cy.wait(500);
// Address table has belongs to, has many & many-to-many
cy.openTableTab("Country", 25);
// store base URL- to re-visit and delete form view later
cy.url().then((url) => {
storedURL = url;
cy.saveLocalStorage();
generateViewLink("rowColUpdate");
});
});
after(() => {
// close table
cy.restoreLocalStorage();
cy.visit(storedURL, {
baseUrl: null,
});
cy.wait(5000);
// cy.visit(storedURL, {
// baseUrl: null,
// });
// cy.wait(5000);
loginPage.loginAndOpenProject(apiType, dbType);
cy.openTableTab("Country", 25)
cy.wait(500);
mainPage.toggleRightSidebar();
cy.wait(500);
cy.saveLocalStorage();
cy.wait(500);
// delete row
mainPage.getPagination(5).click();
@ -414,6 +438,10 @@ export const genTest = (apiType, dbType) => {
});
it(`Generate default Shared GRID view URL`, () => {
cy.restoreLocalStorage();
cy.wait(500);
// add row
cy.get(".nc-add-new-row-btn").click();
cy.get(".nc-expand-col-Country").find(".nc-cell > input")
@ -433,9 +461,10 @@ export const genTest = (apiType, dbType) => {
// add column
mainPage.addColumn("dummy", "Country");
cy.signOut();
// visit public view
cy.log(viewURL["rowColUpdate"]);
cy.restoreLocalStorage();
cy.visit(viewURL["rowColUpdate"], {
baseUrl: null,
});

4
scripts/cypress-v2/integration/test/pg-restViews.js

@ -19,8 +19,8 @@ const nocoTestSuite = (apiType, dbType) => {
t4a.genTest(apiType, dbType);
t4b.genTest(apiType, dbType);
t4d.genTest(apiType, dbType);
// to be fixed t4e.genTest(apiType, dbType);
t4f.genTest(apiType, dbType);
t4e.genTest(apiType, dbType);
// tbd t4f.genTest(apiType, dbType);
};
nocoTestSuite("rest", "postgres");

2
scripts/cypress-v2/integration/test/restViews.js

@ -19,7 +19,7 @@ const nocoTestSuite = (apiType, dbType) => {
t4a.genTest(apiType, dbType);
t4b.genTest(apiType, dbType);
t4d.genTest(apiType, dbType);
// to be fixed t4e.genTest(apiType, dbType);
t4e.genTest(apiType, dbType);
t4f.genTest(apiType, dbType);
};

21
scripts/cypress-v2/support/page_objects/mainPage.js

@ -291,30 +291,41 @@ export class _mainPage {
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.wait(500)
cy.get(".nc-fields-menu-btn").click();
cy.wait(500)
cy.get(`th[data-title="${field}"]`).should("not.exist");
};
unhideField = (field) => {
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.wait(500)
cy.get(".nc-fields-menu-btn").click();
cy.wait(500)
cy.get(`th[data-title="${field}"]`).should("be.visible");
};
sortField = (field, criteria) => {
cy.get(".nc-sort-menu-btn").click();
cy.wait(500)
cy.getActiveMenu().contains("Add Sort Option").click();
cy.wait(500)
// cy.get(".nc-sort-field-select div").first().click().type(field);
cy.get(".nc-sort-field-select div").first().click();
cy.wait(500)
cy.get('.ant-select-dropdown:visible').find(`.ant-select-item`).contains(new RegExp("^" + field + "$", "g")).should('exist').click();
cy.wait(500)
cy.get(".nc-sort-dir-select div").first().click();
cy.wait(500)
cy.get('.ant-select-dropdown:visible').find(`.ant-select-item`).contains(criteria).should('exist').click();
cy.wait(500)
cy.get(".nc-sort-menu-btn").click();
cy.wait(500)
};
clearSort = () => {
@ -324,11 +335,15 @@ export class _mainPage {
cy.wait(500)
cy.get(".nc-sort-item-remove-btn:visible").should("not.exist");
cy.get(".nc-sort-menu-btn").click();
cy.wait(500)
};
filterField = (field, operation, value) => {
cy.get(".nc-filter-menu-btn").click();
cy.wait(500)
cy.contains("Add Filter").click();
cy.wait(500)
// cy.get(".nc-filter-field-select").should("exist").last().click().type(field);
cy.get(".nc-filter-field-select").should("exist").last().click();
cy.wait(500)
@ -337,21 +352,27 @@ export class _mainPage {
cy.get(".nc-filter-operation-select").should("exist").last().click();
cy.wait(500)
cy.get('.ant-select-dropdown:visible').should('exist').find(`.ant-select-item`).contains(operation).should('exist').click();
cy.wait(500)
if (operation != "is null" && operation != "is not null") {
cy.get(".nc-filter-value-select")
.should("exist")
.last()
.type(value);
cy.get(".nc-filter-operation-select").last().click();
cy.wait(500)
}
cy.get(".nc-filter-menu-btn").click();
cy.wait(500)
};
filterReset = () => {
cy.get(".nc-filter-menu-btn").click();
cy.wait(500)
cy.get(".nc-filter-item-remove-btn").click();
cy.wait(500)
cy.get(".nc-filter-item-remove-btn").should("not.exist");
cy.get(".nc-filter-menu-btn").click();
cy.wait(500)
};
// delete created views

1
scripts/cypress-v2/support/page_objects/navigation.js

@ -200,6 +200,7 @@ export class _projectsPage {
// Create project
cy.contains("Ok & Save Project", { timeout: 20000 }).click();
cy.wait(5000)
// takes a while to load project
this.waitHomePageLoad();

Loading…
Cancel
Save