|
|
|
@ -50,21 +50,29 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
|
|
|
|
|
it(`Validate ${viewType} view: Drag & drop for re-order items`, () => { |
|
|
|
|
// default order: Country, LastUpdate, Country => City
|
|
|
|
|
cy.get(".nc-field-wrapper").eq(0).contains("Country").should("exist"); |
|
|
|
|
cy.get(".nc-field-wrapper") |
|
|
|
|
.eq(0) |
|
|
|
|
.contains("Country") |
|
|
|
|
.should("exist"); |
|
|
|
|
cy.get(".nc-field-wrapper") |
|
|
|
|
.eq(1) |
|
|
|
|
.contains("LastUpdate") |
|
|
|
|
.should("exist"); |
|
|
|
|
|
|
|
|
|
// move Country field down (drag, drop)
|
|
|
|
|
cy.get("#data-table-form-Country").drag("#data-table-form-LastUpdate"); |
|
|
|
|
cy.get("#data-table-form-Country").drag( |
|
|
|
|
"#data-table-form-LastUpdate" |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// Verify if order is: LastUpdate, Country, Country => City
|
|
|
|
|
cy.get(".nc-field-wrapper") |
|
|
|
|
.eq(0) |
|
|
|
|
.contains("LastUpdate") |
|
|
|
|
.should("exist"); |
|
|
|
|
cy.get(".nc-field-wrapper").eq(1).contains("Country").should("exist"); |
|
|
|
|
cy.get(".nc-field-wrapper") |
|
|
|
|
.eq(1) |
|
|
|
|
.contains("Country") |
|
|
|
|
.should("exist"); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it(`Validate ${viewType} view: Drag & drop for add/remove items`, () => { |
|
|
|
@ -76,12 +84,20 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
.should("exist"); |
|
|
|
|
|
|
|
|
|
// drag 'LastUpdate' & drop into menu bar drag-drop box
|
|
|
|
|
cy.get("#data-table-form-LastUpdate").drag(".nc-drag-n-drop-to-hide"); |
|
|
|
|
cy.get("#data-table-form-LastUpdate").drag( |
|
|
|
|
".nc-drag-n-drop-to-hide" |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// validate- fields count in menu bar to be increased by 1 &&
|
|
|
|
|
// first member in 'formView' is Country
|
|
|
|
|
cy.get(".nc-field-wrapper").eq(0).contains("Country").should("exist"); |
|
|
|
|
cy.get(".col-md-4").find(".pointer.item").its("length").should("eq", 1); |
|
|
|
|
cy.get(".nc-field-wrapper") |
|
|
|
|
.eq(0) |
|
|
|
|
.contains("Country") |
|
|
|
|
.should("exist"); |
|
|
|
|
cy.get(".col-md-4") |
|
|
|
|
.find(".pointer.item") |
|
|
|
|
.its("length") |
|
|
|
|
.should("eq", 1); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it(`Validate ${viewType} view: Inverted order field member addition from menu`, () => { |
|
|
|
@ -96,7 +112,10 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
|
|
|
|
|
// verify if order of appearance in form is right
|
|
|
|
|
// Country was never removed as its required field. Other two will appear in inverted order
|
|
|
|
|
cy.get(".nc-field-wrapper").eq(0).contains("Country").should("exist"); |
|
|
|
|
cy.get(".nc-field-wrapper") |
|
|
|
|
.eq(0) |
|
|
|
|
.contains("Country") |
|
|
|
|
.should("exist"); |
|
|
|
|
cy.get(".nc-field-wrapper") |
|
|
|
|
.eq(1) |
|
|
|
|
.contains("Country => City") |
|
|
|
@ -109,13 +128,17 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
|
|
|
|
|
it(`Validate ${viewType}: Form header & description validation`, () => { |
|
|
|
|
// Header & description should exist
|
|
|
|
|
cy.get(".nc-form").find('[placeholder="Form Title"]').should("exist"); |
|
|
|
|
cy.get(".nc-form") |
|
|
|
|
.find('[placeholder="Form Title"]') |
|
|
|
|
.should("exist"); |
|
|
|
|
cy.get(".nc-form") |
|
|
|
|
.find('[placeholder="Add form description"]') |
|
|
|
|
.should("exist"); |
|
|
|
|
|
|
|
|
|
// Update header & add some description, verify
|
|
|
|
|
cy.get(".nc-form").find('[placeholder="Form Title"]').type("A B C D"); |
|
|
|
|
cy.get(".nc-form") |
|
|
|
|
.find('[placeholder="Form Title"]') |
|
|
|
|
.type("A B C D"); |
|
|
|
|
cy.get(".nc-form") |
|
|
|
|
.find('[placeholder="Add form description"]') |
|
|
|
|
.type("Some description about form comes here"); |
|
|
|
@ -156,7 +179,10 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
.its("length") |
|
|
|
|
.should("eq", 1); |
|
|
|
|
// menu bar should contain 3 .pointer.item (LastUpdate, County->City)
|
|
|
|
|
cy.get(".col-md-4").find(".pointer.item").its("length").should("eq", 2); |
|
|
|
|
cy.get(".col-md-4") |
|
|
|
|
.find(".pointer.item") |
|
|
|
|
.its("length") |
|
|
|
|
.should("eq", 2); |
|
|
|
|
|
|
|
|
|
// click: Add all
|
|
|
|
|
// cy.get('.col-md-4').find('.pointer.caption').contains('Remove all').should('not.exist')
|
|
|
|
@ -169,7 +195,9 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
.contains("Remove all") |
|
|
|
|
.should("exist"); |
|
|
|
|
// form should contain "field remove icons"
|
|
|
|
|
cy.get(".nc-form").find(".nc-field-remove-icon").should("exist"); |
|
|
|
|
cy.get(".nc-form") |
|
|
|
|
.find(".nc-field-remove-icon") |
|
|
|
|
.should("exist"); |
|
|
|
|
// Fix me: a dummy remove icon is left over on screen
|
|
|
|
|
cy.get(".nc-form") |
|
|
|
|
.find(".nc-field-remove-icon") |
|
|
|
@ -212,7 +240,9 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
cy.getActiveModal().find("button").contains("OK").click(); |
|
|
|
|
|
|
|
|
|
// add message
|
|
|
|
|
cy.get(".nc-form > .mx-auto").find("textarea").type("Congratulations!"); |
|
|
|
|
cy.get(".nc-form > .mx-auto") |
|
|
|
|
.find("textarea") |
|
|
|
|
.type("Congratulations!"); |
|
|
|
|
|
|
|
|
|
// submit button & validate
|
|
|
|
|
cy.get(".nc-form").find("button").contains("Submit").click(); |
|
|
|
@ -236,13 +266,18 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
cy.getActiveModal().find("button").contains("OK").click(); |
|
|
|
|
|
|
|
|
|
// enable "Submit another form" check box
|
|
|
|
|
cy.get(".nc-form > .mx-auto").find('[type="checkbox"]').eq(0).click(); |
|
|
|
|
cy.get(".nc-form > .mx-auto") |
|
|
|
|
.find('[type="checkbox"]') |
|
|
|
|
.eq(0) |
|
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
// submit button & validate
|
|
|
|
|
cy.get(".nc-form").find("button").contains("Submit").click(); |
|
|
|
|
cy.toastWait("Congratulations"); |
|
|
|
|
cy.get(".v-alert").contains("Congratulations").should("exist"); |
|
|
|
|
cy.get("button").contains("Submit Another Form").should("exist"); |
|
|
|
|
cy.get("button") |
|
|
|
|
.contains("Submit Another Form") |
|
|
|
|
.should("exist"); |
|
|
|
|
|
|
|
|
|
cy.get("button").contains("Submit Another Form").click(); |
|
|
|
|
cy.get(".nc-form").should("exist"); |
|
|
|
@ -273,7 +308,10 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
.find('[type="checkbox"]') |
|
|
|
|
.eq(0) |
|
|
|
|
.click({ force: true }); |
|
|
|
|
cy.get(".nc-form > .mx-auto").find('[type="checkbox"]').eq(1).click(); |
|
|
|
|
cy.get(".nc-form > .mx-auto") |
|
|
|
|
.find('[type="checkbox"]') |
|
|
|
|
.eq(1) |
|
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
// submit button & validate
|
|
|
|
|
cy.get(".nc-form").find("button").contains("Submit").click(); |
|
|
|
@ -317,7 +355,12 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
it(`Validate ${viewType}: Email me verification, with SMTP configuration`, () => { |
|
|
|
|
// activate SMTP, dummy profile
|
|
|
|
|
mainPage.navigationDraw(mainPage.APPSTORE).click(); |
|
|
|
|
mainPage.configureSMTP("admin@ex.com", "smtp.ex.com", "8080", "TLS"); |
|
|
|
|
mainPage.configureSMTP( |
|
|
|
|
"admin@ex.com", |
|
|
|
|
"smtp.ex.com", |
|
|
|
|
"8080", |
|
|
|
|
"TLS" |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// open form view & enable "email me" option
|
|
|
|
|
cy.openTableTab("Country", 25); |
|
|
|
|