Skip to content

Feat/esm #5045

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

Open
wants to merge 235 commits into
base: 4.x
Choose a base branch
from
Open

Feat/esm #5045

wants to merge 235 commits into from

Conversation

DavertMik
Copy link
Contributor

Refactored to be fully ESM

Should be the base for 4.x branch

dependabot bot and others added 30 commits January 2, 2025 17:31
Bumps [ts-morph](https://github.com/dsherret/ts-morph) from 24.0.0 to 25.0.0.
- [Release notes](https://github.com/dsherret/ts-morph/releases)
- [Commits](dsherret/ts-morph@24.0.0...25.0.0)

---
updated-dependencies:
- dependency-name: ts-morph
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* feature: clear individual cookie by name with Playwright (available since Playwright 1.43)

* feature: clear individual cookie by name with Playwright (available since Playwright 1.43)

* feature: clear individual cookie by name with Playwright (available since Playwright 1.43)

* feature: clear individual cookie by name with Playwright (available since Playwright 1.43)

* feature: clear individual cookie by name with Playwright (available since Playwright 1.43)

---------

Co-authored-by: Norbert Graf <[email protected]>
* added els functions

* implemented els module

* added els to package.json

* els functions & terminal improvements

* fixed metastep display

* remove not used test

---------

Co-authored-by: DavertMik <[email protected]>
* refactored mocha, implemented hooks

* refactored mocha classes, added class hooks

* fixed tests

* fixed formatting

* updated tests

* workers fix

* fixed def

* fixed type definitions

* refactored mocha classes

* fixed bdd tests

* added hook config

* fixed lint

* refactored tests

---------

Co-authored-by: DavertMik <[email protected]>
* Bump webdriverio to v9

* Adjust config

* Adjust config

* Remove options

* Update chrome driver

* Fix deprecations

* Fix deprecations

* Fix markup

* Added condition

* Fix more tests

* Fix iFrame stuff

* try to fix some wdio tests

* try to fix some wdio tests

* try to fix some wdio tests

* try to fix some wdio tests

* try to fix some wdio tests

* try to fix some wdio tests

* try to fix some wdio tests

* try to fix some wdio tests

* try to fix some wdio tests

* try to fix some wdio tests

* try to fix some wdio tests

* try to fix some wdio tests

* Try to fix popup test

* Try to fix window size #resizeWindow

* Another fix

* Fix popup tests

* Enable should be authenticated

* Trigger Build

---------

Co-authored-by: kobenguyent <[email protected]>
Co-authored-by: kobenguyent <[email protected]>
* fixed regression in waitfortext

* fixed wait test for wait for text

* fixed retries for PW waitForText test

---------

Co-authored-by: DavertMik <[email protected]>
* update to async/await style

* update to async/await style
…4724)

* Bump eslint to 9.1.15 and removed dep to eslint-config-airbnb-base

* eslint ^9.17.0

* Re-added no-return-await
#4713)

* fixed pause finishing, added suggest for empty run, included fuse.js for better search

* fixed test

* updated plugins docs

* improved unit tests setup

* fixed interface test for CI mode

* fixed on ci

* added env variable config

---------

Co-authored-by: DavertMik <[email protected]>
* improve the docker compose networks

* improve the docker compose networks

* improve the docker compose networks
* 3.7.0-beta.1

* added check command

* added file

* added debug for container, fixed check command

* added support for custom config -c, added checks to workflows

* fixed check command

* added await for check

---------

Co-authored-by: DavertMik <[email protected]>
kobenguyent and others added 24 commits June 9, 2025 12:09
Bumps [sinon](https://github.com/sinonjs/sinon) from 20.0.0 to 21.0.0.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/commits)

---
updated-dependencies:
- dependency-name: sinon
  dependency-version: 21.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.31.0 to 2.32.0.
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](import-js/eslint-plugin-import@v2.31.0...v2.32.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-import
  dependency-version: 2.32.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@eslint/js](https://github.com/eslint/eslint/tree/HEAD/packages/js) from 9.28.0 to 9.29.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/commits/v9.29.0/packages/js)

---
updated-dependencies:
- dependency-name: "@eslint/js"
  dependency-version: 9.29.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [eslint-plugin-mocha](https://github.com/lo1tuma/eslint-plugin-mocha) from 11.0.0 to 11.1.0.
- [Release notes](https://github.com/lo1tuma/eslint-plugin-mocha/releases)
- [Changelog](https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/CHANGELOG.md)
- [Commits](lo1tuma/eslint-plugin-mocha@11.0.0...11.1.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-mocha
  dependency-version: 11.1.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Update jsdoc.conf.js

* fix: jsdoc.conf.js

* Update jsdoc.conf.js

* add types test

* Update global-variables.types.ts
Bumps [electron](https://github.com/electron/electron) from 36.4.0 to 37.1.0.
- [Release notes](https://github.com/electron/electron/releases)
- [Changelog](https://github.com/electron/electron/blob/main/docs/breaking-changes.md)
- [Commits](electron/electron@v36.4.0...v37.1.0)

---
updated-dependencies:
- dependency-name: electron
  dependency-version: 37.1.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 24.0.2 to 24.0.7.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 24.0.7
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
)

Bumps [typedoc-plugin-markdown](https://github.com/typedoc2md/typedoc-plugin-markdown/tree/HEAD/packages/typedoc-plugin-markdown) from 4.6.3 to 4.7.0.
- [Release notes](https://github.com/typedoc2md/typedoc-plugin-markdown/releases)
- [Changelog](https://github.com/typedoc2md/typedoc-plugin-markdown/blob/main/packages/typedoc-plugin-markdown/CHANGELOG.md)
- [Commits](https://github.com/typedoc2md/typedoc-plugin-markdown/commits/[email protected]/packages/typedoc-plugin-markdown)

---
updated-dependencies:
- dependency-name: typedoc-plugin-markdown
  dependency-version: 4.7.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 5.2.1 to 5.2.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

---
updated-dependencies:
- dependency-name: "@types/chai"
  dependency-version: 5.2.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@DavertMik DavertMik requested a review from kobenguyent July 19, 2025 10:21
@kobenguyent kobenguyent requested a review from Copilot July 21, 2025 06:42
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the codebase from CommonJS (CJS) to ECMAScript Modules (ESM) syntax, representing a foundational change for the 4.x branch. The conversion includes updating import/export statements, removing semicolons following ESM standards, and adapting module loading patterns for better compatibility.

Key changes include:

  • Converting require() statements to import statements and module.exports to export statements
  • Removing semicolons from most statements to align with ESM conventions
  • Updating dynamic module loading patterns with proper ESM compatibility fallbacks
  • Complete removal of the deprecated Protractor helper

Reviewed Changes

Copilot reviewed 111 out of 467 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
lib/hooks.js Converted to ESM imports/exports with semicolon removal
lib/history.js Updated module syntax and removed semicolons
lib/helper/testcafe/testcafe-utils.js Mixed conversion retaining some CJS patterns
lib/helper/network/utils.js Full ESM conversion with export syntax changes
lib/helper/network/actions.js Updated imports and exports to ESM format
lib/helper/extras/Popup.js Converted exports while keeping CJS compatibility
lib/helper/extras/PlaywrightRestartOpts.js Converted to named ESM exports
lib/helper/errors/ElementNotFound.js Updated to ESM import/export syntax
lib/helper/WebDriver.js Extensive ESM conversion with dynamic import handling
lib/helper/TestCafe.js Mixed compatibility handling for ESM/CJS modules
lib/helper/REST.js Full ESM conversion with error handling improvements
lib/helper/Puppeteer.js Complete ESM refactoring with dynamic imports
lib/helper/Protractor.js Complete file removal (deprecated helper)
Comments suppressed due to low confidence (1)

lib/helper/WebDriver.js:32

  • The line 'this.context = this.root' appears to be incorrectly placed outside of a constructor or method. This will cause a syntax error as it's attempting to assign a property at the module level.
 *

Comment on lines +1 to +6
const { ClientFunction } = require('testcafe')

const assert = require('assert');
const fs = require('fs');
const path = require('path');
const { getParamNames } = require('../../utils');
const assert = require('assert')
const fs = require('fs')
const path = require('path')
const { getParamNames } = require('../../utils')
Copy link
Preview

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

This file mixes ESM and CommonJS syntax. The first line uses CommonJS require() while other files in this PR use ESM imports. Consider converting all require() statements to import statements for consistency.

Copilot uses AI. Check for mistakes.

}
}

module.exports = Popup;
module.exports = Popup
Copy link
Preview

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

This file uses module.exports instead of ESM export syntax. For consistency with the ESM conversion, this should be 'export default Popup' to match the pattern used in other converted files.

Suggested change
module.exports = Popup
export default Popup

Copilot uses AI. Check for mistakes.

await new Promise((done) => {
setTimeout(done, 1000);
});
await new Promise(done => {
Copy link
Preview

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

[nitpick] The arrow function parameter should be parenthesized for consistency. Use 'await new Promise((done) => {' instead of 'await new Promise(done => {' to maintain consistent parameter formatting.

Suggested change
await new Promise(done => {
await new Promise((done) => {

Copilot uses AI. Check for mistakes.

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.