Intellij support for Gauge project.

Actions Status Contributor Covenant

Deprecation Notice

VS Code has good support for Java and the Gauge VS Code works great with the Gauge java plugin. We are deprecating the IntelliJ Gauge plugin in favour of the Gauge VS Code plugin.

The Gauge team will stop addding new features to the IntelliJ Gauge plugin, only bug fixes will be done henceforth. The Gauge team will officially end support for IntelliJ Gauge plugin in October 2020.

If you wish to take up owership of this plugin, please contact us. We would be happy to transfer the plugin ownwership.

Building from Source

> git clone [email protected]:getgauge/Intellij-Plugin.git
> cd Intellij-Plugin
> ./gradlew buildPlugin

The plugin zip will be available at build/distributions. Install the zip file from IntelliJ IDEA

Installation

Plugin can be installed by downloading from Jetbrains plugin repository.

Steps to install Gauge Intellij IDEA plugin from IDE:

Note: The plugin you have installed is automatically enabled. When necessary, you can disable it as described in Enabling and Disabling plugins.

To install plugin by downloading it manually or to update plugin, follow the steps here.

Create a new Gauge project and start writing your tests.

Explore all the features of Gauge Intellij IDEA plugin now!

Creating a Java project

Note: If gauge-java is not installed, it will download it for the first time.

java project creation

Maven project using gauge-maven-plugin

maven add archetype

maven add archetype

See gauge-maven-plugin for more details on using the gauge maven plugin.

Features

Syntax Highlighting

Specifications, Scenarios, Steps and Tags are highlighted. Steps with missing implementation are also highlighted.

syntax highlighting

Auto Completion

Steps present in the current project can be listed by invoking the auto completion pop up ctrl+space after the '*'.

step completion

Quick fix

step quick fix

Navigation

Usage: right Click -> Go to -> Declaration

Formatting

A specification file can be formatted easily using the keyboard shortcut of Spec Format in the action menu ctrl+shift+a.

This formats the specification including indentation of tables and steps.

Execution

Single Scenario Execution

A single scenario can be executed by doing a right click on the scenario which should be executed and choosing the scenario. right click -> run -> Scenario Name

.. note:: If the right click is done in context other than that of scenario, by default, first scenario will be executed.

scenario execution

Parallel Execution

To run multiple specifications in parallel

Select parallel nodes based on current systems performance. For example on a 2 core machine select upto 4 parallel streams. A very large number may affect performance.

Debugging

Debugging can be performed the same way spec execution works.

Run Configuration

You can edit the run configuration to make changes to:

- The scenario or spec file to be executed
- Choose table-rows to be executed
- The environment to run against
- Add a tag filter to the execution
- Choose the number of parallel streams
- Add program arguments (Example: --log-level)

run configuration

Multiple Spec Files Execution

To execute multiple specs/scenarios add || seperated list of spec/scenarios in Specification to execute section

multiple spec run configuration

The delimiter for multiple spec files in run config has been changed from comma (,) to double bar (||). Until v0.1.0 of IntelliJ plugin, the delimiter is ,. Any higher version will have delimiter ||.

Rephrase Steps

Find Usages

find usages

Extract Concept

The intellij idea gauge plugin comes with more features to simplify writing specifications.

Create Spec and Concept files

Spec creation

Templates

For example, to create a table with 4 columns type

table template fill

Then fill the column names in the template.

table template fill

spec heading enter

Then fill the specification name in the template.

spec heading fill

scenario heading enter

Then fill the scenario name in the template.

sce heading fill

HTML Preview

This is a spec file in markdown.

spec text

Press alt + F2 or right click and select open in Browser option. It gives option to choose a browser. On choosig a browser, it opens a browser window with HTML equivalent preview of spec file.

browser preview Since specs are written in markdown, they can be converted to HTML using any markdown to HTML convertors.

License

Apache License, Version 2.0

Copyright

Copyright (c) ThoughtWorks, Inc.