Skip to content

Create the output directory before opening playwright-log.txt - #5314

Merged
aaltat merged 1 commit into
MarketSquare:mainfrom
d-biehl:fix/create-output-dir-for-playwright-log
Oct 9, 2026
Merged

aaltat merged 1 commit into
MarketSquare:mainfrom
d-biehl:fix/create-output-dir-for-playwright-log

Conversation

@d-biehl

@d-biehl d-biehl commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #5313

Playwright._get_logfile() now creates the parent directory of playwright-log.txt before 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.

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.
Copilot AI balanced review requested due to automatic review settings October 9, 2026 18:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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.

@aaltat
aaltat merged commit 9e5997a into MarketSquare:main Oct 9, 2026
58 of 60 checks passed
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.

New Browser fails with FileNotFoundError for playwright-log.txt when all output files are disabled

3 participants