Want to select environment(with one-click) in IntelliJ IDEA UI window or toolbar before test run
I have a java testNG project(framework) with API tests which I need to run on different environments (dev/qa/stage/etc)
For test run/debug I use Run xxx / Debug xxx options from context menu or gutter.
To support different environments I use set of configuration files wich describe those environments. When testNg starts I should pass the name of configuration file to process with test framework.
Currently to do that I use the next way: project contains file 'startup.properties' where I have the only property: config_file=<name-of-environment-config-file>. But to run test on different environment I need to locate this file, change the property and then navigate back to test and run it.
What I want to avoid:
1. I dont want to edit the 'config_file' property before test invocation
2. I dont want to check the value of 'config_file' property every time when I forgot the value
I want either of next:
option#1: to have some dropdown or list in IntelliJ UI (on toolbar or some tool window) which is always visible (so I always can see which environment is currently 'active')/. I should be able to select items in this list or dropdown in 1 click (i.e. without text editing). Of cause it must be configurable.
option#2: to specify selected config just after I clicked "Run xxxx" button (or Ctll+Shift+F10). Again it should be window where I can select envoronment in one click. I know I can configure IDEA to show "run/debug configuration" dialog for testNG just after test invocation, but this dialog does not allow to select my environment in 1-click
In other words (more generally) I want to find a way to define configurable property via IntellijI IDEA UI and then pass it (as system property) to runned/debuged process (to testNG)
Do you have any ideas how it can be configured in IDEA with embedded functionality (maybe with 'before lauch' config or custom scripts) or with existing plugins?
P.S.
When environment will be defined then it can be passed to testing framework with system property or in another way. (I know how to do that, so it is not the question for topic)
Please sign in to leave a comment.
Hello,
Please clarify if it solves the issue for you if you create several configurations with different properties defined:
Thank you
@...
No, it does not. Because I have a tot of tests (>500) which I sometimes need to debug on certain environment. In your case I need to create 500*N configurations (N - number of environments)
Hello, please feel free to create a feature request in YouTrack: https://youtrack.jetbrains.com/issues
Thank you