为什么“方案纲要”为我产生了新的步骤?

时间:2019-12-21 15:02:10

标签: java cucumber

我有以下 Gerkin 文件:

Feature: Create a new insurance contract.
  As a customer, I should be able to register for insurance.

  Scenario: The customer should be able to register for an insurance.
    Given I am in the starting page
    And The car is already insured
    And I want to have an insurance from today
    When I click on Weiter button
    Then It asks for the owner of the car
    And I am not the ownner of the car
    And the car is new when i purchase it
    When I click on Weiter
    Then It navigates to selectVehicle
    When I click on the "brand" of my car in the list
    Then I am asked to specify the model of my car in selectModel
    When I click on the "model" of my car
    Then I am asked to specify the body type of the car
    When I click on the "body type" of the car
    Then I am asked to specify the Fuel Type of the car
    When I select the "fuel"
    Then I am asked to specify the horse power of the car
    When I select the "power" of engine
    Then I am asked specify Engine
    When I select the "engine" of the car
    Then I am asked to specify the registeration date
    When I specify the registeration date
    Then I am asked to specify my birth date

  Scenario Outline: The customer should be able to register for an insurance.
    Given I am in the starting page
    And The car is already insured
    And I want to have an insurance from today
    When I click on Weiter button
    Then It asks for the owner of the car
    And I am not the ownner of the car
    And the car is new when i purchase it
    When I click on Weiter
    Then It navigates to selectVehicle
    When I click on the <brand> of my car in the list
    Then I am asked to specify the model of my car in selectModel
    When I click on the <model> of my car
    Then I am asked to specify the body type of the car
    When I click on the <body-type> of the car
    Then I am asked to specify the Fuel Type of the car
    When I select the <fuel>
    Then I am asked to specify the horse power of the car
    When I select the <engine-power> of engine
    Then I am asked specify Engine
    When I select the <engine> of the car
    Then I am asked to specify the registeration date
    When I specify the registeration date
    Then I am asked to specify my birth date

    Examples: 
      | brand | model | body-type | fuel   | engine-power    | engine              |
      | BMW   | 1er   | Cabrio    | Benzin | 105 kW / 143 PS | HSN: 0005, TSN: AMP |

我已经实现了此文件的步骤。

运行测试时,它首先运行Scenario,然后运行Scenario Outline。ُ因此,测试运行2次,同时我希望它只运行一次,并且只执行{ {1}},具有以下参数:

Scenario Outline

它也执行 | BMW | 1er | Cabrio | Benzin | 105 kW / 143 PS | HSN: 0005, TSN: AMP| (第二次尝试),但是它为我生成了新步骤,这很奇怪,因为这些步骤已经存在。

我的问题是:

  1. 不是只执行我的Scenario Outline吗?
  2. 如何解决此问题?
  3. 为什么找不到我的脚步?

0 个答案:

没有答案