借助功能文件中场景的标记,我们可以跳过在Cucumber中执行的特定测试方法。
功能文件。
@Regression Feature: Invoice Testing @Smoke Scenario: Login Verification Given User is in Home Page @Payment Scenario: Payment Testing Given User is in Payment Page
具有方案的特征文件,其中方案具有标签烟和付款。
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import cucumber.api.testng.AbstractTestNGCucumberTests;
@RunWith(Cucumber.class)
@CucumberOptions(
features = “src/test/java/features”,
glue = “stepDefiniations”
tags = { “~@Payment”}
)要跳过使用@Payment的方案,在Test Runner文件中,在@Payment标记之前放置〜。