From 02ae84a55ab7b44f5191e75c55d58b745aa0384b Mon Sep 17 00:00:00 2001 From: Dirk Schumann Date: Tue, 3 Sep 2024 09:32:10 +0200 Subject: [PATCH 1/2] acknowledge site integrate e2e-test --- e2e/cypress/e2e/onboarding/banner.cy.ts | 14 +++++++++++++- e2e/cypress/selectors/acknowledge.ts | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 e2e/cypress/selectors/acknowledge.ts diff --git a/e2e/cypress/e2e/onboarding/banner.cy.ts b/e2e/cypress/e2e/onboarding/banner.cy.ts index 7bc411f..690fbd7 100644 --- a/e2e/cypress/e2e/onboarding/banner.cy.ts +++ b/e2e/cypress/e2e/onboarding/banner.cy.ts @@ -1,5 +1,6 @@ /// +import { acknowledgeButton } from '../../selectors/acknowledge'; import { getStartedButton, onboardingBanner } from '../../selectors/banner'; import { step } from '../../selectors/onboarding'; import { activatePublisherButton, deactivatePublisherButton, deactivatePublisherButtonSelector, publisherEntry } from '../../selectors/plugins'; @@ -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()); }); @@ -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'); }); diff --git a/e2e/cypress/selectors/acknowledge.ts b/e2e/cypress/selectors/acknowledge.ts new file mode 100644 index 0000000..c0a44c0 --- /dev/null +++ b/e2e/cypress/selectors/acknowledge.ts @@ -0,0 +1 @@ +export const acknowledgeButton = () => cy.get('#acknowledge-button') \ No newline at end of file From 5bbf076109ffb8f8f59b3a7136e02232773bd129 Mon Sep 17 00:00:00 2001 From: Dirk Schumann Date: Thu, 5 Sep 2024 10:57:20 +0200 Subject: [PATCH 2/2] fix typo --- e2e/cypress/e2e/onboarding/banner.cy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/cypress/e2e/onboarding/banner.cy.ts b/e2e/cypress/e2e/onboarding/banner.cy.ts index 690fbd7..6da3ae0 100644 --- a/e2e/cypress/e2e/onboarding/banner.cy.ts +++ b/e2e/cypress/e2e/onboarding/banner.cy.ts @@ -27,7 +27,7 @@ describe('Onboarding Banner', () => { onboardingBanner().should('exist'); }); - it('should show the aknowledge screen on "Get Started" click', () => { + it('should show the acknowledge screen on "Get Started" click', () => { cy.visit('/wp-admin/plugins.php'); activatePublisherButton().should('be.visible'); activatePublisherButton().click();