Specflow, Blazor, and Test Studio

1 Answer 277 Views
General Discussions Test Execution
Kevin Tory
Top achievements
Rank 1
Kevin Tory asked on 28 Nov 2021, 01:41 PM
I do not see any posts regarding Specflow integration in the last 5 years, and I wanted a current answer. I am writing an application in Blazor, using Telerik components, with all my test cases written in Gherkin. Selenium integrates with Specflow, and I can call my test cases from Specflow as part of a fully automated regression test each time I build. However, I'd like to use Telerik Test Studio, as offers some advantages, but I still want to drive my testing from Specflow. A post from 7 years ago by Cody from Telerik said only the Telerik testing framework was compatible. Is this still true? My hope is I can use Test Studio to create the test cases, then integrate them with Specflow using a bit of code.  

1 Answer, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 01 Dec 2021, 12:00 PM

Hi Kevin,

i am not familiar with SpecFlow and Gherkin in depth. But as far as I know the Gherkin feature files are not to be executed as they are and require the so called bindings classes and methods to get the actual actions that the test will perform. These classes and methods can be defined in an external framework assemblies (like the Test Studio Testing one). 

On the other hand, Test Studio IDE is designed for end-to-end UI testing and as such tool it expects complete scenarios defined in a test. Of course, you can take out some specific and repeatable actions into test as steps but these are always executed as part of another test and in its context. The context of a test handles the browser process, for example, and keeps it for the whole run. 

So, where these two topics cross? When running the tests in SpecFlow, it is the tool which handles the overall process and the Gherkin bindings execute the actual test. If there is any approach in which you can call a Test Studio test from the command line, it will bring up its own context and will not the use the one defined from SpecFlow. This is the reason why only the Testing Framework can be implemented into the SpecFlow used in unit tests bound to the Gherkin feature files.

Having these notes in mind, the answer for your question is that there is no change in regards this topic. 

However, there are few useful things I can suggest. 

  • Blazor controls and Test Studio - the wrappers for the Telerik controls are also part of the Testing framework and you can use them in code. You can have a look on this blog post - although it talks about Kendo controls (not Blazor), the implementation and capabilities are similar. 
  • You can explore the option to convert complete recorded Test Studio tests into code. This option is available in the Test Studio plugin for Visual Studio - if you have a Visual Studio (Professional or higher) installed, the plugin is automatically installed. 
    Although these tests may require some additional adjustments, this can be helpful for you. 

I hope the provided information will be helpful for you to find the best approach for your automation. Let me know if there is anything else I can assist with. 

Thank you for your understanding and cooperation.

Regards,
Elena
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Test Studio course! Check it out at https://learn.telerik.com/.
Tags
General Discussions Test Execution
Asked by
Kevin Tory
Top achievements
Rank 1
Answers by
Elena
Telerik team
Share this question
or