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

Login 2FA / no 2FA / create account maestro flows #4205

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -7,3 +7,6 @@ indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[maestro/**/*.yaml]
indent_size = 4
2 changes: 2 additions & 0 deletions maestro/02-launch-login/C310-launch-no-crash.yaml
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@
# 1. User is able to open Edge without crashing

appId: co.edgesecure.app
tags:
- launch
---
- runFlow:
file: ../common/launch.yaml
5 changes: 3 additions & 2 deletions maestro/02-launch-login/C311-relaunch-no-crash.yaml
Original file line number Diff line number Diff line change
@@ -5,11 +5,12 @@
# 1. Edge should not crash when relaunching the App

appId: co.edgesecure.app
tags:
- launch
- crash
---
- runFlow:
file: ../common/launch.yaml

- pressKey: home

- runFlow:
file: ../common/launch.yaml
39 changes: 39 additions & 0 deletions maestro/02-launch-login/C314-login-no-2fa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Priority: Critical
# Test ID: C314
# Title: Login with Username and Password
# Expected Result:
# 1. User is able to login to a their account without being IP2FA blocked

appId: co.edgesecure.app
tags:
- login
---

# Launch, hopefully with the correct account already logged in
- runFlow: ../common/launch.yaml
- runScript: ../env.js

- runFlow:
when:
visible: Security Alerts
file: ../common/close-modal-hack.yaml

# Check we are logged into the correct account
- assertVisible: "${output.logins.C314.USERNAME}"

- runFlow:
when:
visible: Exit PIN
file: ../common/exit-pin-login.yaml

# Login scene
- assertVisible: Username

- pressKey: Enter
- inputText: ${output.logins.C314.PASSWORD}
- pressKey: Enter

# Wait for the wallets to appear
- extendedWaitUntil:
visible: LTC C314
timeout: 30000
79 changes: 79 additions & 0 deletions maestro/02-launch-login/C431-create-account.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Priority: Critical
# Test ID: C431
# Title: Account will successfully create and goes to wallets list screen
# Expected Result:
# 1. Tapping Create takes user to new Wallet List Scene with:
# - BTC
# - ETH
# - LTC
# - BCH
# - DASH

appId: co.edgesecure.app
tags:
- create
- account
---
- runFlow:
file: ../common/launch-cleared.yaml
- runFlow:
when:
visible: Security Alerts
file: ../common/cancel.yaml
- tapOn: Create account
- assertVisible: Username
- tapOn: Username
- inputText: test-
- inputRandomText
- pressKey: Enter
- extendedWaitUntil:
notVisible: Choose Username
timeout: 10000
- tapOn: Password
- inputText: Test123456
- pressKey: Enter
- tapOn: Confirm Password
- inputText: Test123456
- pressKey: Enter
- inputText: 1111
- pressKey: Enter
- tapOn: Next
- tapOn: I understand that my funds are held securely on this device, not by Edge
- tapOn: I understand that if I lose this device or uninstall the app, my digital assets can only be recovered with my username and password
- tapOn: I understand that if I lose my username and password, Edge will not be able to recover my account, unless I set up password recovery
- tapOn: I understand that I am responsible for safekeeping of my passwords, private key pairs, PIN, and any other codes to access the software. Edge is not responsible if my information is compromised or accessed by a 3rd party where funds are lost
- tapOn: Confirm
- tapOn: Create
- assertVisible: Choose Wallets to Add

# Allow notifications
- runFlow:
when:
visible: Security is Our Priority
file: ../common/enable-notifications.yaml

# Pin scene
- inputText: 1111

- extendedWaitUntil:
visible: BTC
timeout: 15000

- tapOn:
point: 50%,95%

- extendedWaitUntil:
visible: My Bitcoin
timeout: 60000
- extendedWaitUntil:
visible: My Bitcoin Cash
timeout: 60000
- extendedWaitUntil:
visible: My Dash
timeout: 60000
- extendedWaitUntil:
visible: My Ether
timeout: 60000
- extendedWaitUntil:
visible: My Litecoin
timeout: 60000
43 changes: 43 additions & 0 deletions maestro/02-launch-login/C753-login-2fa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Priority: Critical
# Test ID: C314
# Title: Login with Username and Password
# Expected Result:
# 1. User is able to login with a valid Username + Password + Backup Code

appId: co.edgesecure.app
tags:
- login
- 2fa
---
- runFlow:
file: ../common/launch-cleared.yaml
- runScript: ../env.js

# Landing scene
- tapOn: Already have an account? Sign in

# Username
- tapOn:
id: usernameFormField
optional: true
- inputText: ${output.logins.C753.USERNAME}
- pressKey: Enter

# Password
- tapOn:
id: passwordFormField
optional: true
- inputText: ${output.logins.C753.PASSWORD}
- pressKey: Enter

# 2FA - Backup code option
- tapOn: Enter Backup Code
- inputText: ${output.logins.C753.BACKUP_CODE}
- tapOn:
text: Submit
retryTapIfNoChange: false

# Wallet list scene
- extendedWaitUntil:
visible: LTC C753
timeout: 60000
7 changes: 7 additions & 0 deletions maestro/02-launch-login/entrypoint.yaml
Original file line number Diff line number Diff line change
@@ -4,3 +4,10 @@ appId: co.edgesecure.app
file: C310-launch-no-crash.yaml
- runFlow:
file: C311-relaunch-no-crash.yaml
- runFlow:
file: C753-login-2fa.yaml
- runFlow:
file: C314-login-no-2fa.yaml
- runFlow:
file: C431-create-account.yaml

5 changes: 5 additions & 0 deletions maestro/common/cancel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Checks that the cancel button is visible and taps on it
appId: co.edgesecure.app
---
- assertVisible: 'Cancel'
- tapOn: 'Cancel'
2 changes: 1 addition & 1 deletion maestro/common/close-modal-hack.yaml
Original file line number Diff line number Diff line change
@@ -4,4 +4,4 @@
appId: co.edgesecure.app
---
- tapOn:
point: '0%,50%' # Left side + verticlaly middle edge of the screen
point: '50%,0%' # Top center of screen
15 changes: 15 additions & 0 deletions maestro/common/enable-notifications.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Title: Enable notifications
# Expected Result:
# 1. User is able to enable notifications


appId: co.edgesecure.app
---
- tapOn: "Enable"
# Android system settings
- tapOn: "Notifications"
- assertVisible: "Edge"
- tapOn:
id: "com.android.settings:id/switch_widget"
- back
- back
5 changes: 5 additions & 0 deletions maestro/common/exit-pin-login.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Launches the app with a cleared cache, and waits for the Edge logo to appear.
appId: co.edgesecure.app
---
- assertVisible: Exit PIN
- tapOn: Exit PIN
9 changes: 9 additions & 0 deletions maestro/common/input-2fa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Inputs the
appId: co.edgesecure.app
env:
BACKUP_CODE: ${BACKUP_CODE}
---
- tapOn:
containsChild: Backup Key
- inputText: ${BACKUP_CODE}
- tapOn: Submit
2 changes: 1 addition & 1 deletion maestro/common/launch-cleared.yaml
Original file line number Diff line number Diff line change
@@ -4,6 +4,6 @@ appId: co.edgesecure.app
- launchApp:
clearState: true
- extendedWaitUntil:
visible: 'Edge Logo'
visible: 'App logo'
timeout: 30000
- assertNotVisible: 'Oops!'
2 changes: 1 addition & 1 deletion maestro/common/launch.yaml
Original file line number Diff line number Diff line change
@@ -3,6 +3,6 @@ appId: co.edgesecure.app
---
- launchApp
- extendedWaitUntil:
visible: 'Edge Logo'
visible: 'App logo'
timeout: 30000
- assertNotVisible: 'Oops!'
23 changes: 23 additions & 0 deletions maestro/common/login.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Launches the app with a cleared cache, and logs in with the CREDENTIALS environment variable.
appId: co.edgesecure.app
env:
CREDENTIALS: ${output.CREDENTIALS}
---
- runFlow:
file: launch-cleared.yaml
- assertVisible: "Username"
- tapOn:
id: usernameFormField
- inputText: ${CREDENTIALS.USERNAME}
- tapOn:
id: passwordFormField
- inputText: ${CREDENTIALS.PASSWORD}
- hideKeyboard
- pressKey: Enter
- runFlow:
when:
visible: Two Factor Authentication
file: input-2fa.yaml
env:
BACKUP_CODE: ${CREDENTIALS.BACKUP_CODE}

9 changes: 9 additions & 0 deletions maestro/common/scroll-to-tappable-row.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
appId: co.edgesecure.app
---
- scrollUntilVisible:
element: ${ROW}
direction: "DOWN"
timeout: 1000
speed: 35
visibilityPercentage: 100
- tapOn: ${ROW}
8 changes: 6 additions & 2 deletions src/components/scenes/CreateWalletSelectCryptoScene.tsx
Original file line number Diff line number Diff line change
@@ -202,15 +202,18 @@ const CreateWalletSelectCryptoComponent = (props: Props) => {

const renderCreateWalletRow: ListRenderItem<WalletCreateItem> = useHandler(item => {
const { key, displayName, pluginId, tokenId } = item.item

const value = selectedItems[key]
const toggle = (
<Switch
accessibilityState={{ checked: value }}
accessibilityRole="switch"
accessibilityActions={[{ name: 'toggle' }]}
ios_backgroundColor={theme.toggleButtonOff}
trackColor={{
false: theme.toggleButtonOff,
true: theme.toggleButton
}}
value={selectedItems[key]}
value={value}
onValueChange={() => handleCreateWalletToggle(key)}
/>
)
@@ -219,6 +222,7 @@ const CreateWalletSelectCryptoComponent = (props: Props) => {
<CreateWalletSelectCryptoRow
pluginId={pluginId}
tokenId={tokenId}
key={displayName}
walletName={displayName}
onPress={() => handleCreateWalletToggle(key)}
rightSide={toggle}