Skip to content

Commit

Permalink
attempt 3 to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wpalani committed Nov 8, 2024
1 parent 7296d41 commit 8d6ed92
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions tests/cypress/integration/coming-soon-woo.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,27 @@ describe( 'Coming Soon with WooCommerce', function () {
} );
} );

it( 'Replace our admin bar site status badge with WooCommerce\'s when active', () => {
// Visit settings page
cy.visit(
'/wp-admin/admin.php?page=' +
Cypress.env( 'pluginId' ) +
'#/settings'
);
it( 'Replace our admin bar site status badge with WooCommerce\'s when active',
{ defaultCommandTimeout: 15000 },
() => {
// Visit settings page
cy.visit(
'/wp-admin/admin.php?page=' +
Cypress.env( 'pluginId' ) +
'#/settings'
);

// reload the page
cy.reload();
// 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' );
// Our badge shouldn't be visible
cy.get( '#wp-toolbar #wp-admin-bar-nfd-site-visibility-badge' )
.should( 'not.exist' );

// WooCommerce badge should be visible
cy.get( '#wp-toolbar #wp-admin-bar-woocommerce-site-visibility-badge a.ab-item' )
.contains( 'a', 'Coming soon' )
.should( 'be.visible' );
// WooCommerce badge should be visible
cy.get( '#wp-toolbar #wp-admin-bar-woocommerce-site-visibility-badge a.ab-item' )
.contains( 'a', 'Coming soon' )
.should( 'be.visible' );
});

it ( 'Our plugin settings should toggle WooCommerce admin bar badge',
Expand Down

0 comments on commit 8d6ed92

Please sign in to comment.