Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): Update to cypress 4.11.0 #19

Merged
merged 16 commits into from
Jul 30, 2020
Merged

Conversation

kamranayub
Copy link
Owner

@kamranayub kamranayub commented Jul 30, 2020

Changes

  • Update to cypress@4.11.0
  • To get Firefox working:
    • Added --shm-size=2g for increasing shared memory
    • Changed cy.reload() to cy.visit('/') as it appeared to hang FF but essentially has the same function
    • Added cy_sw_page_only_bypass document-only bypass for Service Worker cache testing

Notes

Firefox Shared Memory

Unsure why but FF seems to have higher memory requirements than Chrome. Adding --shm-size=2g to the Docker container options fixed some hanging issues. See cypress-io/github-action#104 (comment)

Bypassing Service Worker for Page Requests

In Firefox because Disable Web Security is unsupported, I found I needed to bypass the SW cache handling for document (HTML) page requests. If I don't, you'll get a SecurityError:

SecurityError: Permission denied to access property "x" on cross-origin object

This is because Cypress needs to access the iframe to inject stuff into the window and document and such. Apparently, when this is being served by the service worker cache, it doesn't work (it thinks it's cross-origin?). This is the same in Chrome which is why we bypass the cache by default for all other tests. However, in Chrome, with chromeDisableSecurity: true set, we can access cross-origin iframes and there are no errors.

So I introduced another denylist regular expression for any URLs that contain cy_sw_page_only_bypass, which the app does not handle (it handles cy_sw_bypass). This effectively means only cy.visit() commands will bypass the cache, and cache API requests which is what we're trying to test.

huzzah

Firefox Errors

Sometimes FF will not re-run test steps for whatever reason. In the JS console I see:

Unhandled rejection [Exception... "Component not initialized"  nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)"

Relaunching from the runner usually resolves that.

public/_headers Outdated Show resolved Hide resolved
@kamranayub kamranayub merged commit d368b9c into master Jul 30, 2020
@kamranayub kamranayub deleted the chore/deps/cypress-4.11.0 branch July 30, 2020 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant