首页 > 解决方案 > Cucumber Scenario Outline 只跑了一次,竟然有 3 个场景

问题描述

Feature: Test Log In Functionality

  Scenario: The user should be able to login with correct userName & Password
    Given user is on Login Page
    When user enters the correct UserName & Password
    Then user gets the Confirmation

  Scenario Outline: User should Log In with below credentials
    Given user is on Login Page
    When user enters the correct Email <UserName>
    And user enters the correct Password <Password>
    And user enters the Log In Button
    Then user gets the Confirmation

    Examples: 
      | UserName             | Password  |
      | shoryak3@outlook.com | Test@1234 |
      | tim@Testmail.com     | trpass    |
      | Rich@TestMail.com    | rwpass    |

标签: javaseleniumcucumbergherkin

解决方案


我已经快速检查了您的功能文件。我希望- .feature file:line 不是您的功能文件的一部分。如果它那么你会得到cucumber.runtime.CucumberException: gherkin.ParserException$CompositeParserException: Parser errors:

运行您的功能文件后,我可以看到它的工作绝对正常,没有任何问题。请参考下面的截图供您参考。尝试重新启动您的 intellij 并再次运行它

在此处输入图像描述


推荐阅读