mobile-dev-inc / maestro

Painless Mobile UI Automation
https://maestro.mobile.dev/
Apache License 2.0
5.9k stars 281 forks source link

JS script console log or error is not shown when running Maestro tests with tags #2154

Open anniefung-starling opened 3 days ago

anniefung-starling commented 3 days ago

Is there an existing issue for this?

Steps to reproduce

  1. Running mestro test using tags_include and tags_exclude flags
  2. Have a step runScript: file: ../../mp-actions/your-script.js in the test yaml
  3. The js script should contain lines console.log or console.error

Actual results

When running maestro test with the use of tags, js script console log and error is not shown, which makes it really hard to debug issue when tests fail. TestSuiteInteractor is invoked when running maestro tests using tags_include and tags_exclude flags, it seems to work differently from maestro.cli.runner.TestRunner, which is triggered when running individual maestro test file.

With TestSuiteInteractor, here is the error message shown when there is failure running the js file:

09:35:49.886 [ INFO] maestro.cli.runner.TestSuiteInteractor.invoke: Run ../../mp-actions/approveNewUser.js RUNNING 09:35:51.171 [ INFO] maestro.cli.runner.TestSuiteInteractor.invoke: Run ../../mp-actions/approveNewUser.js FAILED

Expected results

When running the individual maestro test file, you can clear see the js log or error, I would like to see the same output when running maestro tests with tags

Example

Screenshot 2024-11-25 at 12 21 11

About app

Closed project, I cannot share the app unfortunately

About environment

Java version 23.0.1

Logs

Logs ``` ```

Maestro version

1.39.1

How did you install Maestro?

install script (https://get.maestro.mobile.dev)

Anything else?

No response

linear[bot] commented 3 days ago

MA-2637 JS script console log or error is not shown when running Maestro tests with tags