10 use Yandex\Allure\Adapter\AllureAdapter;
11 use Yandex\Allure\Adapter\Event\StepStartedEvent;
12 use Codeception\Event\SuiteEvent;
13 use Codeception\Event\StepEvent;
30 private function getGroup()
32 if ($this->options[
'groups'] !=
null) {
33 return $this->options[
'groups'][0];
46 $changeSuiteEvent = $suiteEvent;
48 if ($this->getGroup() !=
null) {
49 $suite = $suiteEvent->getSuite();
50 $suiteName = ($suite->getName()) .
"\\" . $this->sanitizeGroupName($this->getGroup());
53 function () use ($suite, $suiteName) {
54 $suite->name = $suiteName;
61 $changeSuiteEvent =
new SuiteEvent(
62 $suiteEvent->getSuite(),
63 $suiteEvent->getResult(),
64 $suiteEvent->getSettings()
68 parent::suiteBefore($changeSuiteEvent);
77 private function sanitizeGroupName(
$group)
80 $exactMatch = in_array(
$group, $suiteNames);
83 if ($exactMatch || strpos(
$group,
"_") ===
false) {
88 $groupNameSplit = explode(
"_",
$group);
89 array_pop($groupNameSplit);
90 $originalName = implode(
"_", $groupNameSplit);
93 $originalName = in_array($originalName, $suiteNames) ? $originalName :
$group;
106 $argumentsLength = 200;
107 $stepAction = $stepEvent->getStep()->getHumanizedActionWithoutArguments();
108 $stepArgs = $stepEvent->getStep()->getArgumentsAsString($argumentsLength);
110 if (!trim($stepAction)) {
111 $stepAction = $stepEvent->getStep()->getMetaStep()->getHumanizedActionWithoutArguments();
112 $stepArgs = $stepEvent->getStep()->getMetaStep()->getArgumentsAsString($argumentsLength);
115 $stepName = $stepAction .
' ' . $stepArgs;
117 $this->emptyStep =
false;
118 $this->getLifecycle()->fire(
new StepStartedEvent($stepName));
call_user_func($callable, $param)
stepBefore(StepEvent $stepEvent)
suiteBefore(SuiteEvent $suiteEvent)