无法编写步骤定义错误?

时间:2019-07-27 11:39:03

标签: selenium cucumber cucumber-java

我正在尝试自动进行Rest API身份验证,但是我已经编写了功能文件,但是在步骤定义中却遇到了错误

我的代码是 功能文件:

adb logcat

这是跑步者

 Feature: Authentication with Bearer Token

    Scenario: Verify Parameter of Get
        Given I perform GET operation for "/posts"
        Then I should see verify GET Parameter

    @smoke
    Scenario: Verify GET Operation with bearer Authentication Token
        Given I perform authentication operation for "/auth/login" with body
            | userName | Password |
            | Test | abc@123  |
        Given I perform GET operation for "/post"
        And User enters <userName> and <Password> Then Message displayed Login Successfully

1 个答案:

答案 0 :(得分:0)

使用如下所示的方案大纲,如果仍然无法正常工作,请分享错误消息

@smoke
    Scenario Outline: Verify GET Operation with bearer Authentication Token
        Given I perform authentication operation for "/auth/login" with body

        Given I perform GET operation for "/post"
        And User enters <userName> and <Password> Then Message displayed Login Successfully
Examples:
 | userName | Password |
            | Test | abc@123  |