Browse Source

chore: maestro e2e tests (#637)

master
Henning Hall 2 years ago
committed by GitHub
parent
commit
78bb29408a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 5063 additions and 2651 deletions
  1. +39
    -0
      .github/workflows/maestro.yml
  2. +12
    -0
      .maestro/display-text.yml
  3. +12
    -0
      .maestro/utils/change-prop.yml
  4. +7
    -0
      .maestro/utils/launch.yml
  5. +5
    -0
      .maestro/utils/swipe-wheel-1.yml
  6. +5
    -0
      .maestro/utils/swipe-wheel-2.yml
  7. +5
    -0
      .maestro/utils/swipe-wheel-am-pm.yml
  8. +1
    -1
      examples/Rn069/android/app/build.gradle
  9. +5
    -4
      examples/Rn069/package.json
  10. +11
    -0
      examples/Rn069/scripts/available-android-emulator.sh
  11. +4
    -0
      examples/Rn069/scripts/start-android-emulator.sh
  12. +13
    -1
      examples/Rn069/yarn.lock
  13. +4944
    -2645
      yarn.lock

+ 39
- 0
.github/workflows/maestro.yml View File

@ -0,0 +1,39 @@
name: E2E tests (maestro)
on:
workflow_dispatch:
jobs:
e2e-maestro:
runs-on: ubuntu-latest
outputs:
app: app/build/outputs/apk/release
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14.18.1
cache: 'yarn'
- name: Install npm dependencies (example project)
working-directory: ./examples/Rn069/
run: yarn install --frozen-lockfile
- name: Install npm dependencies (root)
working-directory: ./
run: yarn install --frozen-lockfile
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'temurin'
- name: build
working-directory: ./examples/Rn069/android
run: ./gradlew assembleRelease
- uses: mobile-dev-inc/action-maestro-cloud@v1.1.1
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: examples/Rn069/android/app/build/outputs/apk/release/app-release.apk

+ 12
- 0
.maestro/display-text.yml View File

@ -0,0 +1,12 @@
appId: com.rn069
---
- runFlow: utils/launch.yml
- runFlow:
file: utils/change-prop.yml
env:
PROP: locale
VALUE: vi-VN
- runFlow: utils/swipe-wheel-1.yml
- assertVisible:
id: dateStringOutput
text: 'CN 2 thg 11200 SA '

+ 12
- 0
.maestro/utils/change-prop.yml View File

@ -0,0 +1,12 @@
appId: com.rn069
---
- tapOn:
id: propName
- inputText: ${PROP}
- tapOn:
id: propValue
- inputText: ${VALUE}
- tapOn:
id: changeProp
- tapOn:
id: changeProp

+ 7
- 0
.maestro/utils/launch.yml View File

@ -0,0 +1,7 @@
appId: com.rn069
---
- launchApp:
stopApp: true
- tapOn: Advanced
- tapOn: androidVariant
- tapOn: nativeAndroid

+ 5
- 0
.maestro/utils/swipe-wheel-1.yml View File

@ -0,0 +1,5 @@
appId: com.rn069
---
- swipe:
start: 25%, 40%
end: 25%, 30%

+ 5
- 0
.maestro/utils/swipe-wheel-2.yml View File

@ -0,0 +1,5 @@
appId: com.rn069
---
- swipe:
start: 50%, 40%
end: 50%, 35%

+ 5
- 0
.maestro/utils/swipe-wheel-am-pm.yml View File

@ -0,0 +1,5 @@
appId: com.rn069
---
- swipe:
start: 75%, 40%
end: 75%, 35%

+ 1
- 1
examples/Rn069/android/app/build.gradle View File

@ -217,7 +217,7 @@ android {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
universalApk true// If true, also generate a universal APK
include (*reactNativeArchitectures())
}
}

+ 5
- 4
examples/Rn069/package.json View File

@ -18,7 +18,8 @@
"test:android-12h-mode": "yarn set-time-format 12 && yarn detox test --configuration android.debug e2e/tests/*.spec.js",
"test:android-12h-mode:ci": "yarn set-time-format 12 && yarn detox test --configuration android.ci e2e/tests/*.spec.js --record-logs failing --record-videos failing --take-screenshots failing",
"test:android": "yarn test:android-12h-mode && yarn test:android-24h-mode",
"test:android:ci": "yarn test:android-12h-mode:ci && yarn test:android-24h-mode:ci"
"test:android:ci": "yarn test:android-12h-mode:ci && yarn test:android-24h-mode:ci",
"emulator": "scripts/start-android-emulator.sh"
},
"dependencies": {
"detox": "^19.7.1",
@ -28,15 +29,15 @@
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/preset-typescript": "^7.18.6",
"@babel/runtime": "^7.12.5",
"@babel/runtime": "^7.21.0",
"@react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^28.1.2",
"babel-plugin-module-resolver": "^4.1.0",
"eslint": "^7.32.0",
"eslint-plugin-detox": "^1.0.0",
"jest": "^28.1.2",
"metro-react-native-babel-preset": "^0.70.3",
"react-test-renderer": "18.0.0",
"babel-plugin-module-resolver": "^4.1.0"
"react-test-renderer": "18.0.0"
},
"jest": {
"preset": "react-native"

+ 11
- 0
examples/Rn069/scripts/available-android-emulator.sh View File

@ -0,0 +1,11 @@
emulators=$(emulator -list-avds )
for emulator in $emulators
do
# Prefer non TV emulators
if [[ "$emulator" != *"TV"* ]]; then
EMULATOR=$emulator
fi
done
echo $EMULATOR

+ 4
- 0
examples/Rn069/scripts/start-android-emulator.sh View File

@ -0,0 +1,4 @@
currentDir=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
emulatorName=$(bash ${currentDir}/available-android-emulator.sh)
echo "Starting $emulatorName ..."
~/Library/Android/sdk/emulator/emulator -avd $emulatorName &

+ 13
- 1
examples/Rn069/yarn.lock View File

@ -715,13 +715,20 @@
pirates "^4.0.5"
source-map-support "^0.5.16"
"@babel/runtime@^7.0.0", "@babel/runtime@^7.12.5":
"@babel/runtime@^7.0.0":
version "7.18.6"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.6.tgz#6a1ef59f838debd670421f8c7f2cbb8da9751580"
integrity sha512-t9wi7/AW6XtKahAe20Yw0/mMljKq0B1r2fPdvaAdV/KPDZewFXdaaa6K7lxmZBZ8FBNpCiAT6iHPmd6QO9bKfQ==
dependencies:
regenerator-runtime "^0.13.4"
"@babel/runtime@^7.21.0":
version "7.21.0"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.21.0.tgz#5b55c9d394e5fcf304909a8b00c07dc217b56673"
integrity sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw==
dependencies:
regenerator-runtime "^0.13.11"
"@babel/template@^7.0.0", "@babel/template@^7.18.6", "@babel/template@^7.3.3":
version "7.18.6"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.18.6.tgz#1283f4993e00b929d6e2d3c72fdc9168a2977a31"
@ -5514,6 +5521,11 @@ regenerate@^1.4.2:
resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a"
integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==
regenerator-runtime@^0.13.11:
version "0.13.11"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9"
integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==
regenerator-runtime@^0.13.2, regenerator-runtime@^0.13.4:
version "0.13.9"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52"

+ 4944
- 2645
yarn.lock
File diff suppressed because it is too large
View File


Loading…
Cancel
Save