Skip to content

Commit ccfcf4f

Browse files
committed
MQE-2575: Allow MFTF Helpers to Return Data to MFTF Test
- fix static tests
1 parent 32747f8 commit ccfcf4f

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

dev/tests/functional/tests/MFTF/DevDocs/Helper/CustomHelper.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,15 @@ public function goTo(
4646
print('$bla = ' . $bla . PHP_EOL);
4747
print('array $arraysomething = [' . implode(', ', $arraysomething) . ']' . PHP_EOL);
4848
}
49+
50+
/**
51+
* Returns value of provided param $text
52+
*
53+
* @param string $text
54+
* @return string
55+
*/
56+
public function getText(string $text): string
57+
{
58+
return $text;
59+
}
4960
}

dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@
4242
<argument name="int">987</argument>
4343
</helper>
4444

45+
<helper class="\MFTF\DevDocs\Helper\CustomHelper" method="getText" stepKey="getText">
46+
<argument name="text">some text</argument>
47+
</helper>
48+
<assertEquals stepKey="assertHelperReturnValue" message="Method getText of CustomHelper should return value which may be used as variable in test">
49+
<expectedResult type="string">some text</expectedResult>
50+
<actualResult type="variable">getText</actualResult>
51+
</assertEquals>
52+
4553
<actionGroup ref="HelperActionGroup" stepKey="actionGroupWithCustomHelper">
4654
<argument name="test" value="{{HelperData.entityField}}" />
4755
<argument name="entityTest" value="HelperData" />

0 commit comments

Comments
 (0)