Search code examples
javaintellij-ideajunit

IntelliJ - test configuration. How to configure once run for everyone?


I want to run JUnit tests in IntelliJ separately. I need to pass special configuration to run them. Everytime I want to run new test I have to create new run configuration. I need to pass VM argument: -Dwebdriver.firefox.bin="C:\Program Files (x86)\Mozilla Firefox_16en\firefox.exe" as well as Environment variables.

How do I define those configuration details once and the just run the particular test I want with those settings?


Solution

  • If you want to change the default run/debug configuration settings, expand the Defaults node, select the desired configuration type, and modify it as required.

    Source

    Open Run > Edit Configurations. Select Defaults > JUnit in the left tree and add your VM arguments. Those arguments will be used for every new JUnit run configuration automatically.