Skip to content

Commit 18a9e57

Browse files
committed
MQE-1150: Test generation fails for arguments containing hyphen
- Added Verification Test
1 parent 995c78f commit 18a9e57

File tree

4 files changed

+54
-0
lines changed

4 files changed

+54
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
namespace Magento\AcceptanceTest\_default\Backend;
3+
4+
use Magento\FunctionalTestingFramework\AcceptanceTester;
5+
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\CredentialStore;
6+
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\PersistedObjectHandler;
7+
use \Codeception\Util\Locator;
8+
use Yandex\Allure\Adapter\Annotation\Features;
9+
use Yandex\Allure\Adapter\Annotation\Stories;
10+
use Yandex\Allure\Adapter\Annotation\Title;
11+
use Yandex\Allure\Adapter\Annotation\Description;
12+
use Yandex\Allure\Adapter\Annotation\Parameter;
13+
use Yandex\Allure\Adapter\Annotation\Severity;
14+
use Yandex\Allure\Adapter\Model\SeverityLevel;
15+
use Yandex\Allure\Adapter\Annotation\TestCaseId;
16+
17+
/**
18+
*/
19+
class ActionGroupWithParameterizedElementWithHyphenCest
20+
{
21+
/**
22+
* @Features({"TestModule"})
23+
* @Parameter(name = "AcceptanceTester", value="$I")
24+
* @param AcceptanceTester $I
25+
* @return void
26+
* @throws \Exception
27+
*/
28+
public function ActionGroupWithParameterizedElementWithHyphen(AcceptanceTester $I)
29+
{
30+
$keyoneActionGroup = $I->executeJS("#element .full-width");
31+
}
32+
}

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

+6
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,10 @@
8585
</arguments>
8686
<seeInCurrentUrl url="/{{persistedData.urlKey}}.html?___store={{xmlData.firstname}}" stepKey="checkUrl"/>
8787
</actionGroup>
88+
<actionGroup name="SectionArgumentWithParameterizedSelector">
89+
<arguments>
90+
<argument name="section" defaultValue="SampleSection"/>
91+
</arguments>
92+
<executeJS function="{{section.oneParamElement('full-width')}}" stepKey="keyone"/>
93+
</actionGroup>
8894
</actionGroups>

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

+5
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,9 @@
158158
<argument name="sameStepKeyAsArg" value="arg1"/>
159159
</actionGroup>
160160
</test>
161+
<test name="ActionGroupWithParameterizedElementWithHyphen">
162+
<actionGroup ref="SectionArgumentWithParameterizedSelector" stepKey="actionGroup">
163+
<argument name="section" value="SampleSection"/>
164+
</actionGroup>
165+
</test>
161166
</tests>

dev/tests/verification/Tests/ActionGroupGenerationTest.php

+11
Original file line numberDiff line numberDiff line change
@@ -195,4 +195,15 @@ public function testActionGroupWithSkipReadiness()
195195
{
196196
$this->generateAndCompareTest('ActionGroupSkipReadiness');
197197
}
198+
199+
/**
200+
* Test an action group with an arg that resolves into section.element with a hyphen in the parameter
201+
*
202+
* @throws \Exception
203+
* @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
204+
*/
205+
public function testActionGroupWithHyphen()
206+
{
207+
$this->generateAndCompareTest('ActionGroupWithParameterizedElementWithHyphen');
208+
}
198209
}

0 commit comments

Comments
 (0)