Skip to content

Commit

Permalink
(devtools): removing devtools automation protocol (webdriverio#12301)
Browse files Browse the repository at this point in the history
* (devtools): bye bye

* remove e2e tests

* more cleanuops

* fix unit tests

* fix test command
  • Loading branch information
christian-bromann authored Mar 3, 2024
1 parent e60161d commit 28e64e4
Show file tree
Hide file tree
Showing 166 changed files with 481 additions and 8,990 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ packages/**/cjs/
/*.js
/*.mjs
/*.ts
devtools.d.ts
!.eslintrc.js
!vitest.config.ts
packages/**/package-lock.json
Expand Down
5 changes: 1 addition & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,7 @@ When a PR gets submitted, WebdriverIO runs the following checks:
$ pnpm run test:smoke
```
- *e2e Tests*
Last but not least, we run actual e2e tests with a real browser to ensure that our WebDriver DevTools implementation is working as expected. These
tests spin up headless Chrome, Firefox and Edge browsers to test various implementations like for example the commands implemented in the `devtools` package. Given that the WebDriver functionality
is already tested with [WPT](https://github.com/web-platform-tests/wpt), we don't need to do it there.
In order to run these tests, an installation of [Firefox Nightly](https://www.mozilla.org/en-US/firefox/channel/desktop/#nightly), [Google Chrome](https://www.google.com/chrome/) and [Microsoft Edge](https://www.microsoft.com/en-us/edge/download)is required
Last but not least, we run actual e2e tests with a real headless browser to ensure we can spin up tests in all support variants and that certain services from end to end.
You can manually trigger this check by calling:
```sh
$ pnpm run test:e2e
Expand Down
4 changes: 2 additions & 2 deletions PROJECT_CHARTER.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ With that, the project offers not only the ability of automating user agents usi

- automation of modern web browsers
- automation of mobile devices (web as well as native applications)
- automation of desktop applications (e.g. Electron or MacOS applications)
- testing applications from end-to-end at scale (including parallelisation and reporting)
- integration into 3rd party services and vendors (e.g. [Sauce Labs](https://saucelabs.com/) or [BrowserStack](https://browserstack.com/))
- support of functional as well as non functional testing aspects (e.g. visual regression or frontend performance testing)
- automated debugging in the browser (e.g. using the [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/))
- support of functional as well as non functional testing aspects (e.g. component testing, visual regression or frontend performance testing)
- scraping of websites
- providing technical content and best practices in form of [boilerplates](https://webdriver.io/) and [blog posts](https://webdriver.io/blog/)
- providing technical help in form of a [community channel](https://discord.webdriver.io)
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

***

WebdriverIO is a test automation framework, for e2e as well as unit and component testing in the browser, that allows you to run tests based on the [WebDriver](https://w3c.github.io/webdriver/webdriver-spec.html), [WebDriver BiDi](https://github.com/w3c/webdriver-bidi) as well as [Chrome DevTools](https://chromedevtools.github.io/devtools-protocol/) protocol and [Appium](http://appium.io/) automation technology. It provides support for your favorite BDD/TDD test framework and will run your tests locally or in the cloud using Sauce Labs, BrowserStack, TestingBot or LambdaTest.
WebdriverIO is a test automation framework, for e2e as well as unit and component testing in the browser, that allows you to run tests based on the [WebDriver](https://w3c.github.io/webdriver/webdriver-spec.html) and [WebDriver BiDi](https://github.com/w3c/webdriver-bidi) as well as [Appium](http://appium.io/) automation technology. It provides support for your favorite BDD/TDD test framework and will run your tests locally or in the cloud using Sauce Labs, BrowserStack, TestingBot or LambdaTest.

## :woman_technologist: :man_technologist: Contributing
Do you like WebdriverIO and want to help make it better? Awesome! Have a look into our [Contributor Documentation](CONTRIBUTING.md) to get started and find out what contributions can be and how to make them.
Expand Down Expand Up @@ -88,7 +88,6 @@ __Did you build a WebdriverIO service or reporter?__ That's awesome! Please add
### Core

- [webdriver](https://github.com/webdriverio/webdriverio/tree/main/packages/webdriver) - A Node.js bindings implementation for the W3C WebDriver and Mobile JSONWire Protocol
- [devtools](https://github.com/webdriverio/webdriverio/tree/main/packages/devtools) - A Chrome DevTools protocol binding that maps WebDriver commands into Chrome DevTools commands using Puppeteer
- [webdriverio](https://github.com/webdriverio/webdriverio/blob/main/packages/webdriverio) - Next-gen browser and mobile automation test framework for Node.js
- [@wdio/cli](https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-cli) - A WebdriverIO testrunner command line interface

Expand Down
4 changes: 1 addition & 3 deletions __mocks__/@wdio/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import webdriverMonadOrig from '../../packages/wdio-utils/src/monad.js'
import {
isW3C as isW3cOrig,
sessionEnvironmentDetector as sessionEnvDetector,
capabilitiesEnvironmentDetector as capabilitiesEnvDetector,
devtoolsEnvironmentDetector as devtoolsEnvDetector
capabilitiesEnvironmentDetector as capabilitiesEnvDetector
} from '../../packages/wdio-utils/src/envDetector.js'
import { UNICODE_CHARACTERS as UNICODE_CHARACTERS_ORIG, HOOK_DEFINITION as HOOK_DEFINITION_ORIG } from '../../packages/wdio-utils/src/constants.js'

Expand Down Expand Up @@ -106,7 +105,6 @@ export const sessionEnvironmentDetector = vi.fn().mockImplementation(
// @ts-ignore
(...args) => sessionEnvDetector(...args))
export const capabilitiesEnvironmentDetector = capabilitiesEnvDetector
export const devtoolsEnvironmentDetector = devtoolsEnvDetector
export const transformCommandLogResult = vi.fn().mockImplementation((data) => data)
export const sleep = vi.fn().mockImplementation(sleepOrig)
export const UNICODE_CHARACTERS = UNICODE_CHARACTERS_ORIG
Expand Down
1 change: 1 addition & 0 deletions __mocks__/puppeteer-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const cdpSession = new CDPSessionMock()

class TargetMock {
page = vi.fn().mockImplementation(() => page)
asPage = vi.fn().mockImplementation(async () => page)
createCDPSession = vi.fn().mockImplementation(() => cdpSession)
}
const target = new TargetMock()
Expand Down
7 changes: 6 additions & 1 deletion e2e/attach.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ test('allow to attach to an existing session', async () => {
const browser = await remote({
capabilities: {
browserName: 'chrome',
'wdio:devtoolsOptions': { headless: true, dumpio: true }
'goog:chromeOptions': {
args: ['headless', 'disable-gpu']
}
}
})

Expand All @@ -24,6 +26,9 @@ test('allow to attach to an existing session', async () => {

await otherBrowser.deleteSession()

/**
* verify that browser session is deleted
*/
const error = await browser.status().catch((err) => err)
expect(error.message).not.toBe('ChromeDriver ready for new sessions.')
expect(error.message).toEqual(expect.stringContaining('fetch failed'))
Expand Down
Loading

0 comments on commit 28e64e4

Please sign in to comment.