maestro
maestro copied to clipboard
Cannot find testID with some characters
Describe the bug If there is testId with some special / not alphanumeric char, it cannot tap on element.
I found out test id is not working with some special chars: []$
- if testID containes one of these - element cannot be pressed.
it find the testId with maestro studio
, but command cannot be executed.
To Reproduce
Add any element with testID: "testID$" or "testID[0]" and try to execute them via maestro studio
Expected behavior
All characters should work in testID definition.
Screenshots
env M1, mac maestro 1.29.0 React-native app
You can use an escape character (backslash) to reference these, e.g.
- assertVisible:
text: \£57.57
\£57.57
This needs to be in the documentation
It's regex
@simon-gilmurray when I try to escape special char (currency symbol €
), I get an error in the console:
found unknown escape character €(8364)
@simon-gilmurray when I try to escape special char (currency symbol
€
), I get an error in the console:found unknown escape character €(8364)
@zigcccc Try removing your quotation marks:
- assertVisible:
text: Cena na enoto: 2,46 \€
If that doesn't work then the engine possibly can't handle the Euro symbol. If that is the case you'll have to use a wildcard to get past it:
- assertVisible:
text: Cena na enoto: 2,46.*
@simon-gilmurray when I try to escape special char (currency symbol
€
), I get an error in the console:found unknown escape character €(8364)
@zigcccc Try removing your quotation marks:
- assertVisible: text: Cena na enoto: 2,46 \€
If that doesn't work then the engine possibly can't handle the Euro symbol. If that is the case you'll have to use a wildcard to get past it:
- assertVisible: text: Cena na enoto: 2,46.*
@simon-gilmurray removing quotation marks introduces a whole different set of problems since my text query includes :
which conflicts with YAML even more I guess:
The wild card approach is what I've been using and it does work, of course 👍 just stumbled upon this issue and thought it would be nice to have the option to include the currency symbol in the assertion as well (we support different currencies, so in some cases it actually makes sense to make assertion on that).
hmm so I was actually able to get around the parsing problem by using multiline text approach >-
and no quotation
assertVisible: >-
Cena na enoto: 2,46 \€
but the problem is that the text query is still not matched when flow is run: