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

Can't implement pure SSR rendering in Cypress, tests pollute each other #40

Closed
eric-burel opened this issue Jun 18, 2020 · 2 comments
Closed

Comments

@eric-burel
Copy link
Collaborator

eric-burel commented Jun 18, 2020

See cypress/support/commands/ssr.ts. This command is based on @bahmutov recipe.

However it seems to work only with one test. cy.state is probably doing some weird asynchronous stuffs, and is not yet documented.

Issue for cy.state documentation: cypress-io/cypress-documentation#108

To repro:

  • git checkout bugfix/40-cypress-ssr-visit
  • yarn run dev
  • yarn run cypress:open
  • Run i18n tests. The fr test will pass, but the document is not correctly rewritten for the en test.
    Code is in cypress/integration/vns/i18n.spec.ts and cypress/support/commands/ssr.ts

I've tried to clone document, no success.

@eric-burel eric-burel added enhancement New feature or request cypress labels Jun 18, 2020
@eric-burel eric-burel changed the title Can't implement pure SSR rendering, tests pollute each other Can't implement pure SSR rendering in Cypress, tests pollute each other Jun 18, 2020
@eric-burel
Copy link
Collaborator Author

Will be partly solved by #71

We now consider data fetching SSR as the most advanced way of rendering, and it should be used only by advanced users with a very clear idea of what they are doing.

Thus, we expect them to be able to spawn an intermediate test server or to be able to run tests against their production architecture efficiently like they would do in any micro-service architecture.

In Vulcan, we won't consider this use case and suppose that all requests are happening in the browser now.

@eric-burel
Copy link
Collaborator Author

Closing as nowadays MSW (Mock Service Worker) is the recommended way to mock server calls, and works also for SSR. See #125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant