Skip to content

feat: add PW_SCRIPT_DIR support to persist test scripts#35

Open
alexanderbailey wants to merge 1 commit intolackeyjb:mainfrom
alexanderbailey:feature/persist-test-scripts
Open

feat: add PW_SCRIPT_DIR support to persist test scripts#35
alexanderbailey wants to merge 1 commit intolackeyjb:mainfrom
alexanderbailey:feature/persist-test-scripts

Conversation

@alexanderbailey
Copy link

Summary

  • Adds PW_SCRIPT_DIR environment variable support to run.js — when set, executed scripts are automatically copied to that directory
  • Directory is created automatically if it doesn't exist; duplicate filenames get a timestamp suffix to avoid overwrites
  • Updates SKILL.md with a new "Persisting Test Scripts" section, workflow examples, and a tip reminding Claude to suggest the option when users ask to save/reuse tests

Test plan

  • Run a script without PW_SCRIPT_DIR set — confirm existing behaviour unchanged
  • Run a script with PW_SCRIPT_DIR=./playwright-tests — confirm script is copied and 💾 Script saved to: is printed
  • Run the same script again — confirm timestamp suffix is added to avoid overwrite
  • Run with inline code or stdin — confirm no save attempt is made
  • Set PW_SCRIPT_DIR to a non-existent path — confirm directory is created automatically

Closes #15

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.

Persist Playwright Test Scripts

1 participant