codeceptjs / CodeceptJS

Supercharged End 2 End Testing Framework for NodeJS
http://codecept.io
MIT License
4.11k stars 725 forks source link

Unexpected behavior with locators #3318

Open examosa opened 2 years ago

examosa commented 2 years ago

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:

  1. The documentation lists class as a valid locator type, but the implementation does not actually account for it; attempting to use it will cause errors.
  2. A locator instantiated with a type of id will throw an error when toXPath() is called, as only the css and xpath types 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.

github-actions[bot] commented 11 months ago

This issue is stale because it has been open for 90 days with no activity.