Skip to content

Commit d455743

Browse files
committed
MQE-1157: Add readiness bypass to test actions
- Updated Tests - Added Restriction for action groups
1 parent 04a394f commit d455743

File tree

8 files changed

+62
-2
lines changed

8 files changed

+62
-2
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
namespace Magento\AcceptanceTest\_default\Backend;
3+
4+
use Magento\FunctionalTestingFramework\AcceptanceTester;
5+
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\DataObjectHandler;
6+
use Magento\FunctionalTestingFramework\DataGenerator\Persist\DataPersistenceHandler;
7+
use Magento\FunctionalTestingFramework\DataGenerator\Objects\EntityDataObject;
8+
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\CredentialStore;
9+
use \Codeception\Util\Locator;
10+
use Yandex\Allure\Adapter\Annotation\Features;
11+
use Yandex\Allure\Adapter\Annotation\Stories;
12+
use Yandex\Allure\Adapter\Annotation\Title;
13+
use Yandex\Allure\Adapter\Annotation\Description;
14+
use Yandex\Allure\Adapter\Annotation\Parameter;
15+
use Yandex\Allure\Adapter\Annotation\Severity;
16+
use Yandex\Allure\Adapter\Model\SeverityLevel;
17+
use Yandex\Allure\Adapter\Annotation\TestCaseId;
18+
19+
/**
20+
*/
21+
class ActionGroupSkipReadinessCest
22+
{
23+
/**
24+
* @Features({"TestModule"})
25+
* @Parameter(name = "AcceptanceTester", value="$I")
26+
* @param AcceptanceTester $I
27+
* @return void
28+
* @throws \Exception
29+
*/
30+
public function ActionGroupSkipReadiness(AcceptanceTester $I)
31+
{
32+
$I->skipReadinessCheck(true);
33+
$I->comment("ActionGroupSkipReadiness");
34+
$I->skipReadinessCheck(false);
35+
}
36+
}

dev/tests/verification/Resources/BasicFunctionalTest.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ class BasicFunctionalTestCest
6262
{
6363
$I->comment("");
6464
$I->comment("");
65+
$I->skipReadinessCheck(true);
66+
$I->comment("skipReadiness");
67+
$I->skipReadinessCheck(false);
6568
$someVarDefinition = $I->grabValueFrom();
6669
$I->acceptPopup();
6770
$I->amOnPage("/test/url");

dev/tests/verification/TestModule/ActionGroup/BasicActionGroup.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,8 @@
114114
</arguments>
115115
<see selector=".selector" userInput="{{sameStepKeyAsArg}}" stepKey="arg1" />
116116
</actionGroup>
117+
118+
<actionGroup name="actionGroupWithSkipReadinessActions">
119+
<comment userInput="ActionGroupSkipReadiness" stepKey="skip" skipReadiness="true"/>
120+
</actionGroup>
117121
</actionGroups>

dev/tests/verification/TestModule/Test/ActionGroupTest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@
144144
</before>
145145
</test>
146146

147+
<test name="ActionGroupSkipReadiness">
148+
<actionGroup ref="actionGroupWithSkipReadinessActions" stepKey="skipReadinessActionGroup"/>
149+
</test>
150+
147151
<test name="ActionGroupContainsStepKeyInArgText">
148152
<before>
149153
<actionGroup ref="actionGroupContainsStepKeyInArgValue" stepKey="actionGroup">

dev/tests/verification/TestModule/Test/BasicFunctionalTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
</after>
2525
<comment stepKey="basicCommentWithNoData" userInput="{{emptyData.noData}}"/>
2626
<comment stepKey="basicCommentWithDefinitelyNoData" userInput="{{emptyData.definitelyNoData}}"/>
27+
<comment stepKey="ReadinessCheckSkipped" userInput="skipReadiness" skipReadiness="true"/>
2728
<grabValueFrom stepKey="someVarDefinition"/>
2829
<acceptPopup stepKey="acceptPopupKey1"/>
2930
<amOnPage stepKey="amOnPageKey1" url="/test/url"/>

dev/tests/verification/Tests/ActionGroupGenerationTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,15 @@ public function testActionGroupWithArgContainingStepKey()
184184
{
185185
$this->generateAndCompareTest('ActionGroupContainsStepKeyInArgText');
186186
}
187+
188+
/**
189+
* Test an action group with an arg containing stepKey text
190+
*
191+
* @throws \Exception
192+
* @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
193+
*/
194+
public function testActionGroupWithSkipReadiness()
195+
{
196+
$this->generateAndCompareTest('ActionGroupSkipReadiness');
197+
}
187198
}

src/Magento/FunctionalTestingFramework/Test/etc/mergedTestSchema.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,5 +130,6 @@
130130
</xs:annotation>
131131
</xs:attribute>
132132
<xs:attributeGroup ref="commonActionAttributes"/>
133+
<xs:attribute type="xs:boolean" name="skipReadiness" use="prohibited"/>
133134
</xs:complexType>
134135
</xs:schema>

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ public function generateStepsPhp($actionObjects, $hookObject = false, $actor = "
514514
$arguments = $this->addUniquenessFunctionCall($customActionAttributes['arguments']);
515515
}
516516
if (isset($customActionAttributes['skipReadiness'])) {
517-
if ($customActionAttributes['skipReadiness']) {
517+
if ($customActionAttributes['skipReadiness'] == "true") {
518518
$testSteps .= sprintf(
519519
"\t\t$%s->skipReadinessCheck(true);\n",
520520
$actor
@@ -1284,7 +1284,7 @@ public function generateStepsPhp($actionObjects, $hookObject = false, $actor = "
12841284
$testSteps .= $this->wrapFunctionCall($actor, $actionObject, $selector, $input, $parameter);
12851285
}
12861286
if (isset($customActionAttributes['skipReadiness'])) {
1287-
if ($customActionAttributes['skipReadiness']) {
1287+
if ($customActionAttributes['skipReadiness'] == "true") {
12881288
$testSteps .= sprintf(
12891289
"\t\t$%s->skipReadinessCheck(false);\n",
12901290
$actor

0 commit comments

Comments
 (0)