CodeceptJS
CodeceptJS copied to clipboard
Unexpected behavior with locators
There are a few discrepancies between documented and actual behavior for some of locator formats. Two that I've run into while writing tests include:
- The documentation lists
classas a valid locator type, but the implementation does not actually account for it; attempting to use it will cause errors. - A locator instantiated with a type of
idwill throw an error whentoXPath()is called, as only thecssandxpathtypes are checked for.
It may be more tenable leverage polymorphism for this implementation, as in replace the type field of the Locator class with subclasses e.g. CSSLocator, XPathLocator, etc.
@DavertMik let me know if you're amenable to this and I'll start working on it.
This issue is stale because it has been open for 90 days with no activity.