Skip to content

Commit 9970faf

Browse files
Mohit.k.SharmaMohit.k.Sharma
authored andcommitted
Test before/after comments in test/allure
1 parent 6d5d312 commit 9970faf

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,6 +1770,32 @@ private function generateHooksPhp($hookObjects)
17701770
throw new TestReferenceException($e->getMessage() . " in Element \"" . $type . "\"");
17711771
}
17721772

1773+
if ($type == 'before') {
1774+
$steps = sprintf(
1775+
"\t\t$%s->comment('[%s]');" . PHP_EOL,
1776+
'I',
1777+
'START BEFORE HOOK'
1778+
) . $steps;
1779+
$steps = $steps . sprintf(
1780+
"\t\t$%s->comment('[%s]');" . PHP_EOL,
1781+
'I',
1782+
'END BEFORE HOOK'
1783+
);
1784+
}
1785+
1786+
if ($type == 'after') {
1787+
$steps = sprintf(
1788+
"\t\t$%s->comment('[%s]');" . PHP_EOL,
1789+
'I',
1790+
'START AFTER HOOK'
1791+
) . $steps;
1792+
$steps = $steps . sprintf(
1793+
"\t\t$%s->comment('[%s]');" . PHP_EOL,
1794+
'I',
1795+
'END AFTER HOOK'
1796+
);
1797+
}
1798+
17731799
$hooks .= sprintf("\tpublic function _{$type}(%s)\n", $dependencies);
17741800
$hooks .= "\t{\n";
17751801
$hooks .= $steps;

0 commit comments

Comments
 (0)