### Start Local Development Server Source: https://github.com/marathonlabs/marathon/blob/develop/docs/README.md Starts a local development server. Changes are reflected live without a server restart. ```bash yarn start ``` -------------------------------- ### Executing Marathon Tests Source: https://github.com/marathonlabs/marathon/blob/develop/README.md Command to start the Marathon test runner from the root of your project. Includes example log output indicating Marathon startup. ```bash $ marathon XXX [main] INFO com.malinskiy.marathon.cli.ApplicationView - Starting marathon XXX [main] INFO com.malinskiy.marathon.cli.config.ConfigFactory - Checking Marathonfile config ... ``` -------------------------------- ### Install Dependencies Source: https://github.com/marathonlabs/marathon/blob/develop/docs/README.md Run this command to install project dependencies using Yarn. ```bash yarn ``` -------------------------------- ### Install Marathon Cloud CLI with Homebrew Source: https://github.com/marathonlabs/marathon/blob/develop/docs/cloud/index.md Installs the Marathon Cloud CLI using Homebrew. Ensure you have Homebrew installed and the MarathonLabs repository tapped. ```shell brew tap malinskiy/tap brew install malinskiy/tap/marathon-cloud ``` -------------------------------- ### Install Marathon Cloud CLI with Homebrew Source: https://github.com/marathonlabs/marathon/blob/develop/docs/cloud/cli/installation.md Install the Marathon Cloud CLI after tapping the MarathonLabs repository. This command installs the latest version of the CLI. ```shell brew install malinskiy/tap/marathon-cloud ``` -------------------------------- ### iOS Project File Structure Source: https://github.com/marathonlabs/marathon/blob/develop/README.md Example file structure for an iOS project using Marathon, including the Marathondevices and Marathonfile, and build directory with app/test bundles. ```shell foo@bar $ tree . . ├── Marathondevices ├── Marathonfile ├── build │   ├── my.app │   ├── my.xctest ``` -------------------------------- ### Android Project File Structure Source: https://github.com/marathonlabs/marathon/blob/develop/README.md Example file structure for an Android project using Marathon, including the Marathonfile and distribution directory with APKs. ```shell foo@bar $ tree . . ├── Marathonfile ├── dist │   ├── app-debug.apk │   ├── app-debug-androidTest.apk ``` -------------------------------- ### Add MarathonLabs Repository with Homebrew Source: https://github.com/marathonlabs/marathon/blob/develop/docs/cloud/cli/installation.md Use this command to add the MarathonLabs repository to your Homebrew installation. This is a prerequisite for installing the Marathon Cloud CLI via Homebrew. ```shell brew tap malinskiy/tap ``` -------------------------------- ### Maestro Test with Environment Variable Source: https://github.com/marathonlabs/marathon/blob/develop/docs/cloud/intro/maestro.md Pass custom environment variables to Maestro tests using the --maestro-env flag. Variables must start with MAESTRO_ and are referenced using ${VARIABLE_NAME} in the test flow. ```yaml appId: your.app.id --- - launchApp - inputText: ${MAESTRO_USERNAME} ``` ```shell export MARATHON_CLOUD_API_KEY=generated_api_key marathon-cloud run maestro android --application your_app.apk --test-application ./path/to/tests --maestro-env=MAESTRO_USERNAME=MY_USER_NAME folder_or_file_to_execute ``` -------------------------------- ### Deploy Website (SSH) Source: https://github.com/marathonlabs/marathon/blob/develop/docs/README.md Builds and deploys the website using SSH. Assumes SSH is configured for deployment. ```bash USE_SSH=true yarn deploy ``` -------------------------------- ### Download iOS Sample Applications Source: https://github.com/marathonlabs/marathon/blob/develop/docs/cloud/index.md Downloads the prebuilt sample application and test application for iOS using curl. Save these files for subsequent test execution. ```shell curl https://cloud.marathonlabs.io/samples/ios/sample.zip -o sample.zip ``` ```shell curl https://cloud.marathonlabs.io/samples/ios/sampleUITests-Runner.zip -o sampleUITests-Runner.zip ``` -------------------------------- ### Display Marathon Cloud CLI Help Source: https://github.com/marathonlabs/marathon/blob/develop/docs/cloud/cli/parameters.md Run this command to see all available commands and options for the marathon-cloud CLI. ```bash --> marathon-cloud help Command-line client for Marathon Cloud Usage: marathon-cloud [OPTIONS] [COMMAND] Commands: run Submit a test run download Download artifacts from a previous test run completions Output shell completion code for the specified shell (bash, zsh, fish) help Print this message or the help of the given subcommand(s) Options: -v, --verbose... Increase logging verbosity -q, --quiet... Decrease logging verbosity -h, --help Print help -V, --version Print version ``` -------------------------------- ### Download Android Sample Applications Source: https://github.com/marathonlabs/marathon/blob/develop/docs/cloud/index.md Downloads the prebuilt sample application and test application for Android using curl. Save these files for subsequent test execution. ```shell curl https://cloud.marathonlabs.io/samples/android/app.apk -o app.apk ``` ```shell curl https://cloud.marathonlabs.io/samples/android/appTest.apk -o appTest.apk ``` -------------------------------- ### Build Static Website Source: https://github.com/marathonlabs/marathon/blob/develop/docs/README.md Generates static website content into the 'build' directory for hosting. ```bash yarn build ``` -------------------------------- ### Marathon Cloud CLI iOS Run Help Source: https://github.com/marathonlabs/marathon/blob/develop/docs/cloud/cli/parameters.md View detailed options for running iOS tests. Requires application, test application, and API key. ```bash --> marathon-cloud run ios -h Run tests for iOS Usage: marathon-cloud run ios [OPTIONS] --application --test-application --api-key Options: -a, --application application filepath, example: /home/user/workspace/sample.zip -t, --test-application test application filepath, example: /home/user/workspace/sampleUITests-Runner.zip -o, --output Output folder for test run results --isolated Run each test in isolation, i.e. isolated batching. [possible values: true, false] -v, --verbose... More output per occurrence --filter-file Test filters supplied as a YAML file following the schema at https://docs.marathonlabs.io/runner/configuration/filtering/#filtering-logic. For iOS see also https://docs.marathonlabs.io/runner/next/ios#test-plans -q, --quiet... Less output per occurrence --wait Wait for test run to finish if true, exits after triggering a run if false --name name for run, for example it could be description of commit --link link to commit --api-key Marathon Cloud API key [env: MARATHON_CLOUD_API_KEY=] --base-url Base url for Marathon Cloud API [default: https://cloud.marathonlabs.io/api/v1] --xctestrun-env xctestrun environment variables, example FOO=BAR -h, --help Print help ``` -------------------------------- ### Marathon Cloud CLI Android Run Help Source: https://github.com/marathonlabs/marathon/blob/develop/docs/cloud/cli/parameters.md View detailed options for running Android tests. Requires test application and API key. ```bash --> marathon-cloud run android -h Run tests for Android Usage: marathon-cloud run android [OPTIONS] --test-application --api-key Options: -a, --application application filepath, example: /home/user/workspace/sample.apk -t, --test-application test application filepath, example: /home/user/workspace/testSample.apk --os-version OS version [10, 11, 12, 13] --system-image Runtime system image [possible values: default, google-apis] -v, --verbose... More output per occurrence -o, --output Output folder for test run results -q, --quiet... Less output per occurrence --isolated Run each test in isolation, i.e. isolated batching. [possible values: true, false] --filter-file Test filters supplied as a YAML file following the schema at https://docs.marathonlabs.io/runner/configuration/filtering/#filtering-logic. For iOS see also https://docs.marathonlabs.io/runner/next/ios#test-plans --wait Wait for test run to finish if true, exits after triggering a run if false --name name for run, for example it could be description of commit --link link to commit --api-key Marathon Cloud API key [env: MARATHON_CLOUD_API_KEY=] --base-url Base url for Marathon Cloud API [default: https://cloud.marathonlabs.io/api/v1] --instrumentation-arg Instrumentation arguments, example: FOO=BAR -h, --help Print help ``` -------------------------------- ### Deploy Website (No SSH) Source: https://github.com/marathonlabs/marathon/blob/develop/docs/README.md Builds and deploys the website without using SSH. Requires specifying the GitHub username. ```bash GIT_USER= yarn deploy ``` -------------------------------- ### Marathon Cloud CLI Help Source: https://github.com/marathonlabs/marathon/blob/develop/docs/cloud/cli/parameters.md Displays general help information for the Marathon Cloud CLI, including available commands and global options. ```APIDOC ## Marathon Cloud CLI Help ### Description Displays general help information for the Marathon Cloud CLI, including available commands and global options. ### Method CLI COMMAND ### Endpoint N/A ### Parameters #### Global Options - **-v, --verbose** (...) - Increase logging verbosity - **-q, --quiet** (...) - Decrease logging verbosity - **-h, --help** - Print help - **-V, --version** - Print version ### Commands - **run** - Submit a test run - **download** - Download artifacts from a previous test run - **completions** - Output shell completion code for the specified shell (bash, zsh, fish) - **help** - Print this message or the help of the given subcommand(s) ``` -------------------------------- ### Build iOS Application for Testing Source: https://github.com/marathonlabs/marathon/blob/develop/docs/cloud/intro/ios.md Use this command to build your application and its tests for iOS simulators. Ensure the destination and derived data path are correctly specified. ```shell xcodebuild build-for-testing \ -project sample.xcodeproj \ -scheme sample \ -destination 'platform=iOS Simulator,name=iPhone 14,OS=16.1' \ -derivedDataPath ./build ``` -------------------------------- ### Build Android App and Test APKs with Gradle Source: https://github.com/marathonlabs/marathon/blob/develop/docs/cloud/intro/android.md Execute this Gradle command to build both the debug version of your application and its corresponding Android test APK. Ensure you are in the project root directory containing the 'app' subproject. ```shell # file structure # | # |--home # |--john # |--project <== you are here # |--app <== it's your primary application # ... # |--build.gragle # |--settings.gradle ./gradlew :app:assembleDebug :app:assembleDebugAndroidTest ``` -------------------------------- ### Marathondevices Configuration for Simulators Source: https://github.com/marathonlabs/marathon/blob/develop/README.md Configuration file to specify local simulators for Marathon to use. Includes transport type and a list of devices with their UDIDs or profiles. ```yaml workers: - transport: type: local devices: - type: simulator udid: "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" - type: simulatorProfile deviceType: com.apple.CoreSimulator.SimDeviceType.iPhone-13-mini ``` -------------------------------- ### Initialize and Render Test Chart Source: https://github.com/marathonlabs/marathon/blob/develop/docs/static/demo/android/html/timeline/index.html This snippet demonstrates how to initialize a chart object and then use it to render test data on a D3.js element. Ensure the 'testsChart' function is defined and the 'dataset' variable is populated with test results. ```javascript var chart = testsChart(); d3.select("#testChart") .datum(dataset) .call(chart); ``` -------------------------------- ### Execute iOS Tests with Marathon Cloud CLI Source: https://github.com/marathonlabs/marathon/blob/develop/docs/cloud/index.md Sets the Marathon Cloud API key and executes iOS tests using the downloaded application and test runner zip files. Ensure the API key is valid. ```shell export MARATHON_CLOUD_API_KEY=generated_api_key marathon-cloud run ios --application sample.zip --test-application sampleUITests-Runner.zip ``` -------------------------------- ### Sample iOS App Main Data Source: https://github.com/marathonlabs/marathon/blob/develop/docs/static/demo/ios/html/index.html This JSON object represents the main data for the sample iOS application, including its title. ```json window.mainData = {"title":"sample-ios-app"} ``` -------------------------------- ### Initialize Global Logs Object Source: https://github.com/marathonlabs/marathon/blob/develop/docs/static/demo/android/html/pools/omni/127.0.0.1-5037-emulator-5556/logs/com.example.ParameterizedTest.test-0-.html This JavaScript code initializes a global object `window.logs` with test-specific information. It's typically used for logging test execution details in a web environment. ```javascript window.logs = {"pool_id":"omni","test_id":"com.example.ParameterizedTest.test[0]","display_name":"test[0]","device_id":"127.0.0.1-5037-emulator-5556","log_path":"../"} // window.mainData / window.suite / window.test={ json } ``` -------------------------------- ### Maestro Tag-Based Filtering Configuration Source: https://github.com/marathonlabs/marathon/blob/develop/docs/cloud/intro/maestro.md Define allowlist and blocklist tags in a YAML file to control which Maestro tests are executed. This provides granular control over test selection. ```yaml filteringConfiguration: allowlist: - type: "annotation" values: - "tag1" - "tag2" blocklist: - type: "annotation" values: - "tag3" - "tag4" ``` ```shell export MARATHON_CLOUD_API_KEY=generated_api_key marathon-cloud run maestro android --application your_app.apk --test-application ./path/to/tests --filter-file filter.yaml folder_or_file_to_execute ``` -------------------------------- ### Execute Android Tests with Marathon Cloud CLI Source: https://github.com/marathonlabs/marathon/blob/develop/docs/cloud/index.md Sets the Marathon Cloud API key and executes Android tests using the downloaded application and test runner APK files. Ensure the API key is valid. ```shell export MARATHON_CLOUD_API_KEY=generated_api_key marathon-cloud run android --application app.apk --test-application appTest.apk ``` -------------------------------- ### Composer Window Logs Source: https://github.com/marathonlabs/marathon/blob/develop/docs/static/demo/android/html/pools/omni/127.0.0.1-5037-emulator-5558/logs/com.example.ParameterizedTest.test-3-.html This JavaScript snippet defines a global `window.logs` object containing test execution details. It includes information such as pool ID, test ID, display name, device ID, and the log path. ```javascript window.logs = {"pool_id":"omni","test_id":"com.example.ParameterizedTest.test[3]","display_name":"test[3]","device_id":"127.0.0.1-5037-emulator-5558","log_path":"../../../../../logs/omni/127.0.0.1-5037-emulator-5558/com.example.ParameterizedTest%23test-3--cdfe0b65-0234-4b3c-a07b-39ff8ee00e03.log"} ``` -------------------------------- ### Configure Allure Report with Google Analytics Source: https://github.com/marathonlabs/marathon/blob/develop/docs/static/demo/ios/allure-report/index.html Use this snippet to initialize Google Analytics and configure Allure Report settings like version and report UUID. Ensure 'allureVersion' and 'reportUuid' are set correctly for your project. ```javascript window.dataLayer = window.dataLayer || []; function gtag(){ dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', 'G-FVWC4GKEYS', { 'allureVersion': 'dev', 'reportUuid': 'ef06a973-a463-481b-8cc2-fe9f3980cfe3', 'single_file': false }); ``` -------------------------------- ### iOS Marathonfile Configuration Source: https://github.com/marathonlabs/marathon/blob/develop/README.md Basic Marathonfile configuration for iOS projects. Specifies output directory and details for the application and test bundles. ```yaml name: "My application" outputDir: "derived-data/Marathon" vendorConfiguration: type: "iOS" bundle: application: "sample.app" testApplication: "sampleUITests.xctest" testType: xcuitest ``` -------------------------------- ### Initialize Logs with Test Data Source: https://github.com/marathonlabs/marathon/blob/develop/docs/static/demo/android/html/pools/omni/127.0.0.1-5037-emulator-5554/logs/com.example.MainActivityFlakyTest.testTextFlaky5.html This JavaScript snippet initializes a global `logs` object with specific test and pool identifiers. It's typically used for logging test execution details. ```javascript window.logs = {"pool_id":"omni","test_id":"com.example.MainActivityFlakyTest.testTextFlaky5","display_name":"testTextFlaky5","device_id":"127.0.0.1-5037-emulator-5554","log_path":"../../../../../logs/omni/127.0.0.1-5037-emulator-5554/com.example.MainActivityFlakyTest%23testTextFlaky5-51bd21fe-5280-467f-b57e-faaa2a90f388.log"} // window.mainData / window.suite / window.test={ json } ``` -------------------------------- ### Android Marathonfile Configuration Source: https://github.com/marathonlabs/marathon/blob/develop/README.md Basic Marathonfile configuration for Android projects. Specifies output directory and paths to application and test APKs. ```yaml name: "My application" outputDir: "build/reports/marathon" vendorConfiguration: type: "Android" applicationApk: "dist/app-debug.apk" testApplicationApk: "dist/app-debug-androidTest.apk" ``` -------------------------------- ### Accessing Test Log Data in JavaScript Source: https://github.com/marathonlabs/marathon/blob/develop/docs/static/demo/ios/html/pools/omni/9DB21872-32E0-4ACF-9D76-67831CDC3938-malinskiy-192.168.2.27-22/logs/sample-appUITests.FlakyTests.testTextFlaky8.html This JavaScript snippet demonstrates how to access test log data, including pool ID, test ID, display name, device ID, and log path, which is available in the `window.logs` object. Ensure the `window.logs` object is populated before accessing its properties. ```javascript window.logs = {"pool_id":"omni","test_id":"sample_appUITests.FlakyTests.testTextFlaky8","display_name":"testTextFlaky8","device_id":"9DB21872-32E0-4ACF-9D76-67831CDC3938-malinskiy-192.168.2.27-22","log_path":"../../../../../logs/omni/9DB21872-32E0-4ACF-9D76-67831CDC3938-malinskiy-192.168.2.27-22/sample-appUITests.FlakyTests%23testTextFlaky8-70734846-c3e2-47ea-b0a5-97e172439786.log"} // window.mainData / window.suite / window.test={ json } ``` -------------------------------- ### Run iOS Tests Source: https://github.com/marathonlabs/marathon/blob/develop/docs/cloud/cli/parameters.md Submits test runs for iOS applications to Marathon Cloud. ```APIDOC ## POST /marathon-cloud run ios ### Description Submits test runs for iOS applications to Marathon Cloud. This command allows you to specify the application, test application, and other configurations for your test run. ### Method CLI COMMAND ### Endpoint `marathon-cloud run ios` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None (CLI arguments are used) #### CLI Options - **-a, --application** (string) - Required - Application filepath, example: `/home/user/workspace/sample.zip` - **-t, --test-application** (string) - Required - Test application filepath, example: `/home/user/workspace/sampleUITests-Runner.zip` - **-o, --output** (string) - Output folder for test run results - **--isolated** (string) - Run each test in isolation [possible values: true, false] - **-v, --verbose** (...) - More output per occurrence - **--filter-file** (string) - Test filters supplied as a YAML file - **-q, --quiet** (...) - Less output per occurrence - **--wait** (boolean) - Wait for test run to finish if true, exits after triggering a run if false - **--name** (string) - Name for the run, e.g., description of commit - **--link** (string) - Link to commit - **--api-key** (string) - Required - Marathon Cloud API key [env: MARATHON_CLOUD_API_KEY] - **--base-url** (string) - Base URL for Marathon Cloud API [default: https://cloud.marathonlabs.io/api/v1] - **--xctestrun-env** (string) - xctestrun environment variables, example `FOO=BAR` - **-h, --help** - Print help ### Request Example ```bash marathon-cloud run ios -a /path/to/your/app.zip -t /path/to/your/test.zip --api-key YOUR_API_KEY ``` ### Response #### Success Response (200) Details about the test run submission and status. #### Response Example (Output will vary based on CLI execution) ``` -------------------------------- ### Configure Allure Report with Google Analytics Source: https://github.com/marathonlabs/marathon/blob/develop/docs/static/demo/android/allure-report/index.html Use this JavaScript snippet to initialize Google Analytics with Allure Report specific configuration. Ensure 'allureVersion', 'reportUuid', and 'single_file' are set correctly for your report. ```javascript window.dataLayer = window.dataLayer || []; function gtag(){ dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', 'G-FVWC4GKEYS', { 'allureVersion': 'dev', 'reportUuid': 'db898afb-6d7d-4f1f-984a-34c082d72a2a', 'single_file': false }); ``` -------------------------------- ### Convert iOS .app Bundles to Zip Archives Source: https://github.com/marathonlabs/marathon/blob/develop/docs/cloud/intro/ios.md Convert the generated .app bundles into zip archives for easier transfer. This is necessary because .app files are technically folders. ```shell cd build/Build/Products/Debug-iphonesimulator # convert to zip archive in this example zip -r sample.zip sample.app zip -r sampleUITests-Runner.zip sampleUITests-runner.app ``` -------------------------------- ### Run Maestro Android Tests Source: https://github.com/marathonlabs/marathon/blob/develop/docs/cloud/intro/maestro.md Execute Maestro tests for an Android application. Ensure the MARATHON_CLOUD_API_KEY is exported and provide the path to your application and test directory. ```shell export MARATHON_CLOUD_API_KEY=generated_api_key marathon-cloud run maestro android --application your_app.apk --test-application ./path/to/tests folder_or_file_to_execute ``` -------------------------------- ### Initialize Locale and Test Data Source: https://github.com/marathonlabs/marathon/blob/develop/docs/static/demo/android/html/timeline/index.html Sets the locale for moment.js and defines a JSON object containing test execution results. This data includes overall pass/fail counts, execution statistics, and detailed metrics for each measure. ```javascript moment.locale('en'); var dataset = {"passedTests":48,"failedTests":43,"ignoredTests":3,"executionStats":{"idleTimeMillis":164387,"averageTestExecutionTimeMillis":1078},"measures":[{"measure":"127.0.0.1:5037:emulator-5558","stats":{"idleTimeMillis":37237,"averageTestExecutionTimeMillis":1883},"data":[{"testName":"DEVICE_PROVIDER_INIT","metricType":"DEVICE_PROVIDER_INIT","startDate":1700046155771,"endDate":1700046155771,"expectedValue":0.0,"variance":0.0},{"testName":"DEVICE_PREPARE","metricType":"DEVICE_PREPARE","startDate":1700046158460,"endDate":1700046159266,"expectedValue":0.0,"variance":0.0},{"testName":"ScreenshotTest.testScreencapture","metricType":"FAILURE","startDate":1700046160367,"endDate":1700046162256,"expectedValue":0.0,"variance":0.0},{"testName":"MainActivityFlakyTest.testTextFlaky8","metricType":"PASSED","startDate":1700046162256,"endDate":1700046163078,"expectedValue":0.0,"variance":0.0},{"testName":"TestWithWrongName.testAlwaysFailing","metricType":"FAILURE","startDate":1700046163078,"endDate":1700046163724,"expectedValue":0.0,"variance":0.0},{"testName":"MainActivityFlakyTest.testTextFlaky3","metricType":"FAILURE","startDate":1700046167374,"endDate":1700046168633,"expectedValue":0.0,"variance":0.0},{"testName":"MainActivityFlakyTest.testTextFlaky4","metricType":"PASSED","startDate":1700046168633,"endDate":1700046169275,"expectedValue":0.0,"variance":0.0},{"testName":"MainActivityFlakyTest.testTextFlaky5","metricType":"FAILURE","startDate":1700046169275,"endDate":1700046169914,"expectedValue":0.0,"variance":0.0},{"testName":"FilePushTest.testExternalFolderPresent","metricType":"FAILURE","startDate":1700046171849,"endDate":1700046172830,"expectedValue":0.0,"variance":0.0},{"testName":"MainActivityFlakyTest.testTextFlaky","metricType":"FAILURE","startDate":1700046172830,"endDate":1700046173475,"expectedValue":0.0,"variance":0.0},{"testName":"MainActivityAllureTest.testFailure","metricType":"FAILURE","startDate":1700046173475,"endDate":1700046174123,"expectedValue":0.0,"variance":0.0},{"testName":"AbstractFailingTest.testAlwaysFailing","metricType":"FAILURE","startDate":1700046184989,"endDate":1700046185978,"expectedValue":0.0,"variance":0.0},{"testName":"ParameterizedTest.test[2]","metricType":"PASSED","startDate":1700046185978,"endDate":1700046186611,"expectedValue":0.0,"variance":0.0},{"testName":"ParameterizedTest.test[3]","metricType":"PASSED","startDate":1700046186611,"endDate":1700046187243,"expectedValue":0.0,"variance":0.0},{"testName":"ParameterizedTest.test[4]","metricType":"PASSED","startDate":1700046187244,"endDate":1700046187877,"expectedValue":0.0,"variance":0.0},{"testName":"ParameterizedTest.test[5]","metricType":"PASSED","startDate":1700046187877,"endDate":1700046188510,"expectedValue":0.0,"variance":0.0},{"testName":"MainActivitySlowTest.testTextSlow1","metricType":"PASSED","startDate":1700046205505,"endDate":1700046211599,"expectedValue":0.0,"variance":0.0},{"testName":"MainActivitySlowTest.testTextSlow2","metricType":"PASSED","startDate":1700046211599,"endDate":1700046216839,"expectedValue":0.0,"variance":0.0},{"testName":"MainActivitySlowTest.testTextSlow3","metricType":"PASSED","startDate":1700046216839,"endDate":1700046221990,"expectedValue":0.0,"variance":0.0},{"testName":"MainActivitySlowTest.testTextSlow4","metricType":"PASSED","startDate":1700046221990,"endDate":1700046227274,"expectedValue":0.0,"variance":0.0},{"testName":"MainActivitySlowTest.testTextSlow","metricType":"PASSED","startDate":1700046227274,"endDate":1700046232570,"expectedValue":0.0,"variance":0.0}]},{"measure":"127.0.0.1:5037:emulator-5556","stats":{"idleTimeMillis":44086,"averageTestExecutionTimeMillis":878},"data":[{"testName":"DEVICE_PROVIDER_INIT","metricType":"DEVICE_PROVIDER_INIT","startDate":1700046155771,"endDate":1700046155771,"expectedValue":0.0,"variance":0.0},{"testName":"DEVICE_PREPARE","metricType":"DEVICE_PREPARE","startDate":1700046158460,"endDate":1700046159541,"expectedValue":0.0,"variance":0.0},{"testName":"MainActivityFlakyTest.testTextFlaky5","metricType":"FAILURE","startDate":1700046160445,"endDate":1700046162380,"expectedValue":0.0,"variance":0.0},{"testName":"MainActivityFlakyTest.testTextFlaky7","metricType":"PASSED","startDate":1700046162380,"endDate":1700046163069,"expectedValue":0.0,"variance":0.0},{"testName":"MainActivityFlakyTest.testTextFlaky8","metricType":"PASSED","startDate":1700046163069,"endDate":1700046163728,"expectedValue":0.0,"variance":0.0},{"testName":"MainActivityFlakyTest.testTextFlaky2","metricType":"FAILURE","startDate":1700046168703,"endDate":1700046170299,"expectedValue":0.0,"variance":0.0},{"testName":"MainActivityFlakyTest.testTextFlaky3","metricType":"FAILURE","startDate":1700046170299,"endDate":1700046170948,"expectedValue":0.0,"variance":0.0},{"testName":"MainActivityFlakyTest.testTextFlaky4","metricType":"FAILURE","startDate":1700046170948,"endDate":1700046171595,"expectedValue":0.0,"variance":0.0},{"t"}]}]} ``` -------------------------------- ### Run Android Tests Source: https://github.com/marathonlabs/marathon/blob/develop/docs/cloud/cli/parameters.md Submits test runs for Android applications to Marathon Cloud. ```APIDOC ## POST /marathon-cloud run android ### Description Submits test runs for Android applications to Marathon Cloud. This command allows you to specify the application, test application, OS version, and other configurations for your test run. ### Method CLI COMMAND ### Endpoint `marathon-cloud run android` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None (CLI arguments are used) #### CLI Options - **-a, --application** (string) - Application filepath, example: `/home/user/workspace/sample.apk` - **-t, --test-application** (string) - Required - Test application filepath, example: `/home/user/workspace/testSample.apk` - **--os-version** (string) - OS version [possible values: 10, 11, 12, 13] - **--system-image** (string) - Runtime system image [possible values: default, google-apis] - **-v, --verbose** (...) - More output per occurrence - **-o, --output** (string) - Output folder for test run results - **-q, --quiet** (...) - Less output per occurrence - **--isolated** (string) - Run each test in isolation [possible values: true, false] - **--filter-file** (string) - Test filters supplied as a YAML file - **--wait** (boolean) - Wait for test run to finish if true, exits after triggering a run if false - **--name** (string) - Name for the run, e.g., description of commit - **--link** (string) - Link to commit - **--api-key** (string) - Required - Marathon Cloud API key [env: MARATHON_CLOUD_API_KEY] - **--base-url** (string) - Base URL for Marathon Cloud API [default: https://cloud.marathonlabs.io/api/v1] - **--instrumentation-arg** (string) - Instrumentation arguments, example: `FOO=BAR` - **-h, --help** - Print help ### Request Example ```bash marathon-cloud run android -t /path/to/your/test.apk --api-key YOUR_API_KEY ``` ### Response #### Success Response (200) Details about the test run submission and status. #### Response Example (Output will vary based on CLI execution) ``` -------------------------------- ### Run Maestro iOS Tests Source: https://github.com/marathonlabs/marathon/blob/develop/docs/cloud/intro/maestro.md Execute Maestro tests for an iOS application. Ensure the MARATHON_CLOUD_API_KEY is exported and provide the path to your application and test directory. ```shell export MARATHON_CLOUD_API_KEY=generated_api_key marathon-cloud run maestro ios --application your_application.app --test-application ./path/to/tests folder_or_file_to_execute ``` -------------------------------- ### Composer Window Logs Structure Source: https://github.com/marathonlabs/marathon/blob/develop/docs/static/demo/android/html/pools/omni/127.0.0.1-5037-emulator-5556/logs/com.example.NamedParameterizedTest.test-compute-test-for-input-6--8-.html This object represents the log data available in the Composer window. It includes details about the test pool, display name, device, and log path. ```javascript window.logs = {"pool_id":"omni","test_id":"com.example.NamedParameterizedTest.test[compute test for input 6: 8]","display_name":"test[compute test for input 6: 8]","device_id":"127.0.0.1-5037-emulator-5556","log_path":"../"} // window.mainData / window.suite / window.test={ json } ``` -------------------------------- ### Initialize Locale and Test Data Source: https://github.com/marathonlabs/marathon/blob/develop/docs/static/demo/ios/html/timeline/index.html Sets the locale for moment.js and defines a dataset containing test execution results. This is typically used for displaying or processing test outcomes. ```javascript moment.locale('en'); var dataset = {"passedTests":16,"failedTests":34,"ignoredTests":0,"executionStats":{"idleTimeMillis":365412,"averageTestExecutionTimeMillis":7903},"measures":[{"measure":"9DB21872-32E0-4ACF-9D76-67831CDC3938@malinskiy@192.168.2.27:22","stats":{"idleTimeMillis":104151,"averageTestExecutionTimeMillis":4679},"data":[{"testName":"DEVICE_PROVIDER_INIT","metricType":"DEVICE_PROVIDER_INIT","startDate":1700051748668,"endDate":1700051749800,"expectedValue":0.0,"variance":0.0},{"testName":"DEVICE_PREPARE","metricType":"DEVICE_PREPARE","startDate":1700051754784,"endDate":1700051760728,"expectedValue":0.0,"variance":0.0},{"testName":"MoreTests.testPresentModal","metricType":"PASSED","startDate":1700051765303,"endDate":1700051769305,"expectedValue":0.0,"variance":0.0},{"testName":"SlowTests.testTextSlow","metricType":"FAILURE","startDate":1700051769307,"endDate":1700051779738,"expectedValue":0.0,"variance":0.0},{"testName":"SlowTests.testTextSlow1","metricType":"FAILURE","startDate":1700051779738,"endDate":1700051790186,"expectedValue":0.0,"variance":0.0},{"testName":"SlowTests.testTextSlow2","metricType":"FAILURE","startDate":1700051790197,"endDate":1700051800637,"expectedValue":0.0,"variance":0.0},{"testName":"ScreenshotTests.testButton","metricType":"PASSED","startDate":1700051816352,"endDate":1700051819914,"expectedValue":0.0,"variance":0.0},{"testName":"FailingTests.testAlwaysFailing","metricType":"FAILURE","startDate":1700051823599,"endDate":1700051825386,"expectedValue":0.0,"variance":0.0},{"testName":"FlakyTests.testTextFlaky8","metricType":"PASSED","startDate":1700051838283,"endDate":1700051840014,"expectedValue":0.0,"variance":0.0},{"testName":"FlakyTests.testTextFlaky1","metricType":"FAILURE","startDate":1700051843726,"endDate":1700051845516,"expectedValue":0.0,"variance":0.0},{"testName":"FlakyTests.testTextFlaky7","metricType":"FAILURE","startDate":1700051856314,"endDate":1700051858144,"expectedValue":0.0,"variance":0.0},{"testName":"FlakyTests.testTextFlaky5","metricType":"PASSED","startDate":1700051872844,"endDate":1700051874553,"expectedValue":0.0,"variance":0.0},{"testName":"FlakyTests.testTextFlaky4","metricType":"PASSED","startDate":1700051878427,"endDate":1700051880186,"expectedValue":0.0,"variance":0.0},{"testName":"FlakyTests.testTextFlaky2","metricType":"PASSED","startDate":1700051884374,"endDate":1700051886164,"expectedValue":0.0,"variance":0.0},{"testName":"FlakyTests.testTextFlaky3","metricType":"PASSED","startDate":1700051891024,"endDate":1700051892925,"expectedValue":0.0,"variance":0.0},{"testName":"SlowTests.testTextSlow4","metricType":"FAILURE","startDate":1700051897209,"endDate":1700051906872,"expectedValue":0.0,"variance":0.0},{"testName":"SlowTests.testTextSlow","metricType":"FAILURE","startDate":1700051922738,"endDate":1700051932362,"expectedValue":0.0,"variance":0.0}]},{"measure":"55CADA10-DB80-4A64-954C-80635FE50E04@malinskiy@192.168.2.27:22","stats":{"idleTimeMillis":115669,"averageTestExecutionTimeMillis":6774},"data":[{"testName":"DEVICE_PROVIDER_INIT","metricType":"DEVICE_PROVIDER_INIT","startDate":1700051750113,"endDate":1700051751015,"expectedValue":0.0,"variance":0.0},{"testName":"DEVICE_PREPARE","metricType":"DEVICE_PREPARE","startDate":1700051754784,"endDate":1700051761245,"expectedValue":0.0,"variance":0.0},{"testName":"MoreTests.testDismissModal","metricType":"FAILURE","startDate":1700051764518,"endDate":1700051768265,"expectedValue":0.0,"variance":0.0},{"testName":"MoreTests.testPresentModal","metricType":"PASSED","startDate":1700051770020,"endDate":1700051772686,"expectedValue":0.0,"variance":0.0},{"testName":"SlowTests.testTextSlow","metricType":"FAILURE","startDate":1700051772687,"endDate":1700051783162,"expectedValue":0.0,"variance":0.0},{"testName":"StoryboardTests.testLabel","metricType":"FAILURE","startDate":1700051783163,"endDate":1700051788603,"expectedValue":0.0,"variance":0.0},{"testName":"MoreTests.testDismissModal","metricType":"FAILURE","startDate":1700051803465,"endDate":1700051806823,"expectedValue":0.0,"variance":0.0},{"testName":"StoryboardTests.testButton","metricType":"PASSED","startDate":1700051807264,"endDate":1700051812242,"expectedValue":0.0,"variance":0.0},{"testName":"StoryboardTests.testDisabledButton","metricType":"PASSED","startDate":1700051813027,"endDate":1700051815831,"expectedValue":0.0,"variance":0.0},{"testName":"StoryboardTests.testLabel","metricType":"FAILURE","startDate":1700051815836,"endDate":1700051821243,"expectedValue":0.0,"variance":0.0},{"testName":"FailingTests.testAlwaysFailing","metricType":"FAILURE","startDate":1700051835326,"endDate":1700051837128,"expectedValue":0.0,"variance":0.0},{"testName":"FlakyTests.testTextFlaky7","metricType":"PASSED","startDate":1700051851860,"endDate":1700051853653,"expectedValue":0.0,"variance":0.0},{"testName":"FlakyTests.testTextFlaky6","metricType":"FAILURE","startDate":1700051857127,"endDate":1700051858883,"expectedValue":0.0,"variance":0.0}]}]} ``` -------------------------------- ### JavaScript Global Variables for Logging Source: https://github.com/marathonlabs/marathon/blob/develop/docs/static/demo/android/html/pools/omni/127.0.0.1-5037-emulator-5560/logs/com.example.ParameterizedTest.test-6-.html This JavaScript code defines global variables used for logging test and device information. It includes details like pool ID, test ID, display name, device ID, and log path. ```javascript window.logs = {"pool_id":"omni","test_id":"com.example.ParameterizedTest.test[6]","display_name":"test[6]","device_id":"127.0.0.1-5037-emulator-5560","log_path":"../"} // window.mainData / window.suite / window.test={ json } ``` -------------------------------- ### Composer Window Logs Structure Source: https://github.com/marathonlabs/marathon/blob/develop/docs/static/demo/android/html/pools/omni/127.0.0.1-5037-emulator-5556/logs/com.example.NamedParameterizedTest.test-compute-test-for-input-5--5-.html This JavaScript object represents the log data available in the Composer window. It includes identifiers for the pool, test, display name, device, and the log path. ```javascript window.logs = {"pool_id":"omni","test_id":"com.example.NamedParameterizedTest.test[compute test for input 5: 5]","display_name":"test[compute test for input 5: 5]","device_id":"127.0.0.1-5037-emulator-5556","log_path":"../"} // window.mainData / window.suite / window.test={ json } ``` -------------------------------- ### Render Test Results Chart Source: https://github.com/marathonlabs/marathon/blob/develop/report/execution-timeline/src/main/resources/timeline/index.html Sets the locale for moment.js, defines a dataset, and renders a test results chart using d3.js. Ensure the dataset variable is properly defined before use. ```javascript moment.locale('en'); var dataset = ${dataset} var chart = testsChart(); d3.select("#testChart") .datum(dataset) .call(chart); ``` -------------------------------- ### Accessing Test Log Data in Composer Source: https://github.com/marathonlabs/marathon/blob/develop/docs/static/demo/android/html/pools/omni/127.0.0.1-5037-emulator-5558/logs/com.example.ParameterizedTest.test-5-.html This snippet shows how to access test log data within the Marathonlabs Composer environment. It is typically found in the `window.logs` object. ```javascript window.logs = {"pool_id":"omni","test_id":"com.example.ParameterizedTest.test[5]","display_name":"test[5]","device_id":"127.0.0.1-5037-emulator-5558","log_path":"../"} // window.mainData / window.suite / window.test={ json } ``` -------------------------------- ### JavaScript Log Data Structure Source: https://github.com/marathonlabs/marathon/blob/develop/docs/static/demo/ios/html/pools/omni/77A9BB89-E98C-440F-8FCA-95D37CCDE3A4-malinskiy-192.168.2.27-22/logs/sample-appUITests.FailingTests.testAlwaysFailing.html This JavaScript object contains log data for a test run, including pool ID, test ID, display name, device ID, and log path. It is typically available as `window.logs`. ```javascript window.logs = {"pool_id":"omni","test_id":"sample_appUITests.FailingTests.testAlwaysFailing","display_name":"testAlwaysFailing","device_id":"77A9BB89-E98C-440F-8FCA-95D37CCDE3A4-malinskiy-192.168.2.27-22","log_path":"../../../../../logs/omni/77A9BB89-E98C-440F-8FCA-95D37CCDE3A4-malinskiy-192.168.2.27-22/sample-appUITests.FailingTests%23testAlwaysFailing-2e3c96c5-2d71-44e9-9b89-66f6578ff272.log"} ``` -------------------------------- ### Target Light Theme Variables Source: https://github.com/marathonlabs/marathon/blob/develop/docs/src/styles/components/README.md Use this selector to override CSS variables for the light theme. Ensure your HTML has the 'data-theme="light"' attribute. ```css html[data-theme='light'] { --ifm-menu-color-background-active: red; } ``` -------------------------------- ### Composer Logging Data Structure Source: https://github.com/marathonlabs/marathon/blob/develop/docs/static/demo/android/html/pools/omni/127.0.0.1-5037-emulator-5554/logs/com.example.NamedParameterizedTest.test-compute-test-for-input-4--3-.html This JavaScript object represents the structure of log data captured by the Composer tool. It includes identifiers for the pool, test, display name, device, and log path. ```javascript window.logs = {"pool_id":"omni","test_id":"com.example.NamedParameterizedTest.test[compute test for input 4: 3]","display_name":"test[compute test for input 4: 3]","device_id":"127.0.0.1-5037-emulator-5554","log_path":"../"} // window.mainData / window.suite / window.test={ json } ``` -------------------------------- ### Composer Test Log Metadata Source: https://github.com/marathonlabs/marathon/blob/develop/docs/static/demo/android/html/pools/omni/127.0.0.1-5037-emulator-5554/logs/com.example.NamedParameterizedTest.test-compute-test-for-input-3--2-.html This JavaScript object represents metadata for a test run, including pool ID, test ID, display name, device ID, and log path. It is typically found in the window.logs object. ```javascript window.logs = {"pool_id":"omni","test_id":"com.example.NamedParameterizedTest.test[compute test for input 3: 2]","display_name":"test[compute test for input 3: 2]","device_id":"127.0.0.1-5037-emulator-5554","log_path":"../"} // window.mainData / window.suite / window.test={ json } ``` -------------------------------- ### JavaScript Window Logs Object Source: https://github.com/marathonlabs/marathon/blob/develop/docs/static/demo/ios/html/pools/omni/9DB21872-32E0-4ACF-9D76-67831CDC3938-malinskiy-192.168.2.27-22/logs/sample-appUITests.SlowTests.testTextSlow.html This JavaScript object, `window.logs`, is used to store information related to test execution, including pool ID, test ID, display name, device ID, and log path. It is typically populated with data for logging and debugging purposes. ```javascript window.logs = {"pool_id":"omni","test_id":"sample_appUITests.SlowTests.testTextSlow","display_name":"testTextSlow","device_id":"9DB21872-32E0-4ACF-9D76-67831CDC3938-malinskiy-192.168.2.27-22","log_path":"../../../../../logs/omni/9DB21872-32E0-4ACF-9D76-67831CDC3938-malinskiy-192.168.2.27-22/sample-appUITests.SlowTests%23testTextSlow-ec5a9f08-d6a1-4245-bd6b-efdeb99eaddb.log"} // window.mainData / window.suite / window.test={ json } ``` -------------------------------- ### Maestro Test with App ID Environment Variable Source: https://github.com/marathonlabs/marathon/blob/develop/docs/cloud/intro/maestro.md Pass the application ID to Maestro tests using the special MAESTRO_APP_ID environment variable. This ensures predictable behavior for the appId field in your flow. ```yaml # flow.yaml appId: ${APP_ID} --- - launchApp - tapOn: "Text on the screen" ``` ```shell export MARATHON_CLOUD_API_KEY=generated_api_key marathon-cloud run maestro android --application your_app.apk --test-application ./path/to/tests --maestro-env=MAESTRO_APP_ID=your.app.id folder_or_file_to_execute ``` -------------------------------- ### JavaScript Log Data Structure Source: https://github.com/marathonlabs/marathon/blob/develop/docs/static/demo/android/html/pools/omni/127.0.0.1-5037-emulator-5554/logs/com.example.ScreenshotTest.testScreencapture.html This JavaScript object contains log data for a test run, including pool ID, test ID, display name, device ID, and log path. It is typically assigned to the window.logs variable. ```javascript window.logs = {"pool_id":"omni","test_id":"com.example.ScreenshotTest.testScreencapture","display_name":"testScreencapture","device_id":"127.0.0.1-5037-emulator-5554","log_path":"../../../../../logs/omni/127.0.0.1-5037-emulator-5554/com.example.ScreenshotTest%23testScreencapture-8c62f39e-f52a-4887-aced-956728dfcf89.log"} // window.mainData / window.suite / window.test={ json } ``` -------------------------------- ### Composer Logging Data Structure Source: https://github.com/marathonlabs/marathon/blob/develop/docs/static/demo/android/html/pools/omni/127.0.0.1-5037-emulator-5554/logs/com.example.BeforeTestFailureTest.testThatWillNotSeeTheLightOfDay.html This JavaScript object represents the logging data structure used in Marathonlabs Composer. It includes details about the test pool, test case, and device. ```javascript window.logs = {"pool_id":"omni","test_id":"com.example.BeforeTestFailureTest.testThatWillNotSeeTheLightOfDay","display_name":"testThatWillNotSeeTheLightOfDay","device_id":"127.0.0.1-5037-emulator-5554","log_path":"../"} // window.mainData / window.suite / window.test={ json } ```