-
Notifications
You must be signed in to change notification settings - Fork 132
MQE-659: [ALLURE] Include the test "stepKey" in the MFTF Allure Report #359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc changes + some actionGroup functionality is required. Works well with normal tests + suites.
Also I will create a branch off of this branch with the one-line stepKey investigation (looks promising)
src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php
Show resolved
Hide resolved
@@ -116,6 +120,11 @@ public function stepBefore(StepEvent $stepEvent) | |||
{ | |||
//Hard set to 200; we don't expose this config in MFTF | |||
$argumentsLength = 200; | |||
$stepKey = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docblock on ln 113 details what this stepBefore does, add inserts stepKey into step name
to it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still need docblock update I believe
src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php
Show resolved
Hide resolved
src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php
Show resolved
Hide resolved
src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php
Show resolved
Hide resolved
src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php
Outdated
Show resolved
Hide resolved
src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php
Show resolved
Hide resolved
Hi @KevinBKozan |
with latest commit I fixed static test failure |
bf34ab1
to
4074560
Compare
$this->testFiles[$filePath] = explode(PHP_EOL, file_get_contents($filePath)); | ||
} | ||
|
||
preg_match("/\/\/ stepKey: (?<stepKey>.*)/", $this->testFiles[$filePath][$stepLine], $matches); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not use preg_match, and instead use sscanf()
so we can make use of the new const in TestGenerator
.
This would require splitting the string to only the //stepKey:
portion and utilizing two consts in TestGenerator
instead
This way we don't need to keep two very similar constants in disparate classes.
See https://github.com/magento/magento2-functional-testing-framework/compare/MQE-659-oneline for the example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you still want to use preg_match
, at the very least move this regex to a const in eithe rthis class or TestGenerator
// if actionGroup flag, start nesting | ||
if (strpos($step->getName(), ActionGroupObject::ACTION_GROUP_CONTEXT_START) !== false) { | ||
$step->setName(str_replace(ActionGroupObject::ACTION_GROUP_CONTEXT_START, '', $step->getName())); | ||
$actionGroupStepContainer = $step; | ||
|
||
preg_match('/\[(?<actionGroupStepKey>.*)\]/', $step->getName(), $matches); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this regex to a const in either actionGroupObject
or this class.
@@ -116,6 +120,11 @@ public function stepBefore(StepEvent $stepEvent) | |||
{ | |||
//Hard set to 200; we don't expose this config in MFTF | |||
$argumentsLength = 200; | |||
$stepKey = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still need docblock update I believe
Hey @KevinBKozan |
Description
Fixed Issues (if relevant)
Contribution checklist