e2e: Add GitHub Actions caching for dotcms-ui-e2e Playwright test suite
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Description
The E2E test suite introduced in PR #33266 (feat(dotcms-ui-e2e): Make run E2E inside Nx) currently downloads Playwright browser binaries and node_modules on every CI run. Adding GitHub Actions caching for these artifacts will reduce E2E job startup time and lower overall PR pipeline duration.
The main caching targets are:
~/.cache/ms-playwright— Playwright browser binaries (~200–400MB download per run without cache)core-web/node_modules— yarn dependencies, if not already covered by existing Nx build workflow caching steps
Acceptance Criteria
- Playwright browser binaries are cached using
actions/cachekeyed on OS +core-web/package.jsonhash - Cache invalidates correctly when the Playwright version changes (i.e.
package.jsonupdate) - node_modules cache is added if not already covered by existing Nx build caching steps
- Cache hit/miss is visible in CI run logs
- E2E pipeline startup time is measurably reduced on a cache hit run
Implementation Pattern
The expected caching pattern for the E2E job step in the relevant workflow file:
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('core-web/package.json') }}
restore-keys: |
playwright-${{ runner.os }}-
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit \!= 'true'
run: npx playwright install --with-deps chromium
working-directory: core-web
The cache-hit conditional on the install step ensures browser binaries are only downloaded when the cache is cold or invalidated. The cache key uses package.json rather than yarn.lock because Playwright's binary version is declared in package.json directly — a lockfile change that doesn't update the Playwright version should still get a cache hit.
For node_modules, check whether the existing Nx build job steps already cache core-web/node_modules. If they do, reuse the same cache key in the E2E job rather than adding a duplicate step:
- name: Cache node_modules
uses: actions/cache@v4
with:
path: core-web/node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('core-web/yarn.lock') }}
restore-keys: |
node-modules-${{ runner.os }}-
Priority
Medium
Additional Context
This is Phase 1.1 of the agreed E2E testing rollout plan:
- Phase 1: Run E2E on every PR (current — PR #33266)
- Phase 1.1: Add GHA caching (this issue)
- Phase 2: Move to nightly when suite size warrants it
- Phase 3: On-demand trigger via PR label or manual workflow dispatch
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the workflow containing the dotcms-ui-e2e job and compare its setup with the existing Nx build workflow, especially caching for core-web/node_modules. Add the Playwright cache and reuse any applicable dependency cache, then verify cache hit and miss behavior, browser installation, and reduced startup time in CI logs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, node.js, playwright
- Domain
- ci-cd, testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100