Skip to content

Commit

Permalink
chore(llm): 🔍 accept analytics during onboarding tests (#7959)
Browse files Browse the repository at this point in the history
chore(llm): accept analytics during onboarding tests
  • Loading branch information
thesan authored Oct 1, 2024
1 parent 23b2710 commit 94b2e3d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/five-ties-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": patch
---

Accept analytics during onboarding tests
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ import { expect } from "detox";

export default class OnboardingStepsPage {
getStartedButtonId = "onboarding-getStarted-button";
acceptAnalyticsButtonId = "accept-analytics-button";
exploreWithoutDeviceButtonId = "discoverLive-exploreWithoutADevice";
readyToScanButtonID = "onboarding-scan-button";
scanAndImportAccountsPageID = "onboarding-import-accounts-title";
discoverLiveTitle = (index: number) => `onboarding-discoverLive-${index}-title`;
onboardingGetStartedButton = () => getElementById(this.getStartedButtonId);
acceptAnalyticsButton = () => getElementById(this.acceptAnalyticsButtonId);
accessWalletButton = () => getElementById("onboarding-accessWallet");
noLedgerYetButton = () => getElementById("onboarding-noLedgerYet");
exploreAppButton = () => getElementById("onboarding-noLedgerYetModal-explore");
Expand Down Expand Up @@ -64,6 +66,12 @@ export default class OnboardingStepsPage {
async startOnboarding() {
await waitForElementById(this.getStartedButtonId);
await tapByElement(this.onboardingGetStartedButton());
await waitForElementById(new RegExp(`${this.setupLedger}|${this.acceptAnalyticsButtonId}`));
try {
await tapByElement(this.acceptAnalyticsButton());
} catch {
// Analytics prompt not enabled
}
}

// Exploring App
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ function Main({ route, navigation }: Props) {
/>
<Button
title={t("analyticsOptIn.variantA.main.content.ctas.accept")}
testID="accept-analytics-button"
onPress={clickOnAcceptAll}
type="main"
size="large"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ function Main({ route, navigation }: Props) {
/>
<Button
title={t("analyticsOptIn.variantB.main.ctas.share")}
testID="accept-analytics-button"
onPress={clickOnAllowAnalytics}
type="main"
size="large"
Expand Down

0 comments on commit 94b2e3d

Please sign in to comment.