Start single Serenity scenario from command line











up vote
0
down vote

favorite












My team received ownership of a webapp. Tests are written with junit suites and serenity. Good things, there a good test coverage. Problem come when you need to run that single test/scenario that is still failing and you need to wait >30min to run everything.



How can I run a single scenario of this suite using mvn command line?



From code editor, it's hard to start single scenario as both suite and test classes contains important initialization code.
I've also tried argument '-Dtest=T1Test#T1Scenario1' without success.



Code snipplet:



   @RunWith(Suite.class)
@Suite.SuiteClasses({
UserConfigASuite.class,
UserConfigBSuite.class,
UserConfigCSuite.class
})
public class AllTestSuite {
}

@RunWith(Suite.class)
@Suite.SuiteClasses({
T1Test.class,
T2Test.class,
//... Lots of other tests
})public class UserConfigASuite {
@BeforeClass
public static void beforeClass() {
//Required init code
}

@AfterClass
public static void afterClass() {
//Cleanup after test suite
}
}

@RunWith(SerenityRunner.class)
public class T1Test {

@Test
@Title("T1: scenario 1")
public void T1Scenario1() {

}

//... Lots of other scenarios
}









share|improve this question


























    up vote
    0
    down vote

    favorite












    My team received ownership of a webapp. Tests are written with junit suites and serenity. Good things, there a good test coverage. Problem come when you need to run that single test/scenario that is still failing and you need to wait >30min to run everything.



    How can I run a single scenario of this suite using mvn command line?



    From code editor, it's hard to start single scenario as both suite and test classes contains important initialization code.
    I've also tried argument '-Dtest=T1Test#T1Scenario1' without success.



    Code snipplet:



       @RunWith(Suite.class)
    @Suite.SuiteClasses({
    UserConfigASuite.class,
    UserConfigBSuite.class,
    UserConfigCSuite.class
    })
    public class AllTestSuite {
    }

    @RunWith(Suite.class)
    @Suite.SuiteClasses({
    T1Test.class,
    T2Test.class,
    //... Lots of other tests
    })public class UserConfigASuite {
    @BeforeClass
    public static void beforeClass() {
    //Required init code
    }

    @AfterClass
    public static void afterClass() {
    //Cleanup after test suite
    }
    }

    @RunWith(SerenityRunner.class)
    public class T1Test {

    @Test
    @Title("T1: scenario 1")
    public void T1Scenario1() {

    }

    //... Lots of other scenarios
    }









    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      My team received ownership of a webapp. Tests are written with junit suites and serenity. Good things, there a good test coverage. Problem come when you need to run that single test/scenario that is still failing and you need to wait >30min to run everything.



      How can I run a single scenario of this suite using mvn command line?



      From code editor, it's hard to start single scenario as both suite and test classes contains important initialization code.
      I've also tried argument '-Dtest=T1Test#T1Scenario1' without success.



      Code snipplet:



         @RunWith(Suite.class)
      @Suite.SuiteClasses({
      UserConfigASuite.class,
      UserConfigBSuite.class,
      UserConfigCSuite.class
      })
      public class AllTestSuite {
      }

      @RunWith(Suite.class)
      @Suite.SuiteClasses({
      T1Test.class,
      T2Test.class,
      //... Lots of other tests
      })public class UserConfigASuite {
      @BeforeClass
      public static void beforeClass() {
      //Required init code
      }

      @AfterClass
      public static void afterClass() {
      //Cleanup after test suite
      }
      }

      @RunWith(SerenityRunner.class)
      public class T1Test {

      @Test
      @Title("T1: scenario 1")
      public void T1Scenario1() {

      }

      //... Lots of other scenarios
      }









      share|improve this question













      My team received ownership of a webapp. Tests are written with junit suites and serenity. Good things, there a good test coverage. Problem come when you need to run that single test/scenario that is still failing and you need to wait >30min to run everything.



      How can I run a single scenario of this suite using mvn command line?



      From code editor, it's hard to start single scenario as both suite and test classes contains important initialization code.
      I've also tried argument '-Dtest=T1Test#T1Scenario1' without success.



      Code snipplet:



         @RunWith(Suite.class)
      @Suite.SuiteClasses({
      UserConfigASuite.class,
      UserConfigBSuite.class,
      UserConfigCSuite.class
      })
      public class AllTestSuite {
      }

      @RunWith(Suite.class)
      @Suite.SuiteClasses({
      T1Test.class,
      T2Test.class,
      //... Lots of other tests
      })public class UserConfigASuite {
      @BeforeClass
      public static void beforeClass() {
      //Required init code
      }

      @AfterClass
      public static void afterClass() {
      //Cleanup after test suite
      }
      }

      @RunWith(SerenityRunner.class)
      public class T1Test {

      @Test
      @Title("T1: scenario 1")
      public void T1Scenario1() {

      }

      //... Lots of other scenarios
      }






      java testing junit serenity-js






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 19 at 15:11









      Kbii

      8527




      8527
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          Just confirm first that your using supported surefire and junit version. For more details refer https://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html



          In case your using maven failsafe plugin then the syntax will vary little bit. Something like this



          mvn -Dit.test=ITCircle#test* verify



          Refer https://maven.apache.org/surefire/maven-failsafe-plugin/examples/single-test.html for more details.






          share|improve this answer





















          • Turn out it was a silly question. Using failsafe, -Dit.test was the right parameter. Thx.
            – Kbii
            13 hours ago











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53377534%2fstart-single-serenity-scenario-from-command-line%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted










          Just confirm first that your using supported surefire and junit version. For more details refer https://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html



          In case your using maven failsafe plugin then the syntax will vary little bit. Something like this



          mvn -Dit.test=ITCircle#test* verify



          Refer https://maven.apache.org/surefire/maven-failsafe-plugin/examples/single-test.html for more details.






          share|improve this answer





















          • Turn out it was a silly question. Using failsafe, -Dit.test was the right parameter. Thx.
            – Kbii
            13 hours ago















          up vote
          1
          down vote



          accepted










          Just confirm first that your using supported surefire and junit version. For more details refer https://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html



          In case your using maven failsafe plugin then the syntax will vary little bit. Something like this



          mvn -Dit.test=ITCircle#test* verify



          Refer https://maven.apache.org/surefire/maven-failsafe-plugin/examples/single-test.html for more details.






          share|improve this answer





















          • Turn out it was a silly question. Using failsafe, -Dit.test was the right parameter. Thx.
            – Kbii
            13 hours ago













          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          Just confirm first that your using supported surefire and junit version. For more details refer https://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html



          In case your using maven failsafe plugin then the syntax will vary little bit. Something like this



          mvn -Dit.test=ITCircle#test* verify



          Refer https://maven.apache.org/surefire/maven-failsafe-plugin/examples/single-test.html for more details.






          share|improve this answer












          Just confirm first that your using supported surefire and junit version. For more details refer https://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html



          In case your using maven failsafe plugin then the syntax will vary little bit. Something like this



          mvn -Dit.test=ITCircle#test* verify



          Refer https://maven.apache.org/surefire/maven-failsafe-plugin/examples/single-test.html for more details.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 22 at 15:06









          Satish

          320512




          320512












          • Turn out it was a silly question. Using failsafe, -Dit.test was the right parameter. Thx.
            – Kbii
            13 hours ago


















          • Turn out it was a silly question. Using failsafe, -Dit.test was the right parameter. Thx.
            – Kbii
            13 hours ago
















          Turn out it was a silly question. Using failsafe, -Dit.test was the right parameter. Thx.
          – Kbii
          13 hours ago




          Turn out it was a silly question. Using failsafe, -Dit.test was the right parameter. Thx.
          – Kbii
          13 hours ago


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53377534%2fstart-single-serenity-scenario-from-command-line%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Feedback on college project

          Futebolista

          Albești (Vaslui)