add Before/AfterGroups methods to report by d-kay23 · Pull Request #386 · allure-framework/allure-java

Expand Up @@ -426,15 +426,15 @@ private void ifMethodFixtureStarted(final ITestNGMethod testMethod) { Current current = currentTestResult.get(); final FixtureResult fixture = getFixtureResult(testMethod); final String uuid = currentExecutable.get(); if (testMethod.isBeforeMethodConfiguration()) { if (isBeforeMethod(testMethod)) { if (current.isStarted()) { currentTestResult.remove(); current = currentTestResult.get(); } getLifecycle().startPrepareFixture(createFakeContainer(testMethod, current), uuid, fixture); }
if (testMethod.isAfterMethodConfiguration()) { if (isAfterMethod(testMethod)) { getLifecycle().startTearDownFixture(createFakeContainer(testMethod, current), uuid, fixture); } } Expand Down Expand Up @@ -487,7 +487,7 @@ public void afterInvocation(final IInvokedMethod method, final ITestResult testR } getLifecycle().stopFixture(executableUuid);
if (testMethod.isBeforeMethodConfiguration() || testMethod.isAfterMethodConfiguration()) { if (isBeforeMethod(testMethod) || isAfterMethod(testMethod)) { final String containerUuid = currentTestContainer.get(); validateContainerExists(getQualifiedName(testMethod), containerUuid); currentTestContainer.remove(); Expand Down Expand Up @@ -542,7 +542,8 @@ private boolean isSupportedConfigurationFixture(final ITestNGMethod testMethod) return testMethod.isBeforeMethodConfiguration() || testMethod.isAfterMethodConfiguration() || testMethod.isBeforeTestConfiguration() || testMethod.isAfterTestConfiguration() || testMethod.isBeforeClassConfiguration() || testMethod.isAfterClassConfiguration() || testMethod.isBeforeSuiteConfiguration() || testMethod.isAfterSuiteConfiguration(); || testMethod.isBeforeSuiteConfiguration() || testMethod.isAfterSuiteConfiguration() || testMethod.isBeforeGroupsConfiguration() || testMethod.isAfterGroupsConfiguration(); }
private void validateContainerExists(final String fixtureName, final String containerUuid) { Expand Down Expand Up @@ -810,4 +811,12 @@ private enum CurrentStage { TEST, AFTER }
private boolean isAfterMethod(ITestNGMethod testMethod) { return testMethod.isAfterMethodConfiguration() || testMethod.isAfterGroupsConfiguration(); }
private boolean isBeforeMethod(ITestNGMethod testMethod) { return testMethod.isBeforeMethodConfiguration() || testMethod.isBeforeGroupsConfiguration(); } }