Open tnrich opened 5 years ago
I would love to see a proper jest runner so that we could script all tests (jest and Cypress) via a runner and use npm run test
or npx jest
to just run all tests and integration tests. Would that feature make it possible? It would require Cypress to be able to communicate it's output to jest/external not only to std out as far as I remember.
@ethernal I don't think what you're suggesting is necessary for what I want to do. While it would technically solve what I'm trying to do, I think it should probably opened as a separate issue to this one.
Could anyone guide me as to how to implement this:
- programmatic launching of a single test file using the
cypress open
command (not currently available according to https://docs.cypress.io/guides/guides/command-line.html#cypress-open). This would look likecypress open mySpec.js
@tnrich There is an issue open to add support for --spec argument to cypress open
https://github.com/cypress-io/cypress/issues/1925
Okay I've created a v1 of the vscode extension vscode-extension-open-cypress
https://github.com/tnrich/vscode-extension-open-cypress
https://marketplace.visualstudio.com/items?itemName=tnrich.vscode-extension-open-cypress
I've added a TODO list for the features that I think would make this extension actually be really cool:
@jennifer-shehane @bahmutov if you guys could help me figure out a way to have cypress run automatically that would be awesome! I think the need to grep to run a single it block is less important because I can just manually add a .only() to the it block and save (which is a little messy but fine).
'Run Test | Debug Test' in a test spec.js file in order to run / debug a cypress test in VSCode is a must.
What's the status of this work in the Cypress dev group?
I've created a similar plugin for IDEA (with JS support only) It allows running a single test, a spec or all tests in a directory from IDE directly (and see test statuses as well) https://plugins.jetbrains.com/plugin/13819-intellij-cypress
Debugging from VSCode by simply setting a breakpoint is a must.
Yeah, it'd be ideal to have this feature delivered to help the extensions be more helpful. https://github.com/cypress-io/cypress/issues/1925
There are some workaround in there, like using the testFiles
config to narrow down the specs shown in the list, but yah - wouldn't open and run directly.
Christ, 3 years and there's still no way to make any meaningful editor extensions. Please, for the love of god, don't misinterpret the original issue as a request for the Cypress team to develop extensions, you're merely asked to expose more fine-grained control over runner. It's literally a no-brainer and nothing to agonize over.
@jennifer-shehane bump on this one.. still waiting for a way to be able to launch and RUN a test directly from my editor.
@jennifer-shehane A year later, would still love to see some way of making this happen.. anyone have any news on this? @emilyrohrbough @chrisbreiding :)
It would be awesome to be able to run a single cypress test in the cypress devtool directly from vscode. Currently something like that exists for debugging a jest test:
As seen in the above photo, a user can hit "debug" and launch a debugging session for an individual jest test. I think it would be super awesome if I could press a "run cypress" button from the editor and have the devtool launch just that test.
In order to get that feature to work I think a few things would need to be done:
programmatic launching of a single test file using the
cypress open
command (not currently available according to https://docs.cypress.io/guides/guides/command-line.html#cypress-open). This would look likecypress open mySpec.js
programmatic running of just 1 test within a file (NOTE: Not Essential as this can already be done using it.only and is potentially a complicated issue, see https://github.com/cypress-io/cypress/issues/925)
actually making the cypress vscode plugin to put it all together!
I'd love to hear other people's thoughts on this. I just think it could make the already excellent cypress workflow even better!
Thanks!