mbolotov / intellij-cypress

IntelliJ-Cypress plugin: https://plugins.jetbrains.com/plugin/13819-intellij-cypress Pro version: https://plugins.jetbrains.com/plugin/13987-cypress-support-pro
MIT License
35 stars 5 forks source link

How to set up for individual tests? #35

Closed jeffersondarcy closed 3 years ago

jeffersondarcy commented 3 years ago

I have managed to set-up the plugin to run all the tests (option "all in directory") but having troubles setting it up to run individual test files or single tests (Error: Cypress spec must be defined). When I am trying to run single file I am getting an error because of incomplete configuration and the file name is not set automatically.
For individual tests no cypress option appears - only mocha or jest. (it might be possible that the file naming collides, but cypress tests are in a different directory)

mbolotov commented 3 years ago

hi @jeffersondarcy! The easiest way to setup a run configuration for an individual cypress spec (or a test inside it) is to use run gutters: image Right click on a gutter and create a corresponding run configuration.

Could you please attach a screenshot where you see the problem?

jeffersondarcy commented 3 years ago

I don't have any cypress options, only jest and mokka

Screenshot 2021-01-28 at 17 34 50
mbolotov commented 3 years ago

Okay, it means the plugin does not treat your test as a cypress one. Could you share you project? If this is not possible, could you at least describe your tests structure? Do you have your tests outside of a directory tree where the cypress.json is placed?

jeffersondarcy commented 3 years ago

tests are located in directory e2e/tests, cypress.json is located in directory e2e.
tests are placed in subfolders by suite for example e2e/tests/cart and named like blabla.test.ts

mbolotov commented 3 years ago

Unfortunately, I unable to reproduce the problem image

Could you share your project somehow? Or create another reproducible sample?

jeffersondarcy commented 3 years ago

unfortunately I can't share the project. I will maybe try it with a new project to see if it works

Mukheem commented 3 years ago

Hello @mbolotov ,

I also see the same issue as faced by @jeffersondarcy .

I used Cypress support free version and Pro version(Trial) one after the another with Intellij Ultimate edition and observed that test cases are recognized by free version and can execute them by just right clicking on spec file --> select cypress as its runner(with appropriate configuration of course)

However, Pro version fails to identify test cases. I managed to configure them manually by changing the spec file name in the same run configuration which was created by free version.

Test case folder structure is projectFolder/myProjectName/cypress/integration/myFolderName/testSpecfile.js

Please be noted that my cypress.json file is under projectFolder/myProjectName/cypress.json

It would be really appreciable if this issue is solved.

mbolotov commented 3 years ago

Hi @Mukheem! Could you share your project to reproduce the problem?

Mukheem commented 3 years ago

@mbolotov ,

I cannot share the project adhering to my Organization's policies.

Let me know if it is okay if I reach out to you on your personal mail id to figure out the issue.

mbolotov commented 3 years ago

yes, feel free to mail me or join to the plugin's slack channel: https://join.slack.com/t/intellij-cypress/shared_invite/zt-g5lcy9xc-F3qy_g8O~qbZvKjD2m0EjQ

mbolotov commented 3 years ago

Hi @jeffersondarcy! Are you still experiencing the problem?

mbolotov commented 3 years ago

@jeffersondarcy I'm closing as there was no answer from you fell free to create a new issue with details if you have any problems