maestro icon indicating copy to clipboard operation
maestro copied to clipboard

[v.1.36.0] $ within inline-javascript cannot be used

Open bullPaul opened this issue 1 year ago • 0 comments

Describe the bug Adding a $ (dollar sign) within the ${} for inline-javascript for use as a string does not work as expected. It works with just a regular plain string e.g. "$100" but if you need to use it with an env variable then it goes awry.

Case 1: - evalScript: ${console.log('$')} Case 2: - text: '${"$" + ENV_VARIABLE + "+"}'

This was mentioned in Slack as well.

To Reproduce 0. Write the test with the single line

  1. Start the simulator
  2. Run maestro test ...
  3. The step is run without an issue but no log is actually sent to the terminal

Expected behavior For cases written above:

  1. Gets logged to the terminal with the dollar sign and the value of the env variable
  2. assertVisible etc works as expected with this while parsing the screen as usual

Screenshots N/A

Environment information (please complete the following information):

  • Maestro version [v.1.36.0]
  • Platform: [iOS 17.0.0+]
  • Framework: [React Native with Expo]
  • Device model and OS version: [iPhone 14+]
  • Simulator
  • Host [Mac]

Workspace (if applicable) N/A

Bugreport output (if applicable) N/A

Additional context N/A

bullPaul avatar May 31 '24 13:05 bullPaul