Skip to content

Fixed: FileSystem.waitForFile: do not crash if directory does not exist yet#5421

Open
danielrentz wants to merge 125 commits into
codeceptjs:4.xfrom
danielrentz:issue5420
Open

Fixed: FileSystem.waitForFile: do not crash if directory does not exist yet#5421
danielrentz wants to merge 125 commits into
codeceptjs:4.xfrom
danielrentz:issue5420

Conversation

@danielrentz
Copy link
Copy Markdown
Contributor

Motivation/Description of the PR

Reworked the complex implementation of FileSystem.waitForFile, now it contains a simple polling loop that uses the existing fileExists helper function like FileSystem.seeFile does.

Applicable helpers:

  • Playwright
  • Puppeteer
  • WebDriver
  • REST
  • FileHelper
  • Appium
  • TestCafe

Applicable plugins:

  • allure
  • autoDelay
  • autoLogin
  • customLocator
  • pauseOnFail
  • coverage
  • retryFailedStep
  • screenshotOnFail
  • selenoid
  • stepByStepReport
  • stepTimeout
  • wdio
  • subtitles

Type of change

  • 🔥 Breaking changes
  • 🚀 New functionality
  • 🐛 Bug fix
  • 🧹 Chore
  • 📋 Documentation changes/updates
  • ♨️ Hot fix
  • 🔨 Markdown files fix - not related to source code
  • 💅 Polish code

Checklist:

  • Tests have been added
  • Documentation has been added (Run npm run docs)
  • Lint checking (Run npm run lint)
  • Local tests are passed (Run npm test)

dependabot Bot and others added 30 commits July 16, 2025 09:36
Bumps [playwright](https://github.com/microsoft/playwright) from 1.53.0 to 1.54.1.
- [Release notes](https://github.com/microsoft/playwright/releases)
- [Commits](microsoft/playwright@v1.53.0...v1.54.1)

---
updated-dependencies:
- dependency-name: playwright
  dependency-version: 1.54.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
updated-dependencies:
- dependency-name: "@eslint/js"
  dependency-version: 9.31.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [expect](https://github.com/jestjs/jest/tree/HEAD/packages/expect) from 29.7.0 to 30.0.4.
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v30.0.4/packages/expect)

---
updated-dependencies:
- dependency-name: expect
  dependency-version: 30.0.4
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [graphql](https://github.com/graphql/graphql-js) from 16.10.0 to 16.11.0.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](graphql/graphql-js@v16.10.0...v16.11.0)

---
updated-dependencies:
- dependency-name: graphql
  dependency-version: 16.11.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [electron](https://github.com/electron/electron) from 37.1.0 to 37.2.3.
- [Release notes](https://github.com/electron/electron/releases)
- [Changelog](https://github.com/electron/electron/blob/main/docs/breaking-changes.md)
- [Commits](electron/electron@v37.1.0...v37.2.3)

---
updated-dependencies:
- dependency-name: electron
  dependency-version: 37.2.3
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [axios](https://github.com/axios/axios) from 1.8.4 to 1.11.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v1.8.4...v1.11.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…deceptjs#5046)

Bumps [typedoc-plugin-markdown](https://github.com/typedoc2md/typedoc-plugin-markdown/tree/HEAD/packages/typedoc-plugin-markdown) from 4.7.0 to 4.7.1.
- [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/typedoc-plugin-markdown@4.7.1/packages/typedoc-plugin-markdown)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…s#5041)

Bumps [browser-actions/setup-chrome](https://github.com/browser-actions/setup-chrome) from 1 to 2.
- [Release notes](https://github.com/browser-actions/setup-chrome/releases)
- [Changelog](https://github.com/browser-actions/setup-chrome/blob/master/CHANGELOG.md)
- [Commits](browser-actions/setup-chrome@v1...v2)

---
updated-dependencies:
- dependency-name: browser-actions/setup-chrome
  dependency-version: '2'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.28.7 to 0.28.10.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](TypeStrong/typedoc@v0.28.7...v0.28.10)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-version: 0.28.10
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix: hook exit code

* Update asyncWrapper.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update asyncWrapper.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update asyncWrapper.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update asyncWrapper.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update asyncWrapper.js

* Update asyncWrapper.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [tsd](https://github.com/tsdjs/tsd) from 0.32.0 to 0.33.0.
- [Release notes](https://github.com/tsdjs/tsd/releases)
- [Commits](tsdjs/tsd@v0.32.0...v0.33.0)

---
updated-dependencies:
- dependency-name: tsd
  dependency-version: 0.33.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…deceptjs#5067)

Bumps [typedoc-plugin-markdown](https://github.com/typedoc2md/typedoc-plugin-markdown/tree/HEAD/packages/typedoc-plugin-markdown) from 4.7.1 to 4.8.1.
- [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/typedoc-plugin-markdown@4.8.1/packages/typedoc-plugin-markdown)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…Timeout` value at the end of test suite (codeceptjs#5077)

* Initial plan

* Changes before error encountered

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
* Initial plan

* Changes before error encountered

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
codeceptjs#5082)

* Initial plan

* Fix JUnit XML test case name inconsistency in scenario retries

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

* Improve edge case handling for empty suite titles in cloned tests

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
* fix: TestCafe_test.js

* Fix TestCafe form submission timeout with efficient polling mechanism (codeceptjs#5080)

* Initial plan

* Fix failed TestCafe tests by skipping doubleClick test

* Update testcafe.yml

* Update testcafe.yml

* Update TestCafe_test.js

* Update TestCafe_test.js

* Changes before error encountered

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

* Fix TestCafe form submission timeout in CI environments

* Improve TestCafe form submission timeout handling with polling mechanism

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

* Improve TestCafe form submission timeout with efficient polling mechanism

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

* Changes before error encountered

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

* Changes before error encountered

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

* Changes before error encountered

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

* Update testcafe.yml

* fix: Chrome popup causes problems with TestCafe

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
Co-authored-by: kobenguyent <kobenguyent@gmail.com>

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
* Initial plan

* Changes before error encountered

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

* Add TypeScript types for Feature.only method

* Changes before error encountered

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

* Fix TypeScript test expectations for hook return types

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
* Initial plan

* Changes before error encountered

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

* Changes before error encountered

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
kobenguyent and others added 26 commits October 2, 2025 05:19
* enhance workers cli log

* fix: make worker enhancements backward compatible with all test suites

- Made feature name display conditional (only in workers mode)
- Preserved run-multiple process format [X.suite:browser]
- Updated test expectations to match new enhanced format
- All test suites now passing (221 runner + 477 unit tests)

Changes:
- lib/output.js: Conditional feature names + run-multiple detection
- test/unit/output_test.js: Updated worker badge test expectation
- test/runner/run_workers_test.js: Updated 3 test expectations

Fixes codeceptjs#5234
* fixed: typings for class Result

* fix docs for getters
* mock server

* mock server

* lint fix

* fix: acceptance tests cannot access mock server

* fix: acceptance tests cannot access mock server

* fix: flaky timeout test
* address HTML reporter issues

* address HTML reporter issues

* fix UTs and lint issue
* Fix: preserve global timeout with BeforeSuite hook

* test: clarify feature name for global timeout with BeforeSuite

* chore: remove unused plugins field from beforeSuiteTimeout config
…odeceptjs#5211)

* Update reports.md: use "reporter" option instead of CLI

* typo

* add config-only variant as an alternative
…odeceptjs#5301)

* Use own implementation of shuffle to remve lodash.shuffle dependency

* Cleanup code

* After review
* Update some outdated deprendencies

* Stay om 1.55.1 of playwright
* Initial plan

* Fix HTML reporter to handle nested arrays in system info

- Updated escapeHtml() to handle non-string inputs including arrays and nested arrays
- Arrays are flattened and joined with commas before HTML escaping
- Added documentation to generateSystemInfoHtml() for clarity
- Added comprehensive unit tests for escapeHtml functionality
- Verified fix handles the exact issue case: edgeInfo with nested array

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

* Improve escapeHtml with recursive array flattening and DRY tests

- Refactored escapeHtml to use recursive flattening for deeply nested arrays
- Removed duplicate helper functions from test file (DRY principle)
- All 15 unit tests pass successfully
- Verified deep nesting support (e.g., [['Level2', ['Level3']]])

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

* Add depth limit to recursive flattening for safety

- Added maxDepth parameter (default: 100) to prevent stack overflow
- Returns string representation if depth limit reached
- Maintains full functionality for normal use cases

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
* Ensure test files are executed in alphabetical order

* add unit test
Comment thread lib/helper/FileSystem.js Outdated
@kobenguyent kobenguyent changed the base branch from 3.x to 4.x June 5, 2026 05:44
@kobenguyent kobenguyent added the bug label Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

I.waitForFile (FileSystem helper) fails if directory does not exist (yet)