Does the testing platform support SpecFlow async Tasks?

Async / Await support for Specflow steps => I would like to use SpecFlow with Aync Await Await functions for C #, Windows Phone 8, SpecFlow with MSTest can execute code using async / wait, but does not wait for results.

I changed BindingInvoker.cs and upgraded to .NET 4 to support asynchronous tasks, and now getting IOC does not initiate errors.

https://github.com/robfe/SpecFlow/commit/507368327341e71b2f5e2a4a1b7757e0f4fb809d

+7
windows-phone-8 specflow
source share
2 answers

The problem is that if I put something in the background thread, then in the test run mode, the main thread does not know about it, and it just goes to the next code fragment for exectue and checks the result, but the point value is not updated to this in the background thread. So it gives an incorrect statement. The way to deal with this problem is to make the main thread wait / sleep until the background work is completed. Example:

Dim caller As AsyncMethodHandler Dim result As IAsyncResult caller = New AsyncMethodHandler(AddressOf lcl_service.CreateSession) result = caller.BeginInvoke(parameter, Nothing, AddressOf AsyncCallback, Nothing) While Not result.IsCompleted Thread.Sleep(1) End While 
0
source share

Async support has already been added to SpecFlow and will be included in the text version. You can use the CI assembly to verify this.

See https://github.com/techtalk/SpecFlow/issues/542

0
source share

All Articles