YusukeIwaki / playwright-ruby-client

Playwright client for Ruby
https://playwright-ruby-client.vercel.app/
MIT License
336 stars 34 forks source link

Better error message when locator assertions have bad expected value types #303

Closed kwojcik closed 2 months ago

kwojcik commented 2 months ago

Simple description about the feature

If you accidentally provide a non-string/non-regex value to an assertion like expect(page.get_by_label('Calculated Total').to have_value(1.25) then you get a cryptic error
 Playwright::Error:
   expectedText[0]: expected object, got null


it would be nice to have a more helpful error to debug what is wrong

### Usecase / Motivation
* any tests that have math involved
* easier test debugging
kwojcik commented 2 months ago

I submitted a PR https://github.com/YusukeIwaki/playwright-ruby-client/pull/302