-
-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Split tests into suites and create workflows for the different…
… run types (#672) * feat: adds a new way of triggering the e2e job * feat: adds a new way of triggering the e2e job - wip * feat: splits e2e workflows and test suites * feat: splits specs for different sdks * chore: renames the JS e2e name * chore: rename E2E workflow name * chore: updates the workflows with the current artifact options * chore: fixes url in workflows * chore: fixes workflows * chore: renames AndroidSDK test for better visibility * chore: fixes JS Tests on android * chore: moves the helper const out of constants to avoid driver not being initialized * chore: cleans wdio configs * chore: makes android SDK dapp mandatory on the CI workflow * chore: fixes ci spelling
- Loading branch information
1 parent
285d158
commit 66a6dd3
Showing
13 changed files
with
330 additions
and
185 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Run Android SDK E2E Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
android_sdk_native: | ||
description: 'Android SDK Native apk' | ||
required: true | ||
type: choice | ||
options: | ||
- 'Android-SDK-Dapp-0-4-0.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 | ||
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_native_sdk="${{ inputs.android_sdk_native }}" | ||
# 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_native_sdk_url=$(echo "$response" | jq -r --arg android_native_sdk "$android_native_sdk" '.[] | select(.app_name == $android_native_sdk) | .app_url') | ||
android_native_sdk_bundle_id=$(echo "$response" | jq -r --arg android_native_sdk "$android_native_sdk" '.[] | select(.app_name == $android_native_sdk) | .custom_id') | ||
{ | ||
echo "APP_PATH=$android_wallet_app_url" | ||
echo "BUNDLE_ID=$android_wallet_app_bundle_id" | ||
echo "ANDROID_SDK_TEST_APP_PATH=$android_native_sdk_url" | ||
echo "ANDROID_SDK_TEST_BUNDLE_ID=$android_native_sdk_bundle_id" | ||
} >> e2e/.android.env | ||
- name: Run Android SDK E2E tests | ||
run: yarn test:android:androidsdk:e2e:browserstack | ||
|
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,73 @@ | ||
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 | ||
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" | ||
} >> e2e/.android.env | ||
# Hard code .dapps.env values in the /e2e directory | ||
- name: Set Dapps Environment Variables | ||
run: | | ||
{ | ||
echo "TEST_DAPP_URL=https://c0f4f41c-2f55-4863-921b-sdk-docs.github.io/test-dapp/" | ||
echo "SDK_PLAYGROUND_DAPP_URL=https://mmsdk-playground-test.vercel.app/demo" | ||
echo "WEB3_ON_BOARD_DAPP_URL=https://mmsdk-playground-test.vercel.app/onboard" | ||
} >> e2e/.dapps.env | ||
- name: Run JS-SDK Android E2E tests | ||
run: yarn test:android:jssdk:e2e:browserstack | ||
|
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,72 @@ | ||
name: Run JS E2E Tests on iOS | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
rn_test_app_name_ios: | ||
description: 'React Native Test App ipa' | ||
required: true | ||
type: choice | ||
options: | ||
- 'RN-demo-0-14-2.ipa' | ||
wallet_app_name_ios: | ||
description: 'MM Wallet iOS ipa name' | ||
required: true | ||
type: choice | ||
options: | ||
- 'MM-Wallet-7-16.0-RC.ipa' | ||
|
||
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 .ios.env with inputs in the /e2e directory | ||
- name: Create .ios.env | ||
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") | ||
ios_wallet_app_name="${{ inputs.wallet_app_name_ios }}" | ||
ios_rn_app_name="${{ inputs.rn_test_app_name_ios }}" | ||
# Gets the app_url and custom_id for the wallet app and the react native test app to use in the .ios.env file | ||
ios_wallet_app_url=$(echo "$response" | jq -r --arg ios_wallet_app_name "$ios_wallet_app_name" '.[] | select(.app_name == $ios_wallet_app_name) | .app_url') | ||
ios_wallet_app_bundle_id=$(echo "$response" | jq -r --arg ios_wallet_app_name "$ios_wallet_app_name" '.[] | select(.app_name == $ios_wallet_app_name) | .custom_id') | ||
ios_rn_app_url=$(echo "$response" | jq -r --arg ios_rn_app_name "$ios_rn_app_name" '.[] | select(.app_name == $ios_rn_app_name) | .app_url') | ||
ios_rn_app_bundle_id=$(echo "$response" | jq -r --arg ios_rn_app_name "$ios_rn_app_name" '.[] | select(.app_name == $ios_rn_app_name) | .custom_id') | ||
# Writes to the .ios.env file | ||
{ | ||
echo "APP_PATH=$ios_wallet_app_url" | ||
echo "BUNDLE_ID=$ios_wallet_app_bundle_id" | ||
echo "RN_TEST_APP_PATH=$ios_rn_app_url" | ||
echo "RN_TEST_APP_BUNDLE_ID=$ios_rn_app_bundle_id" | ||
} >> e2e/.ios.env | ||
# Hard code .dapps.env values in the /e2e directory | ||
- name: Set Dapps Environment Variables | ||
run: | | ||
{ | ||
echo "TEST_DAPP_URL=https://c0f4f41c-2f55-4863-921b-sdk-docs.github.io/test-dapp/" | ||
echo "SDK_PLAYGROUND_DAPP_URL=https://mmsdk-playground-test.vercel.app/demo" | ||
echo "WEB3_ON_BOARD_DAPP_URL=https://mmsdk-playground-test.vercel.app/onboard" | ||
} >> e2e/.dapps.env | ||
- name: Run JS-SDK iOS E2E tests | ||
run: yarn test:ios:jssdk:e2e:browserstack |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Dynamically infers the path of the other apps to be installed on the device | ||
* based on the SDK_TYPE environment variable | ||
*/ | ||
export const getOtherAppsPath = () => { | ||
const SDK_TYPE = process.env.SDK_TYPE as string; | ||
|
||
const otherAppsPaths = []; | ||
switch (SDK_TYPE) { | ||
case 'js': | ||
otherAppsPaths.push(process.env.RN_TEST_APP_PATH ?? ''); | ||
break; | ||
case 'androidsdk': | ||
otherAppsPaths.push(process.env.ANDROID_SDK_TEST_APP_PATH ?? ''); | ||
break; | ||
default: | ||
break; | ||
} | ||
return otherAppsPaths; | ||
}; |
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
Oops, something went wrong.