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

Fix problems with cachePath service option #107

Merged

Conversation

ilia-db
Copy link
Contributor

@ilia-db ilia-db commented Feb 16, 2024

Using the vscode service with the cachePath option:

services: [["vscode", {cachePath: "/tmp/wdio-vscode-service"}]],

On the 6.0.0 version this results in a failure to run tests:

ERROR @wdio/runner: Error: Invalid or unsupported WebDriver capabilities found ("cachePath"). Ensure to only use valid W3C WebDriver capabilities (see https://w3c.github.io/webdriver/#capabilities).If you run your tests on a remote vendor, like Sauce Labs or BrowserStack, make sure that you put them into vendor specific capabilities, e.g. "sauce:options" or "bstack:options". Please reach out to your vendor support team if you have further questions.

cachePath is indeed not a capability based on any of the wdio or webdriver types.

Looking at the old 5.* code, assigning options to the capabilities made sense because options field actually contained different things in the wdio-chromedriver-service/launcher base class.

Right now the options are only relevant for the vscode service, so I've removed all logic that merges them into capabilities.

Using the `vscode` service with the `cachePath` option:
```js
services: [["vscode", {cachePath: "/tmp/wdio-vscode-service"}]],
```

On the `6.0.0` version this results failure to run tests with this error:
```
ERROR @wdio/runner: Error: Invalid or unsupported WebDriver capabilities found ("cachePath"). Ensure to only use valid W3C WebDriver capabilities (see https://w3c.github.io/webdriver/#capabilities).If you run your tests on a remote vendor, like Sauce Labs or BrowserStack, make sure that you put them into vendor specific capabilities, e.g. "sauce:options" or "bstack:options". Please reach out to your vendor support team if you have further questions.
```

Seems like `cachePath` is not a capability based on any of the wdio types.
Looking at the code, it seems like before assigning `options` to the
capabilities made sense because `options` field actually contained different
things in the wdio-chromedriver-service - https://github.com/webdriverio-community/wdio-chromedriver-service/blob/104e63525faa156866aa521397ae56ffc6059a8f/src/launcher.ts#L47

Right now the options are only relevant for the `vscode` service, so I've
removed all logic that merges them into capabilities.
@seanpoulter
Copy link
Contributor

Oh no, sorry I didn't catch that in the previous PR. Is it worth adding a test case that uses cachePath? I'm happy to add one after. It doesn't have to block the PR.

@seanpoulter
Copy link
Contributor

seanpoulter commented Feb 19, 2024

The build fails for the same reason as webdriverio/webdriverio#12305. I'll open a PR to bump those dependencies when the workflows pass.

Edit: #108

@christian-bromann christian-bromann merged commit c4585c6 into webdriverio-community:main Feb 20, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants