-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(e2e): set up tests on mainnet (#6229)
### Description - Moves E2E testing to mainnet. - Removes `Verify.spec` & `FiatConnectTransferOut.spec.js`. - Moves secret management from GH to GCP. - Adjusts the `waitForElementByText` util function to take an object param. - Wraps all use cases with a `e2e/src/*.spec.js`, use cases changed: - `e2e/src/usecases/ChooseYourAdventure.js` - `e2e/src/usecases/HomeFeed.js` ### Test plan To test locally, populate the `e2e/example.env` and rename for `e2e/.env`. - [x] Tested locally on iOS & Android - [x] Tested CI on iOS and on Android ### Related issues - Fixes ACT-1419 ### Backwards compatibility Yes ### Network scalability Yes --------- Co-authored-by: Joe Bergeron <[email protected]> Co-authored-by: Satish Ravi <[email protected]>
- Loading branch information
1 parent
f39abe8
commit e2346ec
Showing
48 changed files
with
354 additions
and
831 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,11 @@ on: | |
|
||
jobs: | ||
android: | ||
env: | ||
# `if` conditions can't directly access secrets, so we use a workaround | ||
# See https://docs.github.com/en/actions/security-guides/encrypted-secrets#using-encrypted-secrets-in-a-workflow | ||
SECRETS_AVAILABLE: ${{ secrets.SECRETS_AVAILABLE }} | ||
BASH_ENV: ~/.profile | ||
name: Android (SDK ${{ inputs.android-api-level }}) | ||
runs-on: | ||
- nscloud-ubuntu-22.04-amd64-16x64-with-cache | ||
|
@@ -17,6 +22,25 @@ jobs: | |
# If it takes longer it usually fails, so no need to pay for more | ||
timeout-minutes: 25 | ||
steps: | ||
- uses: google-github-actions/auth@v2 | ||
if: ${{ env.SECRETS_AVAILABLE }} | ||
with: | ||
project_id: celo-mobile-mainnet | ||
credentials_json: ${{ secrets.MAINNET_SERVICE_ACCOUNT_KEY }} | ||
- name: Google Secrets | ||
if: ${{ env.SECRETS_AVAILABLE }} | ||
id: google-secrets | ||
uses: google-github-actions/[email protected] | ||
with: | ||
secrets: |- | ||
E2E_WALLET_CONNECT_PROJECT_ID:projects/1027349420744/secrets/E2E_WALLET_CONNECT_PROJECT_ID | ||
E2E_DEFAULT_RECIPIENT_MNEMONIC:projects/1027349420744/secrets/E2E_DEFAULT_RECIPIENT_MNEMONIC | ||
E2E_DEFAULT_RECIPIENT_PRIVATE_KEY:projects/1027349420744/secrets/E2E_DEFAULT_RECIPIENT_PRIVATE_KEY | ||
E2E_WALLET_MNEMONIC:projects/1027349420744/secrets/E2E_WALLET_MNEMONIC | ||
E2E_WALLET_PRIVATE_KEY:projects/1027349420744/secrets/E2E_WALLET_PRIVATE_KEY | ||
E2E_WALLET_SINGLE_VERIFIED_MNEMONIC:projects/1027349420744/secrets/E2E_WALLET_SINGLE_VERIFIED_MNEMONIC | ||
E2E_WALLET_MULTIPLE_VERIFIED_MNEMONIC:projects/1027349420744/secrets/E2E_WALLET_MULTIPLE_VERIFIED_MNEMONIC | ||
E2E_WALLET_12_WORDS_MNEMONIC:projects/1027349420744/secrets/E2E_WALLET_12_WORDS_MNEMONIC | ||
- uses: actions/checkout@v4 | ||
- name: Set env | ||
run: | | ||
|
@@ -74,9 +98,6 @@ jobs: | |
run: yarn build:ts | ||
- name: Check E2E wallet balance | ||
run: NODE_OPTIONS='--unhandled-rejections=strict' yarn ts-node ./e2e/scripts/check-e2e-wallet-balance.ts | ||
- name: Create Android E2E .env File | ||
working-directory: e2e | ||
run: echo WALLET_CONNECT_PROJECT_ID_E2E=${{ secrets.WALLET_CONNECT_PROJECT_ID_E2E }} >> .env | ||
- name: Create Detox Build | ||
run: CELO_TEST_CONFIG=e2e yarn detox build -c android.release | ||
- name: Run Detox | ||
|
@@ -94,6 +115,15 @@ jobs: | |
--headless | ||
--retries 3 | ||
--device-boot-args="-snapshot ci_boot" | ||
env: | ||
E2E_WALLET_CONNECT_PROJECT_ID: ${{ steps.google-secrets.outputs.E2E_WALLET_CONNECT_PROJECT_ID }} | ||
E2E_DEFAULT_RECIPIENT_MNEMONIC: ${{ steps.google-secrets.outputs.E2E_DEFAULT_RECIPIENT_MNEMONIC }} | ||
E2E_DEFAULT_RECIPIENT_PRIVATE_KEY: ${{ steps.google-secrets.outputs.E2E_DEFAULT_RECIPIENT_PRIVATE_KEY }} | ||
E2E_WALLET_MNEMONIC: ${{ steps.google-secrets.outputs.E2E_WALLET_MNEMONIC }} | ||
E2E_WALLET_PRIVATE_KEY: ${{ steps.google-secrets.outputs.E2E_WALLET_PRIVATE_KEY }} | ||
E2E_WALLET_SINGLE_VERIFIED_MNEMONIC: ${{ steps.google-secrets.outputs.E2E_WALLET_SINGLE_VERIFIED_MNEMONIC }} | ||
E2E_WALLET_MULTIPLE_VERIFIED_MNEMONIC: ${{ steps.google-secrets.outputs.E2E_WALLET_MULTIPLE_VERIFIED_MNEMONIC }} | ||
E2E_WALLET_12_WORDS_MNEMONIC: ${{ steps.google-secrets.outputs.E2E_WALLET_12_WORDS_MNEMONIC }} | ||
- name: Publish Android JUnit Report | ||
if: always() | ||
uses: mikepenz/action-junit-report@v4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,13 +16,27 @@ jobs: | |
balance-and-fund: | ||
name: balance-and-fund | ||
runs-on: ubuntu-latest | ||
env: | ||
# `if` conditions can't directly access secrets, so we use a workaround | ||
# See https://docs.github.com/en/actions/security-guides/encrypted-secrets#using-encrypted-secrets-in-a-workflow | ||
SECRETS_AVAILABLE: ${{ secrets.SECRETS_AVAILABLE }} | ||
BASH_ENV: ~/.profile | ||
steps: | ||
- uses: google-github-actions/auth@v2 | ||
if: ${{ env.SECRETS_AVAILABLE }} | ||
with: | ||
project_id: celo-mobile-mainnet | ||
credentials_json: ${{ secrets.MAINNET_SERVICE_ACCOUNT_KEY }} | ||
- name: Google Secrets | ||
if: ${{ env.SECRETS_AVAILABLE }} | ||
id: google-secrets | ||
uses: google-github-actions/[email protected] | ||
with: | ||
secrets: |- | ||
E2E_TEST_FAUCET_SECRET:projects/1027349420744/secrets/E2E_TEST_FAUCET_SECRET | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/yarn-install | ||
- name: Create E2E Fund .env File | ||
env: | ||
TEST_FAUCET_SECRET: ${{ secrets.TEST_FAUCET_SECRET }} | ||
working-directory: e2e | ||
run: echo TEST_FAUCET_SECRET=$TEST_FAUCET_SECRET >> .env | ||
- name: Run Balance and Fund | ||
run: NODE_OPTIONS='--unhandled-rejections=strict' yarn ts-node ./e2e/scripts/fund-e2e-accounts.ts | ||
env: | ||
E2E_TEST_FAUCET_SECRET: ${{ steps.google-secrets.outputs.E2E_TEST_FAUCET_SECRET }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
E2E_TEST_FAUCET_SECRET="" | ||
E2E_WALLET_CONNECT_PROJECT_ID="" | ||
E2E_DEFAULT_RECIPIENT_MNEMONIC="" | ||
E2E_DEFAULT_RECIPIENT_PRIVATE_KEY="" | ||
E2E_WALLET_MNEMONIC="" | ||
E2E_WALLET_PRIVATE_KEY="" | ||
E2E_WALLET_SINGLE_VERIFIED_MNEMONIC="" | ||
E2E_WALLET_MULTIPLE_VERIFIED_MNEMONIC="" | ||
E2E_WALLET_12_WORDS_MNEMONIC="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export const E2E_TEST_WALLET = '0x6131a6d616a4be3737b38988847270a64bc10caa' | ||
export const E2E_TEST_WALLET_SECURE_SEND = '0x86b8f44386cb2d457db79c3dab8cf42f9d8a3fc0' | ||
export const E2E_TEST_FAUCET = '0xe5F5363e31351C38ac82DBAdeaD91Fd5a7B08846' | ||
export const E2E_TEST_WALLET = '0xebf95355cc5ea643179a02337f3f943fd8dd2bcb' | ||
export const E2E_TEST_WALLET_SECURE_SEND = '0x06f4b680c6cb1aeec4a3ce12c63ea18acb136aa3' | ||
export const E2E_TEST_FAUCET = '0xa694b396cd6f73e4003da8f97f4b12e498b3f2ec' | ||
export const REFILL_TOKENS = ['CELO', 'cUSD', 'cEUR'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import ChooseYourAdventure from './usecases/ChooseYourAdventure' | ||
import NewAccountOnboarding from './usecases/NewAccountOnboarding' | ||
import RestoreAccountOnboarding from './usecases/RestoreAccountOnboarding' | ||
|
||
describe('Account Setup', () => { | ||
describe('New Account', NewAccountOnboarding) | ||
describe('Restore', RestoreAccountOnboarding) | ||
describe('Choose Your Adventure', ChooseYourAdventure) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import ChooseYourAdventure from './usecases/ChooseYourAdventure' | ||
|
||
describe('Choose your adventure', ChooseYourAdventure) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.