getgauge / gauge-visualstudio

Visual Studio plugin for Gauge
10 stars 9 forks source link

Gauge.VisualStudio

Visual Studio plugin for Gauge - wires up Visual Studio features to Gauge.

Build status

Contributor Covenant

Deprecation Notice

VS Code has good support for .Net Core and the Gauge VS Code works great with the Gauge dotnet plugin. We are deprecating the Visual Studio Gauge plugin in favour of the Gauge VS Code plugin.

The Gauge team will stop addding new features to the Visual Studio Gauge plugin, only bug fixes will be done henceforth. The Gauge team will officially end support for Visual Studio 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

Installation

The extension resides on the Visual Studio Marketplace

install plugin

Creating a new Gauge Project

Install project and item templates from Visual Studio Marketplace

Create Gauge Project

ProjectCreation

This should setup a new Gauge project, and add the required meta data for Gauge to execute this project.

Alternately, you can create a Gauge project from command-line as:

    mkdir <project_name>
    cd <project_name>
    gauge init csharp

This creates <project_name>.sln file which can be opened with Visual Studio.

Syntax Highlighting

Gauge specs are in Markdown syntax. This plugin highlights Specifications, Scenarios, Steps and Tags.

Steps with missing implementation are also highlighted.

syntax highlighting

Auto Completion

This plugin hooks into VisualStudio Intellisense, and brings in autocompletion of Step text. The step texts brought in is a union of steps already defined, concepts defined, and step text from implementation.

Hint: Hit Ctrl + Space to bring up the Intellisense menu.

Auto Complete

Implement Step

If you have an unimplemented step in the spec file, it will be get highlighted with a red underline. Hover over towards the end of step text to get the Smart Tag to implement it. On clicking the Smart Tag a pop up opens. The destination of the implementation can be chosen, either a new class or from a list of existing classes. It will then generate the step with required annotation and parameters.

step quick fix

Navigation

Jump from Step text to it's implementation.

Usage: Right Click -> Go to Declaration or hit F12

Formatting

A specification file can be formatted easily using Right Click -> Format File Or use the command: Ctrl+K, Ctrl+D

This formats the specification including indentation of tables and steps.

Execution with Test Explorer

note: Refer MSDN Documentation on Unit Test Explorer` for all features of Unit Test Explorer.

When you build the test project, all the test scenarios appear in Test Explorer. If Test Explorer is not visible, choose Test on the Visual Studio menu, choose Windows, and then choose Test Explorer.

Test Explorer

Run tests

Run tests in parallel

If individual scenarios have no dependencies that prevent them from being run in any order, turn on parallel test execution with the |ute_parallel| toggle button on the toolbar.

If you want to use the parallel run of Gauge refer the command line parallel execution.

Test results

The pass/fail bar at the top of the Test Explorer window is animated as the scenarios run. At the conclusion of the run, the pass/fail bar turns green if all tests passed or turns red if any test failed.

As you run, write, and rerun your tests, Test Explorer displays the results in default groups of Failed Tests, Passed Tests, Skipped Tests and Not Run Tests. You can change the way Test Explorer groups your tests. You can perform much of the work of finding, organizing and running tests from the Test Explorer toolbar.

Test Explorer options

Traits

Groups of scenarios by specification, tags that are defined.

Search and filter the test list

This Test Explorer feature can be used as mentioned in Search and filter the test list of Visual Studio documentation.

Debugging

Debugging can be performed the same way spec execution works.

Right click -> Debug Selected Tests on a scenario(s) in the Test explorer. Execution will halt on marked breakpoints.

Rephrase Steps

Find Usages

Create Spec and Concept files

Create FileType

Development Environment Setup

Refer here for development setup.

License

Gauge.VisualStudio is released under Apache License 2.0

Copyright

Copyright - 2014, 2015 ThoughtWorks Inc.