diff --git a/tests/cypress/e2e/Form Templates/FormTemplates.cy.js b/tests/cypress/e2e/Form Templates/FormTemplates.cy.js index 980b53d4ef..a3412ad08b 100644 --- a/tests/cypress/e2e/Form Templates/FormTemplates.cy.js +++ b/tests/cypress/e2e/Form Templates/FormTemplates.cy.js @@ -3,6 +3,7 @@ describe("Form Templates page", () => { cy.login(); cy.visit('/wp-admin/admin.php?page=formidable-form-templates'); cy.viewport(1280, 720); + }); it("should validate page content", () => { @@ -266,7 +267,8 @@ describe("Form Templates page", () => { it("add templates as favorites, view demo and use templates", () => { cy.log("Add contact us template as favorite"); - cy.get('li[frm-search-text="contact us"]').first() + cy.contains('li', 'Contact Us', { timeout: 10000 }) + .first() .trigger('mouseover', { force: true }) .find('.frm-form-templates-item-favorite-button') .click({ force: true }); @@ -282,7 +284,8 @@ describe("Form Templates page", () => { cy.get('[data-category="all-items"]').should("contain", "All Templates").click(); cy.log("View demo of the contact us template"); - cy.get('li[frm-search-text="contact us"]').first() + cy.contains('li', 'Contact Us', { timeout: 10000 }) + .first() .trigger('mouseover', { force: true }) .find('.frm-button-secondary') .invoke('removeAttr', 'target') @@ -296,7 +299,8 @@ describe("Form Templates page", () => { cy.visit('/wp-admin/admin.php?page=formidable-form-templates'); - cy.get('li[frm-search-text="contact us"]').first() + cy.contains('li', 'Contact Us', { timeout: 10000 }) + .first() .trigger('mouseover', { force: true }) .find('.frm-form-templates-use-template-button') .should("contain", "Use Template"); @@ -304,13 +308,15 @@ describe("Form Templates page", () => { cy.log("Try to use available templates"); cy.get('[data-category="available-templates"]').should("contain", "Available Templates").click(); cy.get('#frm-form-templates-page-title-text').should("contain", "Available Templates"); - cy.get('li[frm-search-text="contact us"]').first() + cy.contains('li', 'Contact Us', { timeout: 10000 }) + .first() .trigger('mouseover', { force: true }) .find('.frm-form-templates-use-template-button') .should('contain', 'Use Template') .click({ force: true }); - cy.get('li[frm-search-text="contact us"]').first() + cy.contains('li', 'Contact Us', { timeout: 10000 }) + .first() .trigger('mouseover', { force: true }) .find('.frm-form-templates-use-template-button') .should('contain', 'Use Template') diff --git a/tests/cypress/e2e/Forms/formPageDataValidation.cy.js b/tests/cypress/e2e/Forms/formPageDataValidation.cy.js index 58062460b5..88ddb3ace2 100644 --- a/tests/cypress/e2e/Forms/formPageDataValidation.cy.js +++ b/tests/cypress/e2e/Forms/formPageDataValidation.cy.js @@ -7,6 +7,7 @@ describe("Forms page", () => { cy.visit('/wp-admin/admin.php?page=formidable'); cy.createNewForm(formTitle); cy.viewport(1280, 720); + }); it("should validate all data in list view", () => { @@ -25,12 +26,15 @@ describe("Forms page", () => { const headingText = $h1.text(); expect([ 'The Only WordPress Form Maker & Application Builder Plugin', - 'Upgrade Today to Unlock the Full Power of Formidable Forms' + 'Upgrade Today to Unlock the Full Power of Formidable Forms', + 'The Most Advanced WordPress Form builder', + 'More Than Just a WordPress Form builder' + ]).to.include(headingText); }); }); } else { - throw new Error(`Unexpected banner text or missing href: "${text}"`); + throw new Error(`Unexpected banner text or missing href: "${text}"`); } }); @@ -166,6 +170,7 @@ describe("Forms page", () => { }); afterEach(() => { + cy.visit('/wp-admin/admin.php?page=formidable'); cy.deleteForm(); }); }); diff --git a/tests/cypress/e2e/Forms/formsSettings.cy.js b/tests/cypress/e2e/Forms/formsSettings.cy.js index 7300ebd38f..84daf762c8 100644 --- a/tests/cypress/e2e/Forms/formsSettings.cy.js +++ b/tests/cypress/e2e/Forms/formsSettings.cy.js @@ -111,7 +111,14 @@ describe("Updating form settings", () => { cy.get("#frm-previewDrop", { timeout: 5000 }).should("contain", "Preview").click(); cy.get('.preview > .frm-dropdown-menu > :nth-child(1) > a').should("contain", "On Blank Page").invoke('removeAttr', 'target').click(); - cy.get("button[type='submit']").should("contain", "Submit").click(); + cy.get('.frm_forms', { timeout: 10000 }) + .should('be.visible') + .within(() => { + cy.get("button[type='submit'], input[type='submit']") + .filter(':visible') + .first() + .click(); + }); cy.log("Verify URL redirect after submitting form"); cy.origin('https://formidableforms.com', ()=> { @@ -125,7 +132,14 @@ describe("Updating form settings", () => { cy.log("Click on Preview - In Theme"); cy.get("#frm-previewDrop", { timeout: 5000 }).should("contain", "Preview").click(); cy.get('.preview > .frm-dropdown-menu > :nth-child(2) > a').should("contain", "In Theme").invoke('removeAttr', 'target').click(); - cy.get("button[type='submit']").should("contain", "Submit").click(); + cy.get('.frm_forms', { timeout: 10000 }) + .should('be.visible') + .within(() => { + cy.get("button[type='submit'], input[type='submit']") + .filter(':visible') + .first() + .click(); + }); cy.log("Verify URL redirect after submitting form"); cy.origin('https://formidableforms.com', ()=> { @@ -138,5 +152,4 @@ describe("Updating form settings", () => { cy.log("Teardown - Delete form"); cy.deleteForm(); }); - });