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

Allow adding '--component' flag in the additional parameters for running Cypress Component tests (base version) #105

Closed manuelkroiss closed 1 year ago

manuelkroiss commented 1 year ago

Cypress does support component tests (currently in beta)

To run a component test, one has to add the --component flag to the cypress run command.

However, it seems like the plugin always adds the --e2e flag by default. Thus, adding --component as a program argument results in the following error:

`--e2e` and `--component` cannot both be passed.

Either pass `--e2e` or `--component`, but not both.

Maybe there are further issues related to component tests.

mbolotov commented 1 year ago

Hi @manuelkroiss! Please make sure you have configured your spec to be run in the component mode in the cypress config file. The plugin should automatically add the correct flag to the command line depending on the spec pattern in the config. Please also make sure you have the 'automatic' mode selected in the 'Misc' tab of the run configuration.

manuelkroiss commented 1 year ago

Hi

I did, everything works fine running the tests without the plugin.

Here is my cypress.config.ts

export default defineConfig({
  component: {
    devServer: {
      framework: "angular",
      bundler: "webpack",
    },
    specPattern: "**/*.cy.ts"
  }
});

Furthermore, I looked for the 'Misc' tab in the run config, but only found a 'General' and a 'Runner' tab. (I am using the newest WebStorm version)

mbolotov commented 1 year ago

I looked for the 'Misc' tab in the run config, but only found a 'General' and a 'Runner' tab

Ohh, that's really strange. What version of the plugin do you use? Can you share the screenshot of your configuration? This is mine: image

mbolotov commented 1 year ago

Well, I just realized you're probably talking about the base version of plugin, right? You can try this bundle with the fix: Cypress Support-1.5.1-EAP.zip It will not add --e2e parameter if you set --component flag in the additional parameters

manuelkroiss commented 1 year ago

You were right, I was talking about the base version.

Your EAP version now works as expected. Thanks.

mbolotov commented 1 year ago

fixed in 1.5.1 version

siffash commented 1 year ago

Well, I just realized you're probably talking about the base version of plugin, right? You can try this bundle with the fix: Cypress Support-1.5.1-EAP.zip It will not add --e2e parameter if you set --component flag in the additional parameters

I have the same issue, and I'm using the latest version 1.5.1. Unfortunately I can't find any additional parameters, this is what I get: image

If I add --component as a program argument, it doesn't recognize it and runs again with --e2e argument.

rdpascua commented 1 year ago

I can't see anything as well on the Webstorm 2023.1, and Cypress Support 1.5.2

image