Skip to content

Commit b462aa8

Browse files
authored
Merge branch 'develop' into MAGETWO-46837-readiness-flag-develop
2 parents ff467df + 45d802b commit b462aa8

25 files changed

+388
-23
lines changed

dev/tests/functional/_bootstrap.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
* See COPYING.txt for license details.
55
*/
66

7+
//Do not continue running this bootstrap if PHPUnit is calling it
8+
$fullTrace = debug_backtrace();
9+
$rootFile = array_values(array_slice($fullTrace, -1))[0]['file'];
10+
if (strpos($rootFile, "phpunit") !== false) {
11+
return;
12+
}
13+
714
defined('PROJECT_ROOT') || define('PROJECT_ROOT', dirname(dirname(dirname(__DIR__))));
815
require_once realpath(PROJECT_ROOT . '/vendor/autoload.php');
916

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+
}

dev/tests/verification/Resources/SectionReplacementTest.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,7 @@ class SectionReplacementTestCest
6464
$I->click("#stringLiteral1-" . $createdData->getCreatedDataByName('firstname') . " .{$data}");
6565
$I->click("#stringLiteral1-" . $createdData->getCreatedDataByName('firstname') . " ." . msq("uniqueData") . "John");
6666
$I->click("#stringLiteral1-" . $createdData->getCreatedDataByName('firstname') . " .Doe" . msq("uniqueData"));
67+
$I->click("#element .1#element .2");
68+
$I->click("#element .1#element .{$data}");
6769
}
6870
}
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>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@
4343
<click stepKey="selectorReplaceThreeParamVariable" selector="{{SampleSection.threeParamElement({$data1}, {$data2}, {$data3})}}"/>
4444
<click stepKey="selectorReplaceThreeParamVariableOneDupe" selector="{{SampleSection.threeOneDuplicateParamElement(simpleData.firstname, simpleData.lastname, simpleData.middlename)}}"/>
4545

46-
4746
<click stepKey="selectorReplaceThreeParamMixed1" selector="{{SampleSection.threeParamElement('stringLiteral1', $createdData.firstname$, simpleData.firstname)}}"/>
4847
<click stepKey="selectorReplaceThreeParamMixed2" selector="{{SampleSection.threeParamElement('stringLiteral1', $createdData.firstname$, {$data})}}"/>
4948
<click stepKey="selectorReplaceThreeParamMixedMSQPrefix" selector="{{SampleSection.threeParamElement('stringLiteral1', $createdData.firstname$, uniqueData.firstname)}}"/>
5049
<click stepKey="selectorReplaceThreeParamMixedMSQSuffix" selector="{{SampleSection.threeParamElement('stringLiteral1', $createdData.firstname$, uniqueData.lastname)}}"/>
50+
51+
<click stepKey="selectorReplaceTwoParamElements" selector="{{SampleSection.oneParamElement('1')}}{{SampleSection.oneParamElement('2')}}"/>
52+
<click stepKey="selectorReplaceTwoParamMixedTypes" selector="{{SampleSection.oneParamElement('1')}}{{SampleSection.oneParamElement({$data})}}"/>
5153
</test>
5254
</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+
}

etc/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@
260260
<item name="/tests/test/annotations/group" xsi:type="string">/tests/test/annotations/group</item>
261261
<item name="/tests/test/annotations/env" xsi:type="string">/tests/test/annotations/env</item>
262262
<item name="/tests/test/annotations/return" xsi:type="string">/tests/test/annotations/return</item>
263+
<item name="/tests/test/annotations/skip/issueId" xsi:type="string">/tests/test/annotations/skip/issueId</item>
263264
</argument>
264265
</arguments>
265266
</virtualType>

src/Magento/FunctionalTestingFramework/Console/RunTestCommand.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ protected function configure()
3131
'name',
3232
InputArgument::REQUIRED | InputArgument::IS_ARRAY,
3333
"name of tests to generate and execute"
34-
)->addOption('skip-generate', 'k', InputOption::VALUE_NONE, "skip generation and execute existing test");
34+
)->addOption('skip-generate', 'k', InputOption::VALUE_NONE, "skip generation and execute existing test")
35+
->addOption(
36+
"force",
37+
'f',
38+
InputOption::VALUE_NONE,
39+
'force generation of tests regardless of Magento Instance Configuration'
40+
);
3541
}
3642

3743
/**
@@ -47,17 +53,18 @@ protected function configure()
4753
protected function execute(InputInterface $input, OutputInterface $output)
4854
{
4955
$tests = $input->getArgument('name');
50-
$skipGeneration = $input->getOption('skip-generate') ?? false;
56+
$skipGeneration = $input->getOption('skip-generate');
57+
$force = $input->getOption('force');
5158

5259
if (!$skipGeneration) {
5360
$command = $this->getApplication()->find('generate:tests');
5461
$args = [
5562
'--tests' => json_encode([
5663
'tests' => $tests,
5764
'suites' => null
58-
])
65+
]),
66+
'--force' => $force
5967
];
60-
6168
$command->run(new ArrayInput($args), $output);
6269
}
6370

0 commit comments

Comments
 (0)