How do I mark tests as Passed/Skipped/Ignored in serenity?

1.3k views Asked by At

I keep getting phantomjs error - unreachablebrowserexception.

I want to mark the test as skipped or passed in the catch block of this managed exception. How do I do that?

1

There are 1 answers

0
JDelorean On

You can use JUnit's Assume class at the beginning of your test to mark the test as ignored/skipped based on a condition.

For example:

@Test
public void myTest() {

    Assume.assumeTrue(yourBooleanCondition);

    // continue your test steps...

}

You can read about its different applications here.

However, being able to mark a failed test as passed is against the test mantra and defeats the purpose of developing such code entirely. I do not know any framework that would allow you to do that. If you absolutely have to, my guess is to fiddle with the results.