G
G
GordeyL2020-09-08 14:35:49
Java
GordeyL, 2020-09-08 14:35:49

I'm trying to run a test and I get the error No tests found for given includes: [en.stqa.pft.sandbox.SquareTests](filter.includeTestsMatching)?

I'm new.
There is a code:

package ru.stqa.pft.sandbox;

public class Square {
  public double l;
  public Square(double l) {
    this.l = l;
  }
  public  double area() {
    return this.l * this.l;
  }
}


I wrote a test for it:
package ru.stqa.pft.sandbox;


import org.testng.Assert;
import org.testng.annotations.Test;

public class SquareTests {
  @Test
  public void testArea(){
    Square s = new Square(5);
    Assert.assertEquals(s.area(), 25.0);
  }
}


build.gradle:
apply plugin: 'java'
apply plugin: 'application'
mainClassName = "MyFirstProgram"

repositories {
    mavenCentral()
}
dependencies {
    implementation 'org.testng:testng:7.3.0'
}


And gives an error:

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
> No tests found for given includes: [en.stqa.pft.sandbox.SquareTests](filter.includeTestsMatching)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Roo, 2020-09-08
@GordeyL

Need to add to build.gradle :

test {
      useTestNG()
  }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question