Tomek
Tomek

Reputation: 741

Is this SpecFlow scenario correct?

This is my first more "complex" SpecFlow scenario written in Gherkin. Please provide me any feedback about it's quality:

Scenario: CompanyUpload
    Given admin (user) log in to admin-site
    When user enters Uploading page
    And user downloads Company Upload template
    And template is updated by script
    And user opens Company upload form
    And user fills it with proper data
    And user submit filled form
    Then new job should be added to the queue (visible in table form)
    And job status should be "In Queue" for not longer than 10 minutes
    And job status should be updated to "Processing" and shouldn't take more than 4 minutes
    And final job status should be "Succeeded"

This scenario is already coded with Selenium Webdriver actions. Now, I would like to cover it with SpecFlow to create acceptance tests library.

Upvotes: 0

Views: 117

Answers (1)

David Baak
David Baak

Reputation: 934

Features should focus on behavior not on implementation. So putting incidental detail in your features is not a good idea. In your example I'd say that your when steps are somewhat fragmented. Instead using 6 when steps to describe how the user uploads something, use one or two to describe what the user does. For instance.

When user uploads document using company upload template

Something like this describes the necessary detail but not more than that.

Upvotes: 3

Related Questions