SpecFlow / WebDriver .NET boilerplate
September 16, 2019 at 3:26 pm #1596
Hey, I recently did a presentation at my job about automated E2E tests, and part of that presentation was convincing other developers (on other projects) to start E2E tests on their own stuff. Because I’d already gone through the hassle of getting SpecFlow and WebDriver (via Ocaramba) working together, and knew that most people would stop when they realized there wasn’t a great out-of-the-box solution, I threw together a boilerplate project.
It’s a .Net 4.6.2 project with SpecFlow, WebDriver, Nunit, and a few other things, but it should be completely workable as is. There’s even a demo test to show that everything is working.
I’d love to get some feedback / buy-in on this. Thanks. 🙂
September 17, 2019 at 7:07 am #1597
September 20, 2019 at 11:46 am #1598
I am not so familiar with Ocaramba, but why don’t you use .NET Core which is the new standard instead of .NET Framework?
About page objects, I suggest defining the elements in properties. You can check some of the Automate The Planet articles about page object design pattern variations. https://www.automatetheplanet.com/category/series/designpatterns/
My preferred approach is using partial classes separating elements, methods, assertions.
Also, just using the name Google is meaningless for me. I would suggest adding the suffix Page to the name- GoogleMainPage, for example.
I would suggest not to couple page objects with ScenarioContext instead register the driver instance into the container and pass it to the constructor.
The part in the AfterTest method I would move it to a separate class. FailedLogService, for example.
Co-Founder and CTO Automate The Planet
Inventor Bellatrix Test Automation Framework
September 20, 2019 at 5:29 pm #1599
Thank you for the feedback, and I’ll definitely take it into consideration. 🙂 I would have preferred .Net Core, and I’ll should build another boilerplate that uses it, but my current job is a Department of Defense contractor and they have us locked to .Net Framework 4.6.2 or lower. It’s suuuuper frustrating.
You must be logged in to reply to this topic.