Added failWhenEverythingSkipped command line option
This commit is contained in:
parent
a84a6fe9e2
commit
1fb81b4156
2 changed files with 17 additions and 0 deletions
|
@ -162,6 +162,14 @@ public class TestNgOperation extends AbstractProcessOperation<TestNgOperation> {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Should TestNG fail execution if all tests were skipped and nothing was run.
|
||||
*/
|
||||
public TestNgOperation failWhenEverythingSkipped(Boolean isFailAllSkipped) {
|
||||
options.put("-failwheneverythingskipped", String.valueOf(isFailAllSkipped));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether TestNG should continue to execute the remaining tests in the suite or skip them if in a {@code @Before*}
|
||||
* method.
|
||||
|
|
|
@ -105,6 +105,15 @@ class TestNgOperationTest {
|
|||
.doesNotThrowAnyException();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFailWheneverEverythingSkipped() {
|
||||
var op = new TestNgOperation().failWhenEverythingSkipped(false);
|
||||
assertThat(op.options.get("-failwheneverythingskipped")).isEqualTo("false");
|
||||
|
||||
op = new TestNgOperation().failWhenEverythingSkipped(true);
|
||||
assertThat(op.options.get("-failwheneverythingskipped")).isEqualTo("true");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFailurePolicy() {
|
||||
var op = new TestNgOperation().failurePolicy(TestNgOperation.FailurePolicy.CONTINUE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue