wix / Detox

Gray box end-to-end testing and automation framework for mobile apps
https://wix.github.io/Detox/
MIT License
11.23k stars 1.92k forks source link

toHaveText fails with percentage character #4567

Open angelica-snowit opened 2 months ago

angelica-snowit commented 2 months ago

What happened?

I have this statement await expect(element(by.id('price-discount')).atIndex(0)).toHaveText('%');

that fails with this message: Test Failed: Failed expectation: TOHAVETEXT(text == “”) WITH MATCHER(id == “price-discount”) AT INDEX(0)

The % character disappears. Adding text before or after lead to the same result.

What was the expected behaviour?

The test should pass if text is "%"

Was it tested on latest Detox?

Help us reproduce this issue!

No response

In what environment did this happen?

Detox version: 20.25.6 React Native version: 0.75.2 Has Fabric (React Native's new rendering system) enabled: no Node version: v20.17.0 Test-runner (select one): jest

Detox logs

Detox logs ``` paste logs here! ```

Device logs

Device logs ``` paste logs here! ```

More data, please!

No response

asafkorem commented 1 month ago

might work with \u0025 or \%