diff --git a/.github/workflows/test-e2e.yaml b/.github/workflows/test-e2e.yaml index c6675563d0..bff56c597d 100644 --- a/.github/workflows/test-e2e.yaml +++ b/.github/workflows/test-e2e.yaml @@ -56,6 +56,7 @@ jobs: ANDROID_HOME: /home/runner/androidsdk ANDROID_SDK_ROOT: /home/runner/androidsdk ANDROID_OS_IMAGE: system-images;android-28;google_apis;x86_64 + MAESTRO_EXAMPLE: test-value steps: - name: Enable KVM group perms diff --git a/e2e/workspaces/no-app/README.md b/e2e/workspaces/no-app/README.md new file mode 100644 index 0000000000..11acb76261 --- /dev/null +++ b/e2e/workspaces/no-app/README.md @@ -0,0 +1,5 @@ +# No App + +For tests that don't require an app to be launched. + +Tests of JavaScript or environment variables can be run here. \ No newline at end of file diff --git a/e2e/workspaces/no-app/environment-variables.yaml b/e2e/workspaces/no-app/environment-variables.yaml new file mode 100644 index 0000000000..1dc9821c97 --- /dev/null +++ b/e2e/workspaces/no-app/environment-variables.yaml @@ -0,0 +1,6 @@ +appId: com.example.notused +tags: + - passing +--- +# Relies on MAESTRO_EXAMPLE being set in the environment +- assertTrue: ${MAESTRO_EXAMPLE == 'test-value'} \ No newline at end of file diff --git a/maestro-cli/src/main/java/maestro/cli/runner/TestSuiteInteractor.kt b/maestro-cli/src/main/java/maestro/cli/runner/TestSuiteInteractor.kt index 4592e12bba..b2c8f8fce1 100644 --- a/maestro-cli/src/main/java/maestro/cli/runner/TestSuiteInteractor.kt +++ b/maestro-cli/src/main/java/maestro/cli/runner/TestSuiteInteractor.kt @@ -88,7 +88,11 @@ class TestSuiteInteractor( // proceed to run all other Flows executionPlan.flowsToRun.forEach { flow -> - val (result, aiOutput) = runFlow(flow.toFile(), env, maestro, debugOutputPath) + val flowFile = flow.toFile() + val updatedEnv = env + .withInjectedShellEnvVars() + .withDefaultEnvVars(flowFile) + val (result, aiOutput) = runFlow(flowFile, updatedEnv, maestro, debugOutputPath) aiOutputs.add(aiOutput) if (result.status == FlowStatus.ERROR) {