Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Using async methods in SpecFlow step definitions

Background

SpecFlow supports using async methods as step definitions since version 2.2. Features requiring asynchronous execution can now be written in a more C#-ish style.

[Given("(.*)")]
public async Task GivenStep()
{
    await GetSomeTask();
}

Instead of writing your own state machine for awaiting tasks, SpecFlow has implemented this feature for you.

Async-Await example

This example shows how to implement a step definition which calls the HttpClient.GetAsync method.