diff --git a/dev/tests/verification/Resources/ExtendedTestInSuiteChildTestCest.txt b/dev/tests/verification/Resources/ExtendedChildTestInSuiteCest.txt
similarity index 84%
rename from dev/tests/verification/Resources/ExtendedTestInSuiteChildTestCest.txt
rename to dev/tests/verification/Resources/ExtendedChildTestInSuiteCest.txt
index 6658525eb..da343e0e1 100644
--- a/dev/tests/verification/Resources/ExtendedTestInSuiteChildTestCest.txt
+++ b/dev/tests/verification/Resources/ExtendedChildTestInSuiteCest.txt
@@ -15,10 +15,10 @@ use Yandex\Allure\Adapter\Model\SeverityLevel;
use Yandex\Allure\Adapter\Annotation\TestCaseId;
/**
- * @Title("[NO TESTCASEID]: ExtendedTestInSuiteChildTest")
- * @group ExtendedTestInSuiteChildTest
+ * @Title("[NO TESTCASEID]: ExtendedChildTestInSuite")
+ * @group ExtendedTestInSuite
*/
-class ExtendedTestInSuiteChildTestCest
+class ExtendedChildTestInSuiteCest
{
/**
* @param AcceptanceTester $I
@@ -50,13 +50,13 @@ class ExtendedTestInSuiteChildTestCest
/**
* @Severity(level = SeverityLevel::TRIVIAL)
* @Features({"TestModule"})
- * @Stories({"ExtendedTestInSuiteChildTest"})
+ * @Stories({"ExtendedChildTestInSuite"})
* @Parameter(name = "AcceptanceTester", value="$I")
* @param AcceptanceTester $I
* @return void
* @throws \Exception
*/
- public function ExtendedTestInSuiteChildTest(AcceptanceTester $I)
+ public function ExtendedChildTestInSuite(AcceptanceTester $I)
{
$I->comment("Different Input");
}
diff --git a/dev/tests/verification/Resources/ExtendedChildTestNotInSuite.txt b/dev/tests/verification/Resources/ExtendedChildTestNotInSuite.txt
new file mode 100644
index 000000000..cba6db454
--- /dev/null
+++ b/dev/tests/verification/Resources/ExtendedChildTestNotInSuite.txt
@@ -0,0 +1,62 @@
+amOnPage("/beforeUrl");
+ }
+
+ /**
+ * @param AcceptanceTester $I
+ * @throws \Exception
+ */
+ public function _after(AcceptanceTester $I)
+ {
+ $I->amOnPage("/afterUrl");
+ }
+
+ /**
+ * @param AcceptanceTester $I
+ * @throws \Exception
+ */
+ public function _failed(AcceptanceTester $I)
+ {
+ $I->saveScreenshot();
+ }
+
+ /**
+ * @Severity(level = SeverityLevel::TRIVIAL)
+ * @Features({"TestModule"})
+ * @Stories({"ExtendedChildTestNotInSuite"})
+ * @Parameter(name = "AcceptanceTester", value="$I")
+ * @param AcceptanceTester $I
+ * @return void
+ * @throws \Exception
+ */
+ public function ExtendedChildTestNotInSuite(AcceptanceTester $I)
+ {
+ $I->comment("Different Input");
+ }
+}
diff --git a/dev/tests/verification/TestModule/Test/ExtendedFunctionalTest.xml b/dev/tests/verification/TestModule/Test/ExtendedFunctionalTest.xml
index 345718751..486a6036f 100644
--- a/dev/tests/verification/TestModule/Test/ExtendedFunctionalTest.xml
+++ b/dev/tests/verification/TestModule/Test/ExtendedFunctionalTest.xml
@@ -159,13 +159,13 @@
-
+
-
-
-
-
+
+
+
+
@@ -174,16 +174,28 @@
+
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/dev/tests/verification/Tests/ExtendedGenerationTest.php b/dev/tests/verification/Tests/ExtendedGenerationTest.php
index e7bb0a879..73fb5fdfb 100644
--- a/dev/tests/verification/Tests/ExtendedGenerationTest.php
+++ b/dev/tests/verification/Tests/ExtendedGenerationTest.php
@@ -118,4 +118,15 @@ public function testExtendingSkippedGeneration()
{
$this->generateAndCompareTest('ExtendingSkippedTest');
}
+
+ /**
+ * Tests extending and removing parent steps test generation.
+ *
+ * @throws \Exception
+ * @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException
+ */
+ public function testExtendingAndRemovingStepsGeneration()
+ {
+ $this->generateAndCompareTest('ExtendedChildTestNotInSuite');
+ }
}
diff --git a/dev/tests/verification/Tests/SuiteGenerationTest.php b/dev/tests/verification/Tests/SuiteGenerationTest.php
index 094a97b5b..f305e565f 100644
--- a/dev/tests/verification/Tests/SuiteGenerationTest.php
+++ b/dev/tests/verification/Tests/SuiteGenerationTest.php
@@ -292,8 +292,8 @@ public function testSuiteGenerationWithExtends()
{
$groupName = 'suiteExtends';
- $expectedContents = [
- 'ExtendedTestInSuiteChildTestCest.php'
+ $expectedFileNames = [
+ 'ExtendedChildTestInSuiteCest'
];
// Generate the Suite
@@ -312,15 +312,18 @@ public function testSuiteGenerationWithExtends()
$this->assertArrayHasKey($groupName, $yml['groups']);
$suiteResultBaseDir = self::GENERATE_RESULT_DIR .
- DIRECTORY_SEPARATOR .
$groupName .
DIRECTORY_SEPARATOR;
// Validate tests have been generated
$dirContents = array_diff(scandir($suiteResultBaseDir), ['..', '.']);
- foreach ($expectedContents as $expectedFile) {
- $this->assertTrue(in_array($expectedFile, $dirContents));
+ foreach ($expectedFileNames as $expectedFileName) {
+ $this->assertTrue(in_array($expectedFileName . ".php", $dirContents));
+ $this->assertFileEquals(
+ self::RESOURCES_PATH . DIRECTORY_SEPARATOR . $expectedFileName . ".txt",
+ $suiteResultBaseDir . $expectedFileName . ".php"
+ );
}
}
diff --git a/dev/tests/verification/_suite/functionalSuiteExtends.xml b/dev/tests/verification/_suite/functionalSuiteExtends.xml
index fccfddcd9..aac3b51e5 100644
--- a/dev/tests/verification/_suite/functionalSuiteExtends.xml
+++ b/dev/tests/verification/_suite/functionalSuiteExtends.xml
@@ -9,7 +9,7 @@
-
+
diff --git a/src/Magento/FunctionalTestingFramework/Test/Handlers/TestObjectHandler.php b/src/Magento/FunctionalTestingFramework/Test/Handlers/TestObjectHandler.php
index a508d8fd4..1c0f7e2fc 100644
--- a/src/Magento/FunctionalTestingFramework/Test/Handlers/TestObjectHandler.php
+++ b/src/Magento/FunctionalTestingFramework/Test/Handlers/TestObjectHandler.php
@@ -92,10 +92,11 @@ public function getObject($testName)
*/
public function getAllObjects()
{
+ $testObjects = [];
foreach ($this->tests as $testName => $test) {
- $this->tests[$testName] = $this->extendTest($test);
+ $testObjects[$testName] = $this->extendTest($test);
}
- return $this->tests;
+ return $testObjects;
}
/**