Skip to content

Fix/test playwright#223

Open
mishautkin wants to merge 21 commits intomainfrom
fix/test-playwright
Open

Fix/test playwright#223
mishautkin wants to merge 21 commits intomainfrom
fix/test-playwright

Conversation

@mishautkin
Copy link

@mishautkin mishautkin commented Feb 17, 2026

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

Feature.

What is the current behavior? (You can also link to an open issue here)

  • All npm and Playwright operations run from the repository root, forcing cd workarounds for projects in subdirectories.
  • PRE_SCRIPT has no access to GitHub CLI authentication, preventing artifact downloads from previous jobs.
  • Test execution only supports a single SCRIPT_NAME npm script, with no way to run Playwright directly with grep or project filters.

What is the new behavior (if this is a feature change)?

  • Adds optional WORK_DIR input (defaults to .) — applies to npm install, Playwright install, PRE_SCRIPT, and test execution. In case of several qa projects (e.g. support of legacy UI on PCP) it would allow to use another palywright project.
  • Exposes GH_TOKEN in PRE_SCRIPT step for GitHub CLI usage (e.g. gh run download).
  • Adds PLAYWRIGHT_GREP, PLAYWRIGHT_GREP_INVERT, PLAYWRIGHT_PROJECT inputs — passes --project, --grep, --grep-invert flags to Playwright when using grep mode.
  • SCRIPT_NAME is now optional, used only when PLAYWRIGHT_GREP is not set.
  • Move .env.ci creation to a separate step because PRE_SCRIPT might require access to env vars (e.g. for VIP authentication).

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

No.

default: ''
required: false
type: string
WORK_DIR:
Copy link
Contributor

Choose a reason for hiding this comment

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

question

During the last meeting, we agreed to move all the npm dependencies to the root package.json to avoid this kind of complication, since there is no evidence that your dependencies will cause version clashes. Can you please explain why you are introducing this input? 😄

Copy link
Author

Choose a reason for hiding this comment

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

I've explained this in the first point of "What is the new behavior" section. But maybe I can find a workaround, e.g. by switching the tests: dir in playwright.config 🤔

Copy link
Member

Choose a reason for hiding this comment

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

I think this is going to be hard to pull off without also assuming control of the playwright.config.js. From my (limited) experience, Playwright is pretty stoic about the way it is configured and bootstraps itself from the config file with extremely limited entrypoints for external configuration/overrides.

We could use npm workspaces to isolate Playwright while also satisfying the centralized node_modules/ requirement, but I am not sure if that really reduces the complexity of the setup. It would allow us to install playwright in the root while executing it in WORK_DIR.

But this still requires the project to be structured to suit the workflow (instead of configuring the workflow to suit the project within a reasonable framework)
It might be a middleground here though.

Another idea:
Playwright supports pointing to a config file with --config - is it then also resolving and picking up tests relative to the config file? Then we would only need a PLAYWRIGHT_CONFIG input

Copy link
Author

@mishautkin mishautkin Feb 25, 2026

Choose a reason for hiding this comment

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

Hi, I remember about this unresolved comment. Moving playwright and all it's dependencies from tests/qa/ to root takes some time. I need to go through some PRs on Mollie before I can tackle this.

In case of several PW projects (like on PayPal with legacy UI), my plan is to manage testDir in playwright.config using path stored in env var PLAYWRIGHT_TEST_DIR='tests/qa/tests'.

@mishautkin mishautkin marked this pull request as ready for review February 25, 2026 10:44
@mishautkin mishautkin requested a review from a team as a code owner February 25, 2026 10:44
mishautkin and others added 9 commits February 25, 2026 12:04
Update how `.env.ci` is created

Replace `echo "${{ secrets.ENV_FILE_DATA }}"` with `printenv` to
avoid bash interpreting special characters ($, `, !) in secret values.

The double-quoted echo caused `$` characters in passwords and tokens
to be treated as variable references, silently truncating values in
the resulting .env.ci file.

Signed-off-by: Misha Utkin <80261935+mishautkin@users.noreply.github.com>
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.

4 participants