-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
chai-webdriver uses a .dom flag to start the assertion chain, like this:
expect(...).dom.to.be.there
This library was originally designed without that, because it's a somewhat awkward token, syntactically. However, there are 2 good reasons for having some such unique flag to start the chain:
- It namespaces the assertions. If we had such a flag, we could use any name for our assertions (including
exist, which we had to avoid, and callthere) - When
chai-webdriveriois not defined, it would cause the test to fail even if the assertion is called without parenthesis. Without it, you can call.visibleoutside the scope ofchai-webdriverioand have no failure, because.visiblejust returnsundefined, like this: False Positives #37
Possible names for this flag:
.dom(to match 'chai-webdriverio`).wdio.elements.element(potentially, we could offer both elements and element, and use the respective webdriverio method).html... ? This isn't quite right - I'm basically out of ideas that actually make sense 😉
Metadata
Metadata
Assignees
Labels
No labels