标签: gherkin

屏幕上可见的所有字段是否都应该在 Gherkin 中进行验证?

我们正在为我们的应用程序创建 Gherkin 功能文件,以创建可执行规范。目前我们的文件如下所示:

Given product <type> is found
    When the product is clicked
    Then detailed information on the product appears
    And the field text has a value
    And the field price has a value
    And the field buy is available
Run Code Online (Sandbox Code Playgroud)

and我们想知道验证字段在屏幕上是否可见的整个关键字列表是否是正确的方法,或者我们是否应该将其缩短为“验证输入”之类的内容。

bdd cucumber specflow gherkin

1
推荐指数
1
解决办法
1624
查看次数

从功能文件导航到步骤定义:任何插件

在 Visual Studio Cod 中,如何从功能导航到步骤定义。我们是否需要任何额外的插件或需要添加任何配置。我已经下载了 Cucumber (Gherkin) Full Support 插件,但仍然无法从 .feature 导航到步骤定义。

javascript selenium gherkin webdriver-io visual-studio-code

1
推荐指数
2
解决办法
7431
查看次数

我可以在场景描述中的When语句中放置'和'吗?(小黄瓜)

我可以在功能中放置这样的场景步骤:

When user enters Upload page, downloads template, fills it with data and then uploads it to system Then ...

或者也许我应该从上一步创建两个步骤?我想知道我应该严格遵守"和".

提前致谢!

unit-testing cucumber gherkin

0
推荐指数
1
解决办法
41
查看次数

Gherkin 中场景的灵活性。

我正在寻找允许构建更灵活场景的机制。

例如,对于测试数据库中记录是否存在的这两个非常相似的场景:

Scenario Outline: Testing query with 1 attribute with these 2 record in and another 2 out of result
  Given I'm connected to <db> database
  When I select <query> from database
  Then Result should contain fields:
    | <row>  |
    | <yes1> |
    | <yes2> |
  And Result should not contain fields:
    | <row> |
    | <no1> |
    | <no2> |

  Examples:
    | db | row   | yes1 | yes2 | no1  | no2  | query                                                            |
    | 1  | …
Run Code Online (Sandbox Code Playgroud)

oop bdd gherkin behat non-repetitive

0
推荐指数
1
解决办法
285
查看次数

Java Cucumber:如何从单个场景中的所有步骤中获取字符串参数值

我正在寻找一种方法来获取在每个步骤中传递的所有参数,然后再输入我的功能文件中每个方案的实际方案.

示例功能文件:

Feature: Login action
  Background:
    When "{login url}" is open

  Scenario: Registered user provides valid username and password
    Given user enters username "{username}" and password "test password"
    And user clicks on "btnLogin"
    Then user is logged in
Run Code Online (Sandbox Code Playgroud)

我想得到的参数:

  • {login url}
  • {用户名}
  • 密码
  • btnLogin

    到目前为止我尝试了什么:

    我尝试过使用一个常见的钩子,它将被我的所有场景自动使用:

    public class ScenarioHook {
    
        public ScenarioHook() {
        }
    
        @Before
        public void setupScenario(Scenario scenario) throws InterruptedException {
        //Here I am currently watching the {scenario} object and I can see all the …
    Run Code Online (Sandbox Code Playgroud)
  • cucumber gherkin feature-file cucumber-java

    0
    推荐指数
    1
    解决办法
    1万
    查看次数

    如何操纵场景执行的顺序

    我有一些功能可以使用Gherkin和Cucumber进行测试.问题是执行是随机的,例如,第一个场景是在页面上创建元素,第二个场景是寻找它们,第三个场景是移动它们,所有测试都崩溃,因为执行过程如下:nº9firts,那么8,然后是2,然后......

    我没有使用执行标签,或者如果我使用它们,我在"功能:"上面使用它来确保所有方案都在运行

    任何人都可以在这里带点光明?

    java selenium cucumber gherkin selenium-webdriver

    0
    推荐指数
    1
    解决办法
    157
    查看次数

    如何在 Cucumber ruby​​ 中实现数据表,我需要一个示例来同时使用特征文件中的数据表和示例

    我想知道如何在黄瓜红宝石中实现数据表?需要一个示例来同时使用特征文件中的数据表和示例。

    请提供带有这些及其实现文件的示例功能。

    ruby cucumber gherkin

    -4
    推荐指数
    1
    解决办法
    2967
    查看次数