本文整理匯總了Java中cucumber.api.Scenario.getName方法的典型用法代碼示例。如果您正苦於以下問題:Java Scenario.getName方法的具體用法?Java Scenario.getName怎麽用?Java Scenario.getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cucumber.api.Scenario
的用法示例。
在下文中一共展示了Scenario.getName方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateTestDetails
import cucumber.api.Scenario; //導入方法依賴的package包/類
/**
* This method captures the GroupName, TestID and TestDescription details of each testcase under execution
* @param scenario
*/
private void updateTestDetails(Scenario scenario){
String featureScenario = scenario.getName();
for(String tag : scenario.getSourceTagNames()){
groupName = groupName + " " + tag.substring(0);
System.out.println("Tag: " + tag);
}
if (featureScenario.contains("<") && featureScenario.contains(">")){
this.testID = featureScenario.substring(
featureScenario.indexOf("<") + 1,
featureScenario.indexOf(">"));
this.testDescription = featureScenario.substring(0, featureScenario.indexOf("<"));//starting from index 1 to skip @ sign of tags
}
System.out.println("Complete Scenario is :-" +featureScenario);
System.out.println("Test Description is:- "+ this.testDescription);
System.out.println("Group Name is:- "+ this.groupName);
System.out.println("============================================================================================");
}
示例2: takeScreenshot
import cucumber.api.Scenario; //導入方法依賴的package包/類
@After
public void takeScreenshot(final Scenario scenario) {
if (scenario.isFailed() && webDriver instanceof TakesScreenshot) {
final String scenarioName = scenario.getName();
takeScreenshot(scenarioName, (TakesScreenshot) webDriver);
}
}
示例3: logScenarioComplete
import cucumber.api.Scenario; //導入方法依賴的package包/類
private void logScenarioComplete(Scenario scenario) {
String scenarioFinished = "\n" +
"\n--------------------------------------------------------------------------------------------\n" +
"\tScenario: '" + scenario.getName() + "'\n" +
"\tRunning on Device ID: '" + config.getProperty(KEYS.ID.name()) + "'\n" +
"\t\tStatus: '" + scenario.getStatus() + "'" +
"\n--------------------------------------------------------------------------------------------\n" +
"\n";
info(logger, scenarioFinished);
}
示例4: ScenarioDTO
import cucumber.api.Scenario; //導入方法依賴的package包/類
public ScenarioDTO(Scenario scenario) {
status = scenario.getStatus();
sourceTagNames = new ArrayList<String>(scenario.getSourceTagNames());
failed = scenario.isFailed();
name = scenario.getName();
}