Run cucumber by right clicking on it in IntelliJ - intellij-idea

I am trying to simplify the way we run cucumbers. We have a runner for each folder and we always change the runner in a run configuration that has some VM options set.
I can right click on a feature, select "Run feature :" but it doesn't run successfully without the parameters from the run configuration (one of them runs the tests with an in memory database for example)
Is there anyway I can add a default configuration so I can run them directly?

Run -> Edit Configurations
In the left-hand panel, there is a category called defaults. You can set the defaults to cucumber there. However, note that you might have to delete your previously existing configurations to get this to work with files you've already tried. They usually appear in a faded gray.

In addition, you could also add a runner class, which can run (a subset of) your tests from a testing framework. You can provide #CucumberOptions in this runner.

Related

Is there a way to fix the used Run/Debug configuration in IntelliJ?

I often switch between running/debugging tests locally in IntelliJ and using remote debugging my server. Therefore I have multiple run/debug configurations (the gradle ones were created automatically):
Whenever I execute a local test like PdfA...en.ttete this profile is selected by default in that combobox. But I want it to stay default on entry Remote...Debugging 5050 so that I can easily run this profile. Is there a fix?
Other solution would be to define a Hotkey for my favourite configuration. But I couldn't find it.

How to run multiple IntelliJ IDEA configurations after one another (serially, sequentially)?

Similar to this question, I want to run multiple Run Configurations as one. However, instead of running them simultaneously (parallel), I want to run them after one another in a specific order.
I know I can select another Run Configuration to run before another, like answered here, but approach has one issue: it's not possible to have one generic/main/super Run Configuration that runs nothing else than the specified run configurations. I must to pick one project-specific configuration (e.g. a Python configuration in PyCharm, the JetBrains Python IDE similar to IntelliJ IDEA) to be able to choose Run Configurations to run serially before the main one. This is an issue, because if I ever want to change to or insert a different configuration where the main Python Run Configuration is, I need to remake the Run Configuration Order besides a new one. With a predefined serial list of Run Configurations to execute, this would be as simple as inserting another configuration in the list.
Is this possible and how do I achieve this?
Besides the Before launch functionality mentioned in the question, there is no such possibility in IntelliJ IDEA and other JetBrains IDEs to my knowledge. However, there exists plugins that add Run Configurations that initially do nothing (empty), which can be considered as a generic/main/super Run Configuration. In such a configuration the regular way of specifying other configurations to run sequentially before launch can be used to achieve the question's goal.
An example of a plugin that adds an initially empty Run Configuration is the Multirun plugin. Don't be confused by its name: it's meant to run multiple Run Configurations simultaneously with the option to start them sequentially, but it does not wait for earlier ones to finish before starting the later ones. Just add the default (empty) Multirun configuration and queue up other tasks to run sequentially through the Before launch section.
It's a pity JetBrains haven't added a serial/sequential execution configuration in their Compound Run Configuration, which basically achieves what the Multirun plugin achieves: simultaneous / parallel execution. With compound run configurations, the Run Configuration editor would become a really powerful but simple to program configurations for various wishes like Gradle achieves for more complex build configurations.

Can IntelliJ's Run/Debug configurations have prompts for input?

i was wondering, if i can configure a run configuration (like executing a ruby script on a deployment server) with a prompt for parameters on starting the config. Like it does for starting rake tasks from the 'Run Rake Task...' after selecting a task.
I couldn't find anything in the run/debug config view and with a google search.
I recently found out that this feature is in fact implemented, kind of.
On the Run/Debug Configurations page there is a checkbox at the bottom called "Show this page". If you check this, everytime you want to start the config, you get a somewhat smaller version of the config page, letting you edit for example arguments and stuff.
Serves me quite well and yes, it is not fully what i need, but it does the job.
It's not supported at the moment, related requests:
IDEA-152268 User prompted values in run configuration for "VM options" and "Program arguments"
IDEA-74031 Variables in command line parameters of run configuration

Is it possible to create a list of tests to run in IntelliJ IDEA?

In Visual Studio each test and class with tests has an icon next to it that opens a dropdown to either run the tests, debug the tests or add them to a new test session. IntelliJ IDEA only has the options to run the tests or debug the tests.
Is there any way to create a list of tests from potentially disparate parts of the test suite then run them all in one go?
I'm using Junit 4 and if there's a plugin to do this, that would be satisfactory.
You can right click on a package (and/or a selection of packages) and then choose Run or Debug from the context menu.
Here's a screenshot showing that in action:
The resulting Run Configuration is then available via Run > Edit Configurations where you can edit/add/remove packages/classes from the selected pattern ...
You could also create a JUnit suite or category and let it contain your 'tests of interest' and then run it via IntelliJ's JUnit runner.

IntelliJ: Mapping running/debugging specific configurations to toolbar

Googling, searching this site and random experimentation yielded nothing, so here goes.
I'm working on a project containing different Maven projects where several of them need to run in order for the system to work. (Clients, servers, etc.) Launching them all individually is kind of inconvenient, but as this question suggests, there's no way to group them into a single configuration (nor does the situation seem to have changed since that answer).
Instead, I'm now wondering if it's possible to map running/debugging specific configurations to the toolbar, i.e. have a "Run Project 1" button, a "Debug Project 3-C" button, and so on instead of having to do the three-step process of opening the list, choosing a configuration and clicking run/debug for each needed component.
Does anyone know of a way to accomplish this?
You can't have multiple configurations at the toolbar, but I can suggest a better alternative for running multiple configurations at once.
In IDEA 12 it's possible to run another configuration in the Before launch section. So you just add all the other configurations you want to be started with the current one in Before launch steps, then run single configuration and get all of them launched. Note that you can run Maven goals from the same configuration:
As you've noted, it will not work if the configuration continues to run as it will wait for the command to finish.
I'm afraid there is no easier way to do it right now except probably using the keyboard shortcut for the run popup menu.
Here are the issues you should vote for:
IDEA-94341 Launch Multiple "Run/Debug Configurations" At Once
IDEA-69968 Add option to assign keyboard shortcut to Run/Debug configurations
IDEA-75078 Make it possible to create toolbar action for running specific run configurations