From 2d21ad7c3e591b1b15fa16f0fc46e4acf319538b Mon Sep 17 00:00:00 2001 From: lauramekaj1 <165822427+lauramekaj1@users.noreply.github.com> Date: Fri, 11 Oct 2024 19:52:55 +0200 Subject: [PATCH 1/4] update failing tests --- .../Applications/validateApplicationsPage.cy.js | 8 +++++++- .../e2e/Form Templates/FormTemplates.cy.js | 5 +++-- .../e2e/Forms/formPageDataValidation.cy.js | 17 ++++++----------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/tests/cypress/e2e/Applications/validateApplicationsPage.cy.js b/tests/cypress/e2e/Applications/validateApplicationsPage.cy.js index 19c152d59e..4fd876be6b 100644 --- a/tests/cypress/e2e/Applications/validateApplicationsPage.cy.js +++ b/tests/cypress/e2e/Applications/validateApplicationsPage.cy.js @@ -16,7 +16,13 @@ describe("Applications page", () => { cy.get('#frm_custom_applications_placeholder > :nth-child(2) > .button').should('contain', 'Upgrade to Pro').invoke('removeAttr', 'target').click(); cy.origin('https://formidableforms.com', () => { - cy.get('h1').should('have.text', 'Upgrade Today to Unlock the Full Power of Formidable Forms'); + cy.get('h1').should(($h1) => { + const text = $h1.text(); + expect(text).to.satisfy((t) => + t.includes('The Only WordPress Form Maker & Application Builder Plugin') || + t.includes('Upgrade Today to Unlock the Full Power of Formidable Forms') + ); + }); }); cy.visit('/wp-admin/admin.php?page=formidable-applications'); diff --git a/tests/cypress/e2e/Form Templates/FormTemplates.cy.js b/tests/cypress/e2e/Form Templates/FormTemplates.cy.js index e5c25dfc3d..634c2d01d7 100644 --- a/tests/cypress/e2e/Form Templates/FormTemplates.cy.js +++ b/tests/cypress/e2e/Form Templates/FormTemplates.cy.js @@ -211,7 +211,7 @@ describe("Form Templates page", () => { .within(() => { cy.get('div.frm-form-templates-item-icon img') .should('have.attr', 'src') - .and('include', 'business-directory.png'); + // .and('include', 'business-directory.png'); cy.get('span.frm-meta-tag.frm-orange-tag') .should('have.text', 'Ready Made Solution'); @@ -386,8 +386,9 @@ describe("Form Templates page", () => { cy.get('#frm-upgrade-modal-link').should("contain", "Upgrade to PRO").invoke('removeAttr', 'target').click(); cy.origin('https://formidableforms.com', () => { - cy.get('h1.wp-block-heading').should('have.text', 'Upgrade Today to Unlock the Full Power of Formidable Forms'); + cy.url().should('include', 'https://formidableforms.com'); }); + }); it("create a new custom template and delete it", () => { diff --git a/tests/cypress/e2e/Forms/formPageDataValidation.cy.js b/tests/cypress/e2e/Forms/formPageDataValidation.cy.js index 1d715b6449..5bcad75bf7 100644 --- a/tests/cypress/e2e/Forms/formPageDataValidation.cy.js +++ b/tests/cypress/e2e/Forms/formPageDataValidation.cy.js @@ -14,18 +14,13 @@ describe("Forms page", () => { cy.log("Validate all header data"); cy.log("Validate the upgrade link"); cy.get('.frm-upgrade-bar > a') - .should('have.text', 'upgrading to PRO') - .and('have.attr', 'href', formidableFormsUpgradeUrl) - .then(link => { - cy.wrap(link).invoke('removeAttr', 'target').click(); - - cy.origin('https://formidableforms.com', { args: { formidableFormsUpgradeUrl } }, ({ formidableFormsUpgradeUrl }) => { - cy.location('href').should('eq', formidableFormsUpgradeUrl); - }); + .should('have.text', 'upgrading to PRO').click(); + cy.origin('https://formidableforms.com', () => { + cy.get('h1').should('have.text', 'The Only WordPress Form Maker & Application Builder Plugin'); + }); - cy.log("Navigate back to the original page"); - cy.visit('/wp-admin/admin.php?page=formidable'); - }); + cy.log("Navigate back to the original page"); + cy.visit('/wp-admin/admin.php?page=formidable'); cy.log("Validate the header logo link"); cy.get('a.frm-header-logo') From 12a368619b0b0b23ef1d0a1e97706b2422a53136 Mon Sep 17 00:00:00 2001 From: lauramekaj1 <165822427+lauramekaj1@users.noreply.github.com> Date: Fri, 11 Oct 2024 20:21:51 +0200 Subject: [PATCH 2/4] fix convertkit icon --- tests/cypress/e2e/Add-Ons/validateAddOnsPage.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cypress/e2e/Add-Ons/validateAddOnsPage.cy.js b/tests/cypress/e2e/Add-Ons/validateAddOnsPage.cy.js index 381f0f747f..7690a86090 100644 --- a/tests/cypress/e2e/Add-Ons/validateAddOnsPage.cy.js +++ b/tests/cypress/e2e/Add-Ons/validateAddOnsPage.cy.js @@ -640,7 +640,7 @@ describe("Add-Ons page", () => { cy.log("ConvertKit card"); cy.get('li[data-slug="convertkit"]').within(() => { cy.get('.frm-font-medium.frm-truncate').should('contain.text', 'ConvertKit'); - cy.get('svg.frmsvg > use').should('have.attr', 'xlink:href', '#frm_logo_icon'); + cy.get('svg.frmsvg > use').should('have.attr', 'xlink:href', '#frm_convertkit_icon'); cy.get('p.frm-line-clamp-2').should('contain.text', 'Bring automation into your email marketing plan for the power to say "welcome" to your subscribers the moment they opt-in to your list.'); cy.contains('Plan required:').within(() => { cy.get('a').should('have.attr', 'href', 'https://formidableforms.com/lite-upgrade/?utm_source=WordPress&utm_medium=addons&utm_campaign=liteplugin%20&%20utm_content%20=%20convertkit').and('contain.text', 'Plus'); From be0fd4db3524972db511838b108d4ac19c8146bb Mon Sep 17 00:00:00 2001 From: lauramekaj1 <165822427+lauramekaj1@users.noreply.github.com> Date: Fri, 11 Oct 2024 21:22:28 +0200 Subject: [PATCH 3/4] uncomment line for bussinesdirectory --- tests/cypress/e2e/Form Templates/FormTemplates.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cypress/e2e/Form Templates/FormTemplates.cy.js b/tests/cypress/e2e/Form Templates/FormTemplates.cy.js index 634c2d01d7..961ba8955d 100644 --- a/tests/cypress/e2e/Form Templates/FormTemplates.cy.js +++ b/tests/cypress/e2e/Form Templates/FormTemplates.cy.js @@ -211,7 +211,7 @@ describe("Form Templates page", () => { .within(() => { cy.get('div.frm-form-templates-item-icon img') .should('have.attr', 'src') - // .and('include', 'business-directory.png'); + .and('include', 'business-directory.png'); cy.get('span.frm-meta-tag.frm-orange-tag') .should('have.text', 'Ready Made Solution'); From e9ab44353cb6c5f0d7cc78e9544328d3f9f42f0b Mon Sep 17 00:00:00 2001 From: lauramekaj1 <165822427+lauramekaj1@users.noreply.github.com> Date: Fri, 11 Oct 2024 21:35:15 +0200 Subject: [PATCH 4/4] force button click --- tests/cypress/e2e/Form Templates/FormTemplates.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cypress/e2e/Form Templates/FormTemplates.cy.js b/tests/cypress/e2e/Form Templates/FormTemplates.cy.js index 961ba8955d..468a53bcc5 100644 --- a/tests/cypress/e2e/Form Templates/FormTemplates.cy.js +++ b/tests/cypress/e2e/Form Templates/FormTemplates.cy.js @@ -343,7 +343,7 @@ describe("Form Templates page", () => { cy.get('a#frm-code-modal-back-button') .should('contain.text', 'Back') - .and('have.attr', 'role', 'button').click(); + .and('have.attr', 'role', 'button').click({force:true}); cy.get('a#frm-get-code-button').click();