Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
3.9k views
by The go-to Tester (181 points)
edited by

I have created a JUnit class with Cucumber annotations like this:

@CucumberOptions(features = {"src/main/java/apitest/feature/APIAuthentication"},
format = {"json:target/cucumber.json", "html:target/site/cucumber-pretty"},
glue = "apitest/steps",
plugin = {"pretty","html:reports/test-report"},
tags = {"@ApiTest"})
public class Runner extends AbstractTestNGCucumberTests{
}

Now src/main/java/apitest/feature contains 1-test case so 1-feature, so if 10 -test case then 10 -features
if i give src/main/java/apitest/feature in features = {"src/main/java/apitest/feature"} it is not picking the all the feature with its corresponding step


it says : None of the features at [src/main/java/apitest/feature] matched the filters: [@ApiTest]
0 Scenarios
0 Steps
0m0.000s

Here is my .feature file:

@Login
Feature:
In order to test the REST API TESTING
@ApiTest
Scenario: To test the Login functionality
Given User provides the credentials username and password to authenticate
When The user gets logged in assert the status code as 302
Then get the session id created for further usage

Kindly advise.

1 Answer

0 like 0 dislike
by The go-to Tester (222 points)

Your features location should be

src/main/java/apitest/feature

Also, it looks like the location of your step definition files mention in glue is wrong.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...