Skip to content

Commit 3671ce9

Browse files
authored
Merge pull request #7 from magento-pangolin/MQE-2307
MQE-2307: Add use cases for <remove> action in SVC
2 parents b353f7b + 8512d1c commit 3671ce9

File tree

12 files changed

+229
-9
lines changed

12 files changed

+229
-9
lines changed

src/Operation/Mftf/ActionGroup/ActionGroupRemoveActionRemoved.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ActionGroupRemoveActionRemoved extends MftfOperation
2121
* Operation Severity
2222
* @var int
2323
*/
24-
protected $level = Level::MINOR;
24+
protected $level = Level::MAJOR;
2525

2626
/**
2727
* Operation message.

src/Operation/Mftf/Suite/SuiteBeforeAfterRemoveActionRemoved.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class SuiteBeforeAfterRemoveActionRemoved extends MftfOperation
2121
* Operation Severity
2222
* @var int
2323
*/
24-
protected $level = Level::MINOR;
24+
protected $level = Level::MAJOR;
2525

2626
/**
2727
* Operation message.

src/Operation/Mftf/Test/TestRemoveActionRemoved.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class TestRemoveActionRemoved extends MftfOperation
2121
* Operation Severity
2222
* @var int
2323
*/
24-
protected $level = Level::MINOR;
24+
protected $level = Level::MAJOR;
2525

2626
/**
2727
* Operation message.

tests/Unit/Console/Command/CompareSourceCommandMftfTest.php

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -617,10 +617,10 @@ public function changesDataProvider()
617617
$pathToFixtures . '/test-remove-action-removed/source-code-before',
618618
$pathToFixtures . '/test-remove-action-removed/source-code-after',
619619
[
620-
'Mftf (MINOR)',
620+
'Mftf (MAJOR)',
621621
'Test/SampleTest/key2 | <test> <remove action> was removed | M402'
622622
],
623-
'Minor change is detected.'
623+
'Major change is detected.'
624624
],
625625
'test-action-group-ref-changed' => [
626626
$pathToFixtures . '/test-action-group-ref-changed/source-code-before',
@@ -828,10 +828,10 @@ public function changesDataProvider()
828828
$pathToFixtures . '/suite-after-remove-action-removed/source-code-before',
829829
$pathToFixtures . '/suite-after-remove-action-removed/source-code-after',
830830
[
831-
'Mftf (MINOR)',
831+
'Mftf (MAJOR)',
832832
'Suite/SampleSuite/after/x | <suite> <before/after> <remove> <action> was removed | M421'
833833
],
834-
'Minor change is detected.'
834+
'Major change is detected.'
835835
],
836836
'suite-before-remove-action-added' => [
837837
$pathToFixtures . '/suite-before-remove-action-added/source-code-before',
@@ -846,10 +846,50 @@ public function changesDataProvider()
846846
$pathToFixtures . '/suite-before-remove-action-removed/source-code-before',
847847
$pathToFixtures . '/suite-before-remove-action-removed/source-code-after',
848848
[
849-
'Mftf (MINOR)',
849+
'Mftf (MAJOR)',
850850
'Suite/SampleSuite/before/x | <suite> <before/after> <remove> <action> was removed | M421'
851851
],
852-
'Minor change is detected.'
852+
'Major change is detected.'
853+
],
854+
'actionGroup-remove-action-key-changed' => [
855+
$pathToFixtures . '/actionGroup-remove-action-key-changed/source-code-before',
856+
$pathToFixtures . '/actionGroup-remove-action-key-changed/source-code-after',
857+
[
858+
'Mftf (MAJOR)',
859+
'ActionGroup/ActionGroup1/action2 | <actionGroup> <remove action> was removed | M406',
860+
'ActionGroup/ActionGroup1/action1 | <actionGroup> <remove action> was added | M404',
861+
],
862+
'Major change is detected.'
863+
],
864+
'suite-before-remove-action-key-changed' => [
865+
$pathToFixtures . '/suite-before-remove-action-key-changed/source-code-before',
866+
$pathToFixtures . '/suite-before-remove-action-key-changed/source-code-after',
867+
[
868+
'Mftf (MAJOR)',
869+
'Suite/SampleSuite/before/a | <suite> <before/after> <remove> <action> was removed | M421',
870+
'Suite/SampleSuite/before/b | <suite> <before/after> <remove> <action> was added | M420',
871+
],
872+
'Major change is detected.'
873+
],
874+
'suite-after-remove-action-key-changed' => [
875+
$pathToFixtures . '/suite-after-remove-action-key-changed/source-code-before',
876+
$pathToFixtures . '/suite-after-remove-action-key-changed/source-code-after',
877+
[
878+
'Mftf (MAJOR)',
879+
'Suite/SampleSuite/after/a | <suite> <before/after> <remove> <action> was removed | M421',
880+
'Suite/SampleSuite/after/b | <suite> <before/after> <remove> <action> was added | M420',
881+
],
882+
'Major change is detected.'
883+
],
884+
'test-remove-action-key-changed' => [
885+
$pathToFixtures . '/test-remove-action-key-changed/source-code-before',
886+
$pathToFixtures . '/test-remove-action-key-changed/source-code-after',
887+
[
888+
'Mftf (MAJOR)',
889+
'Test/SampleTest/key2 | <test> <remove action> was removed | M402',
890+
'Test/SampleTest/key1 | <test> <remove action> was added | M401',
891+
],
892+
'Major change is detected.'
853893
],
854894
];
855895
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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="ActionGroup1">
11+
<comment userInput="action1" stepKey="action1"/>
12+
<remove keyForRemoval="action1"/>
13+
</actionGroup>
14+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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="ActionGroup1">
11+
<comment userInput="action1" stepKey="action1"/>
12+
<remove keyForRemoval="action2"/>
13+
</actionGroup>
14+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Suite/etc/suiteSchema.xsd">
9+
<suite name="SampleSuite">
10+
<before>
11+
<amOnPage stepKey="a" url="a"/>
12+
<click stepKey="b" userInput="a" selector="a"/>
13+
<actionGroup stepKey="c" ref="ag"/>
14+
</before>
15+
<after>
16+
<amOnPage stepKey="x" url="a"/>
17+
<remove keyForRemoval="b"/>
18+
<actionGroup stepKey="z" ref="ag"/>
19+
</after>
20+
<include>
21+
<group name="group1"/>
22+
</include>
23+
</suite>
24+
</suites>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Suite/etc/suiteSchema.xsd">
9+
<suite name="SampleSuite">
10+
<before>
11+
<amOnPage stepKey="a" url="a"/>
12+
<click stepKey="b" userInput="a" selector="a"/>
13+
<actionGroup stepKey="c" ref="ag"/>
14+
</before>
15+
<after>
16+
<amOnPage stepKey="x" url="a"/>
17+
<remove keyForRemoval="a"/>
18+
<actionGroup stepKey="z" ref="ag"/>
19+
</after>
20+
<include>
21+
<group name="group1"/>
22+
</include>
23+
</suite>
24+
</suites>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Suite/etc/suiteSchema.xsd">
9+
<suite name="SampleSuite">
10+
<after>
11+
<amOnPage stepKey="a" url="a"/>
12+
<click stepKey="b" userInput="a" selector="a"/>
13+
<actionGroup stepKey="c" ref="ag"/>
14+
</after>
15+
<before>
16+
<amOnPage stepKey="x" url="a"/>
17+
<remove keyForRemoval="b"/>
18+
<actionGroup stepKey="z" ref="ag"/>
19+
</before>
20+
<include>
21+
<group name="group1"/>
22+
</include>
23+
</suite>
24+
</suites>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Suite/etc/suiteSchema.xsd">
9+
<suite name="SampleSuite">
10+
<after>
11+
<amOnPage stepKey="a" url="a"/>
12+
<click stepKey="b" userInput="a" selector="a"/>
13+
<actionGroup stepKey="c" ref="ag"/>
14+
</after>
15+
<before>
16+
<amOnPage stepKey="x" url="a"/>
17+
<remove keyForRemoval="a"/>
18+
<actionGroup stepKey="z" ref="ag"/>
19+
</before>
20+
<include>
21+
<group name="group1"/>
22+
</include>
23+
</suite>
24+
</suites>

0 commit comments

Comments
 (0)