Skip to content

Commit 9e44d05

Browse files
committed
MQE-1234: Allow XML Parser to read XML comment into comment action
1 parent b8f7667 commit 9e44d05

14 files changed

+218
-10
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
<!-- Open MFTF DevDocs Page -->
2323
<amOnPage stepKey="openMFTFDevDocPage" url="{{MFTFDocPage.url}}" />
24-
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="asdf" />
2524
<see stepKey="verifyPageIntroText" selector="{{contentSection.pageIntro}}" userInput="Introduction to the Magento Functional Testing Framework" />
2625
</test>
2726
</tests>

dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ class ActionGroupWithDefaultArgumentAndStringSelectorParamCest
3030
public function ActionGroupWithDefaultArgumentAndStringSelectorParam(AcceptanceTester $I)
3131
{
3232
$I->comment("Entering Action Group [actionGroup] actionGroupWithDefaultArgumentAndStringSelectorParam");
33-
$I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id\">/");
3433
$I->see("John", "#element .test1"); // stepKey: seeFirstNameActionGroup
3534
$I->comment("Exiting Action Group [actionGroup] actionGroupWithDefaultArgumentAndStringSelectorParam");
3635
}

dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ class ActionGroupWithPassedArgumentAndStringSelectorParamCest
3030
public function ActionGroupWithPassedArgumentAndStringSelectorParam(AcceptanceTester $I)
3131
{
3232
$I->comment("Entering Action Group [actionGroup] actionGroupWithDefaultArgumentAndStringSelectorParam");
33-
$I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id\">/");
3433
$I->see("John" . msq("UniquePerson"), "#element .test1"); // stepKey: seeFirstNameActionGroup
3534
$I->comment("Exiting Action Group [actionGroup] actionGroupWithDefaultArgumentAndStringSelectorParam");
3635
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
* @Title("[NO TESTCASEID]: Action Group With comment block in arguments and action group body")
19+
*/
20+
class XmlCommentedActionGroupTestCest
21+
{
22+
/**
23+
* @Severity(level = SeverityLevel::CRITICAL)
24+
* @Features({"TestModule"})
25+
* @Parameter(name = "AcceptanceTester", value="$I")
26+
* @param AcceptanceTester $I
27+
* @return void
28+
* @throws \Exception
29+
*/
30+
public function XmlCommentedActionGroupTest(AcceptanceTester $I)
31+
{
32+
$I->comment("Entering Action Group [actionGroup] XmlCommentedActionGroup");
33+
$I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id\">/");
34+
$I->see("John", "#element .test1"); // stepKey: seeFirstNameActionGroup
35+
$I->comment("Exiting Action Group [actionGroup] XmlCommentedActionGroup");
36+
}
37+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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+
* @Title("[NO TESTCASEID]: Test With comment blocks in root element 'tests', in annotations and in test body.")
19+
*/
20+
class XmlCommentedTestCest
21+
{
22+
/**
23+
* @param AcceptanceTester $I
24+
* @throws \Exception
25+
*/
26+
public function _before(AcceptanceTester $I)
27+
{
28+
$I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id_1\">/");
29+
$I->amOnPage("/beforeUrl"); // stepKey: beforeAmOnPageKey
30+
$I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id_2\">/");
31+
}
32+
33+
/**
34+
* @param AcceptanceTester $I
35+
* @throws \Exception
36+
*/
37+
public function _after(AcceptanceTester $I)
38+
{
39+
$I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id_1\">/");
40+
$I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey
41+
$I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id_2\">/");
42+
}
43+
44+
/**
45+
* @param AcceptanceTester $I
46+
* @throws \Exception
47+
*/
48+
public function _failed(AcceptanceTester $I)
49+
{
50+
$I->saveScreenshot(); // stepKey: saveScreenshot
51+
}
52+
53+
/**
54+
* @Severity(level = SeverityLevel::CRITICAL)
55+
* @Features({"TestModule"})
56+
* @Parameter(name = "AcceptanceTester", value="$I")
57+
* @param AcceptanceTester $I
58+
* @return void
59+
* @throws \Exception
60+
*/
61+
public function XmlCommentedTest(AcceptanceTester $I)
62+
{
63+
$I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id_1\">/");
64+
$someVarDefinition = $I->grabValueFrom(); // stepKey: someVarDefinition
65+
$I->acceptPopup(); // stepKey: acceptPopupKey1
66+
$I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id_2\">/");
67+
$I->amOnPage("/test/url"); // stepKey: amOnPageKey1
68+
$I->appendField(".functionalTestSelector"); // stepKey: appendFieldKey1
69+
$I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id_3\">/");
70+
$I->attachFile(".functionalTestSelector", "testFileAttachment"); // stepKey: attachFileKey1
71+
$I->comment("<cancelPopup stepKey=\"cancelPopupKey1\"/>");
72+
$I->checkOption(".functionalTestSelector"); // stepKey: checkOptionKey1
73+
}
74+
}

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@
1313

1414
<actionGroup name="actionGroupWithDefaultArgumentAndStringSelectorParam">
1515
<arguments>
16-
<!-- Comments in arguments are not affecting test generation -->
17-
<!-- <argument name="someArgument" defaultValue="ReplacementPerson" /> -->
1816
<argument name="someArgument" defaultValue="ReplacementPerson" />
1917
</arguments>
2018

21-
<!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id">/-->
2219
<see selector="{{SampleSection.oneParamElement('test1')}}" userInput="{{someArgument.firstname}}" stepKey="seeFirstName" />
2320
</actionGroup>
2421

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="XmlCommentedActionGroup">
11+
<arguments>
12+
<!-- Comments in arguments are not affecting test generation -->
13+
<!-- <argument name="someArgument" defaultValue="ReplacementPerson" /> -->
14+
<argument name="someArgument" defaultValue="ReplacementPerson" />
15+
</arguments>
16+
17+
<!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id">/-->
18+
<see selector="{{SampleSection.oneParamElement('test1')}}" userInput="{{someArgument.firstname}}" stepKey="seeFirstName" />
19+
</actionGroup>
20+
</actionGroups>

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@
1515
<actionGroup ref="actionGroupWithoutArguments" stepKey="actionGroup"/>
1616
</test>
1717

18-
<!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id">/-->
1918
<test name="ActionGroupWithDefaultArgumentAndStringSelectorParam">
2019
<annotations>
21-
<!-- Comments in Test annotations are not affecting test generation -->
22-
<!-- <severity value="BLOCKER"/> -->
2320
<severity value="BLOCKER"/>
2421
<title value="Action Group With Default Argument Value and Hardcoded Value in Param"/>
2522
</annotations>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
10+
<test name="XmlCommentedActionGroupTest">
11+
<annotations>
12+
<severity value="CRITICAL"/>
13+
<title value="Action Group With comment block in arguments and action group body"/>
14+
</annotations>
15+
<actionGroup ref="XmlCommentedActionGroup" stepKey="actionGroup"/>
16+
</test>
17+
</tests>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
10+
<!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id">/-->
11+
<test name="XmlCommentedTest">
12+
<annotations>
13+
<!-- Comments in Test annotations are not affecting test generation -->
14+
<!-- <severity value="BLOCKER"/> -->
15+
<severity value="CRITICAL"/>
16+
<title value="Test With comment blocks in root element 'tests', in annotations and in test body."/>
17+
</annotations>
18+
<before>
19+
<!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id_1">/-->
20+
<amOnPage url="/beforeUrl" stepKey="beforeAmOnPageKey"/>
21+
<!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id_2">/-->
22+
</before>
23+
<after>
24+
<!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id_1">/-->
25+
<amOnPage url="/afterUrl" stepKey="afterAmOnPageKey"/>
26+
<!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id_2">/-->
27+
</after>
28+
29+
<!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id_1">/-->
30+
<grabValueFrom stepKey="someVarDefinition"/>
31+
<acceptPopup stepKey="acceptPopupKey1"/>
32+
33+
<!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id_2">/-->
34+
<amOnPage stepKey="amOnPageKey1" url="/test/url"/>
35+
<appendField selector=".functionalTestSelector" stepKey="appendFieldKey1" />
36+
37+
<!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id_3">/-->
38+
<attachFile userInput="testFileAttachment" selector=".functionalTestSelector" stepKey="attachFileKey1" />
39+
<!-- <cancelPopup stepKey="cancelPopupKey1"/>-->
40+
<checkOption selector=".functionalTestSelector" stepKey="checkOptionKey1"/>
41+
</test>
42+
</tests>

0 commit comments

Comments
 (0)