Keeps switching my protractor tests to Karma

For our end to end automation testing, we have a our spec setup in the config as : specs: ['./**/*.e2e-spec.ts'], which works all well and good.

Now, I have cloned that config for our API integrations tests.  I want to switch to specs: ['./**/*.int-spec.ts'] , however, anytime I try this, WebStorm will then try running my tests as Karma tests, and not protractor.  How do I get WebStorm to stop doing this?

Thanks

8 comments
Comment actions Permalink

Currently, if both Protractor and Karma test runners are installed in project, a JavaScript/TypeScript test file is run with Protractor if the file path contains folder with e2e name or file name matches *.e2e-spec.{ts,js} pattern

0
Comment actions Permalink

Is there any way to alter this?  Like add a new extension type?

0
Comment actions Permalink

No, this can't be altered:(

0
Comment actions Permalink

Hello Elena Pogorelova 
My file name does end with .e2e-spec.ts but IntelliJ opens a Karma run configuration rather than a Protactor run configuration when I try to run a test, any idea why please?

IntelliJ IDEA 2022.3.2 (Ultimate Edition)

Build #IU-223.8617.56, built on January 26, 2023

0
Comment actions Permalink

Do you have a sample project you could share that reproduces the problem?

0
Comment actions Permalink

Yes, here is a basic Angular project created with ng new. I just added the protractor dependency, a app.component.e2e-spec.ts file and a protractor.conf.ts file.

https://github.com/MaximeAnsquer/test-protractor-intellij

0
Comment actions Permalink

Thanks!

The IDE needs a valid protractor configuration file to detect protractor tests; but protractor.conf.ts is treated as a usual .ts file, not as protractor configuration file, the IDE expects it to be a JavaScript file. The issue will go away if you change the file extension to .js. Note that you will have to delete all auto-created Karma run configurations for your e2e files, as the IDE will always prefer existing configurations current file is associated with when running tests

1

Please sign in to leave a comment.