Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No tasks available when executing JUnit runner class

I am trying to run Cucumber feature files in IntelliJ.

Cucumber Options is pointing to the right folder, but I get the "No tasks available" notification when trying to execute the JUnit runner class.

What am I doing wrong?

enter image description here

Here is my build.gradle:

plugins {     id 'java' }  sourceCompatibility = 1.8  apply plugin: 'java'  repositories {     mavenCentral() }  compileJava.options.encoding = "UTF-8"  dependencies {     compile 'org.codehaus.groovy:groovy-all:2.3.11'     testCompile group: 'junit', name: 'junit', version: '4.12'     testCompile 'io.cucumber:cucumber-java:4.7.1'     compile 'org.seleniumhq.selenium:selenium-server:2.44.0'     testImplementation 'io.cucumber:cucumber-java:4.7.1'     compile group: 'junit', name: 'junit', version: '4.12'     compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.141.59'     compile group: 'io.cucumber', name: 'cucumber-java', version: '4.7.1'     compile group: 'io.cucumber', name: 'cucumber-junit', version: '4.7.1'     compile group: 'io.cucumber', name: 'cucumber-core', version: '4.7.1'     compile group: 'net.masterthought', name: 'cucumber-reporting', version: '3.20.0'     compile group: 'io.cucumber', name: 'gherkin', version: '5.1.0'     compile group: 'info.cukes', name: 'cucumber-picocontainer', version: '1.2.5'     compile group: 'io.github.bonigarcia', name: 'webdrivermanager', version: '3.6.0' }  
like image 418
Mate Mrše Avatar asked Sep 12 '19 14:09

Mate Mrše


People also ask

How does the runner class access the JUnit test method?

A JUnit Runner is a class that extends JUnit's abstract Runner class and it is responsible for running JUnit tests, typically using reflection. The getDescription method is inherited from Describable and returns a Description that contains the information that is later being exported and may be used by various tools.

What is a runner class in Java?

The Runner class provides methods that interact with the runner. It is used by the runner, debugger, profiler, and code coach. Constructor Summary. Runner()


1 Answers

Ok, none of the proposed solutions worked, but I finally figured it out.

Went to Settings > Build, Execution, Deployment > Build Tools > Gradle and changed Run tests using: from Gradle (Default) to IntelliJ IDEA.

enter image description here

Note: found the solution here.

like image 69
Mate Mrše Avatar answered Sep 21 '22 05:09

Mate Mrše