|
1 | 1 | # maestro-sample |
2 | | -Samples to support Mastro for iOS and Android apps on browserstack |
| 2 | +This repo contains a sample test suite that can be used to run maestro tests on App Automate. |
| 3 | + |
| 4 | +### To Run tests: |
| 5 | +App for android: `sample_apps/sample_android.apk` |
| 6 | +App for iOS: `sample_apps/sample_ios.ipa` |
| 7 | +Upload the app using the command: |
| 8 | +``` |
| 9 | +curl -u "<username>:<accesskey>" \ |
| 10 | +-X POST "https://api-cloud.browserstack.com/app-automate/upload" \ |
| 11 | +-F "file=@<path_to_app>" |
| 12 | +``` |
| 13 | +This should generate and return an app hash. |
| 14 | + |
| 15 | +__Test Suite__: `tests/` |
| 16 | +zip the `tests/` folder before uploading, and upload using the command: |
| 17 | +``` |
| 18 | +curl -u "<username>:<accesskey>" \ |
| 19 | +-X POST "https://api-cloud.browserstack.com/app-automate/maestro/v2/test-suite" \ |
| 20 | +-F "file=@<path_to_zipped_testsuite>" \ |
| 21 | +-F "custom_id=maestro_sample_tests" |
| 22 | +``` |
| 23 | +This should generate and return a test suite hash. |
| 24 | + |
| 25 | +Once the app and the zipped test suite are uploaded, use the following command to run tests: |
| 26 | +For Android: |
| 27 | +``` |
| 28 | +curl -u "<username>:<accesskey>" \ |
| 29 | + -X POST "https://api-cloud.browserstack.com/app-automate/maestro/v2/android/build" \ |
| 30 | + -H "Content-Type: application/json" \ |
| 31 | + -d '{ |
| 32 | + "app": "bs://<app-hash>", |
| 33 | + "testSuite": "bs://<test-suite-hash>", |
| 34 | + "project": "Maestro_Sample_Repo", |
| 35 | + "execute": ["android-flow.yaml"], |
| 36 | + "devices": [ |
| 37 | + "Google Pixel 9-16.0", |
| 38 | + "Samsung Galaxy S22-14.0", |
| 39 | + "Samsung Galaxy Tab S11-16.0" |
| 40 | + ] |
| 41 | + }' |
| 42 | +``` |
| 43 | + |
| 44 | +For iOS: |
| 45 | +``` |
| 46 | +curl -u "<username>:<accesskey>" \ |
| 47 | + -X POST "https://api-cloud.browserstack.com/app-automate/maestro/v2/ios/build" \ |
| 48 | + -H "Content-Type: application/json" \ |
| 49 | + -d '{ |
| 50 | + "app": "bs://<app-hash>", |
| 51 | + "testSuite": "bs://<test-suite-hash>", |
| 52 | + "project": "<Maestro Demo>", |
| 53 | + "execute": ["ios-flow.yaml"], |
| 54 | + "devices": [ |
| 55 | + "iPhone 15-17.0", |
| 56 | + "iPhone 12 Pro Max-16.0", |
| 57 | + "iPad Pro 11 2021-18.0" |
| 58 | + ] |
| 59 | + }' |
| 60 | +``` |
| 61 | +This parallelly runs tests on the devices listed in the above command. |
0 commit comments