-
-
Notifications
You must be signed in to change notification settings - Fork 114
74 lines (65 loc) · 3.12 KB
/
e2e-js-sdk-android-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Run JS E2E Tests on Android
on:
workflow_dispatch:
inputs:
rn_test_app_name_android:
description: 'React Native Test App apk'
required: true
type: choice
options:
- 'RN-demo-0-14-2.apk'
wallet_app_name_android:
description: 'MM Wallet Android apk name'
required: true
type: choice
options:
- 'MM-Wallet-7-16.0-RC.apk'
jobs:
e2e-tests:
runs-on: ubuntu-latest
env:
SRP: ${{ secrets.SRP }}
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
BROWSERSTACK_API_USERNAME: ${{ secrets.BROWSERSTACK_API_USERNAME }}
BROWSERSTACK_API_PASSWORD: ${{ secrets.BROWSERSTACK_API_PASSWORD }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18.18.2'
- name: Install dependencies
run: yarn install && cd e2e && yarn install && cd ..
# Create .android.env with inputs in the /e2e directory
- name: Create .android.env
working-directory: ./e2e
run: |
browserstack_api_url="https://api-cloud.browserstack.com/app-automate/recent_apps/"
response=$(curl -s -u "$BROWSERSTACK_API_USERNAME:$BROWSERSTACK_API_PASSWORD" "$browserstack_api_url")
android_wallet_app_name="${{ inputs.wallet_app_name_android }}"
android_rn_app_name="${{ inputs.rn_test_app_name_android }}"
# Gets the app_url and custom_id for the wallet app, react native and android native test app to use in the .android.env file
android_wallet_app_url=$(echo "$response" | jq -r --arg android_wallet_app_name "$android_wallet_app_name" '.[] | select(.app_name == $android_wallet_app_name) | .app_url')
android_wallet_app_bundle_id=$(echo "$response" | jq -r --arg android_wallet_app_name "$android_wallet_app_name" '.[] | select(.app_name == $android_wallet_app_name) | .custom_id')
android_rn_app_url=$(echo "$response" | jq -r --arg android_rn_app_name "$android_rn_app_name" '.[] | select(.app_name == $android_rn_app_name) | .app_url')
android_rn_app_bundle_id=$(echo "$response" | jq -r --arg android_rn_app_name "$android_rn_app_name" '.[] | select(.app_name == $android_rn_app_name) | .custom_id')
# Writes to the .android.env file
{
echo "APP_PATH=$android_wallet_app_url"
echo "BUNDLE_ID=$android_wallet_app_bundle_id"
echo "RN_TEST_APP_PATH=$android_rn_app_url"
echo "RN_TEST_APP_BUNDLE_ID=$android_rn_app_bundle_id"
} >> .android.env
# Hard code .dapps.env values in the /e2e directory
- name: Set Dapps Environment Variables
working-directory: ./e2e
run: |
{
# TODO: Add dapps environment variables here
echo "Add dapps environment variables here"
} >> .dapps.env
- name: Run JS-SDK Android E2E tests
working-directory: ./e2e
run: yarn test:android:jssdk:e2e:browserstack