intellij-cypress icon indicating copy to clipboard operation
intellij-cypress copied to clipboard

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

Open manuelkroiss opened this issue 2 years ago • 5 comments

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.

manuelkroiss avatar Oct 11 '22 08:10 manuelkroiss

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.

mbolotov avatar Oct 11 '22 09:10 mbolotov

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)

manuelkroiss avatar Oct 11 '22 12:10 manuelkroiss

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 avatar Oct 11 '22 17:10 mbolotov

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

mbolotov avatar Oct 11 '22 20:10 mbolotov

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

Your EAP version now works as expected. Thanks.

manuelkroiss avatar Oct 12 '22 04:10 manuelkroiss

fixed in 1.5.1 version

mbolotov avatar Jan 16 '23 18:01 mbolotov

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.

siffash avatar Mar 30 '23 10:03 siffash

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

image

rdpascua avatar Mar 31 '23 02:03 rdpascua