|
|
@ -1,5 +1,6 @@ |
|
|
|
import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; |
|
|
|
import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; |
|
|
|
import { mainPage, settingsPage } from "../../support/page_objects/mainPage"; |
|
|
|
import { mainPage, settingsPage } from "../../support/page_objects/mainPage"; |
|
|
|
|
|
|
|
import {loginPage} from "../../support/page_objects/navigation"; |
|
|
|
|
|
|
|
|
|
|
|
let formViewURL; |
|
|
|
let formViewURL; |
|
|
|
|
|
|
|
|
|
|
@ -11,14 +12,24 @@ function verifyFormDrawerFieldLocation(fieldName, position) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function verifyFormDrawerHideObjectCount(count) { |
|
|
|
function verifyFormDrawerHideObjectCount(count) { |
|
|
|
cy.get(".nc-form") |
|
|
|
if(count) { |
|
|
|
.find(".nc-field-remove-icon") |
|
|
|
cy.get(".nc-form") |
|
|
|
.its("length") |
|
|
|
.find(".nc-field-remove-icon") |
|
|
|
.should("eq", count); |
|
|
|
.its("length") |
|
|
|
|
|
|
|
.should("eq", count); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
cy.get(".nc-form") |
|
|
|
|
|
|
|
.find(".nc-field-remove-icon") |
|
|
|
|
|
|
|
.should("not.exist"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function verifyFormMenuDrawerCardCount(cardCount) { |
|
|
|
function verifyFormMenuDrawerCardCount(cardCount) { |
|
|
|
cy.get('.nc-form-left-drawer').find('.ant-card').should('have.length', cardCount); |
|
|
|
if(cardCount) { |
|
|
|
|
|
|
|
cy.get('.nc-form-left-drawer').find('.ant-card').should('have.length', cardCount); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
cy.get('.nc-form-left-drawer').find('.ant-card').should('not.exist'); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function validateFormHeader() { |
|
|
|
function validateFormHeader() { |
|
|
@ -47,14 +58,14 @@ export const genTest = (apiType, dbType) => { |
|
|
|
// Run once before test- create project (rest/graphql)
|
|
|
|
// Run once before test- create project (rest/graphql)
|
|
|
|
//
|
|
|
|
//
|
|
|
|
before(() => { |
|
|
|
before(() => { |
|
|
|
cy.fileHook(); |
|
|
|
|
|
|
|
mainPage.tabReset(); |
|
|
|
mainPage.tabReset(); |
|
|
|
|
|
|
|
// loginPage.loginAndOpenProject(apiType, dbType);
|
|
|
|
|
|
|
|
|
|
|
|
// // kludge: wait for page load to finish
|
|
|
|
// kludge: wait for page load to finish
|
|
|
|
// cy.wait(1000);
|
|
|
|
cy.wait(2000); |
|
|
|
// // close team & auth tab
|
|
|
|
// close team & auth tab
|
|
|
|
// cy.get('button.ant-tabs-tab-remove').should('exist').click();
|
|
|
|
cy.get('button.ant-tabs-tab-remove').should('exist').click(); |
|
|
|
// cy.wait(1000);
|
|
|
|
cy.wait(1000); |
|
|
|
|
|
|
|
|
|
|
|
// open a table to work on views
|
|
|
|
// open a table to work on views
|
|
|
|
//
|
|
|
|
//
|
|
|
@ -63,12 +74,11 @@ export const genTest = (apiType, dbType) => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
beforeEach(() => { |
|
|
|
beforeEach(() => { |
|
|
|
cy.fileHook(); |
|
|
|
// fix me!
|
|
|
|
cy.restoreLocalStorage(); |
|
|
|
window.localStorage.setItem('nc-right-sidebar', '{"isOpen":true,"hasSidebar":true}') |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
afterEach(() => { |
|
|
|
afterEach(() => { |
|
|
|
cy.saveLocalStorage(); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
after(() => { |
|
|
|
after(() => { |
|
|
@ -103,6 +113,7 @@ export const genTest = (apiType, dbType) => { |
|
|
|
cy.get(".nc-form-drag-LastUpdate").drag( |
|
|
|
cy.get(".nc-form-drag-LastUpdate").drag( |
|
|
|
".nc-form-drag-Country" |
|
|
|
".nc-form-drag-Country" |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
cy.wait(1000); |
|
|
|
|
|
|
|
|
|
|
|
// Verify if order is: LastUpdate, Country, Country => City
|
|
|
|
// Verify if order is: LastUpdate, Country, Country => City
|
|
|
|
verifyFormDrawerFieldLocation("LastUpdate", 0); |
|
|
|
verifyFormDrawerFieldLocation("LastUpdate", 0); |
|
|
@ -197,8 +208,8 @@ export const genTest = (apiType, dbType) => { |
|
|
|
// fill up mandatory fields
|
|
|
|
// fill up mandatory fields
|
|
|
|
cy.get(".nc-form-input-Country").type("_abc"); |
|
|
|
cy.get(".nc-form-input-Country").type("_abc"); |
|
|
|
cy.get(".nc-form-input-LastUpdate").click(); |
|
|
|
cy.get(".nc-form-input-LastUpdate").click(); |
|
|
|
cy.getActiveModal().find("button").contains("19").click(); |
|
|
|
cy.get(".ant-picker-now-btn:visible").contains("Now").click(); |
|
|
|
cy.getActiveModal().find("button").contains("OK").click(); |
|
|
|
cy.get(".ant-btn-primary:visible").contains("Ok").click(); |
|
|
|
|
|
|
|
|
|
|
|
// default message, no update
|
|
|
|
// default message, no update
|
|
|
|
|
|
|
|
|
|
|
@ -214,18 +225,15 @@ export const genTest = (apiType, dbType) => { |
|
|
|
|
|
|
|
|
|
|
|
it(`Validate ${viewType}: Submit default, with valid Show message entry`, () => { |
|
|
|
it(`Validate ${viewType}: Submit default, with valid Show message entry`, () => { |
|
|
|
// clicking again on view name shows blank still. work around- toggling between two views
|
|
|
|
// clicking again on view name shows blank still. work around- toggling between two views
|
|
|
|
// cy.get(`.nc-view-item.nc-grid-view-item`)
|
|
|
|
|
|
|
|
// .contains("Country")
|
|
|
|
|
|
|
|
// .click();
|
|
|
|
|
|
|
|
cy.get(`.nc-view-item.nc-${viewType}-view-item`) |
|
|
|
cy.get(`.nc-view-item.nc-${viewType}-view-item`) |
|
|
|
.contains("Form-1") |
|
|
|
.contains("Form-1") |
|
|
|
.click(); |
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
|
|
// fill up mandatory fields
|
|
|
|
// fill up mandatory fields
|
|
|
|
cy.get(".nc-form-input-Country").type("_abc"); |
|
|
|
cy.get(".nc-form-input-Country").should('exist').type("_abc"); |
|
|
|
cy.get(".nc-form-input-LastUpdate").click(); |
|
|
|
cy.get(".nc-form-input-LastUpdate").click(); |
|
|
|
cy.getActiveModal().find("button").contains("19").click(); |
|
|
|
cy.get(".ant-picker-now-btn:visible").contains("Now").click(); |
|
|
|
cy.getActiveModal().find("button").contains("OK").click(); |
|
|
|
cy.get(".ant-btn-primary:visible").contains("Ok").click(); |
|
|
|
|
|
|
|
|
|
|
|
// add message
|
|
|
|
// add message
|
|
|
|
cy.get("textarea.nc-form-after-submit-msg") |
|
|
|
cy.get("textarea.nc-form-after-submit-msg") |
|
|
@ -240,9 +248,6 @@ export const genTest = (apiType, dbType) => { |
|
|
|
|
|
|
|
|
|
|
|
it(`Validate ${viewType}: Submit default, Enable checkbox "Submit another form`, () => { |
|
|
|
it(`Validate ${viewType}: Submit default, Enable checkbox "Submit another form`, () => { |
|
|
|
// clicking again on view name shows blank still. work around- toggling between two views
|
|
|
|
// clicking again on view name shows blank still. work around- toggling between two views
|
|
|
|
// cy.get(`.nc-view-item.nc-grid-view-item`)
|
|
|
|
|
|
|
|
// .contains("Country")
|
|
|
|
|
|
|
|
// .click();
|
|
|
|
|
|
|
|
cy.get(`.nc-view-item.nc-${viewType}-view-item`) |
|
|
|
cy.get(`.nc-view-item.nc-${viewType}-view-item`) |
|
|
|
.contains("Form-1") |
|
|
|
.contains("Form-1") |
|
|
|
.click(); |
|
|
|
.click(); |
|
|
@ -250,8 +255,8 @@ export const genTest = (apiType, dbType) => { |
|
|
|
// fill up mandatory fields
|
|
|
|
// fill up mandatory fields
|
|
|
|
cy.get(".nc-form-input-Country").type("_abc"); |
|
|
|
cy.get(".nc-form-input-Country").type("_abc"); |
|
|
|
cy.get(".nc-form-input-LastUpdate").click(); |
|
|
|
cy.get(".nc-form-input-LastUpdate").click(); |
|
|
|
cy.getActiveModal().find("button").contains("19").click(); |
|
|
|
cy.get(".ant-picker-now-btn:visible").contains("Now").click(); |
|
|
|
cy.getActiveModal().find("button").contains("OK").click(); |
|
|
|
cy.get(".ant-btn-primary:visible").contains("Ok").click(); |
|
|
|
|
|
|
|
|
|
|
|
// enable "Submit another form" check box
|
|
|
|
// enable "Submit another form" check box
|
|
|
|
cy.get("button.nc-form-checkbox-submit-another-form").click(); |
|
|
|
cy.get("button.nc-form-checkbox-submit-another-form").click(); |
|
|
@ -274,8 +279,8 @@ export const genTest = (apiType, dbType) => { |
|
|
|
|
|
|
|
|
|
|
|
cy.get(".nc-form-input-Country").type("_abc"); |
|
|
|
cy.get(".nc-form-input-Country").type("_abc"); |
|
|
|
cy.get(".nc-form-input-LastUpdate").click(); |
|
|
|
cy.get(".nc-form-input-LastUpdate").click(); |
|
|
|
cy.getActiveModal().find("button").contains("19").click(); |
|
|
|
cy.get(".ant-picker-now-btn:visible").contains("Now").click(); |
|
|
|
cy.getActiveModal().find("button").contains("OK").click(); |
|
|
|
cy.get(".ant-btn-primary:visible").contains("Ok").click(); |
|
|
|
|
|
|
|
|
|
|
|
// enable "New form after 5 seconds" button
|
|
|
|
// enable "New form after 5 seconds" button
|
|
|
|
cy.get("button.nc-form-checkbox-submit-another-form") |
|
|
|
cy.get("button.nc-form-checkbox-submit-another-form") |
|
|
@ -303,10 +308,11 @@ export const genTest = (apiType, dbType) => { |
|
|
|
.click(); |
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
|
|
// validate if form has appeared again
|
|
|
|
// validate if form has appeared again
|
|
|
|
|
|
|
|
cy.wait(1000); |
|
|
|
validateFormHeader(); |
|
|
|
validateFormHeader(); |
|
|
|
|
|
|
|
cy.get(".nc-form-remove-all").click(); |
|
|
|
|
|
|
|
|
|
|
|
cy.get("button.nc-form-checkbox-send-email") |
|
|
|
cy.get(".nc-form-checkbox-send-email").click(); |
|
|
|
.click(); |
|
|
|
|
|
|
|
// validate if toaster pops up requesting to activate SMTP
|
|
|
|
// validate if toaster pops up requesting to activate SMTP
|
|
|
|
cy.toastWait( |
|
|
|
cy.toastWait( |
|
|
|
"Please activate SMTP plugin in App store for enabling email notification" |
|
|
|
"Please activate SMTP plugin in App store for enabling email notification" |
|
|
@ -335,13 +341,17 @@ export const genTest = (apiType, dbType) => { |
|
|
|
// validate if form has appeared again
|
|
|
|
// validate if form has appeared again
|
|
|
|
validateFormHeader(); |
|
|
|
validateFormHeader(); |
|
|
|
|
|
|
|
|
|
|
|
cy.get("button.nc-form-checkbox-send-email") |
|
|
|
cy.get(".nc-form-checkbox-send-email") |
|
|
|
.click(); |
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cy.toastWait( |
|
|
|
|
|
|
|
"Please activate SMTP plugin in App store for enabling email notification" |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
settingsPage.openMenu(settingsPage.APPSTORE) |
|
|
|
settingsPage.openMenu(settingsPage.APPSTORE) |
|
|
|
mainPage.resetSMTP(); |
|
|
|
mainPage.resetSMTP(); |
|
|
|
|
|
|
|
|
|
|
|
cy.wait(3000); |
|
|
|
cy.wait(300); |
|
|
|
|
|
|
|
|
|
|
|
cy.openTableTab("Country", 25); |
|
|
|
cy.openTableTab("Country", 25); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -350,30 +360,22 @@ export const genTest = (apiType, dbType) => { |
|
|
|
cy.get(`.nc-view-item.nc-${viewType}-view-item`) |
|
|
|
cy.get(`.nc-view-item.nc-${viewType}-view-item`) |
|
|
|
.contains("Form-1") |
|
|
|
.contains("Form-1") |
|
|
|
.click(); |
|
|
|
.click(); |
|
|
|
|
|
|
|
cy.get(".nc-form-add-all").click(); |
|
|
|
|
|
|
|
|
|
|
|
cy.wait(3000); |
|
|
|
cy.wait(300); |
|
|
|
|
|
|
|
|
|
|
|
// validate if form has appeared again
|
|
|
|
// validate if form has appeared again
|
|
|
|
validateFormHeader(); |
|
|
|
validateFormHeader(); |
|
|
|
|
|
|
|
|
|
|
|
cy.get(".nc-form-input-LastUpdate").should("exist"); |
|
|
|
cy.get(".nc-form-input-LastUpdate").should("exist"); |
|
|
|
// remove "LastUpdate field"
|
|
|
|
// remove "LastUpdate field"
|
|
|
|
cy.get(".nc-form").find(".nc-field-remove-icon").eq(2).click(); |
|
|
|
cy.get(".nc-form").find(".nc-field-remove-icon").eq(1).click(); |
|
|
|
cy.get(".nc-form-input-LastUpdate").should("not.exist"); |
|
|
|
cy.get(".nc-form-input-LastUpdate").should("not.exist"); |
|
|
|
// cy.get(".col-md-4")
|
|
|
|
|
|
|
|
// .find(".pointer.item")
|
|
|
|
|
|
|
|
// .contains("LastUpdate")
|
|
|
|
|
|
|
|
// .should("exist");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// add it back
|
|
|
|
|
|
|
|
// cy.get(".col-md-4")
|
|
|
|
|
|
|
|
// .find(".pointer.item")
|
|
|
|
|
|
|
|
// .contains("LastUpdate")
|
|
|
|
|
|
|
|
// .click();
|
|
|
|
|
|
|
|
cy.get('.nc-form-left-drawer').find('.ant-card').contains('LastUpdate').should('exist').click(); |
|
|
|
cy.get('.nc-form-left-drawer').find('.ant-card').contains('LastUpdate').should('exist').click(); |
|
|
|
cy.get(".nc-form-input-LastUpdate").should("exist"); |
|
|
|
cy.get(".nc-form-input-LastUpdate").should("exist"); |
|
|
|
|
|
|
|
|
|
|
|
cy.wait(3000); |
|
|
|
cy.wait(300); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it(`Validate ${viewType}: URL verification`, () => { |
|
|
|
it(`Validate ${viewType}: URL verification`, () => { |
|
|
@ -391,27 +393,33 @@ export const genTest = (apiType, dbType) => { |
|
|
|
formViewURL = url; |
|
|
|
formViewURL = url; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
cy.wait(3000); |
|
|
|
// cy.saveLocalStorage();
|
|
|
|
|
|
|
|
cy.wait(300); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it(`Validate ${viewType}: URL validation after re-access`, () => { |
|
|
|
it.skip(`Validate ${viewType}: URL validation after re-access`, () => { |
|
|
|
// visit URL
|
|
|
|
// visit URL
|
|
|
|
cy.log(formViewURL); |
|
|
|
cy.log(formViewURL); |
|
|
|
|
|
|
|
// cy.restoreLocalStorage();
|
|
|
|
|
|
|
|
|
|
|
|
cy.visit(formViewURL, { |
|
|
|
cy.visit(formViewURL, { |
|
|
|
baseUrl: null, |
|
|
|
baseUrl: null, |
|
|
|
}); |
|
|
|
}); |
|
|
|
cy.wait(5000); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// New form appeared? Header & description should exist
|
|
|
|
// New form appeared? Header & description should exist
|
|
|
|
validateFormHeader(); |
|
|
|
validateFormHeader(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it(`Delete ${viewType} view`, () => { |
|
|
|
it(`Delete ${viewType} view`, () => { |
|
|
|
|
|
|
|
// cy.restoreLocalStorage();
|
|
|
|
|
|
|
|
|
|
|
|
// number of view entries should be 2 before we delete
|
|
|
|
// number of view entries should be 2 before we delete
|
|
|
|
cy.get(".nc-view-item").its("length").should("eq", 2); |
|
|
|
cy.get(".nc-view-item").its("length").should("eq", 2); |
|
|
|
|
|
|
|
|
|
|
|
// click on delete icon (becomes visible on hovering mouse)
|
|
|
|
// click on delete icon (becomes visible on hovering mouse)
|
|
|
|
cy.get(".nc-view-delete-icon").click({ force: true }); |
|
|
|
cy.get(".nc-view-delete-icon").click({ force: true }); |
|
|
|
|
|
|
|
cy.wait(1000) |
|
|
|
|
|
|
|
cy.getActiveModal().find('.ant-btn-dangerous').click(); |
|
|
|
cy.toastWait("View deleted successfully"); |
|
|
|
cy.toastWait("View deleted successfully"); |
|
|
|
|
|
|
|
|
|
|
|
// confirm if the number of veiw entries is reduced by 1
|
|
|
|
// confirm if the number of veiw entries is reduced by 1
|
|
|
@ -420,8 +428,6 @@ export const genTest = (apiType, dbType) => { |
|
|
|
// clean up newly added rows into Country table operations
|
|
|
|
// clean up newly added rows into Country table operations
|
|
|
|
// this auto verifies successfull addition of rows to table as well
|
|
|
|
// this auto verifies successfull addition of rows to table as well
|
|
|
|
mainPage.getPagination(5).click(); |
|
|
|
mainPage.getPagination(5).click(); |
|
|
|
// kludge: flicker on load
|
|
|
|
|
|
|
|
// cy.wait(3000)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cy.get(".nc-grid-row").should("have.length", 13); |
|
|
|
cy.get(".nc-grid-row").should("have.length", 13); |
|
|
|
cy.get(".ant-checkbox").should('exist').eq(10).click({ force: true }); |
|
|
|
cy.get(".ant-checkbox").should('exist').eq(10).click({ force: true }); |
|
|
@ -433,27 +439,6 @@ export const genTest = (apiType, dbType) => { |
|
|
|
cy.getActiveMenu() |
|
|
|
cy.getActiveMenu() |
|
|
|
.contains("Delete Selected Rows") |
|
|
|
.contains("Delete Selected Rows") |
|
|
|
.click({ force: true }); |
|
|
|
.click({ force: true }); |
|
|
|
|
|
|
|
|
|
|
|
// mainPage
|
|
|
|
|
|
|
|
// .getRow(10)
|
|
|
|
|
|
|
|
// .find(".mdi-checkbox-blank-outline")
|
|
|
|
|
|
|
|
// .click({ force: true });
|
|
|
|
|
|
|
|
// mainPage
|
|
|
|
|
|
|
|
// .getRow(11)
|
|
|
|
|
|
|
|
// .find(".mdi-checkbox-blank-outline")
|
|
|
|
|
|
|
|
// .click({ force: true });
|
|
|
|
|
|
|
|
// mainPage
|
|
|
|
|
|
|
|
// .getRow(12)
|
|
|
|
|
|
|
|
// .find(".mdi-checkbox-blank-outline")
|
|
|
|
|
|
|
|
// .click({ force: true });
|
|
|
|
|
|
|
|
// mainPage
|
|
|
|
|
|
|
|
// .getRow(13)
|
|
|
|
|
|
|
|
// .find(".mdi-checkbox-blank-outline")
|
|
|
|
|
|
|
|
// .click({ force: true });
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// mainPage.getCell("Country", 10).rightclick();
|
|
|
|
|
|
|
|
// cy.getActiveMenu().contains("Delete Selected Row").click();
|
|
|
|
|
|
|
|
// cy.toastWait('Deleted selected rows successfully')
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|