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 component testing could not detect tests when spec file contains spaces in path #16278

Closed
realmerx opened this issue Apr 29, 2021 · 5 comments · Fixed by #16416
Closed
Assignees

Comments

@realmerx
Copy link

realmerx commented Apr 29, 2021

Current behavior

Cypress component testing (cypress open-ct) could not detects tests when spec file contains spaces in path. When trying to load a spec in browser following message is displayed:

No tests found.
Cypress could not detect tests in this file.

Example:
OS: Windows 10

path is:

c:\projects\my project\cypress\component\test.spec.js

if I change the path to:

c:\projects\my_project\cypress\component\test.spec.js

then tests are successfully detected.

Desired behavior

Tests would be detected

Test code to reproduce

Just include space in path to spec file

Versions

Cypress 7.2.0
OS: Windows 10

BTW: Cypress rules and keep up the good work :)

@realmerx
Copy link
Author

If anyone needs quick workaround you can create symbolic link without spaces in path to the project directory.

@lmiller1990
Copy link
Contributor

Thanks for reporting this. We should encode the URLs to support white-space.

@realmerx realmerx changed the title Cypress component testing could not detects tests when spec file contains spaces in path Cypress component testing could not detect tests when spec file contains spaces in path Apr 30, 2021
@lmiller1990
Copy link
Contributor

I think the problem is in the packages/runner-ct part of the code base. I am able to curl a spec with white space without any problems: curl http://localhost:50117/cypress/component/Spec%20With%20Whitespace.spec.tsx, where the spec is "Spec With Whitespace".

@lmiller1990
Copy link
Contributor

Ok, I fixed it here. #16416

@cypress-bot
Copy link
Contributor

cypress-bot bot commented May 24, 2021

Released in 7.4.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v7.4.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators May 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants