Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serenity doesn't count tests when using SerenityParameterizedRunner without @Managed #179

Closed
dsmt opened this issue Nov 13, 2015 · 6 comments

Comments

@dsmt
Copy link

dsmt commented Nov 13, 2015

Sometimes you don't need webdriver. When it is omitted with SerenityRunner.class everything is Ok, but with SerenityParameterizedRunner.class the amount of tests in the report is always 1

@Managed
public WebDriver webdriver;
@YamStranger
Copy link
Member

Hello @dsmt!
Thanks for reporting us.

This issue should fixed under 1.1.22-rc.5 release.

Please close this issue, if all works for you.

Thanks!!!

@dsmt
Copy link
Author

dsmt commented Nov 19, 2015

@YamStranger, many thanks for your work!
I have checked this issue but unfortunately the defect can be reproduced under 1.1.22-rc.5 while 180 has been fixed

@YamStranger
Copy link
Member

Hello @dsmt.

Lets check that I get your point. For such purpose lets use our demo project.

To investigate your problem I done next:

  1. Clone it: [email protected]:serenity-bdd/serenity-demos.git
  2. navigate to junit-parameterized-tests.
  3. update version of serenity in gradle.build in this directory to use current version:
repositories {
    mavenLocal()
    jcenter()
}

ext{
    serenity_version = "1.1.22-rc.7"
}

buildscript {
    repositories {
        mavenLocal()
        jcenter()
    }
    dependencies {
        classpath("net.serenity-bdd:serenity-gradle-plugin:1.1.22-rc.7")
    }
}

apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "net.serenity-bdd.aggregator"

dependencies {
    compile localGroovy()
    compile "net.serenity-bdd:serenity-core:$serenity_version"
    compile "net.serenity-bdd:serenity-junit:$serenity_version"
    compile("net.serenity-bdd:serenity-rest-assured:$serenity_version")
    compile 'org.slf4j:slf4j-simple:1.7.12'
    compile 'org.codehaus.groovy:groovy-all:2.3.10'
    compile 'junit:junit:4.12'
    compile 'com.googlecode.lambdaj:lambdaj:2.3.3'
    compile 'org.assertj:assertj-core:3.1.0'
}

test {
    testLogging {
        showStandardStreams = true
    }
    /* Pass all system properties: */
    systemProperties System.getProperties()
}

task copyDeps(type: Copy) {
    from configurations.runtime
    into project.projectDir.path+"/lib"
}

gradle.startParameter.continueOnFailure = true
  1. run in this dir next command
gradle clean test aggregate

After this build executed, all reports should be under target dir.

According to current configuration next class executed:

@RunWith(SerenityParameterizedRunner.class)
@UserStoryCode("US01")
@Concurrent
public class SampleTest {
    @TestData
    public static Collection<Object[]> testData() {
        return Arrays.asList(new Object[][]{{1}, {2}, {3}});
    }

    @Steps
    TestSteps steps;
    private final int value;

    public SampleTest(int value) {
        this.value = value;
    }

    @Test
    public void shouldExecuteThisTest() {
        steps.initialization();
        steps.when_example_action_for(this.value);
        steps.then_example_result_should_be(this.value);
    }

    @Test
    public void shouldExecuteThisTestToo() {
        steps.initialization();
        steps.when_example_action_for(this.value);
        steps.then_example_result_should_be(this.value);
    }
}

This class contains two test and some amount of steps. All of them should be in report.

And here is page with tests and with steps
two_tests

two_tests_step_1

two_tests_step_2

@dsmt please help me investigate the problem, I not sure that I can reproduce it.

@dsmt
Copy link
Author

dsmt commented Nov 20, 2015

@YamStranger, it seems that I didn't describe the issue clear enough, so I just waste your time =(
Ok, here is the second try. In this issue I'm talking about information in the major block of the report. You can see screenshots which I included this time. Hope they will help. If they not I can do example project.



cliviu added a commit to cliviu/serenity-core that referenced this issue Nov 21, 2015
@cliviu
Copy link
Collaborator

cliviu commented Nov 21, 2015

I think it should be fixed now, please give it a spin :-)

wakaleo added a commit that referenced this issue Nov 24, 2015
@YamStranger
Copy link
Member

Hello @dsmt. This fix should be available under 1.1.22-rc.10.

Please check it, and if you fill that this problem resolved - please close this issue.

Thanks a lot!

@dsmt dsmt closed this as completed Nov 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants