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

Cypress E2E testing WorkspaceRoot detection #326

Closed
radoslavirha opened this issue Mar 1, 2023 · 7 comments
Closed

Cypress E2E testing WorkspaceRoot detection #326

radoslavirha opened this issue Mar 1, 2023 · 7 comments

Comments

@radoslavirha
Copy link

Hi,

when testing Quasar + Cypress (component tests) in multiple workspaces, build server does not recognise project root and tests are failing.

My issue is similar to https://stackoverflow.com/questions/74902697/error-the-request-url-is-outside-of-vite-serving-allow-list-after-git-init

It can be fixed in quasar.config.js with:

    extendViteConf(viteConf) {
      if (!viteConf.server) {
        viteConf.server = { fs: {} };
      }
      viteConf.server.fs = {
        allow: [
          searchForWorkspaceRoot(process.cwd())
        ]
      };
    }

Normal Quasar build/dev works fine without ^^ piece of code, but it's necessary for component tests.

The question is if it can be fixed/set in @quasar/quasar-app-extension-testing-e2e-cypress or me (maybe others) should stick with my solution.

Thanks

@IlCallo
Copy link
Member

IlCallo commented Mar 6, 2023

It should be possible to fix this via our index file behind a api.hasVite check, or even commit it upstream to Cypress vite dev server, see https://github.com/cypress-io/cypress/blob/9db5251a0ee954b260abdd1ddf217834667818bc/npm/vite-dev-server/src/resolveConfig.ts#L111

We would prefer to have it fixed upstream, but if it's too much hassle to deal with Cypress team we'll accept a PR to fix it into this app extension

@radoslavirha
Copy link
Author

Hi @IlCallo I opened PR in Cypress .... It seems to be complicated to merge something into cypress repo. I don't have example repo for them (my is private). Hopefully it will be OK.

cypress-io/cypress#26036

@IlCallo
Copy link
Member

IlCallo commented Mar 7, 2023

Thanks, I tried to bring some attention on the issue, as it's related to a similar problem we just had to tackle to make own Quasar tests to work

@radoslavirha
Copy link
Author

There are some failing tests in cypress repo. If you want and have few spare minutes, feel free to help me with PR. I'll continue in the evening.

Thanks

@IlCallo
Copy link
Member

IlCallo commented Mar 7, 2023

I can't unluckily, but they may be just failing snapshot tests which need to be refreshed, it happened to a PR of mine last month too

@lmiller1990
Copy link

Thanks for the PR, we will get this reviewed in the Cypress repo 👍

@radoslavirha
Copy link
Author

@lmiller1990 @IlCallo I tracked down where the problem first appeared, and it seems to be related to the typescript references in the tsconfig.json file, where I reference another workspace (some tools).

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

No branches or pull requests

3 participants