citrus icon indicating copy to clipboard operation
citrus copied to clipboard

TestCaseMetaInfo.Status.DISABLED ignored

Open chokdee opened this issue 6 years ago • 6 comments

Citrus Version 2.7.4

Expected behavior Testcase isn't executed as it is when we are using the CitrusXmlTest annotation

Actual behavior Testcase is executed

Test case sample

public class Foo extends extends TestNGCitrusTestRunner {
  @CitrusTest
   @Test
   public void test() {
      status(TestCaseMetaInfo.Status.DISABLED);
   

Please, share the test case (as small as possible) which shows the issue

chokdee avatar Jun 10 '19 11:06 chokdee

Hi!

Please use the annotations provided from the respective test runner (TestNG, Junit4, Junit5).

E.g. @Test(enabled = false) For TestNG

BR, Sven

svettwer avatar Jun 10 '19 11:06 svettwer

Sure I can do, but still a bug. Otherwise you have to remove it from your API

chokdee avatar Jun 10 '19 11:06 chokdee

After a little research, I agree that this is a potential bug. :+1:

status(TestCaseMetaInfo.Status.DISABLED); is a supported feature according to the Test meta information documentation.

BR, Sven

svettwer avatar Jun 10 '19 11:06 svettwer

Confirmed for the runner using

    @Test
    @CitrusTest
    public void testGet() {
       status(TestCaseMetaInfo.Status.DISABLED);
       echo("foo");
    }

For the designer, the feature works as expected.

Nevertheless, I am pretty sure that this can not be fixed as the runner works completely different from the designer. The runner executes the test case immediately, while the designer just configures the Citrus test when the underlying test runner "executes" the test. After the configuration has been completed, the Citrus test designer starts executing the test case. To put it another way, in the moment the runner gets status(TestCaseMetaInfo.Status.DISABLED); the test execution has already been started.

So from my current perspective, status(TestCaseMetaInfo.Status.DISABLED); is a redundant feature to the underlying test runner capabilities and should be removed instead of being fixed.

BR, Sven

svettwer avatar Jun 10 '19 12:06 svettwer

@christophd @bbortt Hello, right now status() not work, right? What do you think about: [svettwer]: So from my current perspective, status(TestCaseMetaInfo.Status.DISABLED); is a redundant feature to the underlying test runner capabilities and should be removed instead of being fixed.

akuz0 avatar Sep 01 '22 08:09 akuz0

@akuz0 maybe rather remove for 4.0.0 and leave it to be for 3.x.x. would create a new issue (to remove the code) and add it to the 4.0.0 project.

bbortt avatar Sep 04 '22 10:09 bbortt