-
-
Notifications
You must be signed in to change notification settings - Fork 828
Convert sticker end-to-end tests to Cypress #8807
Conversation
Reference materials: * https://www.cypress.io/blog/2020/02/12/working-with-iframes-in-cypress/ * cypress-io/cypress#136 * https://docs.cypress.io/api/commands/origin#Other-limitations Ideally we'd be able to use `cy.origin()` to jump into the iframe, but it's explicitly not supported. Instead we disable web security as instructed by cypress because it's our only reasonable option here. Thankfully, disabling web security doesn't appear to remove the crypto libraries from the browser so we can still function in that respect. Rationale for why we can't just serve the sticker picker off the app domain is included in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test ran locally without issues. LGTM 👍
@@ -7,5 +7,6 @@ | |||
"retries": { | |||
"runMode": 2, | |||
"openMode": 0 | |||
} | |||
}, | |||
"chromeWebSecurity": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests should also be runnable in firefox, do they work there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does one run them in Firefox? (Should we be enabling that in CI?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test:cypress:open
then pick your favourite installed Firefox version in the dropdown in the top right
Yeah ideally we'd run CI on Firefox & Chrome & Electron, but Electron doesn't work properly in CI for some reason
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reference materials:
Ideally we'd be able to use
cy.origin()
to jump into the iframe, but it's explicitly not supported. Instead we disable web security as instructed by cypress because it's our only reasonable option here. Thankfully, disabling web security doesn't appear to remove the crypto libraries from the browser so we can still function in that respect.Rationale for why we can't just serve the sticker picker off the app domain is included in the code.
Please thumbs-up cypress-io/cypress#136 if you don't mind 😇
element-web notes: None
Fixes element-hq/element-web#22450
This change is marked as an internal change (Task), so will not be included in the changelog.