Skip to content

Commit 9737bd8

Browse files
committed
MQE-1068: Require Issue ID for Skipped Test
- Removed IssueId comment generator - Updated Tests - Added merge test
1 parent eca4c88 commit 9737bd8

File tree

7 files changed

+55
-9
lines changed

7 files changed

+55
-9
lines changed
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");
33+
}
34+
}

dev/tests/verification/Resources/SkippedTest.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId;
1919
/**
2020
* @Title("skippedTest")
2121
* @Description("")
22-
* @skipIssueId SkippedValue
2322
*/
2423
class SkippedTestCest
2524
{

dev/tests/verification/Resources/SkippedTestTwoIssues.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ use Yandex\Allure\Adapter\Annotation\TestCaseId;
1919
/**
2020
* @Title("skippedMultipleIssuesTest")
2121
* @Description("")
22-
* @skipIssueId SkippedValue
23-
* @skipIssueId SecondSkippedValue
2422
*/
2523
class SkippedTestTwoIssuesCest
2624
{

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>

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
}

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -437,12 +437,6 @@ private function generateClassAnnotations($annotationType, $annotationName)
437437
$annotationToAppend .= sprintf(" * @group %s\n", $group);
438438
}
439439
break;
440-
441-
case "skip":
442-
foreach ($annotationName as $issue) {
443-
$annotationToAppend .= sprintf(" * @skipIssueId %s\n", $issue);
444-
}
445-
break;
446440
}
447441

448442
return $annotationToAppend;

0 commit comments

Comments
 (0)