I'm working on a monorepo project and as many monorepo projects do they tend to have their own CLI on top of to do common things across packages. One of these things is to run test.
The problem that I'm having is that when I place the plugins/index
file outside the project root I get the following error message:
......\mono-cli\src\cypress\plugins contains invalid WIN32 path characters.
but as soon as I place the plugins/index
file inside the project root and require the plugins/index
file from outside the root of the project it works. This also happens for the support/index
file.
When I place the plugins/index
or support/index
file outside the root folder I get the following error:
Error: C:\Users\baldurarna\AppData\Roaming\Cypress\cy\production\projects\MMS-3bc48668dc408d2c7575d3d91289f8f1\bundles\C:\Code\Frontend\Cosmic\tools\mono-cli\src\cypress\support contains invalid WIN32 path characters.
Having these files outside the root of the project should work the same as having them inside the root of the project.
Cypress: 3.1
Chrome: 69
@spoldman did the issue #853 solved your problem ?
It looks like I have the same problem, having created an Angular mono-repo project with Nx ; I get
Oops...we found an error preparing this test file:
..\..\dist\out-tsc\apps\frontend-e2e\src\support\index.js
The error was:
Error: C:\Users\Me\AppData\Roaming\Cypress\cy\production\projects\frontend-e2e-8ce4430423f282711e3fec07c048a172\bundles\C:\dev\myApp\dist\out-tsc\apps\frontend-e2e\src\support contains invalid WIN32 path characters.
Cypress: 3.1.5
This is still happening on Windows within an Nx environment with cypress e2e setup as well.
"supportFile": "../../dist/out-tsc/apps/web-example-e2e/src/support",
will work on Mac, but not windows.
Same Nx/Cypress issue as @MarkPieszak & @EirikBirkeland are having... as soon as you provide a value for supportFile i.e."supportFile": "../../dist/out-tsc/apps/app1-e2e/src/support/index.js"
it breaks.
We have the same problem at the moment on Windows. I can confirm that exactly the same project runs fine on Linux and OSX.
> cypress --version
Cypress package version: 3.2.0
Cypress binary version: 3.2.0
After looking through the code a bit I suspect that the bug is somewhere in the https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/plugins/preprocessor.coffee#L38 (in the appData.projectsPath
call)
Is there any progress on this? It is still a Blocker for all nx-workspace users on Windows.
Version
Cypress: 3.3.1
Nx: 8.1.0
We are experiencing the same issue.
The only ugly way to proceed with this somehow was to remove the reference to custom support file
"supportFile": "../../dist/out-tsc/your_path/support/index.js"
, then duplicate the folder with support (both index.js adc commands.js) in cypress folder. Leaving the same support folder in our /src, with the .ts files instead...
This forces us to work with WSL and XMing. That's a pretty buggy and unstable setup.
A workaround can be to import the file in each spec.
import '../support/index.ts';
This can replace the /// <references>
if you put that into the support/index.ts
. This can be done with find and replace this way.
Same issue here... My Windows users cannot get this to work at all.
Interesting - probably paths handling on Windows is incorrect, we will look into it.
For now here is a workaround:
cypress/plugins/index.js
export required root plugins file likemodule.exports = require('../../../plugins')
import '../../../support'
See example of this in https://github.com/bahmutov/multiple-cy-example - there are two subfolders one
and two
but they reuse common support.js
and plugins.js
files
Thanks @bahmutov !
Not sure this is an easy way to start contributing to Cypress, but I would be glad to help if I can have a hint.
You would need to find the "packages" folder where we resolve the plugins
and support files, probably in "packages/server/lib". Then check the logic
to make sure it uses path.resolve
and/or path.join
instead of
concatenation. Also we will need a unit test to confirm the behavior
On Mon, Jun 24, 2019 at 10:03 AM euZebe notifications@github.com wrote:
Thanks @bahmutov https://github.com/bahmutov !
Not sure this is an easy way to start contributing to Cypress, but I would
be glad to help if I can have a hint.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/cypress-io/cypress/issues/2595?email_source=notifications&email_token=AAQ4BJXX4X43NT7Y7WCDLODP4DH3RA5CNFSM4F27JSYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYNA52A#issuecomment-505024232,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAQ4BJRQ56SK5VLXPFVN6QDP4DH3RANCNFSM4F27JSYA
.
--
Dr. Gleb Bahmutov, PhD
Schedule video chat / phone call / meeting with me via
https://calendly.com/bahmutov
gleb.[email protected] @bahmutov https://twitter.com/@bahmutov
https://glebbahmutov.com/ https://glebbahmutov.com/blog
https://github.com/bahmutov
I'm getting the same issue, im trying to use the directory "/support" in other repo but i got the same error.
this is mi path for integration tests:
C:\Git\test-view-ts\cypress\integration\test1.js
Inside the code trying to import the support files:
import {
some_already_exported_function
}
from '../../../../../cy-config-ts/cypress/support/index.js'
Path of support file:
C:\Git\cy-config-ts\cypress\support\index.js
this is my cypress.json:
{
"supportFile" : "/Git/cy-config-ts/cypress/support/index.js",
}
and i got this message:
Error: C:\Users\caportillo\AppData\Roaming\Cypress\cy\production\projects\test-view-ts-26918ea0ae940a886090e981042d163e\bundles\C:\Git\cy-config-ts\cypress\support contains invalid WIN32 path characters.
Most helpful comment
This is still happening on Windows within an Nx environment with cypress e2e setup as well.
"supportFile": "../../dist/out-tsc/apps/web-example-e2e/src/support",
will work on Mac, but not windows.