wolfenrain / fluttium

Fluttium, the user flow testing tool for Flutter
https://fluttium.dev
MIT License
354 stars 10 forks source link

fix: I cannot expect a string with a dollar sign in it #407

Open rekire opened 4 months ago

rekire commented 4 months ago

Description

I cannot expect that a string with a dollar sign is visible or not.

Steps To Reproduce

  1. Open a shell
  2. Install the CLI via flutter pub global activate fluttium_cli (on Windows 11 if that matters)
  3. Go to your flutter project in my case autologin/example (even not sure if that matters)
  4. Run fluttium new flow foo
  5. Use this three steps:
    - pressOn: "Enter sample data"
    - expectVisible: "Some-Username"
    - expectNotVisible: "Example-P@§$w0rd!"
  6. Execute the flow/test via fluttium test .\foo.yaml

Expected Behavior

A passed test. Actual I get a compile error.

Screenshots

Temp/fluttium_b62c6914/lib/fluttium_test_runner.dart:24:60: Error: Undefined name 'w0rd'.
    UserFlowStep.fromJson({"expectNotVisible":"Example-P@§$w0rd!"}),
                                                           ^^^^
Failed to compile application.

Additional Context

It is cool that you can click on icons when they have a tooltip.

rekire commented 4 months ago

My current workaround is to use this \\u0024 as a replacement for the $. Very ugly but it works.

ZimboPro commented 2 months ago

Is it possible because the text is converted to Regex? According to the docs, the string can also be regex and '$' is used in regex https://fluttium.dev/docs/actions/built-in/expectations

rekire commented 2 months ago

The compile error shows that the dollar sign is interpreted for embedding a variable. This is nothing about regular expression.