Skip to content

Commit e6122a8

Browse files
authored
Merge branch 'develop' into MQE-2110
2 parents d6c82ca + ba3362b commit e6122a8

17 files changed

+543
-52
lines changed

dev/tests/_bootstrap.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99

1010
$vendorAutoloadPath = realpath(PROJECT_ROOT . '/vendor/autoload.php');
1111
$mftfTestCasePath = realpath(PROJECT_ROOT . '/dev/tests/util/MftfTestCase.php');
12+
$mftfStaticTestCasePath = realpath(PROJECT_ROOT . '/dev/tests/util/MftfStaticTestCase.php');
1213

1314
require_once $vendorAutoloadPath;
1415
require_once $mftfTestCasePath;
16+
require_once $mftfStaticTestCasePath;
1517

1618
// Set up AspectMock
1719
$kernel = \AspectMock\Kernel::getInstance();

dev/tests/util/MftfStaticTestCase.php

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace tests\util;
8+
9+
use Magento\FunctionalTestingFramework\Util\Filesystem\DirSetupUtil;
10+
use PHPUnit\Framework\TestCase;
11+
use Symfony\Component\Console\Input\InputInterface;
12+
13+
class MftfStaticTestCase extends TestCase
14+
{
15+
const STATIC_RESULTS_DIR = TESTS_MODULE_PATH .
16+
DIRECTORY_SEPARATOR .
17+
'_output' .
18+
DIRECTORY_SEPARATOR .
19+
'static-results';
20+
21+
const RESOURCES_PATH = TESTS_MODULE_PATH .
22+
DIRECTORY_SEPARATOR .
23+
"Resources" .
24+
DIRECTORY_SEPARATOR .
25+
'StaticChecks';
26+
27+
/**
28+
* Sets input interface
29+
* @param $path
30+
* @return \PHPUnit\Framework\MockObject\MockObject
31+
*/
32+
public function mockInputInterface($path = null)
33+
{
34+
$input = $this->getMockBuilder(InputInterface::class)
35+
->disableOriginalConstructor()
36+
->getMock();
37+
if ($path) {
38+
$input->method('getOption')
39+
->with('path')
40+
->willReturn($path);
41+
}
42+
return $input;
43+
}
44+
45+
public function tearDown(): void
46+
{
47+
DirSetupUtil::rmdirRecursive(self::STATIC_RESULTS_DIR);
48+
}
49+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="ActionGroupWithMultiplePausesActionGroup">
11+
<fillField selector="#foo" userInput="foo" stepKey="fillField1"/>
12+
<pause stepKey="pauseAfterFillField1"/>
13+
<fillField selector="#bar" userInput="bar" stepKey="fillField2"/>
14+
<pause stepKey="pauseAfterFillField2"/>
15+
<fillField selector="#baz" userInput="baz" stepKey="fillField3"/>
16+
<pause stepKey="pauseAfterFillField3"/>
17+
</actionGroup>
18+
</actionGroups>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="ActionGroupWithNoPauseActionGroup">
11+
<fillField selector="#foo" userInput="foo" stepKey="fillField1"/>
12+
<fillField selector="#bar" userInput="bar" stepKey="fillField2"/>
13+
<fillField selector="#baz" userInput="baz" stepKey="fillField3"/>
14+
</actionGroup>
15+
</actionGroups>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="ActionGroupWithPauseActionGroup">
11+
<fillField selector="#foo" userInput="myData1" stepKey="fillField1"/>
12+
<fillField selector="#bar" userInput="myData2" stepKey="fillField2"/>
13+
<pause stepKey="pauseAfterFillField2"/>
14+
</actionGroup>
15+
</actionGroups>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
9+
<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Suite/etc/suiteSchema.xsd">
10+
<suite name="suiteWithMultiplePauseActionsSuite">
11+
<include>
12+
<group name="include" />
13+
</include>
14+
<before>
15+
<amOnPage url="some.url" stepKey="before"/>
16+
<createData entity="SecretData" stepKey="create1">
17+
<field key="someKey">dataHere</field>
18+
</createData>
19+
<pause stepKey="pauseCreate1"/>
20+
</before>
21+
<after>
22+
<deleteData createDataKey="create1" stepKey="delete1"/>
23+
<deleteData url="deleteThis" stepKey="deleteThis"/>
24+
<fillField selector="#fill" userInput="{{SecretData.key2}}" stepKey="fillAfter"/>
25+
<pause stepKey="pauseFillAfter"/>
26+
</after>
27+
</suite>
28+
</suites>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
9+
<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Suite/etc/suiteSchema.xsd">
10+
<suite name="suiteWithPauseActionSuite">
11+
<include>
12+
<group name="include" />
13+
</include>
14+
<before>
15+
<amOnPage url="some.url" stepKey="before"/>
16+
<createData entity="createThis" stepKey="create">
17+
<field key="someKey">dataHere</field>
18+
</createData>
19+
<pause stepKey="pauseSuite"/>
20+
<click stepKey="clickWithData" userInput="$create.data$"/>
21+
<fillField selector="#foo" userInput="myData1" stepKey="fillField1"/>
22+
</before>
23+
<after>
24+
<comment userInput="afterBlock" stepKey="afterBlock"/>
25+
</after>
26+
</suite>
27+
</suites>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="TestWithMultiplePauseActionsTest">
12+
<annotations>
13+
<severity value="CRITICAL"/>
14+
<group value="functional"/>
15+
<features value="Pause check"/>
16+
<stories value="MQE-433"/>
17+
</annotations>
18+
<before>
19+
<amOnPage url="/beforeUrl" stepKey="beforeAmOnPageKey"/>
20+
<pause stepKey="pauseBeforeAmOnPageKey"/>
21+
</before>
22+
<fillField stepKey="step1" selector="#username" userInput="step1"/>
23+
<fillField stepKey="step2" selector="#password" userInput="step2"/>
24+
<pause stepKey="pauseAfterStep2"/>
25+
<after>
26+
<amOnPage url="/afterUrl" stepKey="afterAmOnPageKey"/>
27+
<pause stepKey="pauseAfterAmOnPageKey"/>
28+
</after>
29+
</test>
30+
</tests>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="TestWithPauseActionTest">
12+
<annotations>
13+
<severity value="CRITICAL"/>
14+
<group value="functional"/>
15+
<features value="Pause check"/>
16+
<stories value="MQE-433"/>
17+
</annotations>
18+
<amOnPage stepKey="step1" url="/step1"/>
19+
<fillField stepKey="step2" selector="#username" userInput="step2"/>
20+
<fillField stepKey="step3" selector="#password" userInput="step3"/>
21+
<pause stepKey="pauseAfterStep3"/>
22+
</test>
23+
</tests>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
File "/verification/PauseCheckModule/ActionGroup/ActionGroupWithMultiplePausesActionGroup.xml"
3+
contains pause action(s):
4+
5+
ActionGroupWithMultiplePausesActionGroup has pause action at stepKey(s): pauseAfterFillField1, pauseAfterFillField2, pauseAfterFillField3
6+
7+
File "/verification/PauseCheckModule/ActionGroup/ActionGroupWithPauseActionGroup.xml"
8+
contains pause action(s):
9+
10+
ActionGroupWithPauseActionGroup has pause action at stepKey(s): pauseAfterFillField2
11+
12+
File "/verification/PauseCheckModule/Test/TestWithMultiplePauseActionsTest.xml"
13+
contains pause action(s):
14+
15+
TestWithMultiplePauseActionsTest has pause action at stepKey(s): pauseBeforeAmOnPageKey, pauseAfterStep2, pauseAfterAmOnPageKey
16+
17+
File "/verification/PauseCheckModule/Test/TestWithPauseActionTest.xml"
18+
contains pause action(s):
19+
20+
TestWithPauseActionTest has pause action at stepKey(s): pauseAfterStep3
21+
22+
File "/verification/PauseCheckModule/Suite/suiteWithMultiplePauseActionsSuite.xml"
23+
contains pause action(s):
24+
25+
suiteWithMultiplePauseActionsSuite has pause action at stepKey(s): pauseCreate1, pauseFillAfter
26+
27+
File "/verification/PauseCheckModule/Suite/suiteWithPauseActionSuite.xml"
28+
contains pause action(s):
29+
30+
suiteWithPauseActionSuite has pause action at stepKey(s): pauseSuite

0 commit comments

Comments
 (0)