File tree 1 file changed +8
-3
lines changed
src/Magento/FunctionalTestingFramework/Extension
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -323,7 +323,7 @@ public function stepName(\Codeception\Event\StepEvent $e)
323
323
$ stepKey = null ;
324
324
325
325
if (!($ e ->getStep () instanceof Comment)) {
326
- $ stepKey = $ this ->retrieveStepKeyForAllure ($ e ->getStep ());
326
+ $ stepKey = $ this ->retrieveStepKeyForAllure ($ e ->getStep (), $ e -> getTest ()-> getMetadata ()-> getFilename () );
327
327
$ isActionGroup = (
328
328
strpos (
329
329
$ e ->getStep ()->__toString (),
@@ -457,15 +457,20 @@ protected function localizePath($path)
457
457
* Reading stepKey from file.
458
458
*
459
459
* @param Step $step
460
+ * @param String $filePath
460
461
* @return string|null
461
462
*/
462
- private function retrieveStepKeyForAllure (Step $ step )
463
+ private function retrieveStepKeyForAllure (Step $ step, string $ filePath )
463
464
{
464
465
$ stepKey = null ;
465
466
$ stepLine = $ step ->getLineNumber ();
466
- $ filePath = $ step ->getFilePath ();
467
467
$ stepLine = $ stepLine - 1 ;
468
468
469
+ //If the step's filepath is different from the test, it's a comment action.
470
+ if ($ this ->getRootDir () . $ step ->getFilePath () != $ filePath ) {
471
+ return "" ;
472
+ }
473
+
469
474
if (!array_key_exists ($ filePath , $ this ->testFiles )) {
470
475
$ this ->testFiles [$ filePath ] = explode (PHP_EOL , file_get_contents ($ filePath ));
471
476
}
You can’t perform that action at this time.
0 commit comments