From a87fa2fed7067a9727b7410dce0cce5beec4cd13 Mon Sep 17 00:00:00 2001 From: Thomas Desmond <24610108+thomas-desmond@users.noreply.github.com> Date: Wed, 13 Sep 2023 16:38:10 -0700 Subject: [PATCH 1/2] Two new tests --- cypress/e2e/OutcomeFlow/outcome.cy.ts | 43 +++++++++++++++++-- cypress/e2e/Themes/theme.cy.ts | 11 +++++ .../ui/Layout/SingleColumnLayout.tsx | 1 + src/components/ui/PersonaList/PersonaList.tsx | 1 + 4 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 cypress/e2e/Themes/theme.cy.ts 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