Cypress E2E testing WorkspaceRoot detection
radoslavirha opened this issue · comments
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
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
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.
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
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
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
Thanks for the PR, we will get this reviewed in the Cypress repo 👍
@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).