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 239 commits into
base: 4.x
Choose a base branch
from
Open

Feat/esm #5045

wants to merge 239 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]>
dependabot bot and others added 18 commits June 20, 2025 18:36
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.

DavertMik and others added 5 commits July 22, 2025 02:32
- Convert all config files from CommonJS to ESM format
- Fix JSDoc generation for ESM codebase
- Update runok.cjs to convert ESM imports/exports to CommonJS for JSDoc compatibility
- Fix TypeScript definition generation issues
- Remove non-existent lib/within.js from JSDoc config
- Fix codeceptjs reference in index.d.ts
- All pre-commit hooks now pass successfully

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Copy link

Testomat.io Report 🔴 UNIT-TESTS FAILED
Tests ✔️ 314 tests run
Summary 🔴 21 failed; 🟢 292 passed; 🟡 1 skipped
Duration 🕐 44 seconds
Job 🗂️ Run Unit tests / unit-tests
Operating System 🖥️ Linux X64

🟥 Failures (20)

🔴 Container: should support object by name

expected [Function] to throw Error

################[ Failure ]################
AssertionError (strictEqual): expected [Function] to throw Error
   124 |      expect(container.support('support1')).is.ok
   125 |      expect(container.support('support1').name).to.eql('hello')
   126 |      expect(container.support('support2')).is.ok
   127 |      expect(container.support('support2').name).to.eql('world')
   128 |
 > 129 |      expect(() => container.support('support3').name).to.throw(Error)
   130 |    })
   131 |  })
   132 |
   133 |  describe('#plugins', () => {
   134 |    beforeEach(async () => {

   at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/unit/container_test.js:129:64)

🔴 Container: should load DI and return a reference to the module

container.support(...).toString is not a function

################[ Failure ]################
TypeError: container.support(...).toString is not a function
   184 |        include: {
   185 |          dummyPage: './data/dummy_page',
   186 |        },
   187 |      })
   188 |      const dummyPage = await import('../data/dummy_page.js')
 > 189 |      expect(container.support('dummyPage').toString()).is.eql((dummyPage.default || dummyPage).toString())
   190 |    })
   191 |
   192 |    it('should load I from path and execute', async () => {
   193 |      await container.create({
   194 |        include: {

   at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/unit/container_test.js:189:45)

🔴 Container: should load I from path and execute

Custom actor loading from path './data/I' must be handled asynchronously during container creation

################[ Failure ]################
Error: Custom actor loading from path './data/I' must be handled asynchronously during container creation
   485 |function createActor(actorPath) {
   486 |  if (container.support.I) return container.support.I
   487 |
   488 |  if (actorPath) {
   489 |    // Actor path loading must be handled async during container creation
 > 490 |    throw new Error(`Custom actor loading from path '${actorPath}' must be handled asynchronously during container creation`)
   491 |  } else {
   492 |    container.support.I = actorFactory({}, Container)
   493 |  }
   494 |
   495 |  return container.support.I

   at createActor (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:490:11)
   at Container.create (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:71:5)
   at async Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/unit/container_test.js:193:7)

🔴 Container: should load DI includes provided as require paths

expected {} to contain key 'openDummyPage'

################[ Failure ]################
AssertionError (deepStrictEqual): expected {} to contain key 'openDummyPage'


+ expected - actual
+ [
+   "openDummyPage"
+ ]
- []

   206 |        include: {
   207 |          dummyPage: './data/dummy_page',
   208 |        },
   209 |      })
   210 |      expect(container.support('dummyPage')).is.ok
 > 211 |      expect(container.support('dummyPage')).to.include.keys('openDummyPage')
   212 |    })
   213 |
   214 |    it('should load DI and inject I into PO', async () => {
   215 |      await container.create({
   216 |        include: {

   at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/unit/container_test.js:211:57)

🔴 Container: should load DI and inject I into PO

Custom actor loading from path './data/I' must be handled asynchronously during container creation

################[ Failure ]################
Error: Custom actor loading from path './data/I' must be handled asynchronously during container creation
   485 |function createActor(actorPath) {
   486 |  if (container.support.I) return container.support.I
   487 |
   488 |  if (actorPath) {
   489 |    // Actor path loading must be handled async during container creation
 > 490 |    throw new Error(`Custom actor loading from path '${actorPath}' must be handled asynchronously during container creation`)
   491 |  } else {
   492 |    container.support.I = actorFactory({}, Container)
   493 |  }
   494 |
   495 |  return container.support.I

   at createActor (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:490:11)
   at Container.create (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:71:5)
   at async Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/unit/container_test.js:215:7)

🔴 Container: should load DI and inject custom I into PO

Custom actor loading from path './data/I' must be handled asynchronously during container creation

################[ Failure ]################
Error: Custom actor loading from path './data/I' must be handled asynchronously during container creation
   485 |function createActor(actorPath) {
   486 |  if (container.support.I) return container.support.I
   487 |
   488 |  if (actorPath) {
   489 |    // Actor path loading must be handled async during container creation
 > 490 |    throw new Error(`Custom actor loading from path '${actorPath}' must be handled asynchronously during container creation`)
   491 |  } else {
   492 |    container.support.I = actorFactory({}, Container)
   493 |  }
   494 |
   495 |  return container.support.I

   at createActor (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:490:11)
   at Container.create (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:71:5)
   at async Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/unit/container_test.js:228:7)

🔴 els: should fail when condition is false

e.cliMessage is not a function

################[ Failure ]################
TypeError: e.cliMessage is not a function
   169 |
   170 |      try {
   171 |        await els.expectElement('.selector', async () => false)
   172 |        throw new Error('should have thrown error')
   173 |      } catch (e) {
 > 174 |        expect(e.cliMessage()).to.include('element (.selector)')
   175 |      }
   176 |    })
   177 |  })
   178 |
   179 |  describe('#expectAnyElement', () => {

   at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/unit/els_test.js:174:18)

🔴 els: should fail when no element matches condition

e.cliMessage is not a function

################[ Failure ]################
TypeError: e.cliMessage is not a function
   188 |
   189 |      try {
   190 |        await els.expectAnyElement('.selector', async () => false)
   191 |        throw new Error('should have thrown error')
   192 |      } catch (e) {
 > 193 |        expect(e.cliMessage()).to.include('any element of (.selector)')
   194 |      }
   195 |    })
   196 |  })
   197 |
   198 |  describe('#expectAllElements', () => {

   at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/unit/els_test.js:193:18)

🔴 els: should fail when any element does not match condition

e.cliMessage is not a function

################[ Failure ]################
TypeError: e.cliMessage is not a function
   207 |
   208 |      try {
   209 |        await els.expectAllElements('.selector', async el => el !== 'el2')
   210 |        throw new Error('should have thrown error')
   211 |      } catch (e) {
 > 212 |        expect(e.cliMessage()).to.include('element #2 of (.selector)')
   213 |      }
   214 |    })
   215 |  })
   216 |})
   217 |

   at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/unit/els_test.js:212:18)

🔴 AsyncWrapper: should work with async func

expected +0 to equal 4

################[ Failure ]################
AssertionError (strictEqual): expected +0 to equal 4


+ expected - actual
+ 4
- 0

   65 |      })
   66 |    }
   67 |
   68 |    await setup()
   69 |    testWrapper(test).fn(() => null)
 > 70 |    recorder.add('validation', () => expect(counter).to.eq(4))
   71 |    return recorder.promise()
   72 |  })
   73 |
   74 |  describe('events', () => {
   75 |    beforeEach(async () => {

   at <anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/unit/mocha/asyncWrapper_test.js:70:57)

🔴 AsyncWrapper: should fire events

expected false to be truthy

################[ Failure ]################
AssertionError (strictEqual): expected false to be truthy
   88 |      await teardown()
   89 |      await suiteTeardown()
   90 |      return recorder
   91 |        .promise()
   92 |        .then(() => {
 > 93 |          expect(started.called).is.ok
   94 |          expect(beforeSuite.called).is.ok
   95 |          expect(afterSuite.called).is.ok
   96 |          expect(before.called).is.ok
   97 |          expect(after.called).is.ok
   98 |        })

   at <anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/unit/mocha/asyncWrapper_test.js:93:36)

🔴 ui: context should contain BeforeAll

expected undefined to be truthy

################[ Failure ]################
AssertionError (strictEqual): expected undefined to be truthy
   22 |
   23 |  describe('basic constants', () => {
   24 |    const constants = ['Before', 'Background', 'BeforeAll', 'After', 'AfterAll', 'Scenario', 'xScenario']
   25 |
   26 |    constants.forEach(c => {
 > 27 |      it(`context should contain ${c}`, () => expect(context[c]).is.ok)
   28 |    })
   29 |  })
   30 |
   31 |  describe('Feature', () => {
   32 |    let suiteConfig

   at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/unit/mocha/ui_test.js:27:68)

🔴 ui: context should contain AfterAll

expected undefined to be truthy

################[ Failure ]################
AssertionError (strictEqual): expected undefined to be truthy
   22 |
   23 |  describe('basic constants', () => {
   24 |    const constants = ['Before', 'Background', 'BeforeAll', 'After', 'AfterAll', 'Scenario', 'xScenario']
   25 |
   26 |    constants.forEach(c => {
 > 27 |      it(`context should contain ${c}`, () => expect(context[c]).is.ok)
   28 |    })
   29 |  })
   30 |
   31 |  describe('Feature', () => {
   32 |    let suiteConfig

   at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/unit/mocha/ui_test.js:27:68)

🔴 retryFailedStep: "before each" hook for "should retry failed step"

Cannot read properties of undefined (reading 'stepShift')

################[ Failure ]################
TypeError: Cannot read properties of undefined (reading 'stepShift')
   70 |   * @param {string} msg
   71 |   */
   72 |  log(msg) {
   73 |    const _msg = isMaskedData() ? maskSensitiveData(msg) : msg
   74 |    if (outputLevel >= 3) {
 > 75 |      print(' '.repeat(this.stepShift), styles.log(truncate(`   ${_msg}`, this.spaceShift)))
   76 |    }
   77 |  },
   78 |
   79 |  /**
   80 |   * Print error

   at log (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/output.js:75:29)
   at Object.reset (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:95:5)
   at Object.start (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:51:10)
   at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/unit/plugin/retryFailedStep_test.js:20:14)

🔴 screenshotOnFail: "before each" hook for "should remove the . at the end of test title"

Cannot read properties of undefined (reading 'stepShift')

################[ Failure ]################
TypeError: Cannot read properties of undefined (reading 'stepShift')
   70 |   * @param {string} msg
   71 |   */
   72 |  log(msg) {
   73 |    const _msg = isMaskedData() ? maskSensitiveData(msg) : msg
   74 |    if (outputLevel >= 3) {
 > 75 |      print(' '.repeat(this.stepShift), styles.log(truncate(`   ${_msg}`, this.spaceShift)))
   76 |    }
   77 |  },
   78 |
   79 |  /**
   80 |   * Print error

   at log (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/output.js:75:29)
   at Object.reset (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:95:5)
   at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/unit/plugin/screenshotOnFail_test.js:15:14)

🔴 subtitles: "before each" hook for "should not capture subtitle as video artifact was missing"

Cannot read properties of undefined (reading 'stepShift')

################[ Failure ]################
TypeError: Cannot read properties of undefined (reading 'stepShift')
   70 |   * @param {string} msg
   71 |   */
   72 |  log(msg) {
   73 |    const _msg = isMaskedData() ? maskSensitiveData(msg) : msg
   74 |    if (outputLevel >= 3) {
 > 75 |      print(' '.repeat(this.stepShift), styles.log(truncate(`   ${_msg}`, this.spaceShift)))
   76 |    }
   77 |  },
   78 |
   79 |  /**
   80 |   * Print error

   at log (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/output.js:75:29)
   at Object.reset (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:95:5)
   at Object.start (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:51:10)
   at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/unit/plugin/subtitles_test.js:22:14)

🔴 Recorder: "before each" hook for "should create a promise"

Cannot read properties of undefined (reading 'stepShift')

################[ Failure ]################
TypeError: Cannot read properties of undefined (reading 'stepShift')
   70 |   * @param {string} msg
   71 |   */
   72 |  log(msg) {
   73 |    const _msg = isMaskedData() ? maskSensitiveData(msg) : msg
   74 |    if (outputLevel >= 3) {
 > 75 |      print(' '.repeat(this.stepShift), styles.log(truncate(`   ${_msg}`, this.spaceShift)))
   76 |    }
   77 |  },
   78 |
   79 |  /**
   80 |   * Print error

   at log (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/output.js:75:29)
   at Object.reset (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:95:5)
   at Object.start (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:51:10)
   at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/unit/recorder_test.js:5:29)

🔴 Workers: should run worker with custom config

expected +0 to equal 3

################[ Failure ]################
AssertionError (strictEqual): expected +0 to equal 3


+ expected - actual
+ 3
- 0

   107 |      passedCount += 1
   108 |    })
   109 |
   110 |    workers.on(event.all.result, result => {
   111 |      expect(result.hasFailed).equal(true)
 > 112 |      expect(passedCount).equal(3)
   113 |      expect(failedCount).equal(2)
   114 |      done()
   115 |    })
   116 |  })
   117 |

   at Workers.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/unit/worker_test.js:112:27)
   at Workers._finishRun (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/workers.js:475:10)
   at Worker.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/workers.js:462:14)

🔴 Workers: should able to add tests to each worker

Timeout of 40000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/runner/work/CodeceptJS/CodeceptJS/test/unit/worker_test.js)

################[ Failure ]################
Error: Timeout of 40000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/runner/work/CodeceptJS/CodeceptJS/test/unit/worker_test.js)

🔴 Workers: should able to add tests to using createGroupsOfTests

Cannot read properties of null (reading 'testFiles')

################[ Failure ]################
TypeError: Cannot read properties of null (reading 'testFiles')
   327 |
   328 |  /**
   329 |   * @param {Number} numberOfWorkers
   330 |   */
   331 |  createGroupsOfSuites(numberOfWorkers) {
 > 332 |    const files = this.codecept.testFiles
   333 |    const groups = populateGroups(numberOfWorkers)
   334 |
   335 |    const mocha = Container.mocha()
   336 |    mocha.files = files
   337 |    mocha.loadFiles()

   at Workers.createGroupsOfSuites (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/workers.js:332:33)
   at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/unit/worker_test.js:159:32)

🐢 Slowest Tests

  • Workers: should able to add tests to each worker (40.002 seconds)
  • Workers: should run worker with multiple config (1.839 seconds)
  • Workers: should run simple worker (0.636 seconds)
  • Workers: should create worker by function (0.611 seconds)
  • Workers: should run worker with custom config (0.58 seconds)

Copy link

Testomat.io Report 🔴 RUNNER-TESTS FAILED
Tests ✔️ 184 tests run
Summary 🔴 64 failed; 🟢 120 passed; 🟡 0 skipped
Duration 🕐 2 minutes, 18 seconds
Job 🗂️ Run Unit tests / runner-tests
Operating System 🖥️ Linux X64

🟥 Failures (20)

🔴 BDD Gherkin: should show all available steps

expected 'Gherkin Step Definitions:\n\n /I hav' to include 'step_definitions/my_steps.js:3:1'

################[ Failure ]################
AssertionError (strictEqual): expected 'Gherkin Step Definitions:\n\n  /I hav…' to include 'step_definitions/my_steps.js:3:1'
   252 |
   253 |  it('should show all available steps', done => {
   254 |    exec(`${runner} gherkin:steps --config ${codecept_dir}/codecept.bdd.js`, (err, stdout, stderr) => {
   255 |      stdout.should.include('Gherkin')
   256 |      stdout.should.include('/I have product with \\$(\\d+) price/')
 > 257 |      stdout.should.include('step_definitions/my_steps.js:3:1')
   258 |      stdout.should.include('step_definitions/my_steps.js:3:1')
   259 |      stdout.should.include('I should see that total number of products is {int}')
   260 |      stdout.should.include('I should see overall price is "{float}" $')
   261 |      assert(!err)
   262 |      done()

   at <anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/runner/bdd_test.js:257:21)

🔴 BDD Gherkin: should generate snippets for missing steps

expected '\nThe requested module '@cucumber/me' to include 'Given('I open a browser on a site','

################[ Failure ]################
AssertionError (strictEqual): expected '\nThe requested module \'@cucumber/me…' to include 'Given(\'I open a browser on a site\',…'
   263 |    })
   264 |  })
   265 |
   266 |  it('should generate snippets for missing steps', done => {
   267 |    exec(`${runner} gherkin:snippets --dry-run --config ${codecept_dir}/codecept.dummy.bdd.js`, (err, stdout, stderr) => {
 > 268 |      stdout.should.include(`Given('I open a browser on a site', () => {
   269 |  // From "support/dummy.feature" {"line":4,"column":5}
   270 |  throw new Error('Not implemented yet');
   271 |});
   272 |
   273 |When('I click login button at {float}', () => {

   at <anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/runner/bdd_test.js:268:21)

🔴 BDD Gherkin: should not generate duplicated steps

Cannot read properties of null (reading 'length')

################[ Failure ]################
TypeError: Cannot read properties of null (reading 'length')
   334 |    })
   335 |  })
   336 |
   337 |  it('should not generate duplicated steps', done => {
   338 |    exec(`${runner} gherkin:snippets --dry-run --config ${codecept_dir}/codecept.duplicate.bdd.js`, (err, stdout, stderr) => {
 > 339 |      assert.equal(stdout.match(/I open a browser on a site/g).length, 1)
   340 |      assert(!err)
   341 |      done()
   342 |    })
   343 |  })
   344 |

   at <anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/runner/bdd_test.js:339:63)

🔴 Definitions: "before all" hook for "def should create definition file"

Command failed: npm run defsh: 1: ./runok.js: not found

################[ Failure ]################
Error: Command failed: npm run def
sh: 1: ./runok.js: not found

   40 |describe('Definitions', function () {
   41 |  this.timeout(30000)
   42 |  this.retries(4)
   43 |
   44 |  before(() => {
 > 45 |    execSync('npm run def', { cwd: pathToRootOfProject })
   46 |  })
   47 |  afterEach(() => {
   48 |    try {
   49 |      fs.unlinkSync(`${codecept_dir}/steps.d.ts`)
   50 |      fs.unlinkSync(`${codecept_dir}/../../steps.d.ts`)

   at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/runner/definitions_test.js:45:5)

🔴 dry-run command: should display meta steps and substeps

expect(received).toEqual(expected) // deep equalityExpected: ArrayContaining [" check current dir", " I open dir "aaa"", " I am in path "."", " I see file "codecept.class.js"", " On MyPage: has file "First arg", "Second arg"", " I see file "codecept.class.js"", " I see file "codecept.po.js"", " I see file "codecept.po.js""]Received: [""]

################[ Failure ]################
Error: expect(received).toEqual(expected) // deep equality

Expected: ArrayContaining ["  check current dir", "    I open dir \"aaa\"", "      I am in path \".\"", "      I see file \"codecept.class.js\"", "    On MyPage: has file \"First arg\", \"Second arg\"", "      I see file \"codecept.class.js\"", "      I see file \"codecept.po.js\"", "    I see file \"codecept.po.js\""]
Received: [""]
   69 |  })
   70 |
   71 |  it('should display meta steps and substeps', done => {
   72 |    exec(`${codecept_run_config('configs/pageObjects/codecept.po.js')} --debug`, (err, stdout) => {
   73 |      const lines = stdout.split('\n')
 > 74 |      expect(lines).toEqual(
   75 |        expect.arrayContaining([
   76 |          '  check current dir',
   77 |          '    I open dir "aaa"',
   78 |          '      I am in path "."',
   79 |          '      I see file "codecept.class.js"',

   at <anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/runner/dry_run_test.js:74:21)

🔴 dry-run command: should work with inject() keyword

expect(received).toContain(expected) // indexOfExpected substring: "injected"Received string: ""

################[ Failure ]################
Error: expect(received).toContain(expected) // indexOf

Expected substring: "injected"
Received string:    ""
   155 |  })
   156 |
   157 |  it('should work with inject() keyword', done => {
   158 |    exec(`${codecept_run_config('configs/pageObjects/codecept.inject.po.js', 'check current dir')} --debug`, (err, stdout) => {
   159 |      const lines = stdout.split('\n')
 > 160 |      expect(stdout).toContain('injected')
   161 |      expect(lines).toEqual(
   162 |        expect.arrayContaining([
   163 |          '  check current dir',
   164 |          '    I open dir "aaa"',
   165 |          '      I am in path "."',

   at <anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/runner/dry_run_test.js:160:22)

🔴 dry-run command: should inject page objects via proxy

expect(received).toContain(expected) // indexOfExpected substring: "newdomain"Received string: "CodeceptJS v3.7.3 #StandWithUkraineUsing test root "/home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/../inject-fail-example"Helpers:Plugins:asdas --/home/runner/work/CodeceptJS/CodeceptJS/test/data/inject-fail-example/first_test.js qw Scenario() FAILED in 7ms-- FAILURES: 1) asdas qw: page.type is not a function TypeError: at Test. (file:///home/runner/work/CodeceptJS/CodeceptJS/test/data/inject-fail-example/first_test.js:4:14) at file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:82:12 File: /home/runner/work/CodeceptJS/CodeceptJS/test/data/inject-fail-example/first_test.js FAIL | 0 passed, 1 failed // 11msRun with --verbose flag to see complete NodeJS stacktrace--- DRY MODE: No tests were executed ---"

################[ Failure ]################
Error: expect(received).toContain(expected) // indexOf

Expected substring: "newdomain"
Received string:    "CodeceptJS v3.7.3 #StandWithUkraine
Using test root \"/home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/../inject-fail-example\"
Helpers:·
Plugins:··
asdas --
/home/runner/work/CodeceptJS/CodeceptJS/test/data/inject-fail-example/first_test.js
  qw
  Scenario()
  ✖ FAILED in 7ms··
-- FAILURES:·
  1) asdas
       qw:······
  page.type is not a function
  TypeError:·
      at Test.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/data/inject-fail-example/first_test.js:4:14)
      at file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:82:12······
  ◯ File: /home/runner/work/CodeceptJS/CodeceptJS/test/data/inject-fail-example/first_test.js·····
  FAIL  | 0 passed, 1 failed   // 11ms
Run with --verbose flag to see complete NodeJS stacktrace·
--- DRY MODE: No tests were executed ---
"
   1 |Feature('asdas');
   2 |
   3 |Scenario('qw', async ({ page }) => {
 > 4 |  await page.type('asda');
   5 |});
   6 |

   at Test.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/data/inject-fail-example/first_test.js:4:14)
   at <anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:82:12······)
   at <anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/runner/dry_run_test.js:181:22)

🔴 dry-run command: should enable all plugins in dry-mode when passing -p all

expect(received).toContain(expected) // indexOfExpected substring: "I see element {xpath: .//*[@data-testid='COURSE']//a}"Received string: "CodeceptJS v3.7.3 #StandWithUkraineUsing test root "/home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox"Helpers: PlaywrightPlugins: screenshotOnFail, customLocatorCustom Locator --/home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/test.customLocator.js "before all" hook: codeceptjs.beforeSuite for "no error with dry-mode" in 1ms "after all" hook: codeceptjs.afterSuite for "no error with dry-mode" in 0ms-- FAILURES: 1) Custom Locator "before all" hook: codeceptjs.beforeSuite for "no error with dry-mode": Cannot read properties of undefined (reading 'catch') TypeError: at Object.catch (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:251:31) at injectHook (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:15:17) at suiteSetup (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:215:10) at Context. (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/ui.js:102:55) at process.processImmediate (node:internal/timers:485:21) File: /home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/test.customLocator.js 2) Custom Locator "after all" hook: codeceptjs.afterSuite for "no error with dry-mode": Cannot read properties of undefined (reading 'catch') TypeError: at Object.catch (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:251:31) at injectHook (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:15:17) at suiteTeardown (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:224:10) at Context. (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/ui.js:103:58) at process.processImmediate (node:internal/timers:485:21) File: /home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/test.customLocator.js FAIL | 0 passed, 2 failed // 256msNo tests were executed. Failing on CI to avoid false positivesTo disable this check, set DONT_FAIL_ON_EMPTY_RUN environment variable to true in CI config--- DRY MODE: No tests were executed ---"

################[ Failure ]################
Error: expect(received).toContain(expected) // indexOf

Expected substring: "I see element {xpath: .//*[@data-testid='COURSE']//a}"
Received string:    "CodeceptJS v3.7.3 #StandWithUkraine
Using test root \"/home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox\"
Helpers: Playwright
Plugins: screenshotOnFail, customLocator·
Custom Locator --
/home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/test.customLocator.js·
  ✖ \"before all\" hook: codeceptjs.beforeSuite for \"no error with dry-mode\" in 1ms·
  ✖ \"after all\" hook: codeceptjs.afterSuite for \"no error with dry-mode\" in 0ms·
-- FAILURES:·
  1) Custom Locator
       \"before all\" hook: codeceptjs.beforeSuite for \"no error with dry-mode\":······
  Cannot read properties of undefined (reading 'catch')
  TypeError:·
      at Object.catch (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:251:31)
      at injectHook (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:15:17)
      at suiteSetup (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:215:10)
      at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/ui.js:102:55)
      at process.processImmediate (node:internal/timers:485:21)······
  ◯ File: /home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/test.customLocator.js····
  2) Custom Locator
       \"after all\" hook: codeceptjs.afterSuite for \"no error with dry-mode\":······
  Cannot read properties of undefined (reading 'catch')
  TypeError:·
      at Object.catch (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:251:31)
      at injectHook (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:15:17)
      at suiteTeardown (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:224:10)
      at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/ui.js:103:58)
      at process.processImmediate (node:internal/timers:485:21)······
  ◯ File: /home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/test.customLocator.js·····
  FAIL  | 0 passed, 2 failed   // 256ms·
No tests were executed. Failing on CI to avoid false positives
To disable this check, set `DONT_FAIL_ON_EMPTY_RUN` environment variable to true in CI config·
--- DRY MODE: No tests were executed ---
"
   246 |      ?.toString()
   247 |      ?.replace(/\s{2,}/g, ' ')
   248 |      .replace(/\n/g, ' ')
   249 |      ?.slice(0, 50)
   250 |    debug(chalk.gray(`${currentQueue()} Queued | catch with error handler ${fnDescription || ''}`))
 > 251 |    return (promise = promise.catch(err => {
   252 |      log(`${currentQueue()}Error | ${err} ${fnDescription}...`)
   253 |      if (!(err instanceof Error)) {
   254 |        // strange things may happen
   255 |        err = new Error(`[Wrapped Error] ${printObjectProperties(err)}`) // we should be prepared for them
   256 |      }

   at Object.catch (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:251:31)
   at injectHook (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:15:17)
   at suiteSetup (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:215:10)
   at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/ui.js:102:55)
   at Object.catch (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:251:31)
   at injectHook (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:15:17)
   at suiteTeardown (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:224:10)
   at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/ui.js:103:58)
   at <anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/runner/dry_run_test.js:192:22)

🔴 dry-run command: should enable a particular plugin in dry-mode when passing it to -p

expect(received).toContain(expected) // indexOfExpected substring: "I see element {xpath: .//*[@data-testid='COURSE']//a}"Received string: "CodeceptJS v3.7.3 #StandWithUkraineUsing test root "/home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox"Helpers: PlaywrightPlugins: customLocatorCustom Locator --/home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/test.customLocator.js "before all" hook: codeceptjs.beforeSuite for "no error with dry-mode" in 0ms "after all" hook: codeceptjs.afterSuite for "no error with dry-mode" in 0ms-- FAILURES: 1) Custom Locator "before all" hook: codeceptjs.beforeSuite for "no error with dry-mode": Cannot read properties of undefined (reading 'catch') TypeError: at Object.catch (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:251:31) at injectHook (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:15:17) at suiteSetup (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:215:10) at Context. (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/ui.js:102:55) at process.processImmediate (node:internal/timers:485:21) File: /home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/test.customLocator.js 2) Custom Locator "after all" hook: codeceptjs.afterSuite for "no error with dry-mode": Cannot read properties of undefined (reading 'catch') TypeError: at Object.catch (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:251:31) at injectHook (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:15:17) at suiteTeardown (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:224:10) at Context. (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/ui.js:103:58) at process.processImmediate (node:internal/timers:485:21) File: /home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/test.customLocator.js FAIL | 0 passed, 2 failed // 5msNo tests were executed. Failing on CI to avoid false positivesTo disable this check, set DONT_FAIL_ON_EMPTY_RUN environment variable to true in CI config--- DRY MODE: No tests were executed ---"

################[ Failure ]################
Error: expect(received).toContain(expected) // indexOf

Expected substring: "I see element {xpath: .//*[@data-testid='COURSE']//a}"
Received string:    "CodeceptJS v3.7.3 #StandWithUkraine
Using test root \"/home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox\"
Helpers: Playwright
Plugins: customLocator·
Custom Locator --
/home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/test.customLocator.js·
  ✖ \"before all\" hook: codeceptjs.beforeSuite for \"no error with dry-mode\" in 0ms·
  ✖ \"after all\" hook: codeceptjs.afterSuite for \"no error with dry-mode\" in 0ms·
-- FAILURES:·
  1) Custom Locator
       \"before all\" hook: codeceptjs.beforeSuite for \"no error with dry-mode\":······
  Cannot read properties of undefined (reading 'catch')
  TypeError:·
      at Object.catch (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:251:31)
      at injectHook (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:15:17)
      at suiteSetup (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:215:10)
      at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/ui.js:102:55)
      at process.processImmediate (node:internal/timers:485:21)······
  ◯ File: /home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/test.customLocator.js····
  2) Custom Locator
       \"after all\" hook: codeceptjs.afterSuite for \"no error with dry-mode\":······
  Cannot read properties of undefined (reading 'catch')
  TypeError:·
      at Object.catch (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:251:31)
      at injectHook (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:15:17)
      at suiteTeardown (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:224:10)
      at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/ui.js:103:58)
      at process.processImmediate (node:internal/timers:485:21)······
  ◯ File: /home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/test.customLocator.js·····
  FAIL  | 0 passed, 2 failed   // 5ms·
No tests were executed. Failing on CI to avoid false positives
To disable this check, set `DONT_FAIL_ON_EMPTY_RUN` environment variable to true in CI config·
--- DRY MODE: No tests were executed ---
"
   246 |      ?.toString()
   247 |      ?.replace(/\s{2,}/g, ' ')
   248 |      .replace(/\n/g, ' ')
   249 |      ?.slice(0, 50)
   250 |    debug(chalk.gray(`${currentQueue()} Queued | catch with error handler ${fnDescription || ''}`))
 > 251 |    return (promise = promise.catch(err => {
   252 |      log(`${currentQueue()}Error | ${err} ${fnDescription}...`)
   253 |      if (!(err instanceof Error)) {
   254 |        // strange things may happen
   255 |        err = new Error(`[Wrapped Error] ${printObjectProperties(err)}`) // we should be prepared for them
   256 |      }

   at Object.catch (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:251:31)
   at injectHook (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:15:17)
   at suiteSetup (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:215:10)
   at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/ui.js:102:55)
   at Object.catch (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:251:31)
   at injectHook (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:15:17)
   at suiteTeardown (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:224:10)
   at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/ui.js:103:58)
   at <anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/runner/dry_run_test.js:203:22)

🔴 gherkin bdd commands: prepare CodeceptJS to run feature files (codecept.conf.ts)

expected 'Error: Failed to load config file /ho' to include 'Initializing Gherkin (Cucumber BDD) f'

################[ Failure ]################
AssertionError (strictEqual): expected 'Error: Failed to load config file /ho…' to include 'Initializing Gherkin (Cucumber BDD) f…'
   57 |    ].forEach(({ codecept_dir_test, extension }) => {
   58 |      it(`prepare CodeceptJS to run feature files (codecept.conf.${extension})`, done => {
   59 |        exec(`${runner} gherkin:init ${codecept_dir_test}`, (err, stdout) => {
   60 |          let dir = path.join(codecept_dir_test, 'features')
   61 |
 > 62 |          stdout.should.include('Initializing Gherkin (Cucumber BDD) for CodeceptJS')
   63 |          stdout.should.include(`Created ${dir}, place your *.feature files in it`)
   64 |          stdout.should.include('Created sample feature file: features/basic.feature')
   65 |
   66 |          dir = path.join(codecept_dir_test, 'step_definitions')
   67 |          stdout.should.include(`Created ${dir}, place step definitions into it`)

   at <anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/runner/gherkin_test.js:62:25)

🔴 Init Command: "before each" hook for "should init Codecept with TypeScript REST JSONResponse English"

mkdirp is not defined

################[ Failure ]################
ReferenceError: mkdirp is not defined
   11 |
   12 |describe('Init Command', function () {
   13 |  this.timeout(20000)
   14 |
   15 |  beforeEach(() => {
 > 16 |    mkdirp.sync(codecept_dir)
   17 |    process.env._INIT_DRY_RUN_INSTALL = true
   18 |  })
   19 |
   20 |  afterEach(() => {
   21 |    try {

   at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/runner/init_test.js:16:5)

🔴 CodeceptJS Interface: should not propagate retries to non retried steps

expect(received).toContain(expected) // indexOfExpected substring: "Retries: 1"Received string: "nodeInfo: 22.17.0osInfo: Linux 6.8 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)cpuInfo: (4) x64 AMD EPYC 7763 64-Core ProcessorchromeInfo: 138.0.7204.100edgeInfo: "N/A"firefoxInfo: undefinedsafariInfo: N/AplaywrightBrowsers: "chromium: 138.0.7204.15, firefox: 139.0, webkit: 18.5"If you need more detailed info, just run this: npx codeceptjs infoCodeceptJS v3.7.3 #StandWithUkraineUsing test root "/home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox"Helpers: RetryPlugins: screenshotOnFailRetry --/home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/flaky_test.retry.js "before all" hook: codeceptjs.beforeSuite for "flaky step @test1" in 0ms "after all" hook: codeceptjs.afterSuite for "flaky step passed globally @test2" in 0ms-- FAILURES: 1) Retry "before all" hook: codeceptjs.beforeSuite for "flaky step @test1": Cannot read properties of undefined (reading 'catch') TypeError: at Object.catch (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:251:31) at injectHook (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:15:17) at suiteSetup (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:215:10) at Context. (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/ui.js:102:55) at process.processImmediate (node:internal/timers:485:21) File: /home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/flaky_test.retry.js 2) Retry "after all" hook: codeceptjs.afterSuite for "flaky step passed globally @test2": Cannot read properties of undefined (reading 'catch') TypeError: at Object.catch (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:251:31) at injectHook (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:15:17) at suiteTeardown (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:224:10) at Context. (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/ui.js:103:58) at process.processImmediate (node:internal/timers:485:21) File: /home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/flaky_test.retry.js FAIL | 0 passed, 2 failed // 3msNo tests found by pattern: /@test2/Maybe you wanted to run one of these tests? Retry: flaky step @test1 Retry: flaky step passed globally @test2To run the first test use the following command:npx codeceptjs run --debug --grep "Retry: flaky step @test1"No tests were executed. Failing on CI to avoid false positivesTo disable this check, set DONT_FAIL_ON_EMPTY_RUN environment variable to true in CI config"

################[ Failure ]################
Error: expect(received).toContain(expected) // indexOf

Expected substring: "Retries: 1"
Received string:    "***************************************
nodeInfo:  22.17.0
osInfo:  Linux 6.8 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
cpuInfo:  (4) x64 AMD EPYC 7763 64-Core Processor
chromeInfo:  138.0.7204.100
edgeInfo:  \"N/A\"
firefoxInfo:  undefined
safariInfo:  N/A
playwrightBrowsers:  \"chromium: 138.0.7204.15, firefox: 139.0, webkit: 18.5\"
If you need more detailed info, just run this: npx codeceptjs info
***************************************
CodeceptJS v3.7.3 #StandWithUkraine
Using test root \"/home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox\"
Helpers: Retry
Plugins: screenshotOnFail·
Retry --
/home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/flaky_test.retry.js·
  ✖ \"before all\" hook: codeceptjs.beforeSuite for \"flaky step @test1\" in 0ms·
  ✖ \"after all\" hook: codeceptjs.afterSuite for \"flaky step passed globally @test2\" in 0ms·
-- FAILURES:·
  1) Retry
       \"before all\" hook: codeceptjs.beforeSuite for \"flaky step @test1\":······
  Cannot read properties of undefined (reading 'catch')
  TypeError:·
      at Object.catch (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:251:31)
      at injectHook (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:15:17)
      at suiteSetup (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:215:10)
      at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/ui.js:102:55)
      at process.processImmediate (node:internal/timers:485:21)······
  ◯ File: /home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/flaky_test.retry.js····
  2) Retry
       \"after all\" hook: codeceptjs.afterSuite for \"flaky step passed globally @test2\":······
  Cannot read properties of undefined (reading 'catch')
  TypeError:·
      at Object.catch (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:251:31)
      at injectHook (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:15:17)
      at suiteTeardown (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:224:10)
      at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/ui.js:103:58)
      at process.processImmediate (node:internal/timers:485:21)······
  ◯ File: /home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/flaky_test.retry.js·····
  FAIL  | 0 passed, 2 failed   // 3ms·
No tests found by pattern: /@test2/·
Maybe you wanted to run one of these tests?
☐ Retry: flaky step @test1
☐ Retry: flaky step passed globally @test2·
To run the first test use the following command:
npx codeceptjs run --debug --grep \"Retry: flaky step @test1\"·
No tests were executed. Failing on CI to avoid false positives
To disable this check, set `DONT_FAIL_ON_EMPTY_RUN` environment variable to true in CI config
"
   246 |      ?.toString()
   247 |      ?.replace(/\s{2,}/g, ' ')
   248 |      .replace(/\n/g, ' ')
   249 |      ?.slice(0, 50)
   250 |    debug(chalk.gray(`${currentQueue()} Queued | catch with error handler ${fnDescription || ''}`))
 > 251 |    return (promise = promise.catch(err => {
   252 |      log(`${currentQueue()}Error | ${err} ${fnDescription}...`)
   253 |      if (!(err instanceof Error)) {
   254 |        // strange things may happen
   255 |        err = new Error(`[Wrapped Error] ${printObjectProperties(err)}`) // we should be prepared for them
   256 |      }

   at Object.catch (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:251:31)
   at injectHook (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:15:17)
   at suiteSetup (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:215:10)
   at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/ui.js:102:55)
   at Object.catch (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:251:31)
   at injectHook (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:15:17)
   at suiteTeardown (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/asyncWrapper.js:224:10)
   at Context.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/mocha/ui.js:103:58)
   at <anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/runner/interface_test.js:45:22)

🔴 CodeceptJS Interface: should not retry steps if retryFailedStep plugin disabled

expect(received).not.toContain(expected) // indexOfExpected substring: not "Retries: 5"Received string: "CodeceptJS v3.7.3 #StandWithUkraineUsing test root "/home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox"Retry --Warning: Timeout was set to 10000secs.Global timeout should be specified in seconds. no retries if disabled per test @test3 in 1231ms[T] Retries: 5-- FAILURES: 1) Retry no retries if disabled per test @test3: 5 == 1 + expected - actual -5 +1 AssertionError [ERR_ASSERTION]: at Test. (file:///home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/flaky_test.retryFailed.js:30:10) File: /home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/flaky_test.retryFailed.js FAIL | 0 passed, 1 failed // 1sRun with --verbose flag to see complete NodeJS stacktrace"

################[ Failure ]################
Error: expect(received).not.toContain(expected) // indexOf

Expected substring: not "Retries: 5"
Received string:        "CodeceptJS v3.7.3 #StandWithUkraine
Using test root \"/home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox\"

Retry --
Warning: Timeout was set to 10000secs.
Global timeout should be specified in seconds.

  ✖ no retries if disabled per test @test3 in 1231ms
[T] Retries: 5

-- FAILURES:

  1) Retry
       no retries if disabled per test @test3:

      
  5 == 1
      + expected - actual

      -5
      +1
      
  AssertionError [ERR_ASSERTION]: 
      at Test.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/flaky_test.retryFailed.js:30:10)
  
  
  ◯ File: /home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/flaky_test.retryFailed.js
  


  FAIL  | 0 passed, 1 failed   // 1s
Run with --verbose flag to see complete NodeJS stacktrace
"
   25 |Scenario('no retries if disabled per test @test3', async ({ I }) => {
   26 |  await I.failWhen(() => {
   27 |    tries++;
   28 |    return tries < 5;
   29 |  });
 > 30 |  assert.equal(tries, 1);
   31 |}).config(test => test.disableRetryFailedStep = true);
   32 |
   33 |After(() => {
   34 |  console.log(`[T] Retries: ${tries}`);
   35 |});

   at Test.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/flaky_test.retryFailed.js:30:10)
   at <anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/runner/interface_test.js:72:26)

🔴 CodeceptJS Interface: should display steps and artifacts & error log

expected 'creating output directory: /home/runn' to include 'Scenario Steps:'

################[ Failure ]################
AssertionError (strictEqual): expected 'creating output directory: /home/runn…' to include 'Scenario Steps:'
   190 |    })
   191 |  })
   192 |
   193 |  it('should display steps and artifacts & error log', done => {
   194 |    exec(`${config_run_config('./configs/testArtifacts')} --debug`, (err, stdout) => {
 > 195 |      stdout.should.include('Scenario Steps:')
   196 |      stdout.should.include('Artifacts')
   197 |      stdout.should.include('- screenshot: [ SCREEENSHOT FILE ]')
   198 |      done()
   199 |    })
   200 |  })

   at <anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/runner/interface_test.js:195:21)

🔴 list commands: list should print actions

expected 'List of test actions: -- \nPS: Action' to include 'FileSystem'

################[ Failure ]################
AssertionError (strictEqual): expected 'List of test actions: -- \nPS: Action…' to include 'FileSystem'
   11 |const codecept_dir = path.join(__dirname, '/../data/sandbox')
   12 |
   13 |describe('list commands', () => {
   14 |  it('list should print actions', done => {
   15 |    exec(`${runner} list ${codecept_dir}`, (err, stdout) => {
 > 16 |      stdout.should.include('FileSystem') // helper name
   17 |      stdout.should.include('FileSystem I.amInPath(openPath)') // action name
   18 |      stdout.should.include('FileSystem I.seeFile(name)')
   19 |      assert(!err)
   20 |      done()
   21 |    })

   at <anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/runner/list_test.js:16:21)

🔴 CodeceptJS PageObject: built methods are still available custom I steps_file is added

expect(received).toContain(expected) // indexOfExpected substring: "Built in say"Received string: "creating output directory: /home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/configs/pageObjects/outputCustom actor loading from path './steps_file.js' must be handled asynchronously during container creationError: at createActor (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:490:11) at Container.create (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:71:5) at async Codecept.init (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/codecept.js:77:5) at async default (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/command/run.js:29:5) at async Command. (file:///home/runner/work/CodeceptJS/CodeceptJS/bin/codecept.js:40:7)"

################[ Failure ]################
Error: expect(received).toContain(expected) // indexOf

Expected substring: "Built in say"
Received string:    "creating output directory: /home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/configs/pageObjects/output·
Custom actor loading from path './steps_file.js' must be handled asynchronously during container creation·
Error:·
    at createActor (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:490:11)
    at Container.create (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:71:5)
    at async Codecept.init (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/codecept.js:77:5)
    at async default (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/command/run.js:29:5)
    at async Command.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/bin/codecept.js:40:7)
"
   485 |function createActor(actorPath) {
   486 |  if (container.support.I) return container.support.I
   487 |
   488 |  if (actorPath) {
   489 |    // Actor path loading must be handled async during container creation
 > 490 |    throw new Error(`Custom actor loading from path '${actorPath}' must be handled asynchronously during container creation`)
   491 |  } else {
   492 |    container.support.I = actorFactory({}, Container)
   493 |  }
   494 |
   495 |  return container.support.I

   at createActor (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:490:11)
   at Container.create (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:71:5)
   at async Codecept.init (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/codecept.js:77:5)
   at async default (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/command/run.js:29:5)
   at async Command.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/bin/codecept.js:40:7)
   at <anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/runner/pageobject_test.js:177:22)

🔴 CodeceptJS PageObject: should fail if page objects was failed

expect(received).toEqual(expected) // deep equalityExpected: ArrayContaining [StringContaining "File notexistfile.js not found in", StringContaining "-- FAILURES", StringContaining " I.seeFile("notexistfile.js")", StringContaining " I.seeFile("codecept.class.js")", StringContaining " I.amInPath(".")"]Received: ["", "Custom actor loading from path './pages/custom_steps.js' must be handled asynchronously during container creation", "", "Error: ", " at createActor (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:490:11)", " at Container.create (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:71:5)", " at async Codecept.init (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/codecept.js:77:5)", " at async default (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/command/run.js:29:5)", " at async Command. (file:///home/runner/work/CodeceptJS/CodeceptJS/bin/codecept.js:40:7)", ""]

################[ Failure ]################
Error: expect(received).toEqual(expected) // deep equality

Expected: ArrayContaining [StringContaining "File notexistfile.js not found in", StringContaining "-- FAILURES", StringContaining "✖ I.seeFile(\"notexistfile.js\")", StringContaining "✔ I.seeFile(\"codecept.class.js\")", StringContaining "✔ I.amInPath(\".\")"]
Received: ["", "Custom actor loading from path './pages/custom_steps.js' must be handled asynchronously during container creation", "", "Error: ", "    at createActor (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:490:11)", "    at Container.create (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:71:5)", "    at async Codecept.init (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/codecept.js:77:5)", "    at async default (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/command/run.js:29:5)", "    at async Command.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/bin/codecept.js:40:7)", ""]
   22 |  describe('Failed PageObject', () => {
   23 |    it('should fail if page objects was failed', done => {
   24 |      exec(`${config_run_config('codecept.fail_po.js')} --debug`, (err, stdout) => {
   25 |        const lines = stdout.split('\n')
   26 |        debug(stdout)
 > 27 |        expect(lines).toEqual(
   28 |          expect.arrayContaining([
   29 |            expect.stringContaining('File notexistfile.js not found in'),
   30 |            expect.stringContaining('-- FAILURES'),
   31 |            expect.stringContaining(figures.cross + ' I.seeFile("notexistfile.js")'),
   32 |            expect.stringContaining(figures.tick + ' I.seeFile("codecept.class.js")'),

   at <anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/runner/pageobject_test.js:27:23)

🔴 CodeceptJS PageObject: should inject page objects by class

expect(received).toContain(expected) // indexOfExpected substring: "On classpage: type "Class Page Type""Received string: "Custom actor loading from path './steps_file.js' must be handled asynchronously during container creationError: at createActor (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:490:11) at Container.create (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:71:5) at async Codecept.init (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/codecept.js:77:5) at async default (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/command/run.js:29:5) at async Command. (file:///home/runner/work/CodeceptJS/CodeceptJS/bin/codecept.js:40:7)"

################[ Failure ]################
Error: expect(received).toContain(expected) // indexOf

Expected substring: "On classpage: type \"Class Page Type\""
Received string:    "
Custom actor loading from path './steps_file.js' must be handled asynchronously during container creation·
Error:·
    at createActor (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:490:11)
    at Container.create (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:71:5)
    at async Codecept.init (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/codecept.js:77:5)
    at async default (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/command/run.js:29:5)
    at async Command.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/bin/codecept.js:40:7)
"
   485 |function createActor(actorPath) {
   486 |  if (container.support.I) return container.support.I
   487 |
   488 |  if (actorPath) {
   489 |    // Actor path loading must be handled async during container creation
 > 490 |    throw new Error(`Custom actor loading from path '${actorPath}' must be handled asynchronously during container creation`)
   491 |  } else {
   492 |    container.support.I = actorFactory({}, Container)
   493 |  }
   494 |
   495 |  return container.support.I

   at createActor (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:490:11)
   at Container.create (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:71:5)
   at async Codecept.init (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/codecept.js:77:5)
   at async default (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/command/run.js:29:5)
   at async Command.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/bin/codecept.js:40:7)
   at <anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/runner/pageobject_test.js:47:24)

🔴 CodeceptJS PageObject: should inject page objects by class which nested base clas

expect(received).toContain(expected) // indexOfExpected substring: "On classnestedpage: type "Nested Class Page Type""Received string: "Custom actor loading from path './steps_file.js' must be handled asynchronously during container creationError: at createActor (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:490:11) at Container.create (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:71:5) at async Codecept.init (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/codecept.js:77:5) at async default (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/command/run.js:29:5) at async Command. (file:///home/runner/work/CodeceptJS/CodeceptJS/bin/codecept.js:40:7)"

################[ Failure ]################
Error: expect(received).toContain(expected) // indexOf

Expected substring: "On classnestedpage: type \"Nested Class Page Type\""
Received string:    "
Custom actor loading from path './steps_file.js' must be handled asynchronously during container creation·
Error:·
    at createActor (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:490:11)
    at Container.create (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:71:5)
    at async Codecept.init (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/codecept.js:77:5)
    at async default (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/command/run.js:29:5)
    at async Command.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/bin/codecept.js:40:7)
"
   485 |function createActor(actorPath) {
   486 |  if (container.support.I) return container.support.I
   487 |
   488 |  if (actorPath) {
   489 |    // Actor path loading must be handled async during container creation
 > 490 |    throw new Error(`Custom actor loading from path '${actorPath}' must be handled asynchronously during container creation`)
   491 |  } else {
   492 |    container.support.I = actorFactory({}, Container)
   493 |  }
   494 |
   495 |  return container.support.I

   at createActor (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:490:11)
   at Container.create (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/container.js:71:5)
   at async Codecept.init (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/codecept.js:77:5)
   at async default (file:///home/runner/work/CodeceptJS/CodeceptJS/lib/command/run.js:29:5)
   at async Command.<anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/bin/codecept.js:40:7)
   at <anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/runner/pageobject_test.js:61:24)

🔴 CodeceptJS PageObject: should print pretty step log and pretty event log

expect(received).toContain(expected) // indexOfExpected substring: "I get humanize args Logs Page Value"Received string: "CodeceptJS v3.7.3 #StandWithUkraineUsing test root "/home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/configs/pageObjects"Filesystem --/home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/configs/pageObjects/fs_test.logs.js Print correct arg messageWarning: Timeout was set to 10000secs.Global timeout should be specified in seconds. Scenario()Start event step: I get humanize args {} I get humanize args {}undefined OK in 8ms OK | 1 passed // 13ms"

################[ Failure ]################
Error: expect(received).toContain(expected) // indexOf

Expected substring: "I get humanize args Logs Page Value"
Received string:    "CodeceptJS v3.7.3 #StandWithUkraine
Using test root \"/home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/configs/pageObjects\"·
Filesystem --
/home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/configs/pageObjects/fs_test.logs.js
  Print correct arg message
Warning: Timeout was set to 10000secs.
Global timeout should be specified in seconds.
  Scenario()
Start event step: I get humanize args {}
    I get humanize args {}
undefined
  ✔ OK in 8ms··
  OK  | 1 passed   // 13ms
"
   70 |      })
   71 |    })
   72 |
   73 |    it('should print pretty step log and pretty event log', done => {
   74 |      exec(`${config_run_config('codecept.logs.js', 'Print correct arg message')} --steps`, (err, stdout) => {
 > 75 |        expect(stdout).toContain('I get humanize args Logs Page Value')
   76 |        expect(stdout).toContain('Start event step: I get humanize args Logs Page Valu')
   77 |        expect(stdout).toContain('OK  | 1 passed')
   78 |        expect(err).toBeFalsy()
   79 |        done()
   80 |      })

   at <anonymous> (file:///home/runner/work/CodeceptJS/CodeceptJS/test/runner/pageobject_test.js:75:24)

🐢 Slowest Tests

  • CodeceptJS Timeouts: should take --no-timeouts option (6.469 seconds)
  • CodeceptJS Timeouts: should stop test when timeout exceeded (5.465 seconds)
  • CodeceptJS Timeouts: should respect grep when overriding config from global config (3.452 seconds)
  • CodeceptJS Multiple Runner: should execute all suites (3.371 seconds)
  • Failure in before: should trigger skipped events (3.164 seconds)

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.