如何在黄瓜Java方案大纲中忽略用例

问题描述 投票:0回答:1
How to ignore the test case in Scenario Outline.

Feature File:

     @ignore
      Scenario Outline: Validation for Order_Summary Report in My_Account Application
        Given User land on Home paage post login
        When User Clicks on Order Summary Report and pass Order Summary Date "<SummaryDate>" for validation in My_Account Application
        And Order Summary Report should be opened in the New Tab
        Then Assertion for the Order Summary Report is performed

    Examples: 
      | SummaryDate |
      | 08/10/2019  |

Test Runner Class:

package Test_Runner;


import java.io.File;

import java.io.File;

import org.junit.AfterClass;
import org.junit.runner.RunWith;

import com.cucumber.listener.Reporter;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;


@RunWith(Cucumber.class)
//@Cucumber.Options(format = {"pretty", "html:target/Destination"})
//@Cucumber.Options(features="features")--> If in Case Feature file reside in Feature Directory
@CucumberOptions(features="Features",
glue={"Step_Defination"},
plugin={"json:target/cucumber.json","html:target/cucumber-pretty"},
tags ={"not @ignore"}) 

//plugin={""html:target/cucumber-html-report"","json:target/cucumber.json","pretty:target/cucumber-pretty.txt","pretty:target/cucumber-pretty.txt","usage:target/cucumber-usage.json","junit:target/cucumber-results.xml"}

public class testrunner {

        public static void teardown() {

        }

        }

It should skip the Scenario Outline Validation
selenium cucumber cucumber-java
1个回答
0
投票

您还需要输入标记名称为:来运行maven命令:>

cucumber --tags "not @ignore"

例如:

mvn install -Dcucumber.options="--tags @runThis --tags ~@ignore --format json-pretty:target/cucumber-report-myReport.json --format html:target/cucumber-html-report-myReport"

来源:

Maven running cucumber specific feature files or folders

How to ignore particular scenario in cucumber?

© www.soinside.com 2019 - 2024. All rights reserved.