/** * Process StepStartedEvent. New step will be created and added to stepStorage. * * @param event to process */ public void fire(StepStartedEvent event) { Step step = new Step(); event.process(step); stepStorage.put(step); notifier.fire(event); }
/** * Process RemoveAttachmentsEvent. Remove * * @param event to process */ public void fire(RemoveAttachmentsEvent event) { Step step = stepStorage.getLast(); resultsHelper.deleteAttachments(step, event.getPattern()); event.process(step); notifier.fire(event); }
/** * Process MakeAttachmentEvent. Attachment will be written to results directory, and information * about it stored to current step. * * @param event to process */ public void fire(MakeAttachmentEvent event) { Step step = stepStorage.getLast(); Attachment attachment = resultsHelper.writeAttachmentSafely( event.getAttachment(), event.getTitle(), event.getType()); step.getAttachments().add(attachment); event.process(step); notifier.fire(event); }
/** * Process TestCaseStartedEvent. New testCase will be created and added to suite as child. * * @param event to process */ public void fire(TestCaseStartedEvent event) { // init root step in parent thread if needed stepStorage.get(); TestCaseResult testCase = testCaseStorage.get(); event.process(testCase); synchronized (TEST_SUITE_ADD_CHILD_LOCK) { testSuiteStorage.get(event.getSuiteUid()).getTestCases().add(testCase); } notifier.fire(event); }
/** * Process TestSuiteFinishedEvent. Using event.getUid() to access testSuite. Then remove this * suite from storage and marshal testSuite to xml using AllureResultsUtils.writeTestSuiteResult() * * @param event to process */ public void fire(TestSuiteFinishedEvent event) { String suiteUid = event.getUid(); TestSuiteResult testSuite = testSuiteStorage.remove(suiteUid); if (testSuite == null) { return; } event.process(testSuite); testSuite.setVersion(getVersion()); testSuite.getLabels().add(AllureUtils.createProgrammingLanguageLabel()); resultsHelper.writeTestSuite(testSuite); notifier.fire(event); }
/** * Process TestCaseFinishedEvent. Add steps and attachments from top step from stepStorage to * current testCase, then remove testCase and step from stores. Also remove attachments matches * removeAttachments config. * * @param event to process */ public void fire(TestCaseFinishedEvent event) { TestCaseResult testCase = testCaseStorage.get(); event.process(testCase); Step root = stepStorage.pollLast(); if (Status.PASSED.equals(testCase.getStatus())) { new RemoveAttachmentsEvent(config.getRemoveAttachmentsPattern()).process(root); } testCase.getSteps().addAll(root.getSteps()); testCase.getAttachments().addAll(root.getAttachments()); stepStorage.remove(); testCaseStorage.remove(); notifier.fire(event); }
/** * Experimental. Can be removed in next releases. * * <p>Add specified listener to notifier. * * @param listener to add * @see ru.yandex.qatools.allure.experimental.LifecycleListener * @since 1.4.0 */ public void addListener(LifecycleListener listener) { notifier.addListener(listener); }
/** * This method just clear current testCase context. * * @param event will be ignored */ @SuppressWarnings("unused") public void fire(ClearTestStorageEvent event) { testCaseStorage.remove(); notifier.fire(event); }
/** * This method just clear current step context. * * @param event will be ignored */ @SuppressWarnings("unused") public void fire(ClearStepStorageEvent event) { stepStorage.remove(); notifier.fire(event); }
/** * Process TestSuiteEvent. You can use this method to change current testSuite context. Using * event.getUid() to access testSuite. * * @param event to process */ public void fire(TestSuiteEvent event) { TestSuiteResult testSuite = testSuiteStorage.get(event.getUid()); event.process(testSuite); notifier.fire(event); }
/** * Process TestCaseEvent. You can change current testCase context using this method. * * @param event to process */ public void fire(TestCaseEvent event) { TestCaseResult testCase = testCaseStorage.get(); event.process(testCase); notifier.fire(event); }
/** * Process StepFinishedEvent. Change last added to stepStorage step and add it as child of * previous step. * * @param event to process */ public void fire(StepFinishedEvent event) { Step step = stepStorage.adopt(); event.process(step); notifier.fire(event); }
/** * Process any StepEvent. You can change last added to stepStorage step using this method. * * @param event to process */ public void fire(StepEvent event) { Step step = stepStorage.getLast(); event.process(step); notifier.fire(event); }