Skip to content

Commit 9bafd56

Browse files
authored
Merge pull request #167 from magento/MQE-1068
MQE-1068: Require Issue ID for Skipped Test
2 parents bf22ecb + cb17300 commit 9bafd56

File tree

15 files changed

+316
-3
lines changed

15 files changed

+316
-3
lines changed

dev/tests/verification/Resources/ChildExtendedTestNoParent.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ class ChildExtendedTestNoParentCest
3434
*/
3535
public function ChildExtendedTestNoParent(AcceptanceTester $I, \Codeception\Scenario $scenario)
3636
{
37-
$scenario->skip("This test is skipped");
37+
$scenario->skip("This test is skipped due to the following issues:\nNo issues have been specified.");
3838
}
3939
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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 MergeSkipCest
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 MergeSkip(AcceptanceTester $I, \Codeception\Scenario $scenario)
31+
{
32+
$scenario->skip("This test is skipped due to the following issues:\nIssue5");
33+
}
34+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
* @Title("skippedTest")
21+
* @Description("")
22+
*/
23+
class SkippedTestCest
24+
{
25+
/**
26+
* @Stories({"skipped"})
27+
* @Severity(level = SeverityLevel::MINOR)
28+
* @Features({"TestModule"})
29+
* @Parameter(name = "AcceptanceTester", value="$I")
30+
* @param AcceptanceTester $I
31+
* @return void
32+
* @throws \Exception
33+
*/
34+
public function SkippedTest(AcceptanceTester $I, \Codeception\Scenario $scenario)
35+
{
36+
$scenario->skip("This test is skipped due to the following issues:\nSkippedValue");
37+
}
38+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
* @Title("skippedNoIssuesTest")
21+
* @Description("")
22+
* @group skip
23+
*/
24+
class SkippedTestNoIssuesCest
25+
{
26+
/**
27+
* @Stories({"skippedNo"})
28+
* @Severity(level = SeverityLevel::MINOR)
29+
* @Features({"TestModule"})
30+
* @Parameter(name = "AcceptanceTester", value="$I")
31+
* @param AcceptanceTester $I
32+
* @return void
33+
* @throws \Exception
34+
*/
35+
public function SkippedTestNoIssues(AcceptanceTester $I, \Codeception\Scenario $scenario)
36+
{
37+
$scenario->skip("This test is skipped due to the following issues:\nNo issues have been specified.");
38+
}
39+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
* @Title("skippedMultipleIssuesTest")
21+
* @Description("")
22+
*/
23+
class SkippedTestTwoIssuesCest
24+
{
25+
/**
26+
* @Stories({"skippedMultiple"})
27+
* @Severity(level = SeverityLevel::MINOR)
28+
* @Features({"TestModule"})
29+
* @Parameter(name = "AcceptanceTester", value="$I")
30+
* @param AcceptanceTester $I
31+
* @return void
32+
* @throws \Exception
33+
*/
34+
public function SkippedTestTwoIssues(AcceptanceTester $I, \Codeception\Scenario $scenario)
35+
{
36+
$scenario->skip("This test is skipped due to the following issues:\nSkippedValue\nSecondSkippedValue");
37+
}
38+
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,7 @@
5555
<click stepKey="clickTwo" selector="#mergeTwo"/>
5656
<click stepKey="clickThree" selector="#mergeThree"/>
5757
</test>
58+
<test name="MergeSkip">
59+
<comment userInput="ThisTestShouldBeSkipped" stepKey="skipComment"/>
60+
</test>
5861
</tests>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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="../../../../../src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="SkippedTest">
12+
<annotations>
13+
<stories value="skipped"/>
14+
<title value="skippedTest"/>
15+
<description value=""/>
16+
<severity value="AVERAGE"/>
17+
<skip>
18+
<issueId value="SkippedValue"/>
19+
</skip>
20+
</annotations>
21+
</test>
22+
<test name="SkippedTestTwoIssues">
23+
<annotations>
24+
<stories value="skippedMultiple"/>
25+
<title value="skippedMultipleIssuesTest"/>
26+
<description value=""/>
27+
<severity value="AVERAGE"/>
28+
<skip>
29+
<issueId value="SkippedValue"/>
30+
<issueId value="SecondSkippedValue"/>
31+
</skip>
32+
</annotations>
33+
</test>
34+
<test name="SkippedTestNoIssues">
35+
<annotations>
36+
<stories value="skippedNo"/>
37+
<title value="skippedNoIssuesTest"/>
38+
<description value=""/>
39+
<severity value="AVERAGE"/>
40+
<group value="skip"/>
41+
</annotations>
42+
</test>
43+
</tests>

dev/tests/verification/TestModuleMerged/Test/MergeFunctionalTest.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,11 @@
2626
<click stepKey="step10" selector="#step10MergedInResult"/>
2727
<actionGroup ref="FunctionalActionGroupWithData" stepKey="step8Merge" after="step7Merge"/>
2828
</test>
29+
<test name="MergeSkip">
30+
<annotations>
31+
<skip>
32+
<issueId value="Issue5"/>
33+
</skip>
34+
</annotations>
35+
</test>
2936
</tests>

dev/tests/verification/Tests/MergedGenerationTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,15 @@ public function testMergeMassViaInsertAfter()
6262
{
6363
$this->generateAndCompareTest('MergeMassViaInsertAfter');
6464
}
65+
66+
/**
67+
* Tests generation of a test skipped in merge.
68+
*
69+
* @throws \Exception
70+
* @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
71+
*/
72+
public function testMergeSkipGeneration()
73+
{
74+
$this->generateAndCompareTest('MergeSkip');
75+
}
6576
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace tests\verification\Tests;
7+
8+
use tests\util\MftfTestCase;
9+
10+
class SkippedGenerationTest extends MftfTestCase
11+
{
12+
/**
13+
* Tests skipped test generation.
14+
*
15+
* @throws \Exception
16+
* @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
17+
*/
18+
public function testSkippedGeneration()
19+
{
20+
$this->generateAndCompareTest('SkippedTest');
21+
}
22+
23+
/**
24+
* Tests skipped test with multiple issues generation.
25+
*
26+
* @throws \Exception
27+
* @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
28+
*/
29+
public function testMultipleSkippedIssuesGeneration()
30+
{
31+
$this->generateAndCompareTest('SkippedTestTwoIssues');
32+
}
33+
34+
/**
35+
* Tests skipped test generation with no specified issues. Will be deprecated after MFTF 3.0.0
36+
*
37+
* @throws \Exception
38+
* @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
39+
*/
40+
public function testSkippedNoIssueGeneration()
41+
{
42+
$this->generateAndCompareTest('SkippedTestNoIssues');
43+
}
44+
}

0 commit comments

Comments
 (0)