Skip to content

ci(e2e): add Playwright-based E2E workflow for Mage-OS#313

Open
digitalrisedorset wants to merge 4 commits intomage-os:mainfrom
digitalrisedorset:ci/tests-e2e-playwright-elgentos-hyva
Open

ci(e2e): add Playwright-based E2E workflow for Mage-OS#313
digitalrisedorset wants to merge 4 commits intomage-os:mainfrom
digitalrisedorset:ci/tests-e2e-playwright-elgentos-hyva

Conversation

@digitalrisedorset
Copy link
Copy Markdown

Introduce a reusable E2E GitHub Actions workflow designed for browser-based testing (Playwright) against Mage-OS.

The workflow reuses existing Magento CI setup and delegates execution to a configurable test command, supporting a two-phase E2E model (setup + execution).

It adds:

  • a reusable e2e.yaml workflow that provisions Magento and executes E2E tests via a configurable command
  • an internal _internal-e2e.yaml workflow that validates the E2E pipeline using Playwright
  • documentation clarifying what “E2E” means in this context and how it is executed

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • [ x ] CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Fixes: N/A

What is the new behavior?

Mage-OS now provides a reusable GitHub Actions workflow to run browser-based End-to-End (E2E) tests using Playwright against a real Magento storefront.

The new behavior allows:

  • provisioning Magento using the existing CI bootstrap
  • executing E2E tests via a configurable command (test_command)
  • supporting a two-phase E2E model (setup + execution) within a single job
  • validating the workflow itself through an internal canary workflow

This introduces a new E2E capability focused on real user journeys, without altering or replacing existing PHPUnit-based (legacy) E2E workflows.

Does this PR introduce a breaking change?

  • Yes
  • [x ] No

Other information

Introduce a reusable E2E GitHub Actions workflow designed for
browser-based testing (Playwright) against Mage-OS.

The workflow reuses existing Magento CI setup and delegates
execution to a configurable test command, supporting a
two-phase E2E model (setup + execution).

Includes an internal workflow to validate the E2E pipeline
and documentation clarifying the E2E execution model.
@digitalrisedorset digitalrisedorset requested a review from a team as a code owner February 10, 2026 13:35
@rhoerr
Copy link
Copy Markdown
Contributor

rhoerr commented Feb 13, 2026

I started looking at this but I'm not prepared to approve the workflow or PR yet. Would appreciate review by someone more knowledgeable here.

Can you explain what you based the workflow files on? It looks like there's a lot in common with https://github.com/mage-os/github-actions/blob/main/.github/workflows/integration.yaml for instance.

@michielgerritsen
Copy link
Copy Markdown

@damienwebdev might be able to tell a bit more about how to run the e2e tests exactly.

@rhoerr
Copy link
Copy Markdown
Contributor

rhoerr commented Mar 2, 2026

I've approved the workflow for testing.

Since the workflow very closely mirrors the integration test suite, we should extract and update the common parts to reduce duplication and maintenance load. That's a separate matter though and I'll open an issue.

Copy link
Copy Markdown
Contributor

@rhoerr rhoerr left a comment

Choose a reason for hiding this comment

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

@digitalrisedorset Can we have the e2e suite skip if the directory doesn't exist?

Comment thread .github/workflows/_internal-e2e.yaml Outdated
id: supported-version
- run: echo ${{ steps.supported-version.outputs.matrix }}
e2e-workflow:
if: ${{ hashFiles('_test/demo-package/**') != '' }}
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

this added line should test if the folder exist. I have a possible alternative if needed but this is simple and hopefully doing what we want

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.

That throws an error on execution:

[Invalid workflow file: .github/workflows/_internal-e2e.yaml#L1](https://github.com/mage-os/github-actions/actions/runs/22717864824/workflow)
(Line: 37, Col: 9): Unrecognized function: 'hashFiles'. Located at position 1 within expression: hashFiles('_test/demo-package/**') != ''

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I found this method mentioned in https://stackoverflow.com/questions/71336204/github-action-check-if-a-file-already-exists
I'd like to suggest the below but I could be more reliable if I understand to test this workflow end to end locally.

- name: Ensure demo package exists
  run: |
    if [ -z "${{ hashFiles('_test/demo-package/**') }}" ]; then
      echo "Missing demo package"
      exit 1
    fi

Can I suggest to discuss this after the meeting this afternoon?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@digitalrisedorset what's the purpose of the existence check? Won't this always exist in the internal version of this?

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.

The initial commit checks showed CI failures on all Magento versions because no Magento version has the Playwright tests bundled. We need that to not happen. https://github.com/mage-os/github-actions/actions/runs/21867114747

Copy link
Copy Markdown
Author

@digitalrisedorset digitalrisedorset Mar 31, 2026

Choose a reason for hiding this comment

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

@damienwebdev like @rhoerr explains, this is very much backward compliance. The hashfile is a github method that does exactly what we are after. But the method needs to be positioned at a place where github can handle it. The comment I am making above is a possible solution whereby I have just moved the hasfile statement higher up in the workflow.

Rather than guessing where to add this statement though, I'd like to know how I can trigger the workflow. I think sansec process prevents me to trigger the workflow.

Copy link
Copy Markdown
Author

@digitalrisedorset digitalrisedorset Apr 14, 2026

Choose a reason for hiding this comment

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

I made a new commit today. This commit is inspired of a working version of the same check made on a dummy repo: https://github.com/digitalrisedorset/dummy-repo

this dummy repo reproduces the same folder structure as our github-actions repo and only performs the step test if the folder demo-package exists. Can you let me know if this new commit helps preventing the e2e workflow to be triggered if the folder is missing? thanks

Copy link
Copy Markdown
Author

@digitalrisedorset digitalrisedorset left a comment

Choose a reason for hiding this comment

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

Hi @rhoerr I made a small change to move this PR through.

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