简体   繁体   中英

Serenity test not running with Serenity Parameterized Runner

I am trying to run serenity test with parameterized runner,

@RunWith(SerenityParameterizedRunner.class)
public class CloneViewTest {
   
    String val;
    public CloneViewTest(String testData) {
        val = testData;
    }

    protected Actor james = Actor.named("James");
    @Managed
    protected WebDriver driver;

    @Before
    public void jamesCanBrowseTheWeb() {
        james.can(BrowseTheWeb.with(driver));
    }

    @TestData
    public Collection<Object[]> testdata() {
        return Arrays.asList(new Object[][]{
                {"cats"},
                {"dogs"},
                {"ferrets"},
                {"rabbits"},
                {"canaries"}
        });
        
    }

    @Test
    public void should_be_able_to_clone_views() {
        james.attemptsTo(Open.browserOn().the(Column_dictionaryPage.class));

    }
}

The problem is whenever is run this test using mvn clean verify Test is successful but no test is run. Also log shows skipping tests

[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ -Automation ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ -Automation ---
[INFO] Building jar: C:\Users\Hamza Y\IdeaProjects\-Assignment-Serenity-Screenplay\target\-Automation-1.0.0-SNAPSHOT.jar
[INFO]
[INFO] --- maven-failsafe-plugin:3.0.0-M5:integration-test (default) @ -Automation ---
[INFO]
[INFO] --- serenity-maven-plugin:2.3.4:aggregate (serenity-reports) @ -Automation ---
[INFO] Test results for 0 tests generated in 1.7 secs in directory: file:/C:/Users/Hamza%20Y/IdeaProjects/-Assignment-Serenity-Screenplay/target/site/serenity
/
[INFO] -----------------------------------------
[INFO]  SERENITY TESTS : SUCCESS
[INFO] -----------------------------------------
[INFO] | Tests executed         | 0
[INFO] | Tests passed           | 0
[INFO] | Tests failed           | 0
[INFO] | Tests with errors      | 0
[INFO] | Tests compromised      | 0
[INFO] | Tests pending          | 0
[INFO] | Tests ignored/skipped  | 0
[INFO] ------------------------ | --------------
[INFO] | Total Duration         | 000ms
[INFO] | Fastest test took      | 000ms
[INFO] | Slowest test took      | 000ms
[INFO] -----------------------------------------

Also as shown in log no test is executed, failed or skipped. What could be the problem here?

You have most likely the wrong class name. Given you are using the default config, verify will run tests with patterns like *IT.java https://maven.apache.org/surefire/maven-failsafe-plugin/examples/inclusion-exclusion.html

rename you class to CloneViewTestIT and try again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM