Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I want to run each .feature file as single TestNG test using Karate?

Tags:

karate

I want to run each .feature file as single TestNG test using Karate, how can I do it?

We are using karate to automate REST API's. We have custom listener which will record status of each TestNG test and other information to postgress DB.

like image 896
Sayed Avatar asked Nov 29 '25 07:11

Sayed


1 Answers

One more way running by tags:

@CucumberOptions(tags = { "@getVersion" })
public class GetVersionTest extends KarateRunner {

}

Feature File:

@getVersion
Feature: Testing Rest API with Karate and Java

  Scenario: 
    Given url 'https://......'
    When method get
    Then status 200
    And match response contains '{version= x.xx.x}'
like image 61
Nael Marwan Avatar answered Dec 02 '25 01:12

Nael Marwan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!