diff --git a/packages/common/src/analytics/types.ts b/packages/common/src/analytics/types.ts index fecddbe5a8..e9b99ce162 100644 --- a/packages/common/src/analytics/types.ts +++ b/packages/common/src/analytics/types.ts @@ -203,7 +203,7 @@ export enum PostHogAction { SettingsCurrencySelectCurrencyClick = 'settings | currency | select currency | click', SettingsCurrencyXClick = 'settings | currency | x | click', SettingsBetaProgramOptInClick = 'settings | beta program | opt-in | click', - SettingsBetaProgramOptOutClick = 'settings | beta program | opt-out |click', + SettingsBetaProgramOptOutClick = 'settings | beta program | opt-out | click', SettingsThemeLightModeClick = 'settings | theme | light mode | click', SettingsThemeDarkModeClick = 'settings | theme | dark mode | click', SettingsShowRecoveryPhraseClick = 'settings | show recovery phrase | click', diff --git a/packages/e2e-tests/src/assert/settings/SettingsPageAssert.ts b/packages/e2e-tests/src/assert/settings/SettingsPageAssert.ts index e74cc92abe..1a6ea93b13 100644 --- a/packages/e2e-tests/src/assert/settings/SettingsPageAssert.ts +++ b/packages/e2e-tests/src/assert/settings/SettingsPageAssert.ts @@ -23,6 +23,18 @@ class SettingsPageAssert { expect(await SettingsPage.collateralLink.getTitleText()).to.equal( await t('browserView.settings.wallet.collateral.title') ); + expect(await SettingsPage.hdWalletSyncLink.getTitleText()).to.equal( + await t('browserView.settings.wallet.walletSync.title') + ); + expect(await SettingsPage.currencyLink.getTitleText()).to.equal( + await t('browserView.settings.preferences.currency.title') + ); + expect(await SettingsPage.themeLink.getTitleText()).to.equal( + await t('browserView.settings.preferences.theme.title') + ); + expect(await SettingsPage.betaProgramLink.getTitleText()).to.equal( + await t('browserView.settings.preferences.betaProgram.title') + ); expect(await SettingsPage.showRecoveryPhraseLink.getTitleText()).to.equal( await t('browserView.settings.security.showPassphrase.title') ); @@ -65,6 +77,18 @@ class SettingsPageAssert { expect(await SettingsPage.collateralLink.getDescriptionText()).to.equal( await t('browserView.settings.wallet.collateral.description') ); + expect(await SettingsPage.hdWalletSyncLink.getDescriptionText()).to.equal( + await t('browserView.settings.wallet.walletSync.description') + ); + expect(await SettingsPage.currencyLink.getDescriptionText()).to.equal( + await t('browserView.settings.preferences.currency.description') + ); + expect(await SettingsPage.themeLink.getDescriptionText()).to.equal( + await t('browserView.settings.preferences.theme.description') + ); + expect(await SettingsPage.betaProgramLink.getDescriptionText()).to.equal( + await t('browserView.settings.preferences.betaProgram.description') + ); expect(await SettingsPage.showRecoveryPhraseLink.getDescriptionText()).to.equal( await t('browserView.settings.security.showPassphrase.description') ); diff --git a/packages/e2e-tests/src/elements/settings/SettingsPage.ts b/packages/e2e-tests/src/elements/settings/SettingsPage.ts index d2e1d36d4b..4e10178961 100644 --- a/packages/e2e-tests/src/elements/settings/SettingsPage.ts +++ b/packages/e2e-tests/src/elements/settings/SettingsPage.ts @@ -25,6 +25,7 @@ class SettingsPage extends CommonDrawerElements { private readonly COLLATERAL_LINK_TEST_ID = 'settings-wallet-collateral-link'; private readonly CUSTOM_SUBMIT_API_LINK_TEST_ID = 'settings-wallet-custom-submit-api-link'; private readonly THEME_SWITCH_TEST_ID = '[data-testid="switch"]'; + private readonly BETA_PROGRAM_SWITCH_TEST_ID = '[data-testid="settings-beta-program-switch"]'; private readonly SHOW_RECOVERY_PHRASE_LINK_TEST_ID = 'settings-show-recovery-phrase-link'; private readonly GENERATE_PAPER_WALLET_LINK_TEST_ID = 'settings-generate-paperwallet-link'; private readonly PASSPHRASE_VERIFICATION_LINK_TEST_ID = 'settings-passphrase-verification-link'; @@ -34,6 +35,10 @@ class SettingsPage extends CommonDrawerElements { private readonly TNC_LINK_TEST_ID = 'settings-legal-tnc-link'; private readonly PRIVACY_POLICY_LINK_TEST_ID = 'settings-legal-privacy-policy-link'; private readonly COOKIE_POLICY_LINK_TEST_ID = 'settings-legal-cookie-policy-link'; + private readonly WALLET_SYNC_LINK_TEST_ID = 'settings-wallet-wallet-sync'; + private readonly CURRENCY_LINK_TEST_ID = 'settings-wallet-currency-link'; + private readonly THEME_LINK_TEST_ID = 'settings-wallet-theme'; + private readonly BETA_PROGRAM_LINK_TEST_ID = 'settings-beta-program-section'; get aboutLaceWidget(): typeof AboutLaceWidget { return AboutLaceWidget; @@ -88,6 +93,22 @@ class SettingsPage extends CommonDrawerElements { return new SettingsLink(this.COLLATERAL_LINK_TEST_ID); } + get hdWalletSyncLink() { + return new SettingsLink(this.WALLET_SYNC_LINK_TEST_ID); + } + + get currencyLink() { + return new SettingsLink(this.CURRENCY_LINK_TEST_ID); + } + + get themeLink() { + return new SettingsLink(this.THEME_LINK_TEST_ID); + } + + get betaProgramLink() { + return new SettingsLink(this.BETA_PROGRAM_LINK_TEST_ID); + } + get customSubmitAPILink() { return new SettingsLink(this.CUSTOM_SUBMIT_API_LINK_TEST_ID); } @@ -140,6 +161,10 @@ class SettingsPage extends CommonDrawerElements { return $(this.THEME_SWITCH_TEST_ID); } + get betaProgramSwitch(): ChainablePromiseElement { + return $(this.BETA_PROGRAM_SWITCH_TEST_ID); + } + get securitySettingsElements(): ChainablePromiseArray { return $$(this.SECURITY_SETTINGS_ELEMENTS); } @@ -152,6 +177,11 @@ class SettingsPage extends CommonDrawerElements { await this.syncButton.waitForClickable(); await this.syncButton.click(); } + + async clickBetaProgramSwitch(): Promise { + await this.betaProgramSwitch.waitForClickable(); + await this.betaProgramSwitch.click(); + } } export default new SettingsPage(); diff --git a/packages/e2e-tests/src/features/analytics/AnalyticsSettingsExtended.feature b/packages/e2e-tests/src/features/analytics/AnalyticsSettingsExtended.feature index cb3087a1e2..ea2e54832a 100644 --- a/packages/e2e-tests/src/features/analytics/AnalyticsSettingsExtended.feature +++ b/packages/e2e-tests/src/features/analytics/AnalyticsSettingsExtended.feature @@ -184,6 +184,16 @@ Feature: Analytics - Settings - Extended View Then I validate latest analytics single event "settings | custom submit api | enable | click" And I validate that 2 analytics event(s) have been sent + @LW-11798 + Scenario: Analytics - Extended View - Beta Program - opt-in/opt-out + When I open settings from header menu + And I set up request interception for posthog analytics request(s) + And I click on "Beta Program" switch + Then I validate latest analytics single event "settings | beta program | opt-in | click" + When I click on "Beta Program" switch + Then I validate latest analytics single event "settings | beta program | opt-out | click" + And I validate that 2 analytics event(s) have been sent + # this test should be executed as the last one in this suite @LW-8559 Scenario: Analytics - Extended View - Settings - Wallet removal events - Remove wallet diff --git a/packages/e2e-tests/src/features/analytics/AnalyticsSettingsPopup.feature b/packages/e2e-tests/src/features/analytics/AnalyticsSettingsPopup.feature index 3c34211829..55d0b892c4 100644 --- a/packages/e2e-tests/src/features/analytics/AnalyticsSettingsPopup.feature +++ b/packages/e2e-tests/src/features/analytics/AnalyticsSettingsPopup.feature @@ -191,6 +191,16 @@ Feature: Analytics - Settings - Popup View Then I validate latest analytics single event "settings | custom submit api | enable | click" And I validate that 2 analytics event(s) have been sent + @LW-11799 + Scenario: Analytics - Popup View - Beta Program - opt-in/opt-out + When I open settings from header menu + And I set up request interception for posthog analytics request(s) + And I click on "Beta Program" switch + Then I validate latest analytics single event "settings | beta program | opt-in | click" + When I click on "Beta Program" switch + Then I validate latest analytics single event "settings | beta program | opt-out | click" + And I validate that 2 analytics event(s) have been sent + # this test should be executed as the last one in this suite @LW-8571 Scenario: Analytics - Popup View - Settings - Wallet removal events - Remove wallet diff --git a/packages/e2e-tests/src/steps/settingsSteps.ts b/packages/e2e-tests/src/steps/settingsSteps.ts index 5979587fdc..d0ff156aec 100644 --- a/packages/e2e-tests/src/steps/settingsSteps.ts +++ b/packages/e2e-tests/src/steps/settingsSteps.ts @@ -400,3 +400,7 @@ Then( await SaveYourPaperWalletDrawerAssert.assertSeeSaveYourPaperWalletPage(expectedPaperWalletName); } ); + +When(/^I click on "Beta Program" switch$/, async () => { + await SettingsPage.clickBetaProgramSwitch(); +});