cucumber / cucumber-eclipse

Eclipse plugin for Cucumber
MIT License
190 stars 147 forks source link

Test class not found in selected project #434

Open utkarssh01 opened 3 years ago

utkarssh01 commented 3 years ago

Issue: Test class not found in selected project

Steps to recreate:

  1. Create a cucumber feature file.
  2. Create a Step Definitions file
  3. Create a Runner test file using Junit

But when I run the Runner file , it shows all tests are passed but when I click on any of the test it shows the error "Test class not found in selected project". image

For example Below is my feature file: Feature: Select Site <<< In order to Tableau select site As a user I want to choose a Tableau Site to generate reports

Scenario Outline: Verify if Tableau allows user to select a Site Given user navigates to Tableau Site Page When user validates the homepage title Then user will click on search box And user will enter the search string | | Then user user will select the site | | And user will successfully reach to home page Examples: | searchSite | selectSite | | Test1 | Test1 |

Below is my Step Definition file for the same <<< package StepDefinitions;

import io.cucumber.java.en.Given; import io.cucumber.java.en.Then;

public class SelectSiteStep { @Given("^user navigates to Tableau Site Page$") public void user_navigates_to_tableau_site_page() throws Throwable{ // Write code here that turns the phrase above into concrete actions System.out.println("user navigates to Tableau Site page"); }

@Then("^user will click on search box$")
public void user_will_click_on_search_box() throws Throwable{
    // Write code here that turns the phrase above into concrete actions
    System.out.println("user will click on search box");
}

@Then("^user will senter the search string$")
public void user_will_senter_the_search_string(String searchSite) throws Throwable{
    System.out.println("user will senter the search string "+searchSite);
}

@Then("^user user will select the site$")
public void user_user_will_select_the_site(String selectSite) throws Throwable{
    System.out.println("user user will select the site "+selectSite);
}

@Then("^user will succesfully reach to home page$")
public void user_will_succesfully_reach_to_home_page() throws Throwable{
    // Write code here that turns the phrase above into concrete actions

}

}

Below is my Test runner file <<< package com.web.automation.base;

import org.junit.runner.RunWith;

import io.cucumber.junit.Cucumber; import io.cucumber.junit.CucumberOptions;

@RunWith(Cucumber.class) @CucumberOptions ( features = {"src/test/java/Features"}, glue = {"StepDefinitions"}, monochrome = true, plugin={"junit:reports/junit/reports.xml",
"pretty:target/cucumber-pretty.text", "html:target/cucumber-html-report", "json:target/cucumber.json", "usage:target/cucumber-usage.json",}

) public class TestRunner {

}

Please let me know why I'm seeing that error "Test class not found in selected project".

aslakhellesoy commented 3 years ago

Can you please surround your code with triple bacticks (fenced code blocks)? I find this too hard to read.

mohdAslah commented 1 year ago

Hi @aslakhellesoy

I am new learner and also getting the same issue, not able to resolve. Please help me out

Rakesh993 commented 9 months ago

I am also getting the same issue if someone could help it would be great