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

docs(mock): 'matches' -> 'calls' property #10129

Merged
merged 1 commit into from
Apr 11, 2023

Conversation

KuznetsovRoman
Copy link
Contributor

@KuznetsovRoman KuznetsovRoman commented Apr 6, 2023

Proposed changes

Change Mock interface in docs (use calls property instead of matches)

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Reviewers: @webdriverio/project-committers

@KuznetsovRoman KuznetsovRoman changed the title types: fix mock 'calls' method -> 'matches' prop types(mock): add 'matches' prop Apr 6, 2023
@christian-bromann
Copy link
Member

Thanks for raising the PR.

I think this is an issue with the docs. The user is suppose to use calls to receive these information. matches is more an internal object for this.

@KuznetsovRoman
Copy link
Contributor Author

KuznetsovRoman commented Apr 7, 2023

Thanks for raising the PR.

I think this is an issue with the docs. The user is suppose to use calls to receive these information. matches is more an internal object for this.

Ok, i will update the docs in this PR. Also, about mocks: i need an ability to check if mock (spy) has some pending requests. Will you approve a feature, which emits something like onRequest, onResponse on request and response accordingly? (i see how it can be done with devtools mock, but not with webdriver one)

@christian-bromann
Copy link
Member

christian-bromann commented Apr 7, 2023

Will you approve a feature, which emits something like onRequest, onResponse on request and response accordingly?

Seems like a reasonable feature request. Yeah totally!

(i see how it can be done with devtools mock, but not with webdriver one)

For WebDriver we will have to use the new WebDriver Bidi features which have not landed yet. While you can already get request information, it is not yet possible to mock/replace requests and responses. So we can ignore this for now and have it throw an Not yet implemented error. Note that the WebDriver part of the mocking feature currently only runs when using Sauce Labs.

@KuznetsovRoman KuznetsovRoman changed the title types(mock): add 'matches' prop docs(mock): 'matches' -> calls property Apr 9, 2023
@KuznetsovRoman KuznetsovRoman changed the title docs(mock): 'matches' -> calls property docs(mock): 'matches' -> 'calls' property Apr 9, 2023
@KuznetsovRoman
Copy link
Contributor Author

Also, do you mind if i add documentation about WDIO_LOG_LEVEL environment variable? It looks like a part of public api (because here it assumes, it can be set from the outside) but is not being documented. I want to use this env variable in my code (i already asked about this in gitter, but didn't got the answer to my question), but i'm scared of using undocumented variables

@christian-bromann
Copy link
Member

Also, do you mind if i add documentation about WDIO_LOG_LEVEL environment variable?

Good call, let's add it to https://webdriver.io/docs/api/environment

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@christian-bromann christian-bromann added the PR: Docs 📝 PRs that contain changes to the documentation label Apr 11, 2023
@christian-bromann christian-bromann merged commit fbc4165 into webdriverio:main Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Docs 📝 PRs that contain changes to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants