diff --git a/client/cypress/e2e/group2/_07project.cy.ts b/client/cypress/e2e/group2/_06project.cy.ts similarity index 100% rename from client/cypress/e2e/group2/_07project.cy.ts rename to client/cypress/e2e/group2/_06project.cy.ts diff --git a/client/cypress/e2e/group2/_08antisybil.cy.ts b/client/cypress/e2e/group2/_07antisybil.cy.ts similarity index 100% rename from client/cypress/e2e/group2/_08antisybil.cy.ts rename to client/cypress/e2e/group2/_07antisybil.cy.ts diff --git a/client/cypress/e2e/group2/_09projects.cy.ts b/client/cypress/e2e/group2/_08projects.cy.ts similarity index 100% rename from client/cypress/e2e/group2/_09projects.cy.ts rename to client/cypress/e2e/group2/_08projects.cy.ts diff --git a/client/cypress/e2e/group2/_10settings.cy.ts b/client/cypress/e2e/group2/_09settings.cy.ts similarity index 99% rename from client/cypress/e2e/group2/_10settings.cy.ts rename to client/cypress/e2e/group2/_09settings.cy.ts index 9b524b7090..0373907dbc 100644 --- a/client/cypress/e2e/group2/_10settings.cy.ts +++ b/client/cypress/e2e/group2/_09settings.cy.ts @@ -186,6 +186,53 @@ Object.values(viewports).forEach( }); }); + it('"Always show onboarding" option toggle works', () => { + connectWallet({ isPatronModeEnabled: false }); + cy.wait(2500); + + if (isLargeDesktop || isDesktop) { + cy.get('[data-test=LayoutTopBar__settingsButton]').click({ force: true }); + } + + cy.get('[data-test=SettingsShowOnboardingBox__InputToggle]').check({ force: true }); + cy.get('[data-test=SettingsShowOnboardingBox__InputToggle]').should('be.checked'); + cy.getAllLocalStorage().then(() => { + expect(localStorage.getItem(IS_ONBOARDING_ALWAYS_VISIBLE)).eq('true'); + }); + cy.reload(); + cy.wait(500); + cy.get('[data-test=ModalOnboarding]').should('be.visible'); + cy.get('[data-test=ModalOnboarding__Button]').click(); + + if (isLargeDesktop || isDesktop) { + cy.get('[data-test=LayoutTopBar__settingsButton]').click(); + } else { + cy.get(`[data-test=LayoutNavbar__Button--settings]`).click(); + } + + cy.get('[data-test=SettingsShowOnboardingBox__InputToggle]').click({ force: true }); + cy.get('[data-test=SettingsShowOnboardingBox__InputToggle]').should('not.be.checked'); + cy.getAllLocalStorage().then(() => { + expect(localStorage.getItem(IS_ONBOARDING_ALWAYS_VISIBLE)).eq('false'); + }); + cy.reload(); + cy.get('[data-test=ModalOnboarding]').should('not.exist'); + + if (isLargeDesktop || isDesktop) { + cy.get('[data-test=LayoutTopBar__settingsButton]').click(); + } else { + cy.get(`[data-test=LayoutNavbar__Button--settings]`).click(); + } + + cy.get('[data-test=SettingsShowOnboardingBox__InputToggle]').click({ force: true }); + cy.get('[data-test=SettingsShowOnboardingBox__InputToggle]').should('be.checked'); + cy.getAllLocalStorage().then(() => { + expect(localStorage.getItem(IS_ONBOARDING_ALWAYS_VISIBLE)).eq('true'); + }); + + cy.disconnectMetamaskWalletFromAllDapps(); + }); + it('"Choose a display currency" option works', () => { for (let i = 0; i < DISPLAY_CURRENCIES.length - 1; i++) { const displayCurrency = DISPLAY_CURRENCIES[i]; @@ -256,51 +303,6 @@ Object.values(viewports).forEach( cy.get('[data-test=HomeGridVideoBar]').should('be.visible'); } }); - - it('"Always show onboarding" option toggle works', () => { - connectWallet({ isPatronModeEnabled: false }); - - if (isLargeDesktop || isDesktop) { - cy.get('[data-test=LayoutTopBar__settingsButton]').click({ force: true }); - } - - cy.get('[data-test=SettingsShowOnboardingBox__InputToggle]').check({ force: true }); - cy.get('[data-test=SettingsShowOnboardingBox__InputToggle]').should('be.checked'); - cy.getAllLocalStorage().then(() => { - expect(localStorage.getItem(IS_ONBOARDING_ALWAYS_VISIBLE)).eq('true'); - }); - cy.reload(); - cy.get('[data-test=ModalOnboarding]').should('be.visible'); - cy.get('[data-test=ModalOnboarding__Button]').click(); - - if (isLargeDesktop || isDesktop) { - cy.get('[data-test=LayoutTopBar__settingsButton]').click(); - } else { - cy.get(`[data-test=LayoutNavbar__Button--settings]`).click(); - } - - cy.get('[data-test=SettingsShowOnboardingBox__InputToggle]').click({ force: true }); - cy.get('[data-test=SettingsShowOnboardingBox__InputToggle]').should('not.be.checked'); - cy.getAllLocalStorage().then(() => { - expect(localStorage.getItem(IS_ONBOARDING_ALWAYS_VISIBLE)).eq('false'); - }); - cy.reload(); - cy.get('[data-test=ModalOnboarding]').should('not.exist'); - - if (isLargeDesktop || isDesktop) { - cy.get('[data-test=LayoutTopBar__settingsButton]').click(); - } else { - cy.get(`[data-test=LayoutNavbar__Button--settings]`).click(); - } - - cy.get('[data-test=SettingsShowOnboardingBox__InputToggle]').click({ force: true }); - cy.get('[data-test=SettingsShowOnboardingBox__InputToggle]').should('be.checked'); - cy.getAllLocalStorage().then(() => { - expect(localStorage.getItem(IS_ONBOARDING_ALWAYS_VISIBLE)).eq('true'); - }); - - cy.disconnectMetamaskWalletFromAllDapps(); - }); }); }, ); diff --git a/client/cypress/e2e/group3/_01metamaskWorkaround.cy.ts b/client/cypress/e2e/group3/_01metamaskWorkaround.cy.ts new file mode 100644 index 0000000000..0d18aa100b --- /dev/null +++ b/client/cypress/e2e/group3/_01metamaskWorkaround.cy.ts @@ -0,0 +1,8 @@ +// Cypress tests based on framer pass only in case when test tab is active (chrome doesn't block animations). +// On first test, active tab is MetaMask and on each next active tab is test tab - due to that we had to add this workaround. +// Only for `synpress run` command +describe('Workaround for first test (active tab is MetaMask instead of Cypress tab)', () => { + it('true', () => { + expect(true).to.be.true; + }); +}); diff --git a/client/cypress/e2e/group2/_06allocationAWOpen.cy.ts b/client/cypress/e2e/group3/_02allocationAWOpen.cy.ts similarity index 100% rename from client/cypress/e2e/group2/_06allocationAWOpen.cy.ts rename to client/cypress/e2e/group3/_02allocationAWOpen.cy.ts diff --git a/client/package.json b/client/package.json index d533f4a657..96ed310e78 100644 --- a/client/package.json +++ b/client/package.json @@ -30,9 +30,10 @@ "type-check": "tsc --noEmit true", "sourcemaps:remove": "rimraf dist/**/*.map", "synpress:open": "TZ=Europe/Warsaw synpress open --configFile synpress.config.ts", - "synpress:run": "yarn synpress:run:group-1 && yarn synpress:run:group-2", + "synpress:run": "yarn synpress:run:group-1 && yarn synpress:run:group-2 && yarn synpress:run:group-3", "synpress:run:group-1": "TZ=Europe/Warsaw synpress run --configFile synpress.config.ts --spec '**/group1/*.cy.ts'", - "synpress:run:group-2": "TZ=Europe/Warsaw synpress run --configFile synpress.config.ts --spec '**/group2/*.cy.ts'" + "synpress:run:group-2": "TZ=Europe/Warsaw synpress run --configFile synpress.config.ts --spec '**/group2/*.cy.ts'", + "synpress:run:group-3": "TZ=Europe/Warsaw synpress run --configFile synpress.config.ts --spec '**/group3/*.cy.ts'" }, "dependencies": { "@ethersproject/constants": "^5.7.0",