From 5f4154f69c13d4e51cae67398080401fbca6f43b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Miko=C5=82ajczyk?= Date: Mon, 13 Jan 2025 12:41:50 +0100 Subject: [PATCH] oct-2097: onboarding e2e update --- client/cypress/e2e/_07onboardingTOSNotAccepted.cy.ts | 6 +++--- client/cypress/e2e/_08onboardingTOSAccepted.cy.ts | 8 +++----- client/cypress/utils/onboarding.ts | 8 ++++---- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/client/cypress/e2e/_07onboardingTOSNotAccepted.cy.ts b/client/cypress/e2e/_07onboardingTOSNotAccepted.cy.ts index e30b974cc..baf2de987 100644 --- a/client/cypress/e2e/_07onboardingTOSNotAccepted.cy.ts +++ b/client/cypress/e2e/_07onboardingTOSNotAccepted.cy.ts @@ -22,7 +22,7 @@ import { chai.use(chaiColors); Object.values(viewports).forEach( - ({ device, viewportWidth, viewportHeight, isMobile }, index, arr) => { + ({ device, viewportWidth, viewportHeight, isMobile, isTablet }, index, arr) => { describe( `[AW IS CLOSED] Onboarding (TOS not accepted): ${device}`, { viewportHeight, viewportWidth }, @@ -77,11 +77,11 @@ Object.values(viewports).forEach( }); it('user cannot change steps by clicking the edge of the screen (up to 25px from each edge)', () => { - checkChangeStepsByClickingEdgeOfTheScreenUpTo25px(false, isMobile); + checkChangeStepsByClickingEdgeOfTheScreenUpTo25px(false, isMobile || isTablet); }); it('user cannot change steps by clicking the edge of the screen (more than 25px from each edge)', () => { - checkChangeStepsByClickingEdgeOfTheScreenMoreThan25px(false, isMobile); + checkChangeStepsByClickingEdgeOfTheScreenMoreThan25px(false, isMobile || isTablet); }); it('user cannot change steps by swiping on screen (difference more than or equal 5px)', () => { diff --git a/client/cypress/e2e/_08onboardingTOSAccepted.cy.ts b/client/cypress/e2e/_08onboardingTOSAccepted.cy.ts index c4c861e67..5c87d733f 100644 --- a/client/cypress/e2e/_08onboardingTOSAccepted.cy.ts +++ b/client/cypress/e2e/_08onboardingTOSAccepted.cy.ts @@ -22,7 +22,7 @@ import { chai.use(chaiColors); Object.values(viewports).forEach( - ({ device, viewportWidth, viewportHeight, isMobile, isDesktop, isLargeDesktop }) => { + ({ device, viewportWidth, viewportHeight, isMobile, isTablet, isDesktop, isLargeDesktop }) => { describe( `[AW IS CLOSED] onboarding (TOS accepted): ${device}`, { viewportHeight, viewportWidth }, @@ -104,13 +104,11 @@ Object.values(viewports).forEach( }); it('user can change steps by clicking the edge of the screen (up to 25px from each edge)', () => { - checkChangeStepsByClickingEdgeOfTheScreenUpTo25px(true, isMobile); + checkChangeStepsByClickingEdgeOfTheScreenUpTo25px(true, isMobile || isTablet); }); - // TODO will be unskipped in https://github.com/golemfoundation/octant/pull/624. - // eslint-disable-next-line it('user cannot change steps by clicking the edge of the screen (more than 25px from each edge)', () => { - checkChangeStepsByClickingEdgeOfTheScreenMoreThan25px(true, isMobile); + checkChangeStepsByClickingEdgeOfTheScreenMoreThan25px(true, isMobile || isTablet); }); it('user can change steps by swiping on screen (difference more than or equal 5px)', () => { diff --git a/client/cypress/utils/onboarding.ts b/client/cypress/utils/onboarding.ts index 62b859e78..d4642bd6e 100644 --- a/client/cypress/utils/onboarding.ts +++ b/client/cypress/utils/onboarding.ts @@ -77,7 +77,7 @@ export const checkChangeStepsWithArrowKeys = (isTOSAccepted: boolean): void => { export const checkChangeStepsByClickingEdgeOfTheScreenUpTo25px = ( isTOSAccepted: boolean, - isMobile = false, + isMobileOrTablet = false, ): void => { checkCurrentElement(0, true); @@ -93,7 +93,7 @@ export const checkChangeStepsByClickingEdgeOfTheScreenUpTo25px = ( { clientX: leftEdgeX, el: 0 }, ].forEach(({ clientX, el }) => { cy.get('[data-test=ModalOnboarding]').click(clientX, element.height()! / 2, { - force: isMobile, + force: isMobileOrTablet, }); checkCurrentElement(el, isTOSAccepted || el === 0); @@ -106,7 +106,7 @@ export const checkChangeStepsByClickingEdgeOfTheScreenUpTo25px = ( export const checkChangeStepsByClickingEdgeOfTheScreenMoreThan25px = ( isTOSAccepted: boolean, - isMobile = false, + isMobileOrTablet = false, ): void => { checkCurrentElement(0, true); @@ -121,7 +121,7 @@ export const checkChangeStepsByClickingEdgeOfTheScreenMoreThan25px = ( { clientX: leftEdgeX + 25, el: 0 }, ].forEach(({ clientX, el }) => { cy.get('[data-test=ModalOnboarding]').click(clientX, element.height()! / 2, { - force: isMobile, + force: isMobileOrTablet, }); checkCurrentElement(el, isTOSAccepted || el === 0);