java - JVM cucumber : Running multiple testcase on a single step definition

标签 java selenium testing cucumber-jvm

我在 jvm cucmber 中有如下场景

Given I have launched the <app_name> application page
And I fill out the <first_name> and <last_name> on the page
And I click Submit
And I am shown <message> on the <app_name> page based on <decision>
When I fill in username with value <username>
And I fill in password with value <password>
And I fill in confirmPassword with value <confirmPassword>
Then I should see the enroll button enabled for submission

在上述情况下,我只想提交一次申请,因为这非常耗时。仅提交后,我可以获得注册页面,因为它受 session token 限制。但在那之后,我想用不同的用户名、密码和确认密码集运行多个测试。在我们跨越特定的提交步骤定义之后是否可以进行多次测试运行。就像测试运行的循环。

最佳答案

使用示例运行具有多个测试值的相同功能。

Feature: Some test feature

    Background:
    Given I have launched the <app_name> application page
    And I fill out the <first_name> and <last_name> on the page
    And I click Submit
    And I am shown <message> on the <app_name> page based on <decision>


    Scenario Outline:
    When I fill in username with value "<username>"
    And I fill in password with value "<password>"
    And I fill in confirmPassword with value "<confirmPassword>"
    Then I should see the enroll button enabled for submission

    Examples:
    |username|password|confirmPassword|
    |usernam1|password1|password1|
    |usernam2|password2|password2|
    |usernam3|password3|password3|

来源:Software Automata

关于java - JVM cucumber : Running multiple testcase on a single step definition,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45465456/

相关文章:

java.lang.NoSuchMethodError : 'com. google.api.client.json.JsonParser

nhibernate - 如何测试直接使用NHibernate的服务层?

python - 使用和随机化代理

Python Selenium Firefox 驱动程序 - 禁用图像

android - 使用没有具体 Activity.class 的广播接收器进行集成测试

python - Selenium Firefox 驱动程序从主机文件读取

java - 如何在不扩展 JFrame 的情况下设置窗口大小?

java - Android : ColorPicker only showing one color, 和从调色板中选择错误的颜色

java - VSCode 找不到单元测试

java - webdriver 无法单击 Firefox 中的超链接