Repository navigation
Create the output directory before opening playwright-log.txt - #5314
Merged
aaltat merged 1 commit intoOct 9, 2026
Merged
Conversation
Robot Framework creates the output directory only when it resolves the path of an output file. With all output files disabled, the directory doesn't exist and starting the Playwright process failed with FileNotFoundError.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The implementation directly resolves the reported failure and includes appropriate regression coverage.
0 open findings
What changed in this PR
Creates the Playwright log’s parent directory when the process starts, fixing startup when Robot Framework output files are disabled.
Changes:
- Creates missing parent directories before opening
playwright-log.txt. - Adds a focused pytest regression test.
| File | Description |
|---|---|
Browser/playwright.py |
Ensures the log directory exists before opening the log. |
utest/test_output_dir.py |
Tests log creation with a missing output directory. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5313
Playwright._get_logfile()now creates the parent directory ofplaywright-log.txtbefore opening it, so Browser also works when Robot Framework runs with all output files disabled and${OUTPUT_DIR}doesn't exist. The directory is created when the Playwright process starts, not when the library is imported.All other outputs already create their directories: Browser itself for screenshots and storage state, Playwright for videos, traces, HAR files and PDFs, and the coverage reporter for coverage reports. I checked each of them with a missing output directory and the Playwright log disabled. The Playwright log was the only file written into
${OUTPUT_DIR}without creating the directory first.Adds a unit test in
utest/test_output_dir.py.AI / tooling disclosure
This contribution was prepared with assistance from Claude Code (Anthropic). I reviewed the result manually, understand the changes, verified them locally, and confirm that I have the right to submit this contribution under the project license.