SpecFlow / WebDriver .NET boilerplate

Home Forum Automate The Planet Specflow SpecFlow / WebDriver .NET boilerplate

  • Author
    Posts
  • #1596
    Helpful
    Up
    0
    Down
    Not Helpful

    matneyx
    Participant
    @matneyx

    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.

    https://github.com/matneyx/SpecFlowOcarambaBoilerplate

    I’d love to get some feedback / buy-in on this.  Thanks. 🙂

  • #1597
    Helpful
    Up
    0
    Down
    Not Helpful

    aangelov
    Keymaster
    @anton1

    Hey,

    I cloned the repo and will look into it. I write here my comments. 🙂

  • #1598
    Helpful
    Up
    2
    Down
    Not Helpful

    aangelov
    Keymaster
    @anton1

    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.

     

    • #1599
      Helpful
      Up
      0
      Down
      Not Helpful

      matneyx
      Participant
      Participant
      @matneyx

      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.