You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The doc has sections for queries and predicates, but it's not clear to me exactly what the difference is. It seems important though. Something about how they are called, maybe?
Some documentation would help here -- or does it already exist and I'm missing it?
The text was updated successfully, but these errors were encountered:
I think I understand this now, and I can clarify my confusion, at least:
predicates return a function that must be called. queries simply return data.
If we want to know whether text inside an element with selector AwesomeLabel matches some string, we can ask for that in two ways.
Query the text and then check whether it matches ourselves: labelText: text('.AwesomeLabel'),
with a contains function: labelContains: contains('.AwesomeLabel')
The big difference here is how we'd use those two functions.
console.log(el.labelText); // Just a get
console.log("text matches 'Alison'?", el.labelContains("Alison"));
@benshine that's correct, contains generates a function you can use to test elements for content. We need to improve the documentations a lot here to make it easy to understand how it works.
Also note that predicates always return true / false values as opposed to queries which return values from the DOM element (text content, attribute values, etc.).
The doc has sections for queries and predicates, but it's not clear to me exactly what the difference is. It seems important though. Something about how they are called, maybe?
Some documentation would help here -- or does it already exist and I'm missing it?
The text was updated successfully, but these errors were encountered: