Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
added some new steps to onboarding
Browse files Browse the repository at this point in the history
  • Loading branch information
ggilchrist-ledger committed Apr 25, 2022
1 parent 4d6fc44 commit 0bd1451
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 28 deletions.
53 changes: 31 additions & 22 deletions e2e/models/onboarding/onboardingSteps.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,55 @@ import * as testHelpers from "../../helpers";

export default class OnboardingSteps {
static async waitForPageToBeVisible() {
await testHelpers.waitForElement("Proceed");
await testHelpers.waitForElement("Onboarding - Start");
}

static async getStarted() {
await testHelpers.tap("Proceed");
await testHelpers.tap("Onboarding - Start");
}

static async acceptTerms() {
await testHelpers.tap("TermsAcceptSwitch");
await testHelpers.tap("Proceed");
static async chooseToSetupLedger() {
await testHelpers.tap("Onboarding PostWelcome - Selection|SetupLedger");
}

// static async acceptTerms() {
// await testHelpers.tap("TermsAcceptSwitch");
// await testHelpers.tap("Proceed");
// }

static async selectDevice(device) {
await testHelpers.tap(`Onboarding Device - Selection|${device}`);
}

static async connectYourNano(device) {
await testHelpers.scrollToElementById(
`Onboarding - Connect|${device}`,
"UseCaseSelectScrollView",
200,
"down",
NaN,
0.5,
);

await testHelpers.tap(`Onboarding - Connect|${device}`);
static async connectYourNano() {
// scroll probably not needed now
// await testHelpers.scrollToElementById(
// `Onboarding - Connect|${device}`,
// "UseCaseSelectScrollView",
// 200,
// "down",
// NaN,
// 0.5,
// );

await testHelpers.tap(`Onboarding - Connect`);
}

static async acceptSeedWarning() {
await testHelpers.delay(1000);
static async checkTheContentsOfThisBox() {
// await testHelpers.delay(1000);
await testHelpers.tap("Onboarding - Seed warning");
}

static async startPairing() {
await testHelpers.tap("OnboardingStemPairNewContinue");
static async letsPairMyNano() {
await testHelpers.tap("Onboarding - Pair New Nano");
}

static async addNewNano() {
await testHelpers.tap("Proceed");
// static async addNewNano() {
// await testHelpers.tap("Proceed");
// }

static async pairWithBluetooth() {
await testHelpers.tap("Onboarding - Pair with Bluetooth");
}

static async addDeviceViaBluetooth() {
Expand Down
10 changes: 6 additions & 4 deletions e2e/specs/onboarding.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ describe("Onboarding", () => {
console.log("==============> STARTING ONBOARDING TEST");
await OnboardingSteps.waitForPageToBeVisible();
await OnboardingSteps.getStarted();
await OnboardingSteps.acceptTerms();
// await OnboardingSteps.acceptTerms();
await OnboardingSteps.chooseToSetupLedger();
await OnboardingSteps.selectDevice("nanoX");
await OnboardingSteps.connectYourNano("nanoX");
await OnboardingSteps.acceptSeedWarning();
await OnboardingSteps.connectYourNano();
await OnboardingSteps.checkTheContentsOfThisBox();
await OnboardingSteps.startPairing();
await OnboardingSteps.addNewNano();
// await OnboardingSteps.addNewNano();
await OnboardingSteps.pairWithBluetooth();
await OnboardingSteps.addDeviceViaBluetooth();
await OnboardingSteps.openLedgerLive();

Expand Down
8 changes: 7 additions & 1 deletion src/components/SelectDevice/BluetoothEmpty.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ function BluetoothEmpty({ onPairNewDevice, hideAnimation }: Props) {
</Text>
</Box>
</Flex>
<Button mb={8} event="PairDevice" type="main" onPress={onPairNewDevice}>
<Button
mb={8}
event="PairDevice"
type="main"
onPress={onPairNewDevice}
testID="Onboarding - Pair with Bluetooth"
>
<Trans i18nKey="SelectDevice.deviceNotFoundPairNewDevice" />
</Button>
</>
Expand Down
1 change: 1 addition & 0 deletions src/components/SelectDevice/DeviceItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ function DeviceItem({
Icon={CustomIcon || NanoFoldedMedium}
renderRight={onMore ? renderOnMore : undefined}
disabled={disabled}
testID={`DeviceItemEnter ${deviceMeta.deviceName ?? ""}`}
>
{deviceMeta.deviceName}
{description && (
Expand Down
7 changes: 6 additions & 1 deletion src/screens/Onboarding/steps/setupDevice/scenes/PairNew.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ const Next = ({
const { t } = useTranslation();

return (
<Button type="main" size="large" onPress={onNext}>
<Button
type="main"
size="large"
onPress={onNext}
testID="Onboarding - Pair New Nano"
>
{t(`onboarding.stepPairNew.${deviceModelId}.cta`)}
</Button>
);
Expand Down
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4839,6 +4839,16 @@ ajv@^8.0.1:
require-from-string "^2.0.2"
uri-js "^4.2.2"

ajv@^8.6.3:
version "8.11.0"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.11.0.tgz#977e91dd96ca669f54a11e23e378e33b884a565f"
integrity sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==
dependencies:
fast-deep-equal "^3.1.1"
json-schema-traverse "^1.0.0"
require-from-string "^2.0.2"
uri-js "^4.2.2"

algo-msgpack-with-bigint@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/algo-msgpack-with-bigint/-/algo-msgpack-with-bigint-2.1.1.tgz#38bb717220525b3ff42232eefdcd9efb9ad405d6"
Expand Down

0 comments on commit 0bd1451

Please sign in to comment.