Add e2e spec for project remix behaviour in web component#1020
Merged
floehopper merged 6 commits intomainfrom May 24, 2024
Merged
Add e2e spec for project remix behaviour in web component#1020floehopper merged 6 commits intomainfrom
floehopper merged 6 commits intomainfrom
Conversation
I'm planning to add another example with a different `baseUrl` and the nicest way to do that will be to use a separate `describe` block.
I'm planning to add some query params to the `baseUrl` in another `describe` block. Renaming the stem of the URL to `origin` will make that simpler.
469c231 to
9e0d3cc
Compare
|
|
6e84b40 to
4430370
Compare
|
|
The Electron browser (used by default in the Cypress e2e specs) doesn't always (ever?) set the "Origin" HTTP header and so the "validation" for `Project#remix_origin` in `Project::CreateRemix#validate_params` [1] fails, making it impossible to remix a project. [1]: https://github.com/RaspberryPiFoundation/editor-api/blob/1bb7e7f74b8021418503bcf3af201844c130aa9a/lib/concepts/project/operations/create_remix.rb#L22-L25
The instance of `editor-api` at test-editor-api.raspberrypi.org has the `BYPASS_AUTH` environment variable set which will allow us to write e2e specs which require the `editor-ui` code to make authenticate requests to `editor-api`.
The editor-standalone app will: * Listen for "editor-projectIdentifierChanged" custom events from the web component and will redirect to the remixed project's URL. * Set the web component `load_remix_disabled` attribute to `true` so that the original project will be loaded in preference to the remixed version (unlike the way projects-ui works). This spec checks that the web component provides the relevant behaviour for editor-standalone to use. I did attempt to add an example for the default behaviour (i.e. when `load_remix_disabled` is not set). However, without any way to easily reset the state of the projects in the editor-api database, it's hard to come up with a robust way to write such a test.
4aea00f to
dd2e1fa
Compare
|
Merged
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
editor-standaloneapp will:editor-standalonebehaviour was changed in RaspberryPiFoundation/editor-standalone#63.load_remix_disabledattribute totrueso that the original project will be loaded in preference to the remixed version (unlike the way projects-ui works). The relevant web component behaviour was changed in Addload-remix-enabledattribute to web component #992 & Invalidate cached project when project is remixed #1003. The relevanteditor-standalonebehaviour will be changed in RaspberryPiFoundation/editor-standalone#85.This spec checks that the web component provides the relevant behaviour for editor-standalone to use.
I did attempt to add an example for the default behaviour (i.e. when
load_remix_disabledis not set). However, without any way to easily reset the state of the projects in the editor-api database, it's hard to come up with a robust way to write such a test.Note that this PR changes both the editor app itself and the fake "app" wrapping the web component to use https://test-editor-api.raspberrypi.org instead of https://staging-editor-api.raspberrypi.org in CI. The former has
BYPASS_AUTHset totrueso the apps can make requests as if the user was logged in. The new e2e spec also relies on theprojects:create_allrake task having been run - which we've only done manually for now, but needs automating.