KeywordEngine 1.0.1
dotnet add package KeywordEngine --version 1.0.1
NuGet\Install-Package KeywordEngine -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="KeywordEngine" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add KeywordEngine --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: KeywordEngine, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install KeywordEngine as a Cake Addin #addin nuget:?package=KeywordEngine&version=1.0.1 // Install KeywordEngine as a Cake Tool #tool nuget:?package=KeywordEngine&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
KeywordEngine
The KeywordEngine is a keyword driven framework execution engine for automation test cases. It can easily integrate with any C# unit testing frameworks like Nunit,XUnit, and MSTest.
At a glance:
- Compatible with .NET Core 6+.
- Support any C# unit testing frameworks like Nunit,XUnit, and MSTest.
- Doesn't depend on other packages (No dependencies beyond standard base libraries).
- Map parameters to scalar types, including
Enums
,Guid
,datetimeoffset
and Nullable scalar types,Enums
,datetimeoffset
andGuid
. - Support addition keyword data/parameters with the help of
ITestContext
interface. - Automatically ignore unused and additional provided parameters.
- Support custom DependencyInjection to resolve the keyword dependencies with the help of
IDependencyResolver
interface. - Default parameters parser has
InvariantCulture
.
Quick Start Example:
using System;
using KeywordEngine.Core;
using KeywordEngine.Test.Keywords;
using KeywordEngine.Abstraction;
using KeywordEngine.Models;
// Create keywords
internal class MyFirstActionKeyword : IActionKeyword
{
private readonly string _message;
public MyFirstActionKeyword(string message)
{
_message = message;
}
public Task<KeywordResponse> Execute()
{
Console.WriteLine(_message);
Console.WriteLine($"{nameof(MyFirstActionKeyword)} keyword executed.");
return Task.FromResult(new KeywordResponse
{
Status = ResponseStatus.Executed,
Message = $"{nameof(MyFirstActionKeyword)} keyword executed."
});
}
}
internal class MyFirstVerifyKeyword : IVerifyKeyword
{
public MyFirstVerifyKeyword()
{
}
public Task<KeywordResponse> Execute()
{
Console.WriteLine($"{nameof(MyFirstVerifyKeyword)} keyword executed.");
return Task.FromResult(new KeywordResponse
{
Status = ResponseStatus.Executed,
Message = $"{nameof(MyFirstVerifyKeyword)} keyword executed."
});
}
}
// Create test steps data
var test = new TestCase
{
Id = 1,
Title = "Demo test",
Steps = new List<TestStep>
{
new TestStep
{
Title="first step",
Keyword=nameof(MyFirstActionKeyword),
Index=0,
Parameters=new List<Parameter>
{
new Parameter
{
Name="message",
Value="Hello"
}
}
},
new TestStep
{
Title="second step",
Keyword=nameof(MyFirstVerifyKeyword),
Index=1,
Parameters=new List<Parameter>()
}
}
};
// Import all keywords
var testRunner = new TestCaseRunner(Module.Export(typeof(MyFirstActionKeyword).Assembly));
// Eexecute test
var response = await testRunner.Execute(test);
Other examples:
For more examples and use cases please check test.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.