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

Restore work with devtools, jsonwp and return support node@18 #17

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
  •  
  •  
  •  
14 changes: 7 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ See [CHANGELOG - v8](https://github.com/webdriverio/webdriverio/blob/v8/CHANGELO
* `wdio-cli`, `wdio-jasmine-framework`, `wdio-types`
* [#14001](https://github.com/webdriverio/webdriverio/pull/14001) fix(@wdio/cli): adjust default value for specFileRetriesDeferred ([@christian-bromann](https://github.com/christian-bromann))
* `wdio-utils`
* [#14000](https://github.com/webdriverio/webdriverio/pull/14000) fix(@wdio/utils): detect Appium if 'appium:options' is used ([@christian-bromann](https://github.com/christian-bromann))
* [#14000](https://github.com/webdriverio/webdriverio/pull/14000) fix(@testplane/utils): detect Appium if 'appium:options' is used ([@christian-bromann](https://github.com/christian-bromann))

#### :nail_care: Polish
* `wdio-types`, `wdio-utils`, `webdriverio`
Expand Down Expand Up @@ -184,7 +184,7 @@ See [CHANGELOG - v8](https://github.com/webdriverio/webdriverio/blob/v8/CHANGELO

#### :nail_care: Polish
* `wdio-utils`
* [#13983](https://github.com/webdriverio/webdriverio/pull/13983) fix(@wdio/utils): Unset geckodriver when stable is set as browserVersion ([@nextlevelbeard](https://github.com/nextlevelbeard))
* [#13983](https://github.com/webdriverio/webdriverio/pull/13983) fix(@testplane/utils): Unset geckodriver when stable is set as browserVersion ([@nextlevelbeard](https://github.com/nextlevelbeard))

#### Committers: 4
- Christian Bromann ([@christian-bromann](https://github.com/christian-bromann))
Expand All @@ -203,7 +203,7 @@ See [CHANGELOG - v8](https://github.com/webdriverio/webdriverio/blob/v8/CHANGELO
* `wdio-utils`, `webdriverio`
* [#13960](https://github.com/webdriverio/webdriverio/pull/13960) fix(webdriverio): support opening file urls ([@christian-bromann](https://github.com/christian-bromann))
* `wdio-utils`
* [#13949](https://github.com/webdriverio/webdriverio/pull/13949) fix(@wdio/utils): properly detect Appium browser sessions ([@christian-bromann](https://github.com/christian-bromann))
* [#13949](https://github.com/webdriverio/webdriverio/pull/13949) fix(@testplane/utils): properly detect Appium browser sessions ([@christian-bromann](https://github.com/christian-bromann))
* `wdio-runner`
* [#13958](https://github.com/webdriverio/webdriverio/pull/13958) fix(@wdio/runner): Continue emitting event on the runner even when a reporter throws an error ([@dprevost-LMI](https://github.com/dprevost-LMI))
* `webdriverio`
Expand Down Expand Up @@ -647,11 +647,11 @@ See [CHANGELOG - v8](https://github.com/webdriverio/webdriverio/blob/v8/CHANGELO
* [#13568](https://github.com/webdriverio/webdriverio/pull/13568) fix(@wdio/cli): package manager detection improvements ([@alcpereira](https://github.com/alcpereira))
* [#13557](https://github.com/webdriverio/webdriverio/pull/13557) fix(#11999): regression with Jasmine types ([@Badisi](https://github.com/Badisi))
* `wdio-types`
* [#13567](https://github.com/webdriverio/webdriverio/pull/13567) fix(@wdio/types): make 'moz:debuggerAddress' a string or boolean ([@christian-bromann](https://github.com/christian-bromann))
* [#13567](https://github.com/webdriverio/webdriverio/pull/13567) fix(@testplane/types): make 'moz:debuggerAddress' a string or boolean ([@christian-bromann](https://github.com/christian-bromann))

#### :nail_care: Polish
* `wdio-utils`, `webdriver`
* [#13648](https://github.com/webdriverio/webdriverio/pull/13648) fix(@wdio/utils): disable Bidi for Appium sessions ([@christian-bromann](https://github.com/christian-bromann))
* [#13648](https://github.com/webdriverio/webdriverio/pull/13648) fix(@testplane/utils): disable Bidi for Appium sessions ([@christian-bromann](https://github.com/christian-bromann))
* `wdio-appium-service`, `wdio-sauce-service`, `wdio-testingbot-service`, `wdio-utils`, `webdriver`, `webdriverio`
* [#13622](https://github.com/webdriverio/webdriverio/pull/13622) fix(webdriverio): don't send `desiredCapabilities` anymore when initializing a session ([@christian-bromann](https://github.com/christian-bromann))
* `wdio-spec-reporter`, `wdio-types`, `webdriverio`
Expand Down Expand Up @@ -832,8 +832,8 @@ See [CHANGELOG - v8](https://github.com/webdriverio/webdriverio/blob/v8/CHANGELO
* `wdio-allure-reporter`, `wdio-appium-service`, `wdio-browser-runner`, `wdio-browserstack-service`, `wdio-cli`, `wdio-concise-reporter`, `wdio-config`, `wdio-cucumber-framework`, `wdio-devtools-service`, `wdio-firefox-profile-service`, `wdio-jasmine-framework`, `wdio-json-reporter`, `wdio-junit-reporter`, `wdio-local-runner`, `wdio-mocha-framework`, `wdio-reporter`, `wdio-runner`, `wdio-sauce-service`, `wdio-shared-store-service`, `wdio-spec-reporter`, `wdio-testingbot-service`, `wdio-types`, `wdio-utils`, `wdio-webdriver-mock-service`, `webdriver`, `webdriverio`
* [#12987](https://github.com/webdriverio/webdriverio/pull/12987) breaking(*): better type definitions for capabilities ([@christian-bromann](https://github.com/christian-bromann))
* [#11942](https://github.com/webdriverio/webdriverio/pull/11942) breaking(*): V9 migrate from got to fetch ([@tamil777selvan](https://github.com/tamil777selvan))
* `@wdio/protocols`
* [#12006](https://github.com/webdriverio/webdriverio/pull/12006) breaking(@wdio/protocols): V9 Remove JSONWireProtocol ([@tamil777selvan](https://github.com/tamil777selvan))
* `@testplane/protocols`
* [#12006](https://github.com/webdriverio/webdriverio/pull/12006) breaking(@testplane/protocols): V9 Remove JSONWireProtocol ([@tamil777selvan](https://github.com/tamil777selvan))
* `webdriverio`
* [#12490](https://github.com/webdriverio/webdriverio/pull/12490) allow getHTML to pierce through Shadow DOM ([@christian-bromann](https://github.com/christian-bromann))

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ WebdriverIO provides its own type definitions for projects that use TypeScript.

All type definitions are generated by the TypeScript compiler. There are some essential packages for that:

- the `@wdio/types` package provides all general types that are used across the code based, e.g. Capabilities, Options etc. If you need a type definitions across multiple packages it is a good idea to define them in here
- the `@testplane/types` package provides all general types that are used across the code based, e.g. Capabilities, Options etc. If you need a type definitions across multiple packages it is a good idea to define them in here
- the `@wdio/protocol` package defines all protocol commands, their function parameters and return types
- all other types should be defined in the package where they are used, here we tend to have general types defined in a `types.ts` file

Expand Down Expand Up @@ -339,7 +339,7 @@ This repository contains everything to set up, build and deploy the WebdriverIO
- the guidelines pages from markdown files of the [docs directory](https://github.com/webdriverio/webdriverio/tree/main/website/docs)
- service and reporter docs from the readme files of those packages within this repository
- service and reporter docs from 3rd party plugins (defined in [these JSON files](https://github.com/webdriverio/webdriverio/tree/main/scripts/docs-generation/3rd-party)) that are downloaded from GitHub and parsed
- the protocol APIs from the [`@wdio/protocols`](https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-protocols/src/protocols) package
- the protocol APIs from the [`@testplane/protocols`](https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-protocols/src/protocols) package
- the WebdriverIO API that is parsed out of the JSDoc comments of individual commands (e.g., [`execute`](https://github.com/webdriverio/webdriverio/blob/main/packages/webdriverio/src/commands/browser/execute.ts#L3-L37) command)

Changes to the docs need to be done in one of these places. Please note that changes to e.g. the config file have to be updated in multiple places given that config files are wide spread (as examples or test files) within this repository. A good way to go about this is to look for all occurrences of a certain string of the config and update changes in all findings.
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. component testing, visual regression or frontend performance testing)
- 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/))
- 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
7 changes: 4 additions & 3 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) 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.
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.

## :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,18 +88,19 @@ __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

### Helper

- [@wdio/config](https://github.com/webdriverio/webdriverio/blob/main/packages/wdio-config) - A helper utility to parse and validate WebdriverIO options
- [@wdio/logger](https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-logger) - A helper utility for logging WebdriverIO packages
- [@wdio/protocols](https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-protocols) - Utility package providing information about automation protocols
- [@testplane/protocols](https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-protocols) - Utility package providing information about automation protocols
- [@wdio/repl](https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-repl) - A WDIO helper utility to provide a repl interface for WebdriverIO
- [@wdio/reporter](https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-reporter) - A WebdriverIO utility to help report all events
- [@wdio/runner](https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-runner) - A WebdriverIO service that runs tests in arbitrary environments
- [@wdio/utils](https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-utils) - A WDIO helper utility to provide several utility functions used across the project
- [@testplane/utils](https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-utils) - A WDIO helper utility to provide several utility functions used across the project
- [@wdio/globals](https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-globals) - A WDIO helper utility for importing global variables directly

### Reporter
Expand Down
5 changes: 4 additions & 1 deletion __mocks__/@wdio/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { vi } from 'vitest'
import {
sleep as sleepOrig,
Expand All @@ -11,7 +12,8 @@ import {
isW3C as isW3cOrig,
isBidi as isBidiOrig,
sessionEnvironmentDetector as sessionEnvDetector,
capabilitiesEnvironmentDetector as capabilitiesEnvDetector
capabilitiesEnvironmentDetector as capabilitiesEnvDetector,
devtoolsEnvironmentDetector as devtoolsEnvDetector
} 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 @@ -107,6 +109,7 @@ 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
2 changes: 1 addition & 1 deletion e2e/browser-runner/mock.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, browser, $ } from '@wdio/globals'
import type { RespondWithOptions } from 'webdriverio'
import type { RespondWithOptions } from '@testplane/webdriverio'
import { html, render } from 'lit'

const CORS_PARAMS: RespondWithOptions = {
Expand Down
2 changes: 1 addition & 1 deletion e2e/launch/aws.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, expect } from 'vitest'
import { remote } from 'webdriverio'
import { remote } from '@testplane/webdriverio'
import AWS from '@aws-sdk/client-device-farm'

let browser: WebdriverIO.Browser | undefined
Expand Down
2 changes: 1 addition & 1 deletion e2e/launch/reloadSession.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { test, expect } from 'vitest'
* $ npm install webdriverio
*
*/
import { remote } from 'webdriverio'
import { remote } from '@testplane/webdriverio'

test('can reconnect to WebDriver Bidi session', async () => {
const browser = await remote({
Expand Down
6 changes: 3 additions & 3 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"@wdio/sauce-service": "workspace:*",
"@wdio/shared-store-service": "workspace:*",
"@wdio/spec-reporter": "workspace:*",
"@wdio/types": "workspace:*",
"@testplane/types": "workspace:*",
"babel-plugin-transform-hook-names": "^1.0.2",
"cross-env": "^7.0.3",
"expect": "^29.7.0",
Expand All @@ -72,8 +72,8 @@
"string-width": "^7.1.0",
"tailwindcss": "^3.4.1",
"vite": "^5.1.3",
"webdriver": "workspace:*",
"webdriverio": "workspace:*"
"@testplane/webdriver": "workspace:*",
"@testplane/webdriverio": "workspace:*"
},
"dependencies": {
"@stencil-community/router": "^1.0.2",
Expand Down
2 changes: 1 addition & 1 deletion e2e/standalone/attach.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { test, expect } from 'vitest'
* $ npm install webdriverio
*
*/
import { remote, attach } from 'webdriverio'
import { remote, attach } from '@testplane/webdriverio'

test('allow to attach to an existing session', async () => {
/**
Expand Down
5 changes: 3 additions & 2 deletions e2e/wdio/headless/bidi.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { browser, expect } from '@wdio/globals'
import type { local } from 'webdriver'
import type { local } from '@testplane/webdriver'

describe('bidi e2e test', () => {
describe('execute', () => {
Expand Down Expand Up @@ -63,7 +64,7 @@ describe('bidi e2e test', () => {
await browser.sessionSubscribe({ events: ['log.entryAdded'] })
browser.on('log.entryAdded', (logEntry) => logEvents.push(logEntry))
await browser.execute(() => console.log('Hello Bidi'))
// eslint-disable-next-line wdio/no-pause

await browser.waitUntil(
async () => logEvents.find((logEvent) => logEvent.text === 'Hello Bidi'),
{
Expand Down
3 changes: 2 additions & 1 deletion e2e/wdio/headless/multiremoteTest.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { multiremotebrowser as browser } from '@wdio/globals'
import { Key } from 'webdriverio'
import { Key } from '@testplane/webdriverio'

let browserA: WebdriverIO.Browser
let browserB: WebdriverIO.Browser
Expand All @@ -20,6 +20,7 @@ describe('multi remote test', () => {
/**
* Unfortunately we don't know which result is from which browser
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const results = (await browser.checkPWA() as any).map((result: { passed: boolean }) => result.passed)
expect(typeof results[0]).toBe('boolean')
expect(typeof results[1]).toBe('boolean')
Expand Down
2 changes: 1 addition & 1 deletion examples/appium/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"private": true,
"type": "module",
"dependencies": {
"webdriverio": "workspace:*"
"@testplane/webdriverio": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion examples/bidi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"private": true,
"type": "module",
"dependencies": {
"webdriverio": "workspace:*"
"@testplane/webdriverio": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion examples/cloudservices/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"test:kobiton": "node kobiton.js"
},
"dependencies": {
"webdriverio": "workspace:*"
"@testplane/webdriverio": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion examples/standalone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"private": true,
"type": "module",
"dependencies": {
"webdriverio": "workspace:*"
"@testplane/webdriverio": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion examples/wdio/cucumber/step-definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/

import { Given, When, Then } from '@wdio/cucumber-framework'
import { Key } from 'webdriverio'
import { Key } from '@testplane/webdriverio'

Given(/^I go on the website "([^"]*)"$/, async (url) => {
await browser.url(url)
Expand Down
6 changes: 3 additions & 3 deletions examples/wdio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"@wdio/repl": "workspace:*",
"@wdio/shared-store-service": "workspace:*",
"@wdio/spec-reporter": "workspace:*",
"@wdio/types": "workspace:*",
"webdriver": "workspace:*",
"webdriverio": "workspace:*"
"@testplane/types": "workspace:*",
"@testplane/webdriver": "workspace:*",
"@testplane/webdriverio": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion examples/wdio/vite-vue-example/wdio.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const config: WebdriverIO.Config = {
// - @wdio/mocha-framework, @wdio/jasmine-framework
// - @wdio/local-runner
// - @wdio/sumologic-reporter
// - @wdio/cli, @wdio/config, @wdio/utils
// - @wdio/cli, @wdio/config, @testplane/utils
// Level of logging verbosity: trace | debug | info | warn | error | silent
// logLevels: {
// webdriver: 'info',
Expand Down
2 changes: 1 addition & 1 deletion infra/compiler/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const packages = (
* plugins for the ESM build
*/
const esmPlugins: Record<string, Plugin[]> = {
'@wdio/protocols': [generateTypes()],
'@testplane/protocols': [generateTypes()],
'@wdio/cli': [copyEJSTemplates()],
'webdriverio': [externalScripts()]
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"clean:cddl": "rimraf --glob scripts/bidi/cddl",
"compile": "pnpm -r --filter=@wdio/compiler run build",
"compile:all": "run-s compile:all:*",
"compile:all:core": "pnpm -r --filter=@wdio/compiler run build -p @wdio/logger -p @wdio/types -p @wdio/globals -p @wdio/protocols -p @wdio/repl",
"compile:all:main": "pnpm -r --filter=@wdio/compiler run build -p @wdio/utils -p @wdio/reporter -p @wdio/config -p webdriver -p webdriverio",
"compile:all:core": "pnpm -r --filter=@wdio/compiler run build -p @wdio/logger -p @testplane/types -p @wdio/globals -p @testplane/protocols -p @wdio/repl",
"compile:all:main": "pnpm -r --filter=@wdio/compiler run build -p @testplane/utils -p @wdio/reporter -p @wdio/config -p webdriver -p webdriverio",
"compile:all:all": "pnpm -r --filter=@wdio/compiler run build",
"generate": "run-s generate:*",
"generate:bidi": "tsx ./scripts/bidi/index.ts",
Expand Down
4 changes: 4 additions & 0 deletions packages/devtools/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
src
tests
tsconfig.json
tsconfig.prod.json
Loading
Loading