Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better failure message when received object is undefined #1615

Open
christian-bromann opened this issue Aug 2, 2024 · 0 comments
Open

Better failure message when received object is undefined #1615

christian-bromann opened this issue Aug 2, 2024 · 0 comments
Labels
Bug 🐛 help wanted Extra attention is needed

Comments

@christian-bromann
Copy link
Member

christian-bromann commented Aug 2, 2024

Given a simple scenario:

const elems = $$('div')
await expect(elems[123]).toHaveText('foobar')

This fails with Cannot read properties of undefined (reading 'getText') as the object passed into expect is undefined. We should provide a better error message here and fail early.

This should be also fixed in the @wdio/runner where we currently just pass in the browser if a passed in object is undefined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant