diff --git a/.github/workflows/main.yml b/.github/workflows/component.yml similarity index 94% rename from .github/workflows/main.yml rename to .github/workflows/component.yml index f6985b6..744a164 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/component.yml @@ -1,4 +1,4 @@ -name: Run Cypress Tests +name: Run Cypress Component Tests on: [workflow_dispatch, push] diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 0000000..43a9046 --- /dev/null +++ b/.github/workflows/e2e.yml @@ -0,0 +1,23 @@ +name: Run Cypress E2E Tests + +on: [workflow_dispatch, push] + + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Cypress run + uses: cypress-io/github-action@v3 + with: + project: ./ + browser: chrome + build: yarn build + start: yarn start + wait-on: "http://localhost:3000" + env: + SITECORE_CH1_ENDPOINT_URL: ${{ secrets.SITECORE_CH1_ENDPOINT_URL }} + SITECORE_CH1_CLIENT_KEY: ${{ secrets.SITECORE_CH1_CLIENT_KEY }} diff --git a/cypress/e2e/OutcomeFlow/outcome.cy.ts b/cypress/e2e/OutcomeFlow/outcome.cy.ts index 5190782..a0f7679 100644 --- a/cypress/e2e/OutcomeFlow/outcome.cy.ts +++ b/cypress/e2e/OutcomeFlow/outcome.cy.ts @@ -9,7 +9,6 @@ describe('Outcome Page', () => { cy.get('[value="nosecuredpages"]').click(); cy.get('[value="search-no"]').click(); cy.get('[value="scs"]').click(); - cy.get('.css-18udl74').click(); cy.get('[value="vuejs"]').click(); cy.get('.css-gmuwbf > .chakra-button').click(); cy.get('[value="yesexperienceedge"]').click(); @@ -18,7 +17,43 @@ describe('Outcome Page', () => { cy.get('ul#required-products').should('exist').find('li').should('have.length', 1); cy.get('ul#required-products li').eq(0).should('contain', 'XM Cloud'); }); -}); - - + it('multiple required products', () => { + cy.visit('/'); + cy.get(':nth-child(1) > .chakra-stack > .chakra-button').click(); + cy.get(':nth-child(11) > .chakra-button').click(); + cy.get('.css-1izj7gt > :nth-child(2)').click(); + cy.get('.chakra-container > :nth-child(3) > .chakra-button').click(); + cy.get('[value="xp"]').click(); + cy.get('[value="sessionpersonalization"]').click(); + cy.get('[value="identityresolution"]').click(); + cy.get('[value="customxdbfacets"]').click(); + cy.get('[value="exm"]').click(); + cy.get('[value="forms"]').click(); + cy.get('[value="customanalyticsdashboards"]').click(); + cy.get('[value="externaldatasystems"]').click(); + cy.get('[value="historicalpersonalization"]').click(); + cy.get('[value="patterncards"]').click(); + cy.get('[value="customrules"]').click(); + cy.get('[value="marketingautomation"]').click(); + cy.get('[value="captureadditionalevents"]').click(); + cy.get('.css-gmuwbf > .chakra-button').click(); + cy.get('[value="securityloginrequired"]').click(); + cy.get('[value="historicalpersonalize90"]').click(); + cy.get('[value="search-index"]').click(); + cy.get('[value="unicorn"]').click(); + // cy.get('.css-18udl74').click(); + // cy.get('.css-e3ognv').click(); + cy.get('[value="netcore"]').click(); + cy.get('.css-gmuwbf > .chakra-button').click(); + cy.get('[value="noexperienceedge"]').click(); + cy.wait(5000); + cy.get('.chakra-modal__close-btn').click(); + cy.get('ul#required-products').should('exist').find('li').should('have.length', 5); + cy.get('ul#required-products li').eq(0).should('contain', 'XM Cloud'); + cy.get('ul#required-products li').eq(1).should('contain', 'Search'); + cy.get('ul#required-products li').eq(2).should('contain', 'Personalize'); + cy.get('ul#required-products li').eq(3).should('contain', 'CDP'); + cy.get('ul#required-products li').eq(4).should('contain', 'Send'); + }); +}); \ No newline at end of file diff --git a/cypress/e2e/Themes/theme.cy.ts b/cypress/e2e/Themes/theme.cy.ts new file mode 100644 index 0000000..94dc1dd --- /dev/null +++ b/cypress/e2e/Themes/theme.cy.ts @@ -0,0 +1,11 @@ +const backgroundImageFileName = "182bc6d196aa465cbf9b614ff2883eb4" + +describe('Theme switcher', () => { + it('Choosing Fantasy theme should change background and buttons', () => { + cy.visit('/'); + cy.get('.css-uvp8xs > :nth-child(2) > .chakra-stack > .chakra-button').click(); + cy.get('div#backgroundImage').should('have.css', 'background-image').and('include', backgroundImageFileName); + cy.get('[value="Bard"]').should('have.css', 'background-image').and('include', "/fantasy/button-default.svg"); + + }) +}) \ No newline at end of file diff --git a/src/components/ui/Layout/SingleColumnLayout.tsx b/src/components/ui/Layout/SingleColumnLayout.tsx index b2b91c7..b3a8cfc 100644 --- a/src/components/ui/Layout/SingleColumnLayout.tsx +++ b/src/components/ui/Layout/SingleColumnLayout.tsx @@ -34,6 +34,7 @@ export const SingleColumnLayout: FC = ({ backgroundRepeat="no-repeat" paddingX={4} paddingBottom="140px" + id="backgroundImage" > = ({ personas, toggledButtonId, h