From 0e1179735b93f247d4dcebae7fe0ad0bd8eedef2 Mon Sep 17 00:00:00 2001 From: nick theile Date: Wed, 7 Dec 2022 12:48:20 -0600 Subject: [PATCH] feat: e2e testing payments flow (#667) * feat: send payments flow * feat: send payment testProps * feat: add amount test * feat: receive flow * feat: auto grant perms, appium-doctor * chore: mermaid diagram * chore: update docs * fix: android selector swipe * chore: grapqhl lookup walletId * chore: temp circle ci test * chore: temp circle ci e2e-testing-payments * feat: ci with browserstack * fix: iphone device os version * fix: ios timing bugs and device id * chore: update BROWSERSTACK_APP_ID in Fastfile * fix: ios selector SecureTextField * feat: share link invoice for ios * fix: set specific ios version * chore: rename browserstack CircleCI tests * chore: remove circleci test for this branch * feat: trigger e2e on main commit * chore: final code cleanup * chore: cleanup code * chore: ios fastlane cleanup Co-authored-by: daviroo * chore: android fastlane cleanup Co-authored-by: daviroo * chore: fix code check * fix: save changes screen * feat: add scroll helper * fix: save twice * fix: ios allow notification * feat: add env vars for BUILD_VERSION * revert: circleci config * revert: hold off on running e2e browserstack Co-authored-by: daviroo --- .gitignore | 2 + android/browserstack.js | 6 - android/fastlane/Fastfile | 2 +- .../stablesats-modal/stablesats-modal.tsx | 2 + .../move-money-screen/move-money-screen.tsx | 1 + .../receive-bitcoin-screen/qr-view.tsx | 3 +- .../receive-bitcoin-screen/receive-btc.tsx | 11 +- .../send-bitcoin-confirmation-screen.tsx | 2 + .../send-bitcoin-destination-screen.tsx | 3 + .../send-bitcoin-details-screen.tsx | 6 + .../send-bitcoin-success-screen.tsx | 8 +- .../settings-screen/settings-screen.tsx | 7 +- docs/e2e-testing.md | 84 ++- e2e/01-welcome-screen-flow.e2e.spec.ts | 16 +- e2e/02-login-flow.e2e.spec.ts | 64 +- e2e/03-payments-flow.e2e.spec.ts | 132 ++++ e2e/04-payments-receive-flow.e2e.spec.ts | 152 +++++ e2e/config/browserstack.conf.js | 24 +- e2e/config/wdio.conf.js | 12 +- e2e/utils/go-back.ts | 2 +- e2e/utils/index.ts | 1 + e2e/utils/scroll.ts | 15 + e2e/utils/selector.ts | 4 +- e2e/utils/swipe.ts | 28 +- ios/browserstack.js | 6 - ios/fastlane/Fastfile | 4 +- package.json | 6 +- yarn.lock | 617 ++++++++++++++---- 28 files changed, 1020 insertions(+), 200 deletions(-) create mode 100644 e2e/03-payments-flow.e2e.spec.ts create mode 100644 e2e/04-payments-receive-flow.e2e.spec.ts create mode 100644 e2e/utils/scroll.ts diff --git a/.gitignore b/.gitignore index 1b7543f5bf..6b4d1b2b3c 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,5 @@ ios/GoogleService-Info.plist .yalc yalc.lock + +*.log diff --git a/android/browserstack.js b/android/browserstack.js index c5526a5727..8755fb3a1b 100644 --- a/android/browserstack.js +++ b/android/browserstack.js @@ -33,25 +33,19 @@ exports.config = { }, onPrepare: (config, capabilities) => { - console.log("Connecting local"); return new Promise((resolve, reject) => { exports.bs_local = new browserstack.Local(); exports.bs_local.start({ 'key': exports.config.key }, (error) => { if (error) return reject(error); - console.log('Connected. Now testing...'); - resolve(); }); }); }, onComplete: (capabilties, specs) => { - console.log("Closing local tunnel"); return new Promise((resolve, reject) => { exports.bs_local.stop((error) => { if (error) return reject(error); - console.log("Stopped BrowserStackLocal"); - resolve(); }); }); diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index 11094bfdd7..285c9ba9f8 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -78,7 +78,7 @@ platform :android do browserstack_access_key: ENV["BROWSERSTACK_ACCESS_KEY"], file_path: lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH], ) - sh("npx wdio ../browserstack.js") + # sh("GALOY_TOKEN=$GALOY_TOKEN && GALOY_TOKEN_2=$GALOY_TOKEN_2 && yarn test:browserstack:android") end desc "Build for end to end testing" diff --git a/app/components/stablesats-modal/stablesats-modal.tsx b/app/components/stablesats-modal/stablesats-modal.tsx index 251a281f7b..bbd2b7fec0 100644 --- a/app/components/stablesats-modal/stablesats-modal.tsx +++ b/app/components/stablesats-modal/stablesats-modal.tsx @@ -7,6 +7,7 @@ import EStyleSheet from "react-native-extended-stylesheet" import Modal from "react-native-modal" import StableSatsImage from "../../assets/images/stable-sats.png" import { useI18nContext } from "@app/i18n/i18n-react" +import { testProps } from "../../../utils/testProps" const styles = EStyleSheet.create({ imageContainer: { @@ -98,6 +99,7 @@ export const StableSatsModal: React.FC = () => {