Prints step using provided printer.

@param Formatter  $formatter
@param Scenario   $scenario
@param StepNode   $step
@param StepResult $result
961073
public function printStep(Formatter $formatter, Scenario $scenario, StepNode $step, StepResult $result)
    {
        /** @var JUnitOutputPrinter $outputPrinter */
        $outputPrinter = $formatter->getOutputPrinter();

        $message = $step->getKeyword() . ' ' . $step->getText();

        if ($result instanceof ExceptionResult && $result->hasException()) {
            $message .= ': ' . $this->exceptionPresenter->presentException($result->getException());
        }

        $attributes = array('message' => $message);

        switch ($result->getResultCode()) {
            case TestResult::FAILED:
                $outputPrinter->addTestcaseChild('failure', $attributes);
                break;

            case TestResult::PENDING:
                $attributes['type'] = 'pending';
                $outputPrinter->addTestcaseChild('error', $attributes);
                break;

            case StepResult::UNDEFINED:
                $attributes['type'] = 'undefined';
                $outputPrinter->addTestcaseChild('error', $attributes);
                break;
        }
    }
1054991
private function getSteps(ScenarioInterface $scenario)
    {
        if (! $scenario->hasSteps()) {
            return;
        }

        $step = new Step($this->align);

        return $step->format($scenario->getSteps()) . "\n";
    }
261351
private function printTitle(OutputPrinter $printer, ExampleNode $example)
    {
        $printer->write(sprintf('%s%s', $this->indentText, $example->getTitle()));
    }
380869
protected function invokeStep(Step $step, Bootstrap $bootstrap)
    {
        $bootstrap->getSignalSlotDispatcher()->dispatch(__CLASS__, 'beforeInvokeStep', [$step, $this->identifier]);
        $identifier = $step->getIdentifier();
        $step($bootstrap);
        $bootstrap->getSignalSlotDispatcher()->dispatch(__CLASS__, 'afterInvokeStep', [$step, $this->identifier]);
        if (isset($this->steps[$identifier])) {
            foreach ($this->steps[$identifier] as $followingStep) {
                $this->invokeStep($followingStep, $bootstrap);
            }
        }
    }
883627
public function debug(&$rootDoc, $formatter)
    {

        $this->formatter = $formatter;

        foreach ($rootDoc->packages() as $package) {
            echo '- Namespace ', $package->name(), "\n";
            $this->fieldDoc($package->globals());
            $this->methodDoc($package->functions());
            $this->classDoc($package->allClasses());

        }

        echo "Done\n";

    }
983321
public function printStepList(OutputPrinter $printer, $intro, $resultCode, array $stepStats)
    {
        if (!count($stepStats)) {
            return;
        }

        $style = $this->resultConverter->convertResultCodeToString($resultCode);
        $intro = $this->translator->trans($intro, array(), 'output');

        $printer->writeln(sprintf('--- {+%s}%s{-%s}' . PHP_EOL, $style, $intro, $style));

        foreach ($stepStats as $num => $stepStat) {
            if ($stepStat instanceof StepStatV2) {
                $this->printStepStat($printer, $num + 1, $stepStat, $style);
            } elseif ($stepStat instanceof StepStat) {
                $this->printStat($printer, $stepStat->getText(), $stepStat->getPath(), $style, $stepStat->getStdOut(), $stepStat->getError());
            }
        }
    }
467372
async def step(self, step_id, session, scenario=None):
        
        if scenario is None:
            scenario = pick_scenario(self.wid, step_id)
        try:
            await self.send_event('scenario_start', scenario=scenario)

            await scenario['func'](session, *scenario['args'],
                                   **scenario['kw'])

            await self.send_event('scenario_success', scenario=scenario)

            if scenario['delay'] > 0.:
                await cancellable_sleep(scenario['delay'])
            return 1
        except Exception as exc:
            await self.send_event('scenario_failure',
                                  scenario=scenario,
                                  exception=exc)
            if self.args.verbose > 0:
                self.console.print_error(exc)
                await self.console.flush()

        return -1
1277886
function(deferred, description) {

      // The results from the previous steps are given as additional arguments to this method.
      // If the result is a single `StepArgs` object (such as returned by `#success`),
      // the multiple results it contains are spread over the arguments of the next step's function.
      // This is what allows a step to pass multiple results to the next step even though
      // a promise can only be resolved with one value.
      var results = slice.call(arguments, 2);
      if (results.length == 1 && results[0] instanceof StepArgs) {
        results = results[0].args;
      }

      if (this.stepSkipped) {
        // **EVENT:** the `step:skip` event is emitted if the step was skipped.
        // The first argument is the step description object, the second argument
        // is the skip message, and remaining arguments are the results that will be
        // passed to the next step.
        this.emit.apply(this, [ 'step:skip', description, this.skipMessage ].concat(results));
      } else {
        // **EVENT:** the `step:done` event is emitted otherwise.
        // The first argument is the step description object, and remaining arguments
        // are the results that will be passed to the next step.
        this.emit.apply(this, [ 'step:done', description ].concat(results));
      }

      var nextStep = this.getNextStep();

      // The scenario is stopped if there are no more steps to run or if it was marked as completed.
      if (!nextStep || this.completed) {

        // **EVENT:** the `scenario:end` event is emitted when the scenario has finished running.
        this.emit('scenario:end');

        return deferred.resolve();
      }

      // The next step is run with the results from the previous step as arguments.
      this.runStep.apply(this, [ nextStep, deferred ].concat(results));
    }
227231
public function calculateStepWidth(StepNode $step, $indentation)
    {
        $indentText = str_repeat(' ', intval($indentation));

        $text = sprintf('%s%s %s', $indentText, $step->getKeyword(), $step->getText());

        return mb_strlen($text, 'utf8');
    }
177854
private static function inFuture($step, CheckoutStepController $controller)
    {
        $currentStep = $controller->getURLParams()['Action'];
        return self::getStepIndex($step) > self::getStepIndex($currentStep);
    }
361909
@Override
	public void formatTo(Formatter formatter, int flags, int width, int precision) {
		formatNodeTo(formatter, 0, root);	
	}
985476
private function printBeforeAfterTasks(array $tasks, $applicationName, $task, $step, &$output)
    {
        $label = $applicationName === '_' ? 'for all applications' : 'for application ' . $applicationName;
        if (isset($tasks[$step][$applicationName][$task])) {
            // 'Task "' . $beforeTask . '" before "' . $task
            foreach ($tasks[$step][$applicationName][$task] as $beforeAfterTask) {
                $output .= '          <success>Task ' . $beforeAfterTask . ' ' . $step . ' ' . $task . '</success> <info>(' . $label . ')</info>' . PHP_EOL;
            }
        }
    }
599168
private function printExamplesSteps(Formatter $formatter, OutlineNode $outline, array $steps)
    {
        foreach ($steps as $step) {
            $this->stepPrinter->printStep($formatter, $outline, $step, new UndefinedStepResult());
        }

        $formatter->getOutputPrinter()->writeln();
    }
1030043
function(deferred, description, err) {

      // **EVENT:** the `step:error` event is emitted with the step description object and the error message if a step fails.
      this.emit('step:error', description, err);

      // **EVENT:** the `scenario:error` event is emitted with the error message if the scenario is interrupted.
      this.emit('scenario:error', err);

      deferred.reject(err);
    }
575427
public function setFormatter(FormatterInterface $formatter)
    {
        foreach ($this->results as $name) {
            $this->columns->offsetGet($name)->setFormatter($formatter);
        }

        return $this;
    }
1219113
public void startStep(final String parentUuid, final String uuid, final StepResult result) {
        notifier.beforeStepStart(result);

        result.setStage(Stage.RUNNING);
        result.setStart(System.currentTimeMillis());

        threadContext.start(uuid);

        storage.put(uuid, result);
        storage.get(parentUuid, WithSteps.class).ifPresent(parentStep -> {
            synchronized (storage) {
                parentStep.getSteps().add(result);
            }
        });

        notifier.afterStepStart(result);
    }
1009889
public function standard(&$rootDoc, $formatter)
    {

        // set doclet options
        $this->_rootDoc =& $rootDoc;
        $phpdoctor =& $rootDoc->phpdoctor();
        $options =& $rootDoc->options();

        $this->formatter = $formatter;

        if (isset($options['d'])) {
            $this->_d = $phpdoctor->makeAbsolutePath($options['d'], $phpdoctor->sourcePath());
        } elseif (isset($options['output_dir'])) {
            $this->_d = $phpdoctor->makeAbsolutePath($options['output_dir'], $phpdoctor->sourcePath());
        } else {
            $this->_d = $phpdoctor->makeAbsolutePath('apidocs', $phpdoctor->sourcePath());
        }
        $this->_d = $phpdoctor->fixPath($this->_d);

        if (is_dir($this->_d)) {
            $phpdoctor->warning('Output directory already exists, overwriting');
        } else {
            mkdir($this->_d);
        }
        $phpdoctor->verbose('Setting output directory to "'.$this->_d.'"');

        if (isset($options['windowtitle'])) $this->_windowTitle = $options['windowtitle'];
        if (isset($options['doctitle'])) $this->_docTitle = $options['doctitle'];
        if (isset($options['header'])) $this->_header = $options['header'];
        if (isset($options['footer'])) $this->_footer = $options['footer'];
        if (isset($options['bottom'])) $this->_bottom = $options['bottom'];

        if (isset($options['tree'])) $this->_tree = $options['tree'];

        if (isset($options['include_source'])) $this->_includeSource = $options['include_source'];
        if ($this->_includeSource) {
            @include_once 'geshi/geshi.php';
            if (!class_exists('GeSHi')) {
                $phpdoctor->warning('Could not find GeSHi in "geshi/geshi.php", not pretty printing source');
            }
        }

        // write frame
        $frameOutputWriter =& new frameOutputWriter($this);

        // write overview summary
        $packageIndexWriter =& new packageIndexWriter($this);

        // write package overview frame
        $packageIndexFrameWriter =& new packageIndexFrameWriter($this);

        // write package summaries
        $packageWriter =& new packageWriter($this);

        // write package frame
        $packageFrameWriter =& new packageFrameWriter($this);

        // write classes
        $classWriter =& new classWriter($this);

        // write global functions
        $functionWriter =& new functionWriter($this);

        // write global variables
        $globalWriter =& new globalWriter($this);

        // write index
        $indexWriter =& new indexWriter($this);

        // write deprecated index
        $deprecatedWriter =& new deprecatedWriter($this);

        // write todo index
        $todoWriter =& new todoWriter($this);

        // write source files
        if ($this->_includeSource) {
            $sourceWriter =& new sourceWriter($this);
        }

        // copy stylesheet
        $phpdoctor->message('Copying stylesheet');
        copy($phpdoctor->docletPath().'stylesheet.css', $this->_d.'stylesheet.css');

    }