From 08e5bf90836292ce20fb61e0b64ff90bd3bda875 Mon Sep 17 00:00:00 2001 From: Mike Letellier Date: Wed, 16 Oct 2024 10:27:50 -0300 Subject: [PATCH 1/2] Add the experimental option to show run all specs option in Chrome, stop including formidable-forms file path in URL checks --- cypress.config.js | 1 + .../validateApplicationsPage.cy.js | 42 +++++++++---------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/cypress.config.js b/cypress.config.js index 26d6aeecf3..046257ae92 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -15,5 +15,6 @@ module.exports = defineConfig({ setupNodeEvents(on) { htmlvalidate.install( on ); }, + experimentalRunAllSpecs: true }, }); diff --git a/tests/cypress/e2e/Applications/validateApplicationsPage.cy.js b/tests/cypress/e2e/Applications/validateApplicationsPage.cy.js index 4fd876be6b..71670127fc 100644 --- a/tests/cypress/e2e/Applications/validateApplicationsPage.cy.js +++ b/tests/cypress/e2e/Applications/validateApplicationsPage.cy.js @@ -39,7 +39,7 @@ describe("Applications page", () => { .and('have.attr', 'aria-description', 'Business Directory Template'); cy.get('.frm-application-card-image-wrapper img') .should('have.attr', 'src') - .and('include', '/plugins/formidable-forms/images/applications/thumbnails/business-directory.png'); + .and('include', '/images/applications/thumbnails/business-directory.png'); cy.get('h3 .frm-inner-text').should('contain.text', 'Business Directory').click(); }); @@ -51,7 +51,7 @@ describe("Applications page", () => { .should('contain.text', 'Access to this application requires the Elite plan.'); cy.get('.frm-application-image-wrapper img') .should('have.attr', 'src') - .and('include', '/plugins/formidable-forms/images/applications/placeholder.png'); + .and('include', '/images/applications/placeholder.png'); cy.get('.frm-application-modal-details .frm-application-modal-label') .should('contain.text', 'Description'); cy.get('.frm-application-modal-details div') @@ -84,7 +84,7 @@ describe("Applications page", () => { .and('have.attr', 'aria-description', 'Business Hours Template'); cy.get('.frm-application-card-image-wrapper img') .should('have.attr', 'src') - .and('include', '/plugins/formidable-forms/images/applications/thumbnails/business-hours.png'); + .and('include', '/images/applications/thumbnails/business-hours.png'); }); cy.get('#frm_application_templates_grid') @@ -96,7 +96,7 @@ describe("Applications page", () => { .and('have.attr', 'aria-description', 'Certificate Template'); cy.get('.frm-application-card-image-wrapper img') .should('have.attr', 'src') - .and('include', '/plugins/formidable-forms/images/applications/thumbnails/certificate.webp'); + .and('include', '/images/applications/thumbnails/certificate.webp'); }); cy.get('#frm_application_templates_grid') @@ -108,7 +108,7 @@ describe("Applications page", () => { .and('have.attr', 'aria-description', 'Charity Tracker Template'); cy.get('.frm-application-card-image-wrapper img') .should('have.attr', 'src') - .and('include', '/plugins/formidable-forms/images/applications/thumbnails/charity-tracker.webp'); + .and('include', '/images/applications/thumbnails/charity-tracker.webp'); }); cy.get('#frm_application_templates_grid') @@ -120,7 +120,7 @@ describe("Applications page", () => { .and('have.attr', 'aria-description', 'Contract Agreement Template'); cy.get('.frm-application-card-image-wrapper img') .should('have.attr', 'src') - .and('include', '/plugins/formidable-forms/images/applications/thumbnails/contract-agreement.webp'); + .and('include', '/images/applications/thumbnails/contract-agreement.webp'); }); cy.get('#frm_application_templates_grid') @@ -132,7 +132,7 @@ describe("Applications page", () => { .and('have.attr', 'aria-description', 'FAQ Template'); cy.get('.frm-application-card-image-wrapper img') .should('have.attr', 'src') - .and('include', '/plugins/formidable-forms/images/applications/thumbnails/faq-template-wordpress.png'); + .and('include', '/images/applications/thumbnails/faq-template-wordpress.png'); }); cy.get('#frm_application_templates_grid') @@ -144,7 +144,7 @@ describe("Applications page", () => { .and('have.attr', 'aria-description', 'Freelance Invoice Generator Template'); cy.get('.frm-application-card-image-wrapper img') .should('have.attr', 'src') - .and('include', '/plugins/formidable-forms/images/applications/thumbnails/freelance-invoice-generator.webp'); + .and('include', '/images/applications/thumbnails/freelance-invoice-generator.webp'); }); cy.get('#frm_application_templates_grid') @@ -156,7 +156,7 @@ describe("Applications page", () => { .and('have.attr', 'aria-description', 'Invoice PDF Template'); cy.get('.frm-application-card-image-wrapper img') .should('have.attr', 'src') - .and('include', '/plugins/formidable-forms/images/applications/thumbnails/invoice-pdf.webp'); + .and('include', '/images/applications/thumbnails/invoice-pdf.webp'); }); cy.get('#frm_application_templates_grid') @@ -167,7 +167,7 @@ describe("Applications page", () => { .and('have.attr', 'aria-description', 'Letter of Recommendation Template'); cy.get('.frm-application-card-image-wrapper img') .should('have.attr', 'src') - .and('include', '/plugins/formidable-forms/images/applications/thumbnails/letter-of-recommendation.webp'); + .and('include', '/images/applications/thumbnails/letter-of-recommendation.webp'); cy.get('h3 .frm-inner-text').should('contain.text', 'Letter of Recommendation').click(); }); @@ -179,7 +179,7 @@ describe("Applications page", () => { .should('contain.text', 'Access to this application requires the Business plan'); cy.get('.frm-application-image-wrapper img') .should('have.attr', 'src') - .and('include', '/plugins/formidable-forms/images/applications/placeholder.png'); + .and('include', '/images/applications/placeholder.png'); cy.get('.frm-application-modal-details .frm-application-modal-label') .should('contain.text', 'Description'); cy.get('.frm-application-modal-details div') @@ -212,7 +212,7 @@ describe("Applications page", () => { .and('have.attr', 'aria-description', 'Link in Bio Instagram Page Template'); cy.get('.frm-application-card-image-wrapper img') .should('have.attr', 'src') - .and('include', '/plugins/formidable-forms/images/applications/thumbnails/link-in-bio-instagram.webp'); + .and('include', '/images/applications/thumbnails/link-in-bio-instagram.webp'); }); cy.get('#frm_application_templates_grid') @@ -224,7 +224,7 @@ describe("Applications page", () => { .and('have.attr', 'aria-description', 'Member Directory Template'); cy.get('.frm-application-card-image-wrapper img') .should('have.attr', 'src') - .and('include', '/plugins/formidable-forms/images/applications/thumbnails/member-directory.webp'); + .and('include', '/images/applications/thumbnails/member-directory.webp'); }); cy.get('#frm_application_templates_grid') @@ -236,7 +236,7 @@ describe("Applications page", () => { .and('have.attr', 'aria-description', 'Product Review and Purchase Template'); cy.get('.frm-application-card-image-wrapper img') .should('have.attr', 'src') - .and('include', '/plugins/formidable-forms/images/applications/thumbnails/product-review.png'); + .and('include', '/images/applications/thumbnails/product-review.png'); }); cy.get('#frm_application_templates_grid') @@ -248,7 +248,7 @@ describe("Applications page", () => { .and('have.attr', 'aria-description', 'Real Estate Listing Template'); cy.get('.frm-application-card-image-wrapper img') .should('have.attr', 'src') - .and('include', '/plugins/formidable-forms/images/applications/thumbnails/real-estate-listings.png'); + .and('include', '/images/applications/thumbnails/real-estate-listings.png'); }); cy.get('#frm_application_templates_grid') @@ -260,7 +260,7 @@ describe("Applications page", () => { .and('have.attr', 'aria-description', 'Restaurant Menu Template'); cy.get('.frm-application-card-image-wrapper img') .should('have.attr', 'src') - .and('include', '/plugins/formidable-forms/images/applications/thumbnails/restaurant-menu.png'); + .and('include', '/images/applications/thumbnails/restaurant-menu.png'); }); cy.get('#frm_application_templates_grid') @@ -272,7 +272,7 @@ describe("Applications page", () => { .and('have.attr', 'aria-description', 'Team Directory Template'); cy.get('.frm-application-card-image-wrapper img') .should('have.attr', 'src') - .and('include', '/plugins/formidable-forms/images/applications/thumbnails/team-directory.png'); + .and('include', '/images/applications/thumbnails/team-directory.png'); }); cy.get('#frm_application_templates_grid') @@ -283,7 +283,7 @@ describe("Applications page", () => { .and('have.attr', 'aria-description', 'Testimonials Template'); cy.get('.frm-application-card-image-wrapper img') .should('have.attr', 'src') - .and('include', '/plugins/formidable-forms/images/applications/thumbnails/testimonials.webp'); + .and('include', '/images/applications/thumbnails/testimonials.webp'); cy.get('h3 .frm-inner-text').should('contain.text', 'Testimonials').click(); }); @@ -296,7 +296,7 @@ describe("Applications page", () => { .should('contain.text', 'Access to this application requires the Business plan'); cy.get('.frm-application-image-wrapper img') .should('have.attr', 'src') - .and('include', '/plugins/formidable-forms/images/applications/placeholder.png'); + .and('include', '/images/applications/placeholder.png'); cy.get('.frm-application-modal-details .frm-application-modal-label') .should('contain.text', 'Description'); cy.get('.frm-application-modal-details div') @@ -338,7 +338,7 @@ describe("Applications page", () => { .and('have.attr', 'aria-description', 'Business Directory Template'); cy.get('.frm-application-card-image-wrapper img') .should('have.attr', 'src') - .and('include', '/plugins/formidable-forms/images/applications/thumbnails/business-directory.png'); + .and('include', '/images/applications/thumbnails/business-directory.png'); }); cy.get('#frm_application_templates_grid') .contains('.frm-application-template-card.frm-search-result', 'Business Hours') @@ -348,7 +348,7 @@ describe("Applications page", () => { .and('have.attr', 'aria-description', 'Business Hours Template'); cy.get('.frm-application-card-image-wrapper img') .should('have.attr', 'src') - .and('include', '/plugins/formidable-forms/images/applications/thumbnails/business-hours.png'); + .and('include', '/images/applications/thumbnails/business-hours.png'); }); cy.log("Search for non-valid application templates"); cy.get('#frm-application-search').clear().type("Application does not exist"); From 2100c9b4c4db90b4087f7775c94d8d59c43d913d Mon Sep 17 00:00:00 2001 From: Mike Letellier Date: Wed, 16 Oct 2024 10:51:20 -0300 Subject: [PATCH 2/2] Define a JS dependency, stop marking onboarding skipped when transient value is not a match, add a role to the slidein to improve accessibility --- classes/controllers/FrmAppController.php | 2 +- classes/controllers/FrmOnboardingWizardController.php | 1 - js/packages/floating-links/s11-floating-links.js | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/controllers/FrmAppController.php b/classes/controllers/FrmAppController.php index 6bf94e207d..879a25a942 100644 --- a/classes/controllers/FrmAppController.php +++ b/classes/controllers/FrmAppController.php @@ -1359,7 +1359,7 @@ private static function enqueue_floating_links( $plugin_url, $version ) { wp_enqueue_style( 's11-floating-links', $plugin_url . '/css/packages/s11-floating-links.css', array(), $version ); // Enqueue the Floating Links script. - wp_enqueue_script( 's11-floating-links', $plugin_url . '/js/packages/floating-links/s11-floating-links.js', array(), $version, true ); + wp_enqueue_script( 's11-floating-links', $plugin_url . '/js/packages/floating-links/s11-floating-links.js', array( 'formidable_admin' ), $version, true ); // Enqueue the config script. wp_enqueue_script( 's11-floating-links-config', $plugin_url . '/js/packages/floating-links/config.js', array( 'wp-i18n' ), $version, true ); diff --git a/classes/controllers/FrmOnboardingWizardController.php b/classes/controllers/FrmOnboardingWizardController.php index 1ca23dbf38..3cc3332ea1 100644 --- a/classes/controllers/FrmOnboardingWizardController.php +++ b/classes/controllers/FrmOnboardingWizardController.php @@ -160,7 +160,6 @@ public static function do_admin_redirects() { $transient_value = get_transient( self::TRANSIENT_NAME ); if ( ! in_array( $transient_value, array( self::TRANSIENT_VALUE, self::TRANSIENT_MULTI_VALUE ), true ) ) { - self::mark_onboarding_as_skipped(); return; } diff --git a/js/packages/floating-links/s11-floating-links.js b/js/packages/floating-links/s11-floating-links.js index e50c8acf81..4e4d0fa0a8 100644 --- a/js/packages/floating-links/s11-floating-links.js +++ b/js/packages/floating-links/s11-floating-links.js @@ -113,6 +113,7 @@ class S11FloatingLinks { children }); slideIn.setAttribute( 'data-message', frmGlobal.inboxSlideIn.key ); + slideIn.setAttribute( 'role', 'alert' ); slideIn.insertAdjacentHTML( 'beforeend', frmAdminBuild.purifyHtml( frmGlobal.inboxSlideIn.cta ) ); slideIn.querySelector( '.frm-button-secondary' )?.remove(); this.updateSlideInCtaUtm( slideIn );