Skip to content

Commit

Permalink
acknowledge site integrate e2e-test
Browse files Browse the repository at this point in the history
  • Loading branch information
dnkbln committed Sep 3, 2024
1 parent 925830e commit 02ae84a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
14 changes: 13 additions & 1 deletion e2e/cypress/e2e/onboarding/banner.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference types="cypress" />

import { acknowledgeButton } from '../../selectors/acknowledge';
import { getStartedButton, onboardingBanner } from '../../selectors/banner';
import { step } from '../../selectors/onboarding';
import { activatePublisherButton, deactivatePublisherButton, deactivatePublisherButtonSelector, publisherEntry } from '../../selectors/plugins';
Expand All @@ -9,6 +10,7 @@ describe('Onboarding Banner', () => {
cy.login('admin', 'admin');
cy.wait(1000);
cy.visit('/wp-admin/plugins.php');
cy.clearAllLocalStorage();
publisherEntry().should('be.visible');
cy.exists(deactivatePublisherButtonSelector).then((exists) => exists && deactivatePublisherButton().click());
});
Expand All @@ -25,11 +27,21 @@ describe('Onboarding Banner', () => {
onboardingBanner().should('exist');
});

it('should show the onboarding screen on "Get Started" click', () => {
it('should show the aknowledge screen on "Get Started" click', () => {
cy.visit('/wp-admin/plugins.php');
activatePublisherButton().should('be.visible');
activatePublisherButton().click();
getStartedButton().click();
acknowledgeButton().should('be.visible');
})

it('should show the onboarding screen on "All right I\'ve got it" click', () => {
cy.visit('/wp-admin/plugins.php');
activatePublisherButton().should('be.visible');
activatePublisherButton().click();
getStartedButton().click();
acknowledgeButton().should('be.visible');
acknowledgeButton().click();
cy.url().should('contain', 'admin.php?page=podlove_settings_onboarding_handle')
step('select').should('be.visible');
});
Expand Down
1 change: 1 addition & 0 deletions e2e/cypress/selectors/acknowledge.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const acknowledgeButton = () => cy.get('#acknowledge-button')

0 comments on commit 02ae84a

Please sign in to comment.