mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Cucumber for Java: do not skip failed hooks when the tree of tests built
The fix creates a node for failed hook. IDEA-185206 Cucumber plugin seems not to include asserts of @After Hooks
This commit is contained in:
+15
-2
@@ -128,7 +128,14 @@ public class CucumberJvm2SMFormatter implements Formatter {
|
||||
|
||||
private static void handleTestStepFinished(TestStepFinished event) {
|
||||
if (event.testStep.isHook()) {
|
||||
return;
|
||||
if (event.result.getStatus() == FAILED) {
|
||||
outCommand(String.format(TEMPLATE_TEST_STARTED, getCurrentTime(), "", getStepName(event.testStep)));
|
||||
|
||||
outCommand(String.format(TEMPLATE_TEST_FAILED, getCurrentTime(), "",
|
||||
escape(event.result.getErrorMessage()), getStepName(event.testStep), ""));
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (event.result.getStatus() == PASSED) {
|
||||
// write nothing
|
||||
@@ -174,7 +181,13 @@ public class CucumberJvm2SMFormatter implements Formatter {
|
||||
}
|
||||
|
||||
private static String getStepName(TestStep step) {
|
||||
return escape(step.getStepText());
|
||||
String stepName;
|
||||
if (step.isHook()) {
|
||||
stepName = "Hook: " + step.getHookType().toString();
|
||||
} else {
|
||||
stepName = step.getStepText();
|
||||
}
|
||||
return escape(stepName);
|
||||
}
|
||||
|
||||
private static void outCommand(String s) {
|
||||
|
||||
Reference in New Issue
Block a user