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

[💥 Breaking] Remove the devtools package as it requires a lot of maintenance and has no real value anymore #11860

Closed
Tracked by #10362
christian-bromann opened this issue Dec 12, 2023 · 19 comments · Fixed by #12301
Assignees
Labels
help wanted Issues that are free to take by anyone interested v9
Milestone

Comments

@christian-bromann
Copy link
Member

christian-bromann commented Dec 12, 2023

The devtools package has been used to automate WebdriverIO through Puppeteer. Back in the days this was useful because Puppeteer helped with setting up Chrome. Today this is done by WebdriverIO and there is no real value anymore to run automation through CDP rather than WebDriver. In fact there are a lot of bugs where the expected automated behavior was not met due to CDP specifics that we were never able to fix e.g. switching windows and run commands in them.

Moving on it makes most sense to remove this capability and force users to use WebDriver. We will use the devtools package for a different project.

This is a v9 task and pull requests should be raised against the v9 branch. Join the 🙏-contribute channel on Discord if you are interested to join us in this effort.

@christian-bromann christian-bromann added help wanted Issues that are free to take by anyone interested v9 labels Dec 12, 2023
@christian-bromann christian-bromann added this to the v9 milestone Dec 12, 2023
@wdio-bot
Copy link
Contributor

Thanks for reporting!

We greatly appreciate any contributions that help resolve the bug. While we understand that active contributors have their own priorities, we kindly request your assistance if you rely on this bug being fixed. We encourage you to take a look at our contribution guidelines or join our friendly Discord development server, where you can ask any questions you may have. Thank you for your support, and cheers!

@christian-bromann christian-bromann changed the title remove the devtools package as it requires a lot of maintenance and has no real value anymore [💥 Breaking] Remove the devtools package as it requires a lot of maintenance and has no real value anymore Dec 12, 2023
@gromanas
Copy link
Contributor

This (hopefully) will be my first contribution to wdio. If it is ok I want to give a try on this.

@christian-bromann
Copy link
Member Author

@gromanas thanks for picking this up. Can you do me a favor and also raise a PR against main to add a deprecation notice to the devtools package and to its driver, so people will know, it will be removed. Thank you!

@gromanas
Copy link
Contributor

gromanas commented Jan 19, 2024

@gromanas thanks for picking this up. Can you do me a favor and also raise a PR against main to add a deprecation notice to the devtools package and to its driver, so people will know, it will be removed. Thank you!

Thank you for all your effort on wdio. Not in a pc at the moment. Will do this asap.

@gromanas
Copy link
Contributor

@christian-bromann what I should include in this PR as it will be against main and not v9 branch? Shall I make any changes and then open the PR? Please provide any info. Thank you in advance!

@christian-bromann
Copy link
Member Author

Please make two separate PRs:

  • one that adds deprecation notices for devtools -> PR against main branch
  • one that removes the devtools package -> PR against v9 branch

@rsinghi
Copy link

rsinghi commented Jan 22, 2024

If devtools service is being deprecated, what is the recommended approach to capture browser traffic in WDIO tests?

@christian-bromann
Copy link
Member Author

@rsinghi with Bidi support around the corner we will have cross browser support for it natively in WebdriverIO soon. Today, you can already use the getPuppeteer command to access the CDP interface for network logging.

gromanas added a commit to gromanas/webdriverio that referenced this issue Jan 23, 2024
- Update website for AutomationProtocols.md and devtools/README.md

Contributes to: webdriverio#11860

Signed-off-by: Georgios Romanas gromanas@gmail.com
@gromanas gromanas mentioned this issue Jan 23, 2024
8 tasks
gromanas added a commit to gromanas/webdriverio that referenced this issue Jan 24, 2024
- Update website for AutomationProtocols.md, Config
and Options.ts with a deprecation warning

Contributes to: webdriverio#11860

Signed-off-by: Georgios Romanas gromanas@gmail.com
gromanas added a commit to gromanas/webdriverio that referenced this issue Jan 24, 2024
- Fix typo on Options.ts

Contributes to: webdriverio#11860

Signed-off-by: Georgios Romanas gromanas@gmail.com
gromanas added a commit to gromanas/webdriverio that referenced this issue Jan 24, 2024
- Fix text on packages/devtools/README.md

Contributes to: webdriverio#11860

Signed-off-by: Georgios Romanas gromanas@gmail.com
gromanas added a commit to gromanas/webdriverio that referenced this issue Jan 24, 2024
- Change text as per comment on Options.md

Contributes to: webdriverio#11860

Signed-off-by: Georgios Romanas gromanas@gmail.com
christian-bromann added a commit that referenced this issue Jan 24, 2024
* chore(devtools):
- Update website for AutomationProtocols.md and devtools/README.md

Contributes to: #11860

Signed-off-by: Georgios Romanas gromanas@gmail.com

* Update devtools/README.md

* Update website/docs/AutomationProtocols.md

Co-authored-by: Christian Bromann <git@bromann.dev>

* Update website/docs/AutomationProtocols.md

Co-authored-by: Christian Bromann <git@bromann.dev>

* chore(devtools):
- Update website for AutomationProtocols.md, Config
and Options.ts with a deprecation warning

Contributes to: #11860

Signed-off-by: Georgios Romanas gromanas@gmail.com

* chore(devtools):
- Fix typo on Options.ts

Contributes to: #11860

Signed-off-by: Georgios Romanas gromanas@gmail.com

* chore(devtools):
- Fix text on packages/devtools/README.md

Contributes to: #11860

Signed-off-by: Georgios Romanas gromanas@gmail.com

* chore(devtools):
- Change text as per comment on Options.md

Contributes to: #11860

Signed-off-by: Georgios Romanas gromanas@gmail.com

* Update website/docs/AutomationProtocols.md

---------

Signed-off-by: Georgios Romanas gromanas@gmail.com
Co-authored-by: Christian Bromann <git@bromann.dev>
@christian-bromann
Copy link
Member Author

I will take on the next step which is removing the package from this repo.

@Jabbar2010
Copy link

Jabbar2010 commented Mar 29, 2024

Hi, @christian-bromann when will the v9 be released?

@rsinghi with Bidi support around the corner we will have cross browser support for it natively in WebdriverIO soon. Today, you can already use the getPuppeteer command to access the CDP interface for network logging.

And I also want to know how to intercept network, is there a workaround with webdriver way?

@christian-bromann
Copy link
Member Author

is there a workaround with webdriver way?

yes, network intercepts can be made via the mock command.

@Jabbar2010
Copy link

@christian-bromann I found in the document
"INFO
Note that using the mock command requires support for Chrome DevTools protocol. That support is given if you run tests locally in Chromium based browser or if you use a Selenium Grid v4 or higher. This command can not be used when running automated tests in the cloud. Find out more in the Automation Protocols section."

It said the cmd requires CDP, but I don't understand: if the browser should support CDP or if we have to use "devtools" for "automationProtocol". Do Safari, Firefox browsers support "mock"?

@Jabbar2010
Copy link

Jabbar2010 commented Apr 1, 2024

And I found another answer from you @christian-bromann : #2759 (comment)

If I use mock API, and I want to modify the HTTP request headers. You mean the "headers" in the mock API are just for selenium server requests not for the browser. So what can I do to modify the request header?

@christian-bromann
Copy link
Member Author

Do Safari, Firefox browsers support "mock"?

Not right now but they will in the future through Bidi. I am currently implementing Bidi support for the mock command in v9 and it will allow cross browser mocking using the same interface.

So what can I do to modify the request header?

I will enhance the mock command to allow something like this:

const mock = await browser.mock('/some/path', {
  requestWith: {
    // set request header
    header: {
      'x-foo': 'bar'
    }
  }
})

// keep response but update response headers
mock.response(null, {
  header: {
    'x-bar': 'foo'
  }
})

What do you think?

@Jabbar2010
Copy link

Thanks, @christian-bromann very cool!

Currently what I'm doing is migrating from Playwright, but I did a lot of research, and I found what Wedriverio can not do but Playwright can, such as network intercept(totally modify request header) or some APIs like upload files "that this command is only supported if you use a Selenium Hub, Chromedriver or EdgeDriver directly.", they're not compatible for all browsers. So another concern is I don't know very clearly which API is workable for all browsers, which is not , that' very important for our project testing, we're running on every popular browser.

Any ideas about my concern? thanks a lot.

And BTW, want to know when v9 will be released.

@christian-bromann
Copy link
Member Author

they're not compatible for all browsers

The idea of WebdriverIO is that all commands work the same way in all browser. Unfortunately as browser adopt the new Bidi standard, we have different progress on certain APIs which will hopefully resolve itself some day. In the past we enabled these features by using Chrome DevTools (which only works for Chrome and Edge in most cases) but with Bidi we move away from that. That said, network interception will work the same way across browser once these features land. I am currently running interception tests successfully in Canary and I expect this to work in FF Nightly soon as well. I can't speak about Safari, except that they plan to implement it.

And BTW, want to know when v9 will be released.

You can already use v9 today using the @next tag. As we aren't as careful shipping breaking changes I recommend maybe pin the version to ensure your tests are stable.

@Jabbar2010
Copy link

Jabbar2010 commented Apr 1, 2024

Wow! very quick response, thanks, @christian-bromann , I have lots of questions about Webdriverio, but maybe here is not a good place to ask.

@Jabbar2010
Copy link

Jabbar2010 commented Apr 1, 2024

Sorry, I forgot an important feature of network intercept is Websocket, does it support? @christian-bromann

Playwright: https://playwright.dev/docs/api/class-websocket

@christian-bromann
Copy link
Member Author

christian-bromann commented Apr 1, 2024

but maybe here is not a good place to ask.

Join our Discord server and ask away 😉

I forgot an important feature of network intercept is Websocket, does it support?

This currently does not seem to be supported by the protocol but is something we can implement in WebdriverIO via script injection. I will create a feature request for this. An issue for this was created some time ago: #5911

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issues that are free to take by anyone interested v9
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants