Skip to content

Improvements to Cypress specs in CI#1017

Merged
floehopper merged 4 commits intomainfrom
improvements-to-cypress-specs-in-ci
May 23, 2024
Merged

Improvements to Cypress specs in CI#1017
floehopper merged 4 commits intomainfrom
improvements-to-cypress-specs-in-ci

Conversation

@floehopper
Copy link
Contributor

We were seeing multiple occurrences of the following error:

    URIError: Failed to decode param '/en/projects/%REACT_APP_PLAUSIBLE_SOURCE%'

This was making it harder to see the wood for the trees when a spec
failed.

I've set the `REACT_APP_PLAUSIBLE_SOURCE` env var to "" which is what
it's set to in `.env.example`.
By default Cypress will capture a screenshot if a spec fails [1]. This is
useful when diagnosing spec failures especially in the CI build and we
have a step [2] in the CI GitHub Action that makes any such screenshots
available as downloadable build artefacts. Note that screenshots are
*not* captured by default when running `cypress open`, but that seems
sensible.

The default behaviour was changed in these two commits [3,4] so that
screenshots were no longer captured in the CI build. However, I can't
find any explanation beyond "Trying to fix screenshot problem".

I've reinstated the default behaviour in this commit.

[1]: https://docs.cypress.io/guides/guides/screenshots-and-videos#Screenshots
[2]: https://github.com/RaspberryPiFoundation/editor-ui/blob/2724a3c6db607eaa5e67bba9b730d9e1055ea467/.github/workflows/ci-cd.yml#L100-L106
[3]: c209c36
[4]: 74290f5
This option [1] effectively enables the `--quiet` option [2] on the
`cypress run` CLI command which makes the output from the Cypress specs
a lot less verbose. This in turn makes it easier to see the wood for the
trees when a spec fails.

Note that it will still be possible to see verbose output when running
the specs locally.

[1]: https://github.com/cypress-io/github-action/blob/master/README.md#quiet-flag
[2]: https://docs.cypress.io/guides/guides/command-line#Options
@github-actions
Copy link

@floehopper
Copy link
Contributor Author

@sra405 I've checked that Cypress screenshots are indeed saved to cypress/screenshots by default which is where the upload-artifact step is expecting to find them.

@floehopper floehopper merged commit 1776098 into main May 23, 2024
@floehopper floehopper deleted the improvements-to-cypress-specs-in-ci branch May 23, 2024 13:28
@floehopper floehopper mentioned this pull request Jun 3, 2024
floehopper added a commit that referenced this pull request Jun 4, 2024
### Added

- Add `project_name_editable` attribute to web component (#1009)
- Fires custom event when the theme changes (#1015)
- Add `output_only` attribute to web component (#1019 & originally #782)
- Add `assets_identifier` attribute to web component (#1019 & originally
#901)
- Enhance `code` attribute on web component to override project main
component content (#1019 & originally #901)
- Add `runCode`, `stopCode` & `rerunCode` methods to web component
(#1019 & originally #899)
- Send error details in "editor-runCompleted" event (#1019 & originally
#915)
- Return error details to web component (#1019 & originally #915)
- Add `output_panels` attribute to web component (#1019 & originally
#909)

### Changed

- Remove unused `/embedded/projects/:identifier` route (#1013)

### Fixed

- Remove unused `REACT_APP_LOGIN_ENABLED` env var (#1006)
- Fix infinite remix loop when `BYPASS_AUTH` set in `editor-api` (#1007)
- Fixes for docker-compose.yml (#1008)
- Fix deprecation warnings in GitHub Actions (#1011)
- Removed unused `isEmbedded` param from `useProject` call in
`EmbeddedViewer` (#1016)
- Improvements to Cypress specs in CI (#1017)
- Fix warnings and verbose output when starting Webpack Dev Server
(#1018)
- Add e2e spec for project remix behaviour in web component (#1020)
- Fix initial value of `user` in `WebComponentLoader` (#1021)
- Make `authKey` in e2e web component spec more realistic (#1022)
- Remove unused `ComponentStore` (#1023)
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.

2 participants