Conversation
PRE_SCRIPT might require access to env vars (e.g. for VIP authentication).
| default: '' | ||
| required: false | ||
| type: string | ||
| WORK_DIR: |
There was a problem hiding this comment.
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? 😄
There was a problem hiding this comment.
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 🤔
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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'.
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>
…able-workflows into fix/test-playwright
Please check if the PR fulfills these requirements
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)
npmand Playwright operations run from the repository root, forcingcdworkarounds for projects in subdirectories.PRE_SCRIPThas no access to GitHub CLI authentication, preventing artifact downloads from previous jobs.SCRIPT_NAMEnpm script, with no way to run Playwright directly with grep or project filters.What is the new behavior (if this is a feature change)?
WORK_DIRinput (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.GH_TOKENinPRE_SCRIPTstep for GitHub CLI usage (e.g. gh run download).PLAYWRIGHT_GREP,PLAYWRIGHT_GREP_INVERT,PLAYWRIGHT_PROJECTinputs — passes--project,--grep,--grep-invertflags to Playwright when using grep mode.SCRIPT_NAMEis now optional, used only whenPLAYWRIGHT_GREPis not set..env.cicreation to a separate step becausePRE_SCRIPTmight 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.