private void takeEndOfStepScreenshotFor(final TestResult result) { if (currentTestIsABrowserTest() && shouldTakeEndOfStepScreenshotFor(result)) { take(MANDATORY_SCREENSHOT, result); } }
public void notifyScreenChange() { if (currentTestIsABrowserTest() && screenshots().areAllowed(TakeScreenshots.FOR_EACH_ACTION)) { take(OPTIONAL_SCREENSHOT); } }
/** * A step within a test is called. * This step might be nested in another step, in which case the original step becomes a group of steps. * * @param description the description of the test that is about to be run */ public void stepStarted(final ExecutedStepDescription description) { pushStepMethodIn(description); recordStep(description); if (currentTestIsABrowserTest() && browserIsOpen()) { takeInitialScreenshot(); } }
public void testSuiteFinished() { closeDarkroom(); clearStorywideTagsAndIssues(); ThucydidesWebDriverSupport.clearStepLibraries(); if (this.currentTestIsABrowserTest()) { this.closeBrowsers.forTestSuite(this.testSuite).closeIfConfiguredForANew(RestartBrowserForEach.FEATURE); } suiteStarted = false; }
/** * A test has finished. * * @param outcome the result of the test that just finished. */ public void testFinished(final TestOutcome outcome) { recordTestDuration(); getCurrentTestOutcome().addIssues(storywideIssues); // TODO: Disable when run from an IDE getCurrentTestOutcome().addTags(storywideTags); if(currentTestIsABrowserTest()) { getCurrentTestOutcome().setDriver(getDriverUsedInThisTest()); } currentStepStack.clear(); }
/** * A test has finished. * * @param outcome the result of the test that just finished. */ public void testFinished(final TestOutcome outcome) { if (getTestOutcomes().isEmpty()) { return; } recordTestDuration(); getCurrentTestOutcome().addIssues(storywideIssues); // TODO: Disable when run from an IDE getCurrentTestOutcome().addTags(storywideTags); if (StepEventBus.getEventBus().isDryRun() || getCurrentTestOutcome().getResult() == IGNORED) { testAndTopLevelStepsShouldBeIgnored(); } if (currentTestIsABrowserTest()) { getCurrentTestOutcome().setDriver(getDriverUsedInThisTest()); updateSessionIdIfKnown(); closeBrowsers.forTestSuite(testSuite).closeIfConfiguredForANew(SCENARIO); } currentStepStack.clear(); }