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

Fix getElementText util function #40

Merged
merged 5 commits into from
Jan 15, 2021
Merged

Conversation

mmarkelov
Copy link
Member

close #21
I believe that we got only this cases:

  • await expect(page).toHaveText('test') 2 arguments, look through body to contain 'test'
  • await expect(page).toHaveText('.selector', 'test') 3 arguments, wait for .selector, look through .selector to contain 'test'
  • await expect(page).toHaveText('.selector', 'test', options) 4 arguments, wait for .selector with passed options, look through .selector to contain 'test'
  • await expect(element).toHaveText('test') 2 arguments, look through element to contain 'test'

@mmarkelov
Copy link
Member Author

@mxschmitt what do you think about possible cases? I'll fix tests and add some more for this cases tomorrow.
I just think that there is no much sense in this case:

await expect(element).toHaveText('test', options)

cause I just don't have any ideas where should we pass them

Copy link
Member

@mxschmitt mxschmitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets see how it goes!

@mmarkelov mmarkelov marked this pull request as ready for review January 15, 2021 07:51
@mmarkelov mmarkelov merged commit 394d1fd into master Jan 15, 2021
@mmarkelov mmarkelov deleted the Fix-getElementText-util-function branch January 15, 2021 12:46
@mmarkelov mmarkelov mentioned this pull request Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Unhandled case for toHaveText where expect contains an elementHandle, text, and options object
2 participants