github-actions-magento2 icon indicating copy to clipboard operation
github-actions-magento2 copied to clipboard

[FEAT] Cypress Tests

Open damienwebdev opened this issue 3 years ago • 5 comments

:bulb: Feature request

Feature Name

Cypress-Test-Action

The Desired Behavior

Automated E2E tests for out of box store validation.

Your Use Case

As a user, if I'm testing an extension, I may want to do E2E tests to validate that I didn't break anything.

Prior Work

https://github.com/elgentos/magento2-cypress-testing-suite

damienwebdev avatar Sep 02 '22 14:09 damienwebdev

@peterjaap is this something you may be interested in contributing? Or, @vinai if you have experience this would be something that could be used in MageOS for "smoke tests".

damienwebdev avatar Sep 02 '22 14:09 damienwebdev

Yes, I'd be interested! I have 0 experience with Github Actions but I do have a ton of experience with Gitlab CI/CD so how hard can it be? :man_shrugging: (famous last words)

peterjaap avatar Sep 02 '22 14:09 peterjaap

Hahaha. Hopefully it's pretty easy! https://github.com/graycoreio/github-actions-magento2/blob/main/.github/workflows/integration.yaml may be a close equivalent?

damienwebdev avatar Sep 02 '22 14:09 damienwebdev

I'm now using this action by Cypress itself over at elgentos/magento2-cypress-testing-suite and it works perfectly!

peterjaap avatar Oct 07 '22 13:10 peterjaap

@peterjaap looking at the action:

These look like inputs to an action (and therefore could be encapsulated in some way).

CYPRESS_MAGENTO2_SKIP_CHECKOUT: 'true'
CYPRESS_MAGENTO2_SPEC_SUITE: 'hyva'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_MAGENTO2_BASE_URL: 'https://hyva-demo.elgentos.io'
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CYPRESS_VIDEO_COMPRESSION: 0
CYPRESS_RETRIES: 3

Additionally, assuming one were to have a "stock" Magento install that they were testing their extension with, how would I run the cypress tests? I think that's where I would be reaching for an off-the-shelf solution.

There's probably three kinds of tests that I want to support:

  1. Cypress Tests for Extensions (smoke) - Smoke Testing that their extension didn't break existing features
  2. Cypress Tests for Stores - Requires in-repo configurations that I think you're most familiar with
  3. Cypress Tests for Extensions - Acceptance testing specific features of that specific extension.

damienwebdev avatar Oct 07 '22 13:10 damienwebdev

Closing in favor of https://github.com/mage-os/github-actions/issues/11

damienwebdev avatar Apr 25 '23 13:04 damienwebdev