Cucumber scenarios for extremely long work flow

后端 未结 1 772
梦毁少年i
梦毁少年i 2021-02-15 14:32

We need to test a long process of steps for one Feature. From logging in to many modal dialogs, multi-step forms, and users of different roles all interacting. How can we break

1条回答
  •  太阳男子
    2021-02-15 14:58

    Scenarios are supposed to be self contained, so you can either create a setup Background process, that setups a basic manuscript that you can use in different scenarios:

    Feature: ...
      Background:
        Given a single manuscript exists
    
      Scenario: ...
    
      Scenario: ...
    
      Scenario: ...
    

    If you are really building on the previous step and are entirely dependent upon it, then create a single scenario:

    Scenario: Manuscript flow
      Given I am on the manuscripts page
      When I press "Submit A New Manuscript"
      Then I should see "Please specify this manuscript's type"
    
      Given I am choosing a manuscript type
      When I click "Original Paper"
      Then I should see "Edit Manuscript Details"
    
      Given I am editing manuscript details
      And I am on the editing page
      When I fill in "Manuscript Title" with "Testing Story"
      Then I should see "Suggest Reviewers"
    

    0 讨论(0)
提交回复
热议问题