diff --git a/dev/tests/verification/Resources/BasicFunctionalTest.txt b/dev/tests/verification/Resources/BasicFunctionalTest.txt index fc4284005..940ec9f3e 100644 --- a/dev/tests/verification/Resources/BasicFunctionalTest.txt +++ b/dev/tests/verification/Resources/BasicFunctionalTest.txt @@ -92,8 +92,10 @@ class BasicFunctionalTestCest $I->dontSeeElementInDOM(".functionalTestSelector"); // stepKey: dontSeeElementInDOMKey1 $I->dontSeeInCurrentUrl("/functionalUrl"); // stepKey: dontSeeInCurrentUrlKey1 $I->dontSeeInField(".functionalTestSelector"); // stepKey: dontSeeInFieldKey1 - $I->dontSeeInPageSource("someInput"); // stepKey: dontSeeInPageSourceKey1 - $I->dontSeeInSource(""); // stepKey: dontSeeInSourceKey1 + $I->dontSeeInPageSource("Cosmo Kramer"); // stepKey: dontSeeInPageSourceKey1 + $I->dontSeeInPageSource("

Jerry Seinfeld

"); // stepKey: dontSeeInPageSourceKey2 + $I->dontSeeInSource("Cosmo Kramer"); // stepKey: dontSeeInSourceKey1 + $I->dontSeeInSource("

Jerry Seinfeld

"); // stepKey: dontSeeInSourceKey2 $I->dontSeeInTitle("someInput"); // stepKey: dontSeeInTitleKey1 $I->dontSeeLink("someInput", "/functionalUrl"); // stepKey: dontSeeLinkKey1 $I->dontSeeOptionIsSelected(".functionalTestSelector", "someInput"); // stepKey: dontSeeOptionIsSelectedKey1 @@ -146,9 +148,11 @@ class BasicFunctionalTestCest $I->seeElementInDOM(".functionalTestSelector"); // stepKey: seeElementInDOMKey1 $I->seeInCurrentUrl("/functionalUrl"); // stepKey: seeInCurrentUrlKey1 $I->seeInField(".functionalTestSelector", "someInput"); // stepKey: seeInFieldKey1 - $I->seeInPageSource(""); // stepKey: seeInPageSourceKey1 + $I->seeInPageSource("Home Page"); // stepKey: seeInPageSourceKey1 + $I->seeInPageSource("

"); // stepKey: seeInPageSourceKey2 $I->seeInPopup("someInput"); // stepKey: seeInPopupKey1 - $I->seeInSource(""); // stepKey: seeInSourceKey1 + $I->seeInSource("Home Page"); // stepKey: seeInSourceKey1 + $I->seeInSource("

"); // stepKey: seeInSourceKey2 $I->seeInTitle("someInput"); // stepKey: seeInTitleKey1 $I->seeLink("someInput", "/functionalUrl"); // stepKey: seeLinkKey1 $I->seeNumberOfElements(".functionalTestSelector"); // stepKey: seeNumberOfElementsKey1 diff --git a/dev/tests/verification/Resources/DataReplacementTest.txt b/dev/tests/verification/Resources/DataReplacementTest.txt index 4eb305e32..8e8eb70a6 100644 --- a/dev/tests/verification/Resources/DataReplacementTest.txt +++ b/dev/tests/verification/Resources/DataReplacementTest.txt @@ -53,5 +53,41 @@ class DataReplacementTestCest $I->fillField(".selector", "0"); // stepKey: insertZero $insertCommand = $I->magentoCLI("do something Doe" . msq("uniqueData") . " with uniqueness"); // stepKey: insertCommand $I->comment($insertCommand); + $I->seeInPageSource("StringBefore John StringAfter"); // stepKey: htmlReplace1 + $I->seeInPageSource("#John"); // stepKey: htmlReplace2 + $I->seeInPageSource("StringBefore " . msq("uniqueData") . "John StringAfter"); // stepKey: htmlReplace3 + $I->seeInPageSource("#" . msq("uniqueData") . "John"); // stepKey: htmlReplace4 + $I->seeInPageSource("#" . msq("uniqueData") . "John#" . msq("uniqueData") . "John"); // stepKey: htmlReplace5 + $I->seeInPageSource("StringBefore Doe" . msq("uniqueData") . " StringAfter"); // stepKey: htmlReplace6 + $I->seeInPageSource("#Doe" . msq("uniqueData")); // stepKey: htmlReplace7 + $I->seeInPageSource("#element"); // stepKey: htmlReplace8 + $I->seeInPageSource("StringBefore #element StringAfter"); // stepKey: htmlReplace9 + $I->dontSeeInPageSource("StringBefore John StringAfter"); // stepKey: htmlReplace10 + $I->dontSeeInPageSource("#John"); // stepKey: htmlReplace11 + $I->dontSeeInPageSource("StringBefore " . msq("uniqueData") . "John StringAfter"); // stepKey: htmlReplace12 + $I->dontSeeInPageSource("#" . msq("uniqueData") . "John"); // stepKey: htmlReplace13 + $I->dontSeeInPageSource("#" . msq("uniqueData") . "John#" . msq("uniqueData") . "John"); // stepKey: htmlReplace14 + $I->dontSeeInPageSource("StringBefore Doe" . msq("uniqueData") . " StringAfter"); // stepKey: htmlReplace15 + $I->dontSeeInPageSource("#Doe" . msq("uniqueData")); // stepKey: htmlReplace16 + $I->dontSeeInPageSource("#element"); // stepKey: htmlReplace17 + $I->dontSeeInPageSource("StringBefore #element StringAfter"); // stepKey: htmlReplace18 + $I->seeInSource("StringBefore John StringAfter"); // stepKey: htmlReplace19 + $I->seeInSource("#John"); // stepKey: htmlReplace20 + $I->seeInSource("StringBefore " . msq("uniqueData") . "John StringAfter"); // stepKey: htmlReplace21 + $I->seeInSource("#" . msq("uniqueData") . "John"); // stepKey: htmlReplace22 + $I->seeInSource("#" . msq("uniqueData") . "John#" . msq("uniqueData") . "John"); // stepKey: htmlReplace23 + $I->seeInSource("StringBefore Doe" . msq("uniqueData") . " StringAfter"); // stepKey: htmlReplace24 + $I->seeInSource("#Doe" . msq("uniqueData")); // stepKey: htmlReplace25 + $I->seeInSource("#element"); // stepKey: htmlReplace26 + $I->seeInSource("StringBefore #element StringAfter"); // stepKey: htmlReplace27 + $I->dontSeeInSource("StringBefore John StringAfter"); // stepKey: htmlReplace28 + $I->dontSeeInSource("#John"); // stepKey: htmlReplace29 + $I->dontSeeInSource("StringBefore " . msq("uniqueData") . "John StringAfter"); // stepKey: htmlReplace30 + $I->dontSeeInSource("#" . msq("uniqueData") . "John"); // stepKey: htmlReplace31 + $I->dontSeeInSource("#" . msq("uniqueData") . "John#" . msq("uniqueData") . "John"); // stepKey: htmlReplace32 + $I->dontSeeInSource("StringBefore Doe" . msq("uniqueData") . " StringAfter"); // stepKey: htmlReplace33 + $I->dontSeeInSource("#Doe" . msq("uniqueData")); // stepKey: htmlReplace34 + $I->dontSeeInSource("#element"); // stepKey: htmlReplace35 + $I->dontSeeInSource("StringBefore #element StringAfter"); // stepKey: htmlReplace36 } } diff --git a/dev/tests/verification/Resources/PersistedReplacementTest.txt b/dev/tests/verification/Resources/PersistedReplacementTest.txt index 6058e34f5..c7ef3291a 100644 --- a/dev/tests/verification/Resources/PersistedReplacementTest.txt +++ b/dev/tests/verification/Resources/PersistedReplacementTest.txt @@ -63,5 +63,17 @@ class PersistedReplacementTestCest $I->searchAndMultiSelectOption("#selector", [PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'lastname', 'test')]); // stepKey: parameterArrayReplacement $I->fillField("#selector", "John " . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " stringLiteral"); // stepKey: allTypesMixed $I->searchAndMultiSelectOption("#selector", [PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), "John", "stringLiteral"]); // stepKey: parameterArrayMixed + $I->seeInPageSource("StringBefore " . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " StringAfter"); // stepKey: htmlReplace1 + $I->seeInPageSource("StringBefore " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test') . " StringAfter"); // stepKey: htmlReplace2 + $I->seeInPageSource("#" . getenv("MAGENTO_BASE_URL") . "#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test')); // stepKey: htmlReplace3 + $I->dontSeeInPageSource("StringBefore " . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " StringAfter"); // stepKey: htmlReplace4 + $I->dontSeeInPageSource("StringBefore " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test') . " StringAfter"); // stepKey: htmlReplace5 + $I->dontSeeInPageSource("#" . getenv("MAGENTO_BASE_URL") . "#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test')); // stepKey: htmlReplace6 + $I->seeInSource("StringBefore " . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " StringAfter"); // stepKey: htmlReplace7 + $I->seeInSource("StringBefore " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test') . " StringAfter"); // stepKey: htmlReplace8 + $I->seeInSource("#" . getenv("MAGENTO_BASE_URL") . "#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test')); // stepKey: htmlReplace9 + $I->dontSeeInSource("StringBefore " . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " StringAfter"); // stepKey: htmlReplace10 + $I->dontSeeInSource("StringBefore " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test') . " StringAfter"); // stepKey: htmlReplace11 + $I->dontSeeInSource("#" . getenv("MAGENTO_BASE_URL") . "#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test')); // stepKey: htmlReplace12 } } diff --git a/dev/tests/verification/TestModule/Test/BasicFunctionalTest.xml b/dev/tests/verification/TestModule/Test/BasicFunctionalTest.xml index bdeb4e0c6..9c99ffa11 100644 --- a/dev/tests/verification/TestModule/Test/BasicFunctionalTest.xml +++ b/dev/tests/verification/TestModule/Test/BasicFunctionalTest.xml @@ -50,8 +50,10 @@ - - + + + + @@ -95,9 +97,11 @@ - + + - + + diff --git a/dev/tests/verification/TestModule/Test/DataReplacementTest.xml b/dev/tests/verification/TestModule/Test/DataReplacementTest.xml index ca3577373..ae11b6fdc 100644 --- a/dev/tests/verification/TestModule/Test/DataReplacementTest.xml +++ b/dev/tests/verification/TestModule/Test/DataReplacementTest.xml @@ -39,5 +39,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dev/tests/verification/TestModule/Test/PersistedReplacementTest.xml b/dev/tests/verification/TestModule/Test/PersistedReplacementTest.xml index 8fc8fd19a..4b0f3c902 100644 --- a/dev/tests/verification/TestModule/Test/PersistedReplacementTest.xml +++ b/dev/tests/verification/TestModule/Test/PersistedReplacementTest.xml @@ -24,5 +24,21 @@ + + + + + + + + + + + + + + + + diff --git a/dev/tests/verification/TestModule/Test/XmlDuplicateTest.xml b/dev/tests/verification/TestModule/Test/XmlDuplicateTest.xml index d3e8ee7b1..937c6edba 100644 --- a/dev/tests/verification/TestModule/Test/XmlDuplicateTest.xml +++ b/dev/tests/verification/TestModule/Test/XmlDuplicateTest.xml @@ -66,8 +66,8 @@ - - + + @@ -282,8 +282,8 @@ - - + + @@ -497,8 +497,8 @@ - - + + diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php index dd7c20b18..9b1cdf1af 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php @@ -53,7 +53,8 @@ class ActionObject "function", 'filterSelector', 'optionSelector', - "command" + "command", + "html" ]; const OLD_ASSERTION_ATTRIBUTES = ["expected", "expectedType", "actual", "actualType"]; const ASSERTION_ATTRIBUTES = ["expectedResult" => "expected", "actualResult" => "actual"]; diff --git a/src/Magento/FunctionalTestingFramework/Test/etc/Actions/dontSeeActions.xsd b/src/Magento/FunctionalTestingFramework/Test/etc/Actions/dontSeeActions.xsd index 3fda54071..dc7cb8d8a 100644 --- a/src/Magento/FunctionalTestingFramework/Test/etc/Actions/dontSeeActions.xsd +++ b/src/Magento/FunctionalTestingFramework/Test/etc/Actions/dontSeeActions.xsd @@ -172,7 +172,7 @@ - + diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index d07c5e1e0..08fc6051c 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -664,7 +664,7 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato } if (isset($customActionAttributes['html'])) { - $html = $customActionAttributes['html']; + $html = $this->addUniquenessFunctionCall($customActionAttributes['html']); } if (isset($customActionAttributes['locale'])) { @@ -1154,7 +1154,6 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato case "dontSeeInField": case "dontSeeInCurrentUrl": case "dontSeeInTitle": - case "dontSeeInPageSource": case "dontSeeOptionIsSelected": case "fillField": case "loadSessionSnapshot": @@ -1172,9 +1171,9 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato ); break; case "seeInPageSource": + case "dontSeeInPageSource": case "seeInSource": case "dontSeeInSource": - // TODO: Need to fix xml parser to allow parsing html. $testSteps .= $this->wrapFunctionCall($actor, $actionObject, $html); break; case "conditionalClick":