Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to skip a particular test method from execution in Cucumber?
We can skip a particular test method from execution in Cucumber with the help of tagging of scenarios in the feature file.
Example
feature file.
@Regression Feature: Invoice Testing @Smoke Scenario: Login Verification Given User is in Home Page @Payment Scenario: Payment Testing Given User is in Payment Page
Feature file with scenarios having tags Smoke and Payment.
Example
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”}
)
To skip the scenarios with @Payment , ~ is placed before the @Payment tag in Test Runner file.
Advertisements