-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add toMatch by id matcher #27
Comments
Part of the EarlGrey philosophy is that all assertions/matchers are run in the app (on the Testee). This means you can't return the text to the Tester and do the comparison there. This means the preferred syntax is: |
The In addition to this assertion, I added a more general one: This tests the accessibility label which is usually (unless overridden specifically) the same as the text. The benefit of this one is that it will work on more view types. The drawback is that it can be overridden so it's not necessarily the text displayed to the user. |
So is there a way to test if a text related component contains a substring |
@talkol
In the situation above, I need to do: const mnemonic = element(by.id('mnemonic')).getText()
element(by.id('textarea')).typeText(mnemonic)
element(by.id('next')).tap() |
In order to select components in the tests we use the
testID
property of course.Right now you can't check the text by testID. It'll be great if we could do it.
Another great thing is to implement the
toMatch
matcher so we won't break on every tiny text change.Protractor syntax is:
P.S - if the
toMatch
is too complicated having the ability to check the text by Id is also good enough.Go team WIX!
The text was updated successfully, but these errors were encountered: