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

test(e2e): set up tests on mainnet #6229

Merged
merged 91 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
05e73ab
test(e2e): use mainnet and access secrets with react-native-dotenv
MuckT Nov 14, 2024
d8de590
ci(e2e): use gh repository secrets in e2e workflows
MuckT Nov 14, 2024
e7ea3ea
test(e2e): handle cases where account has no balance in restore flow
MuckT Nov 14, 2024
c1a7f52
test(e2e): decrease minimum balance for testing
MuckT Nov 14, 2024
aa76258
test(e2e): adjust expected display amounts for deeplinks
MuckT Nov 14, 2024
6a504f5
test(e2e): log faucet balance
MuckT Nov 14, 2024
1baaadd
test(e2e): adjust expected display value to use new addess
MuckT Nov 14, 2024
c6a45df
test(e2e): add getDisplayAddress function
MuckT Nov 14, 2024
109a159
test(e2e): add verified phone numbers
MuckT Nov 15, 2024
54b8c6d
test(e2e): use default wallet in send flow
MuckT Nov 15, 2024
db7e0fd
test(e2e): secure send test on mainnet
MuckT Nov 15, 2024
a91898c
Merge branch 'main' into tomm/act-1419
MuckT Nov 15, 2024
a173633
ci(e2e): use private key in e2e workflows
MuckT Nov 15, 2024
67cc45b
test(e2e): optionally skip phone verification during restore flow
MuckT Nov 15, 2024
91372e5
test(e2e-android): add static wait before eth_signTransaction
MuckT Nov 15, 2024
6cef669
test(e2e-android): add static wait before sign and send tx
MuckT Nov 15, 2024
2baa2bd
Merge branch 'main' into tomm/act-1419
MuckT Nov 15, 2024
0cefb3d
test(e2e): disable analytics
MuckT Nov 15, 2024
0876d4d
test(e2e): remove alfajores dependent fiat connect tests
MuckT Nov 15, 2024
2a34cda
test(e2e): add wait in wallet connect tests
MuckT Nov 15, 2024
9f685f3
test(e2e): remove old phone verification tests
MuckT Nov 15, 2024
6745d5d
test(e2e): update blocklist to use mainnet url
MuckT Nov 15, 2024
25e01d3
ci(e2e): use gcp secrets instead of gh secrets
MuckT Nov 15, 2024
0efe530
test(e2e): use send action for cUSD
MuckT Nov 15, 2024
2f9552d
fix(e2e): disable analytics in dev and e2e builds
MuckT Nov 15, 2024
a2388f7
Merge branch 'main' into tomm/act-1419
MuckT Nov 16, 2024
3d6aee0
ci(e2e): use gcp secrets for balance-and-fund
MuckT Nov 16, 2024
58d55e2
test(e2e): adjust wait for wallet connect
MuckT Nov 16, 2024
ba3c3ec
ci(e2e): adjust minimum balance for test wallets
MuckT Nov 18, 2024
2c47c65
Update e2e/scripts/fund-e2e-accounts.ts
MuckT Nov 18, 2024
dfc681e
test(e2e): store secrets only in gcp
MuckT Nov 18, 2024
2602b2b
Merge branch 'main' into tomm/act-1419
MuckT Nov 18, 2024
0881c28
ci(e2e): report faucet balance without erroring if low
MuckT Nov 19, 2024
aca37ad
test(e2e): update phone number for default wallet
MuckT Nov 19, 2024
70f1730
Merge branch 'main' into tomm/act-1419
MuckT Nov 19, 2024
0b09568
Merge branch 'main' into tomm/act-1419
MuckT Nov 19, 2024
e26e4de
Merge branch 'main' into tomm/act-1419
MuckT Nov 20, 2024
3c6757f
Merge branch 'main' into tomm/act-1419
MuckT Nov 20, 2024
40c3e2c
Update e2e/example.env
MuckT Nov 20, 2024
76159a4
test(e2e): prefix secrets used in e2e tests with E2E_
MuckT Nov 20, 2024
107859b
style(e2e): organize and remove unused imports
MuckT Nov 20, 2024
c8c739e
test(e2e): update wallet phone number
MuckT Nov 20, 2024
693422a
test(e2e): check that input amount is changed
MuckT Nov 20, 2024
2f47622
test(e2e): use cMCO2
MuckT Nov 20, 2024
a92090d
Merge branch 'main' into tomm/act-1419
MuckT Nov 21, 2024
12806e1
Merge branch 'main' into tomm/act-1419
MuckT Nov 21, 2024
2c47ae5
Merge branch 'main' into tomm/act-1419
MuckT Nov 21, 2024
f9fa7fd
Merge branch 'main' into tomm/act-1419
MuckT Nov 22, 2024
f965d93
Merge branch 'main' into tomm/act-1419
MuckT Nov 22, 2024
ee42ac9
test(e2e): replace static wait in quick onboarding with dynamic wait
MuckT Nov 22, 2024
0d8c381
Merge branch 'main' into tomm/act-1419
MuckT Nov 22, 2024
b410f43
test(e2e): add static wait after importing the wallet
MuckT Nov 23, 2024
9b8aafe
Merge branch 'main' into tomm/act-1419
MuckT Nov 25, 2024
054819d
Merge branch 'main' into tomm/act-1419
MuckT Nov 25, 2024
19d75bd
test(e2e): use new tx feed by default
MuckT Nov 25, 2024
83aa9ed
test(e2e): wait for TransferFeedItem
MuckT Nov 25, 2024
81f2de7
test(e2e): update waitForElementByText util function
MuckT Nov 25, 2024
0631aca
test(e2e): move cya to it's own spec to prevent long runs
MuckT Nov 25, 2024
e1bcf2b
test(e2e): adjust cya test setup and assertations
MuckT Nov 25, 2024
88c711b
test(e2e): remove old cya usecase
MuckT Nov 25, 2024
72a2fe0
test(e2e): use delete instead of uninstall then install
MuckT Nov 26, 2024
8037cef
test(e2e): follow use cases in spec pattern to prevent Signal 11 on ios
MuckT Nov 26, 2024
eb19296
fix(e2e): use zerion tx feed
MuckT Nov 26, 2024
36db417
test(e2e): use zerion tx feed for newly created account
MuckT Nov 26, 2024
a41d96a
test(e2e): homefeed spec
MuckT Nov 26, 2024
427f1ba
test(e2e): handle times when .01 cUSD !== .01 USD
MuckT Nov 26, 2024
c8b1014
test(e2e): increase precision for crypto amount compare
MuckT Nov 26, 2024
f909346
Merge branch 'main' into tomm/act-1419
MuckT Nov 26, 2024
1eb9487
docs(e2e): rename example.env to env.example
MuckT Nov 26, 2024
438bd69
test(e2e): use new test id transaction feed
MuckT Nov 26, 2024
87179f5
test(e2e): use default launch args unless overwritten
MuckT Nov 26, 2024
0d7a861
ci(e2e): rename TEST_FAUCET_SECRET to E2E_TEST_FAUCET_SECRET
MuckT Nov 26, 2024
d40b7c1
ci(e2e): set secrets available
MuckT Nov 26, 2024
5ad0492
ci(e2e): adjust env variable name for test faucet secret
MuckT Nov 26, 2024
a5c6e1f
docs(e2e): expected precision when using jests toBeCloseTo
MuckT Nov 26, 2024
2badc5b
test(e2e): adjust expected values
MuckT Nov 26, 2024
d77be26
test(e2e): remove url blocklist
MuckT Nov 26, 2024
f945fd5
test(e2e): wait for tx feed load
MuckT Nov 26, 2024
228c7e0
docs(e2e): document value extraction for elements
MuckT Nov 26, 2024
4883f46
test(e2e): increase scroll down pixels
MuckT Nov 26, 2024
58372fd
test(e2e): use static value for scroll to bottom
MuckT Nov 27, 2024
23c6872
ci(e2e): increase timeout for namespace runners on android to 30 minutes
MuckT Nov 27, 2024
ff9c4e3
Merge branch 'main' into tomm/act-1419
MuckT Nov 27, 2024
1689ab0
test(e2e): use old tx feed
MuckT Nov 27, 2024
3af5770
test(e2e): home feed spec address assertion
MuckT Nov 27, 2024
b176dbf
test(e2e): restore previously used static wait duration
MuckT Nov 27, 2024
9fde68d
test(e2e): disable feed item amount compared to tx details assert
MuckT Nov 27, 2024
3c2f6ff
test(e2e): use new tx feed
MuckT Nov 27, 2024
2fd0c28
test(e2e): update tx feed test id
MuckT Nov 27, 2024
d837a85
test(e2e): specify funded and verification status of e2e accounts
MuckT Nov 27, 2024
202c026
docs(e2e): add note to re-enable assert linked issue is fixed
MuckT Nov 27, 2024
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
2 changes: 1 addition & 1 deletion .env.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DEFAULT_TESTNET=alfajores
DEFAULT_TESTNET=mainnet
SMS_RETRIEVER_APP_SIGNATURE=TODO
DEV_SETTINGS_ACTIVE_INITIALLY=true
# Disable firebase b.c. google-services.json files are missing in CI
Expand Down
36 changes: 33 additions & 3 deletions .github/workflows/e2e-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know we currently use this in our iOS workflow, but for my own curiosity, when would this ever evaluate to false?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link has a bit more info about the workaround listed; however, I couldn't find an example where SECRETS_AVAILABLE would return false.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if secrets are not available, is there a reason to run the entire workflow over failing early? It seems like only some steps are behind the condition, but I assume if no secrets are available, the entire suite will fail right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could look into failing early, but that seems like an improvement that should be made in a separate stream of work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we make an issue and add a TODO for this? seems like something we could easily forget

BASH_ENV: ~/.profile
name: Android (SDK ${{ inputs.android-api-level }})
runs-on:
- nscloud-ubuntu-22.04-amd64-16x64-with-cache
Expand All @@ -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: |-
MuckT marked this conversation as resolved.
Show resolved Hide resolved
WALLET_CONNECT_PROJECT_ID_E2E:projects/1027349420744/secrets/WALLET_CONNECT_PROJECT_ID_E2E
DEFAULT_RECIPIENT_MNEMONIC:projects/1027349420744/secrets/DEFAULT_RECIPIENT_MNEMONIC
DEFAULT_RECIPIENT_PRIVATE_KEY:projects/1027349420744/secrets/DEFAULT_RECIPIENT_PRIVATE_KEY
WALLET_MNEMONIC:projects/1027349420744/secrets/WALLET_MNEMONIC
WALLET_PRIVATE_KEY:projects/1027349420744/secrets/WALLET_PRIVATE_KEY
WALLET_SINGLE_VERIFIED_MNEMONIC:projects/1027349420744/secrets/WALLET_SINGLE_VERIFIED_MNEMONIC
WALLET_MULTIPLE_VERIFIED_MNEMONIC:projects/1027349420744/secrets/WALLET_MULTIPLE_VERIFIED_MNEMONIC
WALLET_12_WORDS_MNEMONIC:projects/1027349420744/secrets/WALLET_12_WORDS_MNEMONIC
MuckT marked this conversation as resolved.
Show resolved Hide resolved
- uses: actions/checkout@v4
- name: Set env
run: |
Expand Down Expand Up @@ -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
Expand All @@ -94,6 +115,15 @@ jobs:
--headless
--retries 3
--device-boot-args="-snapshot ci_boot"
env:
WALLET_CONNECT_PROJECT_ID_E2E: ${{ steps.google-secrets.outputs.WALLET_CONNECT_PROJECT_ID_E2E }}
DEFAULT_RECIPIENT_MNEMONIC: ${{ steps.google-secrets.outputs.DEFAULT_RECIPIENT_MNEMONIC }}
DEFAULT_RECIPIENT_PRIVATE_KEY: ${{ steps.google-secrets.outputs.DEFAULT_RECIPIENT_PRIVATE_KEY }}
WALLET_MNEMONIC: ${{ steps.google-secrets.outputs.WALLET_MNEMONIC }}
WALLET_PRIVATE_KEY: ${{ steps.google-secrets.outputs.WALLET_PRIVATE_KEY }}
WALLET_SINGLE_VERIFIED_MNEMONIC: ${{ steps.google-secrets.outputs.WALLET_SINGLE_VERIFIED_MNEMONIC }}
WALLET_MULTIPLE_VERIFIED_MNEMONIC: ${{ steps.google-secrets.outputs.WALLET_MULTIPLE_VERIFIED_MNEMONIC }}
WALLET_12_WORDS_MNEMONIC: ${{ steps.google-secrets.outputs.WALLET_12_WORDS_MNEMONIC }}
- name: Publish Android JUnit Report
if: always()
uses: mikepenz/action-junit-report@v4
Expand Down
19 changes: 14 additions & 5 deletions .github/workflows/e2e-faucet-balance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,21 @@ jobs:
name: balance-and-fund
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/auth@v2
if: ${{ env.SECRETS_AVAILABLE }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this env be set in the first place, like how it's done in the above workflow? Otherwise I assume this will always evaluate to false?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: |-
TEST_FAUCET_SECRET:projects/1027349420744/secrets/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:
TEST_FAUCET_SECRET: ${{ steps.google-secrets.outputs.TEST_FAUCET_SECRET }}
20 changes: 17 additions & 3 deletions .github/workflows/e2e-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ jobs:
with:
secrets: |-
EMERGE_API_TOKEN:projects/1027349420744/secrets/EMERGE_API_TOKEN
WALLET_CONNECT_PROJECT_ID_E2E:projects/1027349420744/secrets/WALLET_CONNECT_PROJECT_ID_E2E
DEFAULT_RECIPIENT_MNEMONIC:projects/1027349420744/secrets/DEFAULT_RECIPIENT_MNEMONIC
DEFAULT_RECIPIENT_PRIVATE_KEY:projects/1027349420744/secrets/DEFAULT_RECIPIENT_PRIVATE_KEY
WALLET_MNEMONIC:projects/1027349420744/secrets/WALLET_MNEMONIC
WALLET_PRIVATE_KEY:projects/1027349420744/secrets/WALLET_PRIVATE_KEY
WALLET_SINGLE_VERIFIED_MNEMONIC:projects/1027349420744/secrets/WALLET_SINGLE_VERIFIED_MNEMONIC
WALLET_MULTIPLE_VERIFIED_MNEMONIC:projects/1027349420744/secrets/WALLET_MULTIPLE_VERIFIED_MNEMONIC
WALLET_12_WORDS_MNEMONIC:projects/1027349420744/secrets/WALLET_12_WORDS_MNEMONIC
- uses: actions/checkout@v4
- uses: ./.github/actions/yarn-install
# Since the e2e runners have access to the Valora branding,
Expand All @@ -46,9 +54,6 @@ jobs:
run: yarn ts-node ./.github/scripts/checkPodfileAndUpdateRenovatePr.ts
- name: Check E2E wallet balance
run: NODE_OPTIONS='--unhandled-rejections=strict' yarn ts-node ./e2e/scripts/check-e2e-wallet-balance.ts
- name: Create iOS E2E .env File
working-directory: e2e
run: echo MOCK_PROVIDER_BASE_URL=${{ secrets.MOCK_PROVIDER_BASE_URL }} >> .env && echo MOCK_PROVIDER_API_KEY=${{ secrets.MOCK_PROVIDER_API_KEY }} >> .env && echo WALLET_CONNECT_PROJECT_ID_E2E=${{ secrets.WALLET_CONNECT_PROJECT_ID_E2E }} >> .env
- name: Create Detox Build
run: |
export CELO_TEST_CONFIG=e2e
Expand Down Expand Up @@ -76,6 +81,15 @@ jobs:
--maxWorkers 6
--retries 3
timeout-minutes: 45
env:
WALLET_CONNECT_PROJECT_ID_E2E: ${{ steps.google-secrets.outputs.WALLET_CONNECT_PROJECT_ID_E2E }}
DEFAULT_RECIPIENT_MNEMONIC: ${{ steps.google-secrets.outputs.DEFAULT_RECIPIENT_MNEMONIC }}
DEFAULT_RECIPIENT_PRIVATE_KEY: ${{ steps.google-secrets.outputs.DEFAULT_RECIPIENT_PRIVATE_KEY }}
WALLET_MNEMONIC: ${{ steps.google-secrets.outputs.WALLET_MNEMONIC }}
WALLET_PRIVATE_KEY: ${{ steps.google-secrets.outputs.WALLET_PRIVATE_KEY }}
WALLET_SINGLE_VERIFIED_MNEMONIC: ${{ steps.google-secrets.outputs.WALLET_SINGLE_VERIFIED_MNEMONIC }}
WALLET_MULTIPLE_VERIFIED_MNEMONIC: ${{ steps.google-secrets.outputs.WALLET_MULTIPLE_VERIFIED_MNEMONIC }}
WALLET_12_WORDS_MNEMONIC: ${{ steps.google-secrets.outputs.WALLET_12_WORDS_MNEMONIC }}
- name: Publish iOS JUnit Report
if: always()
uses: mikepenz/action-junit-report@v4
Expand Down
Binary file modified e2e/.env.enc
Binary file not shown.
6 changes: 5 additions & 1 deletion e2e/scripts/check-e2e-wallet-balance.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { E2E_TEST_WALLET, E2E_TEST_WALLET_SECURE_SEND } from './consts'
import { E2E_TEST_FAUCET, E2E_TEST_WALLET, E2E_TEST_WALLET_SECURE_SEND } from './consts'
import { checkBalance, getCeloTokensBalance } from './utils'
;(async () => {
console.log(`E2E_TEST_WALLET: ${E2E_TEST_WALLET}`)
Expand All @@ -8,4 +8,8 @@ import { checkBalance, getCeloTokensBalance } from './utils'
console.log(`E2E_TEST_WALLET_SECURE_SEND: ${E2E_TEST_WALLET_SECURE_SEND}`)
console.table(await getCeloTokensBalance(E2E_TEST_WALLET_SECURE_SEND))
await checkBalance(E2E_TEST_WALLET_SECURE_SEND)

console.log(`E2E_TEST_FACUET: ${E2E_TEST_FAUCET}`)
console.table(await getCeloTokensBalance(E2E_TEST_FAUCET))
MuckT marked this conversation as resolved.
Show resolved Hide resolved
await checkBalance(E2E_TEST_FAUCET)
})()
6 changes: 3 additions & 3 deletions e2e/scripts/consts.ts
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']
14 changes: 7 additions & 7 deletions e2e/scripts/fund-e2e-accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from './consts'
import { checkBalance, getCeloTokensBalance } from './utils'

const provider = new providers.JsonRpcProvider('https://alfajores-forno.celo-testnet.org')
const provider = new providers.JsonRpcProvider('https://forno.celo.org/')

dotenv.config({ path: `${__dirname}/../.env` })

Expand All @@ -25,17 +25,17 @@ interface Token {

const CELO: Token = {
symbol: 'CELO',
address: utils.getAddress('0xf194afdf50b03e69bd7d057c1aa9e10c9954e4c9'),
address: utils.getAddress('0x471ece3750da237f93b8e339c536989b8978a438'),
decimals: 18,
}
const CUSD: Token = {
symbol: 'cUSD',
address: utils.getAddress('0x874069fa1eb16d44d622f2e0ca25eea172369bc1'),
address: utils.getAddress('0x765de816845861e75a25fca122bb6898b8b1282a'),
decimals: 18,
}
const CEUR: Token = {
symbol: 'cEUR',
address: utils.getAddress('0x10c892a6ec43a53e45d0b916b4b7d383b1b78c0f'),
address: utils.getAddress('0xd8763cba276a3738e6de85b4b3bf5fded6d6ca73'),
decimals: 18,
}
const TOKENS_BY_SYMBOL: Record<string, Token> = {
Expand All @@ -53,7 +53,7 @@ const TOKENS_BY_SYMBOL: Record<string, Token> = {
}

const faucetTokenBalances = (await getCeloTokensBalance(E2E_TEST_FAUCET)) ?? {}
console.log('Initial faucet balance:')
console.log(`Initial balance for ${E2E_TEST_FAUCET}:`)
MuckT marked this conversation as resolved.
Show resolved Hide resolved
console.table(faucetTokenBalances)

// Connect Valora E2E Test Faucet - Private Key Stored in GitHub Secrets
Expand Down Expand Up @@ -216,14 +216,14 @@ const TOKENS_BY_SYMBOL: Record<string, Token> = {
}

// Set Amount To Send
const amountToSend = '100'
const amountToSend = '10'

for (let i = 0; i < walletsToBeFunded.length; i++) {
const walletAddress = walletsToBeFunded[i]
const walletBalance = walletBalances[i]
for (const tokenSymbol of REFILL_TOKENS) {
// @ts-ignore
if (walletBalance && walletBalance[tokenSymbol] < 200) {
if (walletBalance && walletBalance[tokenSymbol] < 20) {
console.log(`Sending ${amountToSend} ${tokenSymbol} to ${walletAddress}`)
await transferToken(TOKENS_BY_SYMBOL[tokenSymbol], amountToSend, walletAddress)
}
Expand Down
16 changes: 8 additions & 8 deletions e2e/scripts/utils.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { Address, createPublicClient, erc20Abi, http } from 'viem'
import { celoAlfajores } from 'viem/chains'
import { celo } from 'viem/chains'
import { REFILL_TOKENS } from './consts'

export async function checkBalance(
address: Address,
minBalance = 10,
minBalance = 1,
MuckT marked this conversation as resolved.
Show resolved Hide resolved
tokenSymbols: string[] = REFILL_TOKENS
) {
const balance = (await getCeloTokensBalance(address)) ?? {}
for (const [tokenSymbol, tokenBalance] of Object.entries(balance)) {
if (tokenSymbols.includes(tokenSymbol) && tokenBalance < minBalance) {
throw new Error(
`${balance} balance of ${address} is below ${minBalance}. Please refill from the faucet https://celo.org/developers/faucet or run ./fund-e2e-accounts.ts if a Valora Dev.`
`${balance} balance of ${address} is below ${minBalance}. Please refill from the faucet or run ./fund-e2e-accounts.ts if a Valora Dev.`
)
}
}
Expand All @@ -20,15 +20,15 @@ export async function checkBalance(
export async function getCeloTokensBalance(walletAddress: Address) {
try {
const supportedTokenAddresses: Address[] = [
'0x874069fa1eb16d44d622f2e0ca25eea172369bc1',
'0x10c892a6ec43a53e45d0b916b4b7d383b1b78c0f',
'0xf194afdf50b03e69bd7d057c1aa9e10c9954e4c9',
'0xe4d517785d091d3c54818832db6094bcc2744545',
'0x765de816845861e75a25fca122bb6898b8b1282a',
'0xd8763cba276a3738e6de85b4b3bf5fded6d6ca73',
'0x471ece3750da237f93b8e339c536989b8978a438',
'0xe8537a3d056da446677b9e9d6c5db704eaab4787',
] // cUSD, cEUR, CELO, cREAL
const supportedTokenSymbols: string[] = ['cUSD', 'cEUR', 'CELO', 'cREAL']

const celoClient = createPublicClient({
chain: celoAlfajores,
chain: celo,
transport: http(),
})

Expand Down
27 changes: 0 additions & 27 deletions e2e/src/FiatConnectTransferOut.spec.js
MuckT marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

5 changes: 0 additions & 5 deletions e2e/src/Verify.spec.js
MuckT marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

23 changes: 13 additions & 10 deletions e2e/src/usecases/Assets.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
import { WALLET_MNEMONIC } from 'react-native-dotenv'
import { english, generateMnemonic } from 'viem/accounts'
import { DEFAULT_RECIPIENT_ADDRESS, SAMPLE_BACKUP_KEY } from '../utils/consts'
import { DEFAULT_RECIPIENT_ADDRESS } from '../utils/consts'
import { launchApp } from '../utils/retries'
import {
getDisplayAddress,
quickOnboarding,
scrollIntoViewByTestId,
waitForElementByIdAndTap,
waitForElementId,
scrollIntoViewByTestId,
} from '../utils/utils'

async function validateSendFlow(tokenSymbol) {
const recipientAddressDisplay = getDisplayAddress(DEFAULT_RECIPIENT_ADDRESS)
// navigate to send amount screen to ensure the expected token symbol is pre-selected
await waitForElementByIdAndTap('SendSelectRecipientSearchInput')
await element(by.id('SendSelectRecipientSearchInput')).replaceText(DEFAULT_RECIPIENT_ADDRESS)
await element(by.id('SendSelectRecipientSearchInput')).tapReturnKey()
await expect(element(by.text('0xe5f5...8846')).atIndex(0)).toBeVisible()
await element(by.text('0xe5f5...8846')).atIndex(0).tap()
await expect(element(by.text(recipientAddressDisplay)).atIndex(0)).toBeVisible()
await element(by.text(recipientAddressDisplay)).atIndex(0).tap()
await waitForElementByIdAndTap('SendOrInviteButton')
await expect(
element(by.text(tokenSymbol).withAncestor(by.id('SendEnterAmount/TokenSelect')))
Expand All @@ -37,15 +40,15 @@ export default Assets = () => {
balance: 'non zero',
tokens: [
{
tokenId: 'celo-alfajores:native',
tokenId: 'celo-mainnet:native',
symbol: 'CELO',
actions: ['Send', 'Add'],
moreActions: ['Send', 'Add', 'Withdraw'],
learnMore: true,
},
{
tokenId: 'celo-alfajores:0x048f47d358ec521a6cf384461d674750a3cb58c8',
symbol: 'TT',
tokenId: 'celo-mainnet:0x765de816845861e75a25fca122bb6898b8b1282a',
symbol: 'cUSD',
MuckT marked this conversation as resolved.
Show resolved Hide resolved
actions: ['Send'],
moreActions: [],
learnMore: false,
Expand All @@ -56,14 +59,14 @@ export default Assets = () => {
balance: 'zero',
tokens: [
{
tokenId: 'celo-alfajores:native',
tokenId: 'celo-mainnet:native',
symbol: 'CELO',
actions: ['Add'],
moreActions: [],
learnMore: true,
},
{
tokenId: 'celo-alfajores:0x874069fa1eb16d44d622f2e0ca25eea172369bc1',
tokenId: 'celo-mainnet:0x765de816845861e75a25fca122bb6898b8b1282a',
symbol: 'cUSD',
actions: ['Add'],
moreActions: [],
Expand All @@ -81,7 +84,7 @@ export default Assets = () => {
newInstance: true,
permissions: { notifications: 'YES', contacts: 'YES', camera: 'YES' },
})
let mnemonic = SAMPLE_BACKUP_KEY
let mnemonic = WALLET_MNEMONIC
if (balance === 'zero') {
mnemonic = generateMnemonic(english)
}
Expand Down
Loading
Loading