diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 06b46cb..db6ca53 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,4 +1,5 @@ name: E2E Tests +# Test trigger for CI verification on: pull_request: @@ -26,12 +27,6 @@ jobs: scheme: PlaygroundRN app_name: PlaygroundRN bundle_id: com.rnziparchive.playground.rn - - app: expo - dir: playground-expo - workspace: RNZipArchivePlayground.xcworkspace - scheme: RNZipArchivePlayground - app_name: RNZipArchivePlayground - bundle_id: com.rnziparchive.playground.expo steps: - name: Checkout uses: actions/checkout@v4 @@ -56,7 +51,8 @@ jobs: working-directory: ${{ matrix.dir }} run: | if [ -f "pnpm-lock.yaml" ]; then - corepack enable && pnpm install + npm install -g pnpm@9 + pnpm install else npm install fi @@ -80,17 +76,14 @@ jobs: -workspace ${{ matrix.workspace }} \ -scheme ${{ matrix.scheme }} \ -configuration Release \ - -destination 'platform=iOS Simulator,name=iPhone 15' \ + -destination 'generic/platform=iOS Simulator' \ -derivedDataPath build \ CODE_SIGNING_ALLOWED=NO \ COMPILER_INDEX_STORE_ENABLE=NO - name: Boot iOS Simulator run: | - DEVICE_ID=$(xcrun simctl list devices | grep "iPhone 15" | grep -oE '[0-9A-F]{8}-([0-9A-F]{4}-){3}[0-9A-F]{12}' | head -1) - if [ -z "$DEVICE_ID" ]; then - DEVICE_ID=$(xcrun simctl list devices | grep "iPhone" | grep -oE '[0-9A-F]{8}-([0-9A-F]{4}-){3}[0-9A-F]{12}' | head -1) - fi + DEVICE_ID=$(xcrun simctl list devices | grep -E 'iPhone [0-9]+ \(' | grep -oE '[0-9A-F]{8}-([0-9A-F]{4}-){3}[0-9A-F]{12}' | head -1) echo "Booting simulator: $DEVICE_ID" xcrun simctl boot "$DEVICE_ID" echo "MAESTRO_IOS_DEVICE=$DEVICE_ID" >> $GITHUB_ENV @@ -101,7 +94,29 @@ jobs: APP_PATH="${{ matrix.dir }}/ios/build/Build/Products/Release-iphonesimulator/${{ matrix.app_name }}.app" xcrun simctl install "$MAESTRO_IOS_DEVICE" "$APP_PATH" export APP_ID="${{ matrix.bundle_id }}" - maestro test --device="$MAESTRO_IOS_DEVICE" --env APP_ID="$APP_ID" .maestro/flows/ + maestro test --device="$MAESTRO_IOS_DEVICE" --env APP_ID="$APP_ID" .maestro/flows/ci-master.yaml + + - name: Upload Maestro debug artifacts + if: failure() + uses: actions/upload-artifact@v4 + with: + name: maestro-debug-ios + path: ~/.maestro/tests/ + + - name: Upload iOS crash logs + if: failure() + run: | + mkdir -p crash-logs + cp ~/Library/Logs/DiagnosticReports/*.crash crash-logs/ 2>/dev/null || true + ls crash-logs/ || echo "No crash logs found" + shell: bash + + - name: Upload crash logs artifact + if: failure() + uses: actions/upload-artifact@v4 + with: + name: ios-crash-logs + path: crash-logs/ e2e-android: name: E2E Android (${{ matrix.app }}) @@ -114,9 +129,6 @@ jobs: - app: rn dir: playground-rn bundle_id: com.rnziparchive.playground.rn - - app: expo - dir: playground-expo - bundle_id: com.rnziparchive.playground.expo steps: - name: Checkout uses: actions/checkout@v4 @@ -147,7 +159,8 @@ jobs: working-directory: ${{ matrix.dir }} run: | if [ -f "pnpm-lock.yaml" ]; then - corepack enable && pnpm install + npm install -g pnpm@9 + pnpm install else npm install fi @@ -175,5 +188,11 @@ jobs: disable-animations: true script: | adb install ${{ matrix.dir }}/android/app/build/outputs/apk/release/app-release.apk - export APP_ID="${{ matrix.bundle_id }}" - maestro test --env APP_ID="$APP_ID" .maestro/flows/ + maestro test --env APP_ID="${{ matrix.bundle_id }}" .maestro/flows/ci-master.yaml + + - name: Upload Maestro debug artifacts + if: failure() + uses: actions/upload-artifact@v4 + with: + name: maestro-debug-android + path: ~/.maestro/tests/ diff --git a/.maestro/flows/_assets-test.yaml b/.maestro/flows/_assets-test.yaml new file mode 100644 index 0000000..731bcdc --- /dev/null +++ b/.maestro/flows/_assets-test.yaml @@ -0,0 +1,30 @@ +appId: ${APP_ID} +--- +- runFlow: + when: + notVisible: "Assets (Android)" + commands: + - tapOn: "Playground" +- scrollUntilVisible: + element: + text: "Assets (Android)" + direction: DOWN +- tapOn: "Assets (Android)" +- runFlow: + when: + visible: "Not Supported" + commands: + - assertVisible: "Not Supported" +- runFlow: + when: + visible: "Android Assets Demo" + commands: + - assertVisible: "Android Assets Demo" + - tapOn: "Unzip Assets" + - waitForAnimationToEnd: + timeout: 10000 + - assertVisible: "Extracted To" + - extendedWaitUntil: + visible: "Files:" + timeout: 10000 + - assertVisible: "Files:" diff --git a/.maestro/flows/_home-check.yaml b/.maestro/flows/_home-check.yaml new file mode 100644 index 0000000..45f5f5d --- /dev/null +++ b/.maestro/flows/_home-check.yaml @@ -0,0 +1,11 @@ +appId: ${APP_ID} +--- +- assertVisible: "Zip Operations" +- assertVisible: "Unzip Operations" +- assertVisible: "Password Protection" +- assertVisible: "Progress Events" +- scrollUntilVisible: + element: + text: "Benchmarks" + direction: DOWN +- assertVisible: "Benchmarks" diff --git a/.maestro/flows/_password-test.yaml b/.maestro/flows/_password-test.yaml new file mode 100644 index 0000000..365670f --- /dev/null +++ b/.maestro/flows/_password-test.yaml @@ -0,0 +1,19 @@ +appId: ${APP_ID} +--- +- runFlow: + when: + notVisible: "Password Protection" + commands: + - tapOn: "Playground" +- tapOn: "Password Protection" +- assertVisible: "Create Password Zip" +- tapOn: "Create Password Zip" +- waitForAnimationToEnd: + timeout: 10000 +- assertVisible: "Zip Created" +- assertVisible: "Password Protected: Yes" +- tapOn: "Unzip with Password" +- waitForAnimationToEnd: + timeout: 10000 +- assertVisible: "Extracted" +- back diff --git a/.maestro/flows/_progress-test.yaml b/.maestro/flows/_progress-test.yaml new file mode 100644 index 0000000..55081cc --- /dev/null +++ b/.maestro/flows/_progress-test.yaml @@ -0,0 +1,18 @@ +appId: ${APP_ID} +--- +- runFlow: + when: + notVisible: "Progress Events" + commands: + - tapOn: "Playground" +- tapOn: "Progress Events" +- assertVisible: "Subscribe" +- tapOn: "Subscribe" +- assertVisible: "Status: Subscribed" +- tapOn: "Run Large Zip" +- extendedWaitUntil: + visible: "Completed" + timeout: 120000 +- tapOn: "Unsubscribe" +- assertVisible: "Status: Not subscribed" +- back diff --git a/.maestro/flows/_setup.yaml b/.maestro/flows/_setup.yaml new file mode 100644 index 0000000..dbbda73 --- /dev/null +++ b/.maestro/flows/_setup.yaml @@ -0,0 +1,77 @@ +appId: ${APP_ID} +--- +- stopApp +- launchApp + +- runFlow: + when: + visible: "DEVELOPMENT SERVERS" + commands: + - tapOn: "RNZipArchive Playground" + - runFlow: + when: + visible: "Open" + commands: + - tapOn: "Open" + - runFlow: + when: + visible: "Continue" + commands: + - tapOn: "Continue" + - runFlow: + when: + visible: "Reload" + commands: + - tapOn: "Reload" + +- runFlow: + when: + visible: "http://localhost:8081" + commands: + - tapOn: "http://localhost:8081" + - runFlow: + when: + visible: "Open" + commands: + - tapOn: "Open" + - runFlow: + when: + visible: "Continue" + commands: + - tapOn: "Continue" + - runFlow: + when: + visible: "Reload" + commands: + - tapOn: "Reload" + +- runFlow: + when: + visible: "http://10.0.2.2:8081" + commands: + - tapOn: "http://10.0.2.2:8081" + - runFlow: + when: + visible: "Open" + commands: + - tapOn: "Open" + - runFlow: + when: + visible: "Continue" + commands: + - tapOn: "Continue" + - runFlow: + when: + visible: "Reload" + commands: + - tapOn: "Reload" + +- extendedWaitUntil: + visible: "RNZipArchive Playground" + timeout: 180000 + +- runFlow: + when: + visible: "Toggle performance monitor" + commands: + - pressKey: BACK diff --git a/.maestro/flows/_unzip-test.yaml b/.maestro/flows/_unzip-test.yaml new file mode 100644 index 0000000..e25f0d0 --- /dev/null +++ b/.maestro/flows/_unzip-test.yaml @@ -0,0 +1,15 @@ +appId: ${APP_ID} +--- +- runFlow: + when: + notVisible: "Unzip Operations" + commands: + - tapOn: "Playground" +- tapOn: "Unzip Operations" +- assertVisible: "Create & Unzip Sample" +- tapOn: "Create & Unzip Sample" +- waitForAnimationToEnd: + timeout: 10000 +- assertVisible: "Extracted To" +- assertVisible: "hello.txt" +- back diff --git a/.maestro/flows/_zip-test.yaml b/.maestro/flows/_zip-test.yaml new file mode 100644 index 0000000..da79997 --- /dev/null +++ b/.maestro/flows/_zip-test.yaml @@ -0,0 +1,9 @@ +appId: ${APP_ID} +--- +- tapOn: "Zip Operations" +- assertVisible: "Zip Sample Folder" +- tapOn: "Zip Sample Folder" +- waitForAnimationToEnd: + timeout: 10000 +- assertVisible: "Success" +- back diff --git a/.maestro/flows/assets.yaml b/.maestro/flows/assets.yaml index 716f6d7..f31ff07 100644 --- a/.maestro/flows/assets.yaml +++ b/.maestro/flows/assets.yaml @@ -1,95 +1,4 @@ appId: ${APP_ID} --- -- runFlow: - when: - visible: "DEVELOPMENT SERVERS" - commands: - - tapOn: "RNZipArchive Playground" - - runFlow: - when: - visible: "Open" - commands: - - tapOn: "Open" - - runFlow: - when: - visible: "Continue" - commands: - - tapOn: "Continue" - - runFlow: - when: - visible: "Reload" - commands: - - tapOn: "Reload" -- stopApp -- launchApp -- runFlow: - when: - visible: "http://localhost:8081" - commands: - - tapOn: "http://localhost:8081" - - runFlow: - when: - visible: "Open" - commands: - - tapOn: "Open" - - runFlow: - when: - visible: "Continue" - commands: - - tapOn: "Continue" - - runFlow: - when: - visible: "Reload" - commands: - - tapOn: "Reload" -- runFlow: - when: - visible: "http://10.0.2.2:8081" - commands: - - tapOn: "http://10.0.2.2:8081" - - runFlow: - when: - visible: "Open" - commands: - - tapOn: "Open" - - runFlow: - when: - visible: "Continue" - commands: - - tapOn: "Continue" - - runFlow: - when: - visible: "Reload" - commands: - - tapOn: "Reload" -- extendedWaitUntil: - visible: "RNZipArchive Playground" - timeout: 45000 -- runFlow: - when: - visible: "Toggle performance monitor" - commands: - - pressKey: BACK -- scrollUntilVisible: - element: - text: "Assets (Android)" - direction: DOWN -- tapOn: "Assets (Android)" -- assertVisible: "Assets" -- runFlow: - when: - visible: "Not Supported" - commands: - - assertVisible: "Not Supported" -- runFlow: - when: - visible: "Unzip Assets" - commands: - - tapOn: "Unzip Assets" - - waitForAnimationToEnd: - timeout: 10000 - - assertVisible: "Extracted To" - - extendedWaitUntil: - visible: "Files:" - timeout: 10000 - - assertVisible: "Files:" +- runFlow: _setup.yaml +- runFlow: _assets-test.yaml diff --git a/.maestro/flows/ci-master.yaml b/.maestro/flows/ci-master.yaml new file mode 100644 index 0000000..a2e834f --- /dev/null +++ b/.maestro/flows/ci-master.yaml @@ -0,0 +1,9 @@ +appId: ${APP_ID} +--- +- runFlow: _setup.yaml +- runFlow: _home-check.yaml +- runFlow: _zip-test.yaml +- runFlow: _unzip-test.yaml +- runFlow: _password-test.yaml +- runFlow: _progress-test.yaml +- runFlow: _assets-test.yaml diff --git a/.maestro/flows/home.yaml b/.maestro/flows/home.yaml index bf61e57..044ed8c 100644 --- a/.maestro/flows/home.yaml +++ b/.maestro/flows/home.yaml @@ -1,77 +1,4 @@ appId: ${APP_ID} --- -- stopApp -- launchApp -- runFlow: - when: - visible: "DEVELOPMENT SERVERS" - commands: - - tapOn: "RNZipArchive Playground" - - runFlow: - when: - visible: "Open" - commands: - - tapOn: "Open" - - runFlow: - when: - visible: "Continue" - commands: - - tapOn: "Continue" - - runFlow: - when: - visible: "Reload" - commands: - - tapOn: "Reload" -- runFlow: - when: - visible: "http://localhost:8081" - commands: - - tapOn: "http://localhost:8081" - - runFlow: - when: - visible: "Open" - commands: - - tapOn: "Open" - - runFlow: - when: - visible: "Continue" - commands: - - tapOn: "Continue" - - runFlow: - when: - visible: "Reload" - commands: - - tapOn: "Reload" -- runFlow: - when: - visible: "http://10.0.2.2:8081" - commands: - - tapOn: "http://10.0.2.2:8081" - - runFlow: - when: - visible: "Open" - commands: - - tapOn: "Open" - - runFlow: - when: - visible: "Continue" - commands: - - tapOn: "Continue" - - runFlow: - when: - visible: "Reload" - commands: - - tapOn: "Reload" -- extendedWaitUntil: - visible: "RNZipArchive Playground" - timeout: 45000 -- runFlow: - when: - visible: "Toggle performance monitor" - commands: - - pressKey: BACK -- assertVisible: "Zip Operations" -- assertVisible: "Unzip Operations" -- assertVisible: "Password Protection" -- assertVisible: "Progress Events" -- assertVisible: "Benchmarks" +- runFlow: _setup.yaml +- runFlow: _home-check.yaml diff --git a/.maestro/flows/password.yaml b/.maestro/flows/password.yaml index 80bf1f6..3b838c6 100644 --- a/.maestro/flows/password.yaml +++ b/.maestro/flows/password.yaml @@ -1,83 +1,4 @@ appId: ${APP_ID} --- -- runFlow: - when: - visible: "DEVELOPMENT SERVERS" - commands: - - tapOn: "RNZipArchive Playground" - - runFlow: - when: - visible: "Open" - commands: - - tapOn: "Open" - - runFlow: - when: - visible: "Continue" - commands: - - tapOn: "Continue" - - runFlow: - when: - visible: "Reload" - commands: - - tapOn: "Reload" -- stopApp -- launchApp -- runFlow: - when: - visible: "http://localhost:8081" - commands: - - tapOn: "http://localhost:8081" - - runFlow: - when: - visible: "Open" - commands: - - tapOn: "Open" - - runFlow: - when: - visible: "Continue" - commands: - - tapOn: "Continue" - - runFlow: - when: - visible: "Reload" - commands: - - tapOn: "Reload" -- runFlow: - when: - visible: "http://10.0.2.2:8081" - commands: - - tapOn: "http://10.0.2.2:8081" - - runFlow: - when: - visible: "Open" - commands: - - tapOn: "Open" - - runFlow: - when: - visible: "Continue" - commands: - - tapOn: "Continue" - - runFlow: - when: - visible: "Reload" - commands: - - tapOn: "Reload" -- extendedWaitUntil: - visible: "RNZipArchive Playground" - timeout: 45000 -- runFlow: - when: - visible: "Toggle performance monitor" - commands: - - pressKey: BACK -- tapOn: "Password Protection" -- assertVisible: "Create Password Zip" -- tapOn: "Create Password Zip" -- waitForAnimationToEnd: - timeout: 10000 -- assertVisible: "Zip Created" -- assertVisible: "Password Protected: Yes" -- tapOn: "Unzip with Password" -- waitForAnimationToEnd: - timeout: 10000 -- assertVisible: "Extracted" +- runFlow: _setup.yaml +- runFlow: _password-test.yaml diff --git a/.maestro/flows/progress.yaml b/.maestro/flows/progress.yaml index 51c100e..5ead97a 100644 --- a/.maestro/flows/progress.yaml +++ b/.maestro/flows/progress.yaml @@ -1,82 +1,4 @@ appId: ${APP_ID} --- -- runFlow: - when: - visible: "DEVELOPMENT SERVERS" - commands: - - tapOn: "RNZipArchive Playground" - - runFlow: - when: - visible: "Open" - commands: - - tapOn: "Open" - - runFlow: - when: - visible: "Continue" - commands: - - tapOn: "Continue" - - runFlow: - when: - visible: "Reload" - commands: - - tapOn: "Reload" -- stopApp -- launchApp -- runFlow: - when: - visible: "http://localhost:8081" - commands: - - tapOn: "http://localhost:8081" - - runFlow: - when: - visible: "Open" - commands: - - tapOn: "Open" - - runFlow: - when: - visible: "Continue" - commands: - - tapOn: "Continue" - - runFlow: - when: - visible: "Reload" - commands: - - tapOn: "Reload" -- runFlow: - when: - visible: "http://10.0.2.2:8081" - commands: - - tapOn: "http://10.0.2.2:8081" - - runFlow: - when: - visible: "Open" - commands: - - tapOn: "Open" - - runFlow: - when: - visible: "Continue" - commands: - - tapOn: "Continue" - - runFlow: - when: - visible: "Reload" - commands: - - tapOn: "Reload" -- extendedWaitUntil: - visible: "RNZipArchive Playground" - timeout: 45000 -- runFlow: - when: - visible: "Toggle performance monitor" - commands: - - pressKey: BACK -- tapOn: "Progress Events" -- assertVisible: "Subscribe" -- tapOn: "Subscribe" -- assertVisible: "Status: Subscribed" -- tapOn: "Run Large Zip" -- extendedWaitUntil: - visible: "Completed" - timeout: 30000 -- tapOn: "Unsubscribe" -- assertVisible: "Status: Not subscribed" +- runFlow: _setup.yaml +- runFlow: _progress-test.yaml diff --git a/.maestro/flows/zip-and-unzip.yaml b/.maestro/flows/zip-and-unzip.yaml index 371bc91..983a2ee 100644 --- a/.maestro/flows/zip-and-unzip.yaml +++ b/.maestro/flows/zip-and-unzip.yaml @@ -1,91 +1,5 @@ appId: ${APP_ID} --- -- runFlow: - when: - visible: "DEVELOPMENT SERVERS" - commands: - - tapOn: "RNZipArchive Playground" - - runFlow: - when: - visible: "Open" - commands: - - tapOn: "Open" - - runFlow: - when: - visible: "Continue" - commands: - - tapOn: "Continue" - - runFlow: - when: - visible: "Reload" - commands: - - tapOn: "Reload" -- stopApp -- launchApp -- runFlow: - when: - visible: "http://localhost:8081" - commands: - - tapOn: "http://localhost:8081" - - runFlow: - when: - visible: "Open" - commands: - - tapOn: "Open" - - runFlow: - when: - visible: "Continue" - commands: - - tapOn: "Continue" - - runFlow: - when: - visible: "Reload" - commands: - - tapOn: "Reload" -- runFlow: - when: - visible: "http://10.0.2.2:8081" - commands: - - tapOn: "http://10.0.2.2:8081" - - runFlow: - when: - visible: "Open" - commands: - - tapOn: "Open" - - runFlow: - when: - visible: "Continue" - commands: - - tapOn: "Continue" - - runFlow: - when: - visible: "Reload" - commands: - - tapOn: "Reload" -- extendedWaitUntil: - visible: "RNZipArchive Playground" - timeout: 45000 -- runFlow: - when: - visible: "Toggle performance monitor" - commands: - - pressKey: BACK -- tapOn: "Zip Operations" -- assertVisible: "Zip Sample Folder" -- tapOn: "Zip Sample Folder" -- waitForAnimationToEnd: - timeout: 10000 -- assertVisible: "Success" -- back -- runFlow: - when: - notVisible: "Unzip Operations" - commands: - - tapOn: "Playground" -- tapOn: "Unzip Operations" -- assertVisible: "Create & Unzip Sample" -- tapOn: "Create & Unzip Sample" -- waitForAnimationToEnd: - timeout: 10000 -- assertVisible: "Extracted To" -- assertVisible: "hello.txt" +- runFlow: _setup.yaml +- runFlow: _zip-test.yaml +- runFlow: _unzip-test.yaml