Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate Matchers between browser, element and mock matchers #1408

Open
christian-bromann opened this issue Jan 6, 2024 · 1 comment
Open
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@christian-bromann
Copy link
Member

Currently we have one single interface for all matchers. This causes the following to not fail:

expect($('foobar')).toHaveUrl('...')

We should create browser, element and mock matchers to be more explicit about the available matchers based on provided object.

@christian-bromann christian-bromann added enhancement New feature or request help wanted Extra attention is needed labels Jan 6, 2024
@christian-bromann
Copy link
Member Author

Made an attempt on this in the cb/separate-matcher branch. Unfortunately if we want to conditionally extend matchers based on the passed in generic it would mean we have to transform the Matchers interface to a type which means that:

  • users can not extend matchers based on current docs (changing it would be a breaking change)
  • we couldn't extend other matchers anymore e.g. extend Jest matchers with WebdriverIO ones

Regarding latter, I am not sure how many folks actually have this use case. This library started as a basic extension to Jest matchers and would develop with this change to an assertion library useful WebdriverIO only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant