CodeceptJS icon indicating copy to clipboard operation
CodeceptJS copied to clipboard

Unexpected behavior with locators

Open examosa opened this issue 3 years ago • 1 comments

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.

examosa avatar May 20 '22 19:05 examosa

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

github-actions[bot] avatar Dec 13 '23 02:12 github-actions[bot]