You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
I.waitForFile (FileSystem helper) fails if directory does not exist (yet) #5420
If the directory ${codecept_dir}/output/downloads does not exist yet (it will be created by the browser download at some point in time), the function I.waitForFile will throw an exception ReferenceError: Cannot access 'watcher' before initialization and the test will fail.
Root cause is in the function isFileExists of the FileSystem helper. The line const watcher = fs.watch(dir, (eventType, filename) => {... will throw if dir does not exist yet. This exception remains unhandled. Later, the timer for the 5sec timeout detection will try to close the uninitialized watcher, leading to the ReferenceError.
changed the title [-]`I.waitForFile` (FileSystem helper) fails if directoty does not exist (yet)[/-][+]`I.waitForFile` (FileSystem helper) fails if directory does not exist (yet)[/+]on Jan 27, 2026
Activity
[-]`I.waitForFile` (FileSystem helper) fails if directoty does not exist (yet)[/-][+]`I.waitForFile` (FileSystem helper) fails if directory does not exist (yet)[/+]Fixed: FileSystem.waitForFile: do not crash if directory does not exi…
github-actions commentedon Apr 28, 2026
This issue is stale because it has been open for 90 days with no activity.