diff --git a/tests/cypress/integration/coming-soon-woo.cy.js b/tests/cypress/integration/coming-soon-woo.cy.js index 50c423c..49a0ea4 100644 --- a/tests/cypress/integration/coming-soon-woo.cy.js +++ b/tests/cypress/integration/coming-soon-woo.cy.js @@ -20,9 +20,12 @@ describe( 'Coming Soon with WooCommerce', function () { } ); } ); - it( 'Replace our admin bar site status badge with WooCommerce\'s when active', + it( 'Replace our admin bar site status badge with WooCommerce\'s when active', { defaultCommandTimeout: 15000 }, () => { + // reload the page + cy.reload(); + // Visit settings page cy.visit( '/wp-admin/admin.php?page=' + @@ -30,9 +33,6 @@ describe( 'Coming Soon with WooCommerce', function () { '#/settings' ); - // reload the page - cy.reload(); - // Our badge shouldn't be visible cy.get( '#wp-toolbar #wp-admin-bar-nfd-site-visibility-badge' ) .should( 'not.exist' ); @@ -43,26 +43,25 @@ describe( 'Coming Soon with WooCommerce', function () { .should( 'be.visible' ); }); - it ( 'Our plugin settings should toggle WooCommerce admin bar badge', - { defaultCommandTimeout: 10000 }, - () => { - // Deactivate coming soon - Launch Site - cy.get( '[data-id="coming-soon-toggle"]' ).click(); - cy.wait( 1000 ); + it ( 'Our plugin settings should toggle WooCommerce admin bar badge', () => { + // Deactivate coming soon - Launch Site + cy.get( '[data-id="coming-soon-toggle"]' ).click(); + cy.wait( 1000 ); - // WooCommerce badge should now be live - cy.get( '#wp-toolbar .woocommerce-site-status-badge-live a.ab-item' ) - .contains( 'a', 'Live' ) - .should( 'be.visible' ); + // WooCommerce badge should now be live + cy.get( '#wp-toolbar .woocommerce-site-status-badge-live a.ab-item' ) + .contains( 'a', 'Live' ) + .should( 'be.visible' ); - // Re-enable coming soon mode - cy.get( '[data-id="coming-soon-toggle"]' ) - .click(); + // Re-enable coming soon mode + cy.get( '[data-id="coming-soon-toggle"]' ) + .click(); + cy.wait( 1000 ); - // WooCommerce badge should now be coming soon - cy.get( '#wp-toolbar .woocommerce-site-status-badge-coming-soon a.ab-item' ) - .contains( 'a', 'Coming soon' ) - .should( 'be.visible' ); + // WooCommerce badge should now be coming soon + cy.get( '#wp-toolbar .woocommerce-site-status-badge-coming-soon a.ab-item' ) + .contains( 'a', 'Coming soon' ) + .should( 'be.visible' ); }); it( 'Hide our site preview notice when WooCommerce is active', () => {