Visual Studio plugin for Gauge - wires up Visual Studio features to Gauge.
- Open Visual Studio Extension Manager from
Extensions and Updates.
- Go to
Visual Studio Galleryand search for
- Click on
- Restart Visual Studio in order for the changes to take effect.
The extension resides on the Visual Studio Marketplace
Creating a new Gauge Project
Install project and item templates from Visual Studio Marketplace
- Download the templates from Visual Studio Marketplace.
- Install the Gauge VisualStudio Templates - vsix
Create Gauge Project
- Go to
Gauge Test Projectunder Visual C# Test category.
- Choose the Project location and Project Name.
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
<project_name>.sln file which can be opened with Visual
Gauge specs are in Markdown syntax. This plugin highlights Specifications, Scenarios, Steps and Tags.
Steps with missing implementation are also highlighted.
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.
Ctrl + Space to bring up the Intellisense menu.
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.
Jump from Step text to it's implementation.
Right Click ->
Go to Declaration or hit F12
A specification file can be formatted easily using
Right Click ->
Or use the command:
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.
- To run all the scenarios in a solution, choose Run All.
- To run all the scenarios of a specification, choose Run... and then choose the group on the menu.
- To run one or more scenarios, select the individual scenarios that you want to run, open the context menu for a selected scenario and then choose Run Selected 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.
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.
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 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.
Renameon a step to rephrase it.
- The parameters can also be reordered,removed or new parameters can be added.
- The rephrase change will reflect across all the specs in the project.
- Right click on a step -> Find All References
Create Spec and Concept files
- You can right-click on
specsdirectory or any nested directory, choose
New Item-> Go to
Visual C# Items.
- Enter file name and click
Development Environment Setup
- Use BoxStarter to setup Windows box.
- Install Windows
- Hit http://bit.ly/20pMrXY from Internet Explorer/Edge.
- Install Visual Studio and Resharper separately (You could consider installing from an ISO).
Gauge.VisualStudio is released under Apache License 2.0
Copyright - 2014, 2015 ThoughtWorks Inc.