首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >为:给定用户签出角色TestRole和auth testAut的用户而缺少的cypress黄瓜错误步骤实现

为:给定用户签出角色TestRole和auth testAut的用户而缺少的cypress黄瓜错误步骤实现
EN

Stack Overflow用户
提问于 2020-11-10 19:35:00
回答 1查看 245关注 0票数 0

我得到了柏树错误步骤实现,因为:给定的用户签出了角色TestRole和auth testAut的用户。

特征文件:

代码语言:javascript
运行
复制
Feature: Initial Test
    Scenario Outline: Test file to test feature files.
        Given User checks out user with role <role> and auth <aut>
        And User visit home page
        Then User click sign in link on the top right of the page

        Examples:
            | role    | aut   |
            | TestRole | testAut |

步骤定义文件:

代码语言:javascript
运行
复制
Given('User checks out user with role {string} and auth {string}', (role,aut) => {
    cy.log('Inside check out user step!!!!!')
})
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-11-11 13:35:35

{ string }是引号字符串的黄瓜表达式。因此,您可能需要在您的场景中编写

代码语言:javascript
运行
复制
Given User checks out user with role "<role>" and auth "<aut>"

你能试试吗?

另一种选择是将引号包含在表中,而不是:

代码语言:javascript
运行
复制
Examples:
            | role    | aut   |
            | TestRole | "testAut" |
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64775612

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档