如何在不对 Cucumber 中使用 Examples 的情况下执行单个数据参数化?
通过直接在要素文件中传递值,可以在不使用 Cucumber 中的 Examples 的情况下执行单个数据参数化。
示例
要素文件。
Feature: Tutorialpoint Job page Scenario: Tutorialpoint job page look and fee Given Launch site https://tutorialspoint.com/about/about_careers.htm Then Verify the tabs on the page
URL 直接在要素文件中的 Given 语句中传递。
步骤定义文件应包含 Given 语句的映射。
示例
@Given (“^Launch site \"([^\"]*)\"$”)
public void launchJobsite(String url){
System.out.println("url is : " + url);
}
@Then (“^Verify the tabs on the page"$”)
public void tabverification(){
System.out.println("Tabs verified successfully);
}@Given (“^启动站点 \"([^\"]*)\"$”)在运行时传递 UR。
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP