diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5fb30b7..51e13c6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -137,3 +137,34 @@ jobs: with: name: output_ios path: output + + check_simple_maestro_android: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Run tests + uses: ./ + with: + apiKey: ${{ secrets.MARATHON_CLOUD_API_TOKEN }} + application: "example/maestro/android/wikipedia.apk" + testApplication: "example/maestro/android/flows" + platform: "maestro/android" + name: "maestro_android_simple" + version: "1.0.51" + + check_simple_maestro_ios: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Run tests + uses: ./ + with: + apiKey: ${{ secrets.MARATHON_CLOUD_API_TOKEN }} + application: "example/maestro/ios/wikipedia.zip" + testApplication: "example/maestro/ios/flows" + platform: "maestro/ios" + name: "maestro_ios_simple" + version: "1.0.51" + diff --git a/action.yaml b/action.yaml index 90cc140..1118540 100644 --- a/action.yaml +++ b/action.yaml @@ -11,16 +11,17 @@ inputs: description: "Application binary path, e.g. apk file for Android or zip file of iOS Application" required: true testApplication: - description: "Test application binary path, e.g. apk file for Android or zip file of iOS Test Runner app" + description: "Test application binary path, e.g. apk file for Android or zip file of iOS Test Runner app or folder containing maestro flow" required: true platform: - description: "Testing platform. Android or iOS only" + description: "Testing platform. [Android,iOS,Maestro/Android,Maestro/iOS]" required: true osVersion: - description: "Android or iOS OS version. For Android one of [10, 11, 12, 13, 14]. For iOS one of [16.4, 17.2]" + description: "Android or iOS OS version. For Android one of [8.1, 9, 10, 11, 12, 13, 14, 15, 16]. For iOS one of [17.5, 18.2, 18.4]" required: false systemImage: - description: "OS-specific system image. For Android one of [default,google_apis]. For iOS only [default]" + description: "OS-specific system image. For Android one of [default,google_apis,google_apis_playstore]. For iOS only [default]" + required: false link: description: "Link to commit" required: false @@ -41,16 +42,15 @@ inputs: required: false wait: description: "Wait for test run to finish if true, exits after triggering a run if false. Defaults to true" - default: "true" required: false name: description: "Name for run, for example it could be description of commit" required: false device: - description: "Device type. For Android one of [phone, tv, watch]. For iOS one of [iPhone-14, iPhone-15]" + description: "Device type. For Android one of [phone, tv, watch]. For iOS one of [iPhone-11, iPhone-15, iPhone-15-Pro, iPhone-15-Pro-Max, iPhone-16, iPhone-16-Plus, iPhone-16-Pro, iPhone-16-Pro-Max]" required: false xcodeVersion: - description: "Xcode version. Only for iOS. Possible values: [14.3.1, 15.2]" + description: "Xcode version. Only for iOS. Possible values: [15.4, 16.2, 16.3]" required: false xctestplanFilterFile: description: "Test filters supplied as .xctestplan file" @@ -97,6 +97,12 @@ inputs: noRetries: description: "Disable all retries [possible values: true, false]" required: false + maestroEnv: + description: "maestro environment variables, format: 'MAESTRO_APP_ID=com.example,MAESTRO_OTHER_VAR=blahblah'" + required: false + flows: + description: "maestro flows to execute, all the files specified should be inside the testApplication folder: 'flows/my-flow.yaml,flows/subfolder/flow.yaml'" + required: false branding: color: purple icon: play-circle @@ -108,7 +114,7 @@ runs: with: version: ${{ inputs.version }} - name: Run tests using marathon-cloud - uses: MarathonLabs/action-invoke@1.0.14 + uses: MarathonLabs/action-invoke@1.0.15 with: apiKey: ${{ inputs.apiKey }} application: ${{ inputs.application }} @@ -141,3 +147,5 @@ runs: retryQuotaTestPreventive: ${{ inputs.retryQuotaTestPreventive }} retryQuotaTestReactive: ${{ inputs.retryQuotaTestReactive }} noRetries: ${{ inputs.noRetries }} + maestroEnv: ${{ inputs.maestroEnv }} + flows: ${{ inputs.flows}} diff --git a/example/maestro/android/flows/android-advanced-flow.yaml b/example/maestro/android/flows/android-advanced-flow.yaml new file mode 100755 index 0000000..ce7c335 --- /dev/null +++ b/example/maestro/android/flows/android-advanced-flow.yaml @@ -0,0 +1,16 @@ +appId: org.wikipedia +tags: + - android + - passing + - advanced +--- +- runFlow: subflows/onboarding-android.yaml +- tapOn: + id: "org.wikipedia:id/search_container" +- tapOn: + text: "Non existent view" + optional: true +- runScript: scripts/getSearchQuery.js +- inputText: ${output.result} +- assertVisible: ${output.result} +- runFlow: subflows/launch-clearstate-android.yaml diff --git a/example/maestro/android/flows/android-failing.yaml b/example/maestro/android/flows/android-failing.yaml new file mode 100755 index 0000000..7d0ced3 --- /dev/null +++ b/example/maestro/android/flows/android-failing.yaml @@ -0,0 +1,6 @@ +appId: org.wikipedia +tags: + - android + - passing +--- +- launchApp diff --git a/example/maestro/android/flows/android-flow.yaml b/example/maestro/android/flows/android-flow.yaml new file mode 100755 index 0000000..b5bc7c9 --- /dev/null +++ b/example/maestro/android/flows/android-flow.yaml @@ -0,0 +1,7 @@ +appId: org.wikipedia +tags: + - android + - passing +--- +- launchApp +- assertVisible: "Doesn't exist" diff --git a/example/maestro/android/flows/scripts/getSearchQuery.js b/example/maestro/android/flows/scripts/getSearchQuery.js new file mode 100755 index 0000000..f8a1842 --- /dev/null +++ b/example/maestro/android/flows/scripts/getSearchQuery.js @@ -0,0 +1 @@ +output.result = 'qwerty'; diff --git a/example/maestro/android/flows/subflows/launch-clearstate-android.yaml b/example/maestro/android/flows/subflows/launch-clearstate-android.yaml new file mode 100755 index 0000000..b9461b6 --- /dev/null +++ b/example/maestro/android/flows/subflows/launch-clearstate-android.yaml @@ -0,0 +1,6 @@ +appId: org.wikipedia +--- +- launchApp: + clearState: true +- assertVisible: "Continue" +- assertVisible: "Skip" \ No newline at end of file diff --git a/example/maestro/android/flows/subflows/onboarding-android.yaml b/example/maestro/android/flows/subflows/onboarding-android.yaml new file mode 100755 index 0000000..e9ee46f --- /dev/null +++ b/example/maestro/android/flows/subflows/onboarding-android.yaml @@ -0,0 +1,15 @@ +appId: org.wikipedia +--- +- launchApp: + clearState: true +- tapOn: + text: "Non existent view" + optional: true +- tapOn: + id: "org.wikipedia:id/fragment_onboarding_forward_button" +- tapOn: + id: "org.wikipedia:id/fragment_onboarding_forward_button" +- tapOn: + id: "org.wikipedia:id/fragment_onboarding_forward_button" +- tapOn: + id: "org.wikipedia:id/fragment_onboarding_done_button" diff --git a/example/maestro/android/wikipedia.apk b/example/maestro/android/wikipedia.apk new file mode 100644 index 0000000..6b206b3 Binary files /dev/null and b/example/maestro/android/wikipedia.apk differ diff --git a/example/maestro/ios/flows/ios-advanced-flow.yaml b/example/maestro/ios/flows/ios-advanced-flow.yaml new file mode 100755 index 0000000..234557c --- /dev/null +++ b/example/maestro/ios/flows/ios-advanced-flow.yaml @@ -0,0 +1,25 @@ +appId: org.wikimedia.wikipedia +tags: + - ios + - passing + - advanced +--- +- runFlow: subflows/onboarding-ios.yaml + +# Dismiss the auth modal if visible +- runFlow: + when: + visible: "You have been logged out" + commands: + - tapOn: + text: "Continue without logging in" +- tapOn: + text: "Non existent view" + optional: true +- tapOn: Search Wikipedia +- runScript: scripts/getSearchQuery.js +- inputText: ${output.result} +- eraseText +- inputText: qwerty +- assertVisible: ${output.result} +- runFlow: subflows/launch-clearstate-ios.yaml diff --git a/example/maestro/ios/flows/ios-failing.yaml b/example/maestro/ios/flows/ios-failing.yaml new file mode 100755 index 0000000..75db874 --- /dev/null +++ b/example/maestro/ios/flows/ios-failing.yaml @@ -0,0 +1,7 @@ +appId: org.wikipedia +tags: + - ios + - failing +--- +- launchApp +- assertVisible: "Doesn't exist" diff --git a/example/maestro/ios/flows/ios-flow.yaml b/example/maestro/ios/flows/ios-flow.yaml new file mode 100755 index 0000000..217066d --- /dev/null +++ b/example/maestro/ios/flows/ios-flow.yaml @@ -0,0 +1,6 @@ +appId: org.wikimedia.wikipedia +tags: + - ios + - passing +--- +- launchApp diff --git a/example/maestro/ios/flows/scripts/getSearchQuery.js b/example/maestro/ios/flows/scripts/getSearchQuery.js new file mode 100755 index 0000000..f8a1842 --- /dev/null +++ b/example/maestro/ios/flows/scripts/getSearchQuery.js @@ -0,0 +1 @@ +output.result = 'qwerty'; diff --git a/example/maestro/ios/flows/subflows/launch-clearstate-ios.yaml b/example/maestro/ios/flows/subflows/launch-clearstate-ios.yaml new file mode 100755 index 0000000..08a8ff7 --- /dev/null +++ b/example/maestro/ios/flows/subflows/launch-clearstate-ios.yaml @@ -0,0 +1,6 @@ +appId: org.wikimedia.wikipedia +--- +- launchApp: + clearState: true +- assertVisible: "Next" +- assertVisible: "Skip" diff --git a/example/maestro/ios/flows/subflows/onboarding-ios.yaml b/example/maestro/ios/flows/subflows/onboarding-ios.yaml new file mode 100755 index 0000000..7f74121 --- /dev/null +++ b/example/maestro/ios/flows/subflows/onboarding-ios.yaml @@ -0,0 +1,15 @@ +appId: org.wikimedia.wikipedia +--- +- launchApp: + clearState: true +- repeat: + times: 3 + commands: + - swipe: + direction: LEFT + duration: 400 + - waitForAnimationToEnd +- tapOn: Get started +- tapOn: + text: "Non existent view" + optional: true diff --git a/example/maestro/ios/wikipedia.zip b/example/maestro/ios/wikipedia.zip new file mode 100644 index 0000000..629cf00 Binary files /dev/null and b/example/maestro/ios/wikipedia.zip differ