Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCT-1396: Implement an onscreen route back to onboarding if users accidentally close it #164

Merged
merged 34 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3627d1a
oct-1396: onboarding progress draft
jmikolajczyk Apr 16, 2024
e6ff8f0
oct-1396: onboarding stepper + e2e
jmikolajczyk Apr 18, 2024
19bfd18
Merge branch 'master' into feature/oct-1396-onboarding-progress
jmikolajczyk Apr 18, 2024
c0d7091
oct-1396: slide.png to slide.webp
jmikolajczyk Apr 18, 2024
53bbd55
oct-1396: adjustment for mobile devices
jmikolajczyk Apr 18, 2024
3818c5a
oct-1396: adjustment for mobile devices - higher
jmikolajczyk Apr 18, 2024
d60419a
Merge branch 'master' into feature/oct-1396-onboarding-progress
jmikolajczyk Apr 23, 2024
221ef39
oct-1396: e2e: hasOnboardingBeenClosed=true
jmikolajczyk Apr 23, 2024
4a99039
Merge branch 'master' into feature/oct-1396-onboarding-progress
jmikolajczyk Apr 24, 2024
d66388c
Merge branch 'master' into feature/oct-1396-onboarding-progress
jmikolajczyk Apr 24, 2024
bfb2e83
oct-1396: e2e AW open
jmikolajczyk Apr 24, 2024
764c96b
oct-1396: split onboarding e2e
jmikolajczyk Apr 25, 2024
cec5b89
oct-1396: e2e fix
jmikolajczyk Apr 25, 2024
95d6cd0
oct-1396: onboarding steps e2e fix
jmikolajczyk Apr 25, 2024
28db523
oct-1396: onboarding e2e - AW open
jmikolajczyk Apr 25, 2024
7cc756b
Merge branch 'master' into feature/oct-1396-onboarding-progress
jmikolajczyk Apr 26, 2024
915ab20
OCT-1396: move time onboarding once
jmikolajczyk Apr 26, 2024
466a058
OCT-1396: ModalOnboarding - change not.be.visible to not.exist
jmikolajczyk Apr 26, 2024
26347c3
OCT-1396: e2e test 1
jmikolajczyk Apr 26, 2024
3afdead
OCT-1396: e2e test 2
jmikolajczyk Apr 26, 2024
8f88341
OCT-1396: e2e test 3
jmikolajczyk Apr 26, 2024
8d89954
OCT-1396: e2e test 4
jmikolajczyk Apr 26, 2024
3a58661
Merge branch 'master' into feature/oct-1396-onboarding-progress
jmikolajczyk Apr 29, 2024
9de7c70
OCT-1396: e2e test 5
jmikolajczyk Apr 29, 2024
a9d7683
OCT-1396: e2e test 6
jmikolajczyk Apr 29, 2024
540b9eb
OCT-1396: e2e fix - connect wallet + wait
jmikolajczyk Apr 29, 2024
1919113
Merge branch 'master' into feature/oct-1396-onboarding-progress
jmikolajczyk Apr 30, 2024
24a9997
Merge branch 'master' into feature/oct-1396-onboarding-progress
aziolek May 1, 2024
b049d64
oct-1396: e2e projects.cy fix
jmikolajczyk May 2, 2024
6c8e201
oct-1396: e2e projects.cy test 1
jmikolajczyk May 2, 2024
dd0f09f
Merge branch 'master' into feature/oct-1396-onboarding-progress
aziolek May 3, 2024
ad3441c
oct-1396: e2e onboardingTOSAccepted fix
jmikolajczyk May 5, 2024
93dc7da
Merge branch 'master' into feature/oct-1396-onboarding-progress
jmikolajczyk May 8, 2024
a456021
oct-1396: cr fixes
jmikolajczyk May 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion client/cypress/e2e/_2makePendingSnapshot.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { mockCoinPricesServer, visitWithLoader } from 'cypress/utils/e2e';
import { mutateAsyncMakeSnapshot } from 'cypress/utils/moveTime';
import { IS_ONBOARDING_ALWAYS_VISIBLE, IS_ONBOARDING_DONE } from 'src/constants/localStorageKeys';
import {
HAS_ONBOARDING_BEEN_CLOSED,
IS_ONBOARDING_ALWAYS_VISIBLE,
IS_ONBOARDING_DONE,
} from 'src/constants/localStorageKeys';
import { ROOT_ROUTES } from 'src/routes/RootRoutes/routes';

// In E2E snapshotter is disabled. Before the first test can be run, pending snapshot needs to be done.
Expand All @@ -19,6 +23,7 @@ describe('Make pending snapshot', () => {
mockCoinPricesServer();
localStorage.setItem(IS_ONBOARDING_ALWAYS_VISIBLE, 'false');
localStorage.setItem(IS_ONBOARDING_DONE, 'true');
localStorage.setItem(HAS_ONBOARDING_BEEN_CLOSED, 'true');
visitWithLoader(ROOT_ROUTES.playground.absolute);
});

Expand Down
2 changes: 2 additions & 0 deletions client/cypress/e2e/allocationItemWindowClosed.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import viewports from 'cypress/utils/viewports';
import { QUERY_KEYS } from 'src/api/queryKeys';
import {
ALLOCATION_ITEMS_KEY,
HAS_ONBOARDING_BEEN_CLOSED,
IS_ONBOARDING_ALWAYS_VISIBLE,
IS_ONBOARDING_DONE,
} from 'src/constants/localStorageKeys';
Expand Down Expand Up @@ -57,6 +58,7 @@ describe('allocation (allocation window closed)', () => {
mockCoinPricesServer();
localStorage.setItem(IS_ONBOARDING_ALWAYS_VISIBLE, 'false');
localStorage.setItem(IS_ONBOARDING_DONE, 'true');
localStorage.setItem(HAS_ONBOARDING_BEEN_CLOSED, 'true');
localStorage.setItem(ALLOCATION_ITEMS_KEY, '[]');
visitWithLoader(ROOT_ROUTES.projects.absolute);

Expand Down
2 changes: 2 additions & 0 deletions client/cypress/e2e/allocationItemWindowOpen.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import viewports from 'cypress/utils/viewports';
import { QUERY_KEYS } from 'src/api/queryKeys';
import {
ALLOCATION_ITEMS_KEY,
HAS_ONBOARDING_BEEN_CLOSED,
IS_ONBOARDING_ALWAYS_VISIBLE,
IS_ONBOARDING_DONE,
} from 'src/constants/localStorageKeys';
Expand Down Expand Up @@ -64,6 +65,7 @@ describe('allocation (allocation window open)', () => {
mockCoinPricesServer();
localStorage.setItem(IS_ONBOARDING_ALWAYS_VISIBLE, 'false');
localStorage.setItem(IS_ONBOARDING_DONE, 'true');
localStorage.setItem(HAS_ONBOARDING_BEEN_CLOSED, 'true');
localStorage.setItem(ALLOCATION_ITEMS_KEY, '[]');
visitWithLoader(ROOT_ROUTES.projects.absolute);
connectWallet(true, false);
Expand Down
8 changes: 7 additions & 1 deletion client/cypress/e2e/allocationRewardsBox.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import chaiColors from 'chai-colors';

import { visitWithLoader, mockCoinPricesServer, connectWallet } from 'cypress/utils/e2e';
import viewports from 'cypress/utils/viewports';
import { IS_ONBOARDING_ALWAYS_VISIBLE, IS_ONBOARDING_DONE } from 'src/constants/localStorageKeys';
import {
HAS_ONBOARDING_BEEN_CLOSED,
IS_ONBOARDING_ALWAYS_VISIBLE,
IS_ONBOARDING_DONE,
} from 'src/constants/localStorageKeys';
import { ROOT_ROUTES } from 'src/routes/RootRoutes/routes';

chai.use(chaiColors);
Expand All @@ -16,6 +20,7 @@ Object.values(viewports).forEach(({ device, viewportWidth, viewportHeight }) =>
beforeEach(() => {
localStorage.setItem(IS_ONBOARDING_ALWAYS_VISIBLE, 'false');
localStorage.setItem(IS_ONBOARDING_DONE, 'true');
localStorage.setItem(HAS_ONBOARDING_BEEN_CLOSED, 'true');
visitWithLoader(ROOT_ROUTES.allocation.absolute);
});

Expand Down Expand Up @@ -108,6 +113,7 @@ Object.values(viewports).forEach(({ device, viewportWidth, viewportHeight }) =>
mockCoinPricesServer();
localStorage.setItem(IS_ONBOARDING_ALWAYS_VISIBLE, 'false');
localStorage.setItem(IS_ONBOARDING_DONE, 'true');
localStorage.setItem(HAS_ONBOARDING_BEEN_CLOSED, 'true');
visitWithLoader(ROOT_ROUTES.allocation.absolute);
cy.intercept('GET', '/rewards/budget/*/epoch/*', { body: { budget: '10000000000' } });
connectWallet(true, false);
Expand Down
35 changes: 15 additions & 20 deletions client/cypress/e2e/earn.cy.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
import { visitWithLoader, mockCoinPricesServer } from 'cypress/utils/e2e';
import { visitWithLoader, mockCoinPricesServer, connectWallet } from 'cypress/utils/e2e';
import { moveTime } from 'cypress/utils/moveTime';
import viewports from 'cypress/utils/viewports';
import { IS_ONBOARDING_ALWAYS_VISIBLE, IS_ONBOARDING_DONE } from 'src/constants/localStorageKeys';
import {
HAS_ONBOARDING_BEEN_CLOSED,
IS_ONBOARDING_ALWAYS_VISIBLE,
IS_ONBOARDING_DONE,
} from 'src/constants/localStorageKeys';
import { ROOT_ROUTES } from 'src/routes/RootRoutes/routes';

import Chainable = Cypress.Chainable;

const connectWallet = (): Chainable => {
cy.intercept('GET', '/user/*/tos', { body: { accepted: true } });
cy.get('[data-test=MainLayout__Button--connect]').click();
cy.get('[data-test=ConnectWallet__BoxRounded--browserWallet]').click();
cy.acceptMetamaskAccess();
return cy.switchToCypressWindow();
};

Object.values(viewports).forEach(({ device, viewportWidth, viewportHeight, isDesktop }, idx) => {
describe(`earn: ${device}`, { viewportHeight, viewportWidth }, () => {
before(() => {
Expand All @@ -30,6 +24,7 @@ Object.values(viewports).forEach(({ device, viewportWidth, viewportHeight, isDes
mockCoinPricesServer();
localStorage.setItem(IS_ONBOARDING_ALWAYS_VISIBLE, 'false');
localStorage.setItem(IS_ONBOARDING_DONE, 'true');
localStorage.setItem(HAS_ONBOARDING_BEEN_CLOSED, 'true');
visitWithLoader(ROOT_ROUTES.earn.absolute);
});

Expand Down Expand Up @@ -73,18 +68,18 @@ Object.values(viewports).forEach(({ device, viewportWidth, viewportHeight, isDes
}

it('Wallet connected: "Lock GLM" / "Edit Locked GLM" button is active', () => {
connectWallet();
connectWallet(true, false);
cy.get('[data-test=BoxGlmLock__Button]').should('not.be.disabled');
});

it('Wallet connected: "Lock GLM" / "Edit Locked GLM" button opens "ModalGlmLock"', () => {
connectWallet();
connectWallet(true, false);
cy.get('[data-test=BoxGlmLock__Button]').click();
cy.get('[data-test=ModalGlmLock]').should('be.visible');
});

it('Wallet connected: "ModalGlmLock" has overflow', () => {
connectWallet();
connectWallet(true, false);
cy.get('[data-test=BoxGlmLock__Button]').click();
cy.get('[data-test=ModalGlmLock__overflow]').should('exist');
});
Expand All @@ -94,7 +89,7 @@ Object.values(viewports).forEach(({ device, viewportWidth, viewportHeight, isDes
* In EarnGlmLock there are multiple autofocus rules set.
* This test checks if user is still able to type without any autofocus disruption.
*/
connectWallet();
connectWallet(true, false);
cy.get('[data-test=BoxGlmLock__Button]').click();
cy.get('[data-test=ModalGlmLock]').should('be.visible');
cy.get('[data-test=InputsCryptoFiat__InputText--crypto]').should('have.focus');
Expand All @@ -106,7 +101,7 @@ Object.values(viewports).forEach(({ device, viewportWidth, viewportHeight, isDes
});

it('Wallet connected: "ModalGlmLock" - changing tabs keep focus on first input', () => {
connectWallet();
connectWallet(true, false);
cy.get('[data-test=BoxGlmLock__Button]').click();
cy.get('[data-test=ModalGlmLock]').should('be.visible');
cy.get('[data-test=InputsCryptoFiat__InputText--crypto]').should('have.focus');
Expand All @@ -117,7 +112,7 @@ Object.values(viewports).forEach(({ device, viewportWidth, viewportHeight, isDes
});

it('Wallet connected: Lock 1 GLM', () => {
connectWallet();
connectWallet(true, false);

cy.get('[data-test=BoxGlmLock__Section--current__DoubleValue__primary]')
.invoke('text')
Expand Down Expand Up @@ -169,7 +164,7 @@ Object.values(viewports).forEach(({ device, viewportWidth, viewportHeight, isDes
});

it('Wallet connected: Unlock 1 GLM', () => {
connectWallet();
connectWallet(true, false);

cy.get('[data-test=BoxGlmLock__Section--current__DoubleValue__primary]')
.invoke('text')
Expand Down Expand Up @@ -216,7 +211,7 @@ Object.values(viewports).forEach(({ device, viewportWidth, viewportHeight, isDes
});

it('Wallet connected: Effective deposit after locking 1000 GLM and moving epoch is equal to current deposit', () => {
connectWallet();
connectWallet(true, false);

cy.get('[data-test=BoxGlmLock__Section--current__DoubleValue__primary]')
.invoke('text')
Expand Down
7 changes: 6 additions & 1 deletion client/cypress/e2e/layout.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { navigateWithCheck, mockCoinPricesServer } from 'cypress/utils/e2e';
import viewports from 'cypress/utils/viewports';
import { IS_ONBOARDING_ALWAYS_VISIBLE, IS_ONBOARDING_DONE } from 'src/constants/localStorageKeys';
import {
HAS_ONBOARDING_BEEN_CLOSED,
IS_ONBOARDING_ALWAYS_VISIBLE,
IS_ONBOARDING_DONE,
} from 'src/constants/localStorageKeys';
import { navigationTabs } from 'src/constants/navigationTabs/navigationTabs';
import { ROOT, ROOT_ROUTES } from 'src/routes/RootRoutes/routes';

Expand All @@ -16,6 +20,7 @@ Object.values(viewports).forEach(({ device, viewportWidth, viewportHeight }) =>
cy.disconnectMetamaskWalletFromAllDapps();
localStorage.setItem(IS_ONBOARDING_ALWAYS_VISIBLE, 'false');
localStorage.setItem(IS_ONBOARDING_DONE, 'true');
localStorage.setItem(HAS_ONBOARDING_BEEN_CLOSED, 'true');
cy.visit(ROOT.absolute);
});

Expand Down
7 changes: 6 additions & 1 deletion client/cypress/e2e/metrics.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { mockCoinPricesServer, visitWithLoader } from 'cypress/utils/e2e';
import viewports from 'cypress/utils/viewports';
import { IS_ONBOARDING_ALWAYS_VISIBLE, IS_ONBOARDING_DONE } from 'src/constants/localStorageKeys';
import {
HAS_ONBOARDING_BEEN_CLOSED,
IS_ONBOARDING_ALWAYS_VISIBLE,
IS_ONBOARDING_DONE,
} from 'src/constants/localStorageKeys';
import { ROOT_ROUTES } from 'src/routes/RootRoutes/routes';

Object.values(viewports).forEach(({ device, viewportWidth, viewportHeight, isDesktop }) => {
Expand All @@ -18,6 +22,7 @@ Object.values(viewports).forEach(({ device, viewportWidth, viewportHeight, isDes
mockCoinPricesServer();
localStorage.setItem(IS_ONBOARDING_ALWAYS_VISIBLE, 'false');
localStorage.setItem(IS_ONBOARDING_DONE, 'true');
localStorage.setItem(HAS_ONBOARDING_BEEN_CLOSED, 'true');
visitWithLoader(ROOT_ROUTES.metrics.absolute);
});

Expand Down
Loading