Windows | Linux / OS X (Mono) |
---|---|
This project adds C# language plugin for gauge.
This plugin is deprecated because Microsoft is ending support for .NET Framework. Refer https://devblogs.microsoft.com/dotnet/net-core-is-the-future-of-net.
Please use the Gauge Dotnet plugin instead.
Gauge-CSharp plugin uses and relies on Microsoft .NET framework for execution. Gauge-Dotnet plugin relies on .NET Core.
In order to port your .NET Framework project to .NET Core, please refer to this guide: https://docs.microsoft.com/en-us/dotnet/core/porting/
Additionally, you'll need to point your gauge project to use gauge-dotnet runner.
This can be done by editing the manifest.json
file located in the project root location.
- Open
manifest.json
in any text editor. - Locate the line with text:
"Language": "csharp",
- Change the located line to
"Language": "dotnet",
- Save the file
Now you should be able to run your project using gauge-dotnet
plugin.
Note that you'll have to ensure that the project file (.csproj) and it's structure meet the recommendations of .NET Core.
- Install Gauge
- .NET Framework - 4.5 and above
gauge install csharp
gauge init csharp
gauge run specs
- Installing specific version
gauge install csharp --version 0.10.1
- Download the plugin from Releases
gauge install csharp --file gauge-csharp-0.10.1.zip
The plugin is authored in C#. Gauge is authored in golang. These are independent processes talking to each other over TCP on port GAUGE_INTERNAL_PORT (env variable) using Protobuf.
Apart from Gauge and [.NET Framework], you will need
- 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).
For building and unit testing you only need mono.
Lib
is a dll that brings in Gauge's data types to C#. It is hosted in Nuget.
Read more about Lib
here.
Core
is a dll that brings in Gauge's API and connection to C#, and also holds the protobuf communication code. It is hosted in Nuget, and is not listed in the search results. This package is used by Lib
and Runner
only.
Read more about Core
here.
Runner
is an executable that is invoked by Gauge Core. The Runner
acts a bridge between C# test code and Gauge's API.
Read more about Runner
here.
This is a submodule of the repository https://github.com/getgauge/gauge-proto
. This repository holds the .proto
files that act as contracts between Gauge and the plugins. This submodule needs to be fetched to generate the protobuf classes.
The Lib is a reference that you can add to your test project, as you would do with any Nuget package.
You will need Gauge and Gauge-csharp plugin installed before installing Lib
.
On mono:
./build.sh CopyBinaries
On Windows
build.cmd CopyBinaries
Update the submodule and run the gen-proto
command:
git submodule update
run.bat gen-proto
On mono:
./build.sh RunTests
On Windows
build.cmd RunTests
For running functional tests
- gauge
- java 1.8
- maven
Choose from the below targets (whichever is applicable)
Target | Purpose |
---|---|
FunctionalTests |
Runs all functional tests without unimplemented tag |
FunctionalTestsP |
Same as FunctionalTests but runs in parallel |
FunctionalTestsUnimplemented |
Runs all functional tests with unimplemented tag, ideally these should fail |
FunctionalTestsPUnimplemented |
Same as FunctionalTestsUnimplemented but runs in parallel |
BuildInstallFT |
Builds, runs Unit and Integration tests, installs Gauge-CSharp from artifact, and triggers FunctionalTestsP |
On mono:
./build.sh <target>
On Windows:
build.cmd <target>
On mono:
./build.sh Package
On Windows:
build.cmd Package
All artifacts are genereated in .\artifacts
folder.
- The plugin is zipped to
artifacts/gauge-csharp/gauge-csharp-<runner-version>.zip
, where<runner-version>
is from top ofCHANGELOG.md
file. - The Lib Nuget package is put at
artifacts/gauge-csharp-lib/Gauge.CSharp.Lib.<lib-version>.nupkg
, where<lib-version>
is from top ofLib/CHANGELOG.md
file. - The Core Nuget package is put at
artifacts/gauge-csharp-core/Gauge.CSharp.Core.<core-version>.nupkg
, where<core-version>
is from top ofCore/CHANGELOG.md
file.
Zip distribution in artifacts/gauge-csharp/gauge-csharp-<runner-version>.zip
can be created with
On mono:
./build.sh Zip
On Windows
build.cmd Zip
To install a local version of the plugin, choose from the below targets (whichever is applicable)
Target | Purpose |
---|---|
Install |
Installs Runner from generated Artifact |
ForceInstall |
Same as Install , but removes conflicting version if already installed |
On mono:
./build.sh <target>
On Windows:
build.cmd <target>
Gauge-csharp is released under GNU Public License version 3.0
Copyright 2019 ThoughtWorks, Inc.