diff --git a/dev/tests/functional/tests/MFTF/DevDocs/Page/MFTFDocPage.xml b/dev/tests/functional/tests/MFTF/DevDocs/Page/MFTFDocPage.xml index 2b706ed67..88c577aef 100644 --- a/dev/tests/functional/tests/MFTF/DevDocs/Page/MFTFDocPage.xml +++ b/dev/tests/functional/tests/MFTF/DevDocs/Page/MFTFDocPage.xml @@ -8,7 +8,7 @@ - +
diff --git a/dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml b/dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml index eceeb3f58..3bdeeb9e8 100644 --- a/dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml +++ b/dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml @@ -10,6 +10,7 @@ xsi:noNamespaceSchemaLocation="../../../../../../../src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> + @@ -18,6 +19,7 @@ <group value="mftf"/> </annotations> + <!-- Open MFTF DevDocs Page --> <amOnPage stepKey="openMFTFDevDocPage" url="{{MFTFDocPage.url}}" /> <see stepKey="verifyPageIntroText" selector="{{contentSection.pageIntro}}" userInput="Introduction to the Magento Functional Testing Framework" /> </test> diff --git a/dev/tests/verification/Resources/ActionGroupContainsStepKeyInArgText.txt b/dev/tests/verification/Resources/ActionGroupContainsStepKeyInArgText.txt index a9d6c3d27..c98120d03 100644 --- a/dev/tests/verification/Resources/ActionGroupContainsStepKeyInArgText.txt +++ b/dev/tests/verification/Resources/ActionGroupContainsStepKeyInArgText.txt @@ -24,9 +24,9 @@ class ActionGroupContainsStepKeyInArgTextCest */ public function _before(AcceptanceTester $I) { - $I->comment("Entering Action Group actionGroupContainsStepKeyInArgValue (actionGroup)"); - $I->see("arg1", ".selector"); - $I->comment("Exiting Action Group actionGroupContainsStepKeyInArgValue (actionGroup)"); + $I->comment("Entering Action Group [actionGroup] actionGroupContainsStepKeyInArgValue"); + $I->see("arg1", ".selector"); // stepKey: arg1ActionGroup + $I->comment("Exiting Action Group [actionGroup] actionGroupContainsStepKeyInArgValue"); } /** @@ -38,8 +38,8 @@ class ActionGroupContainsStepKeyInArgTextCest */ public function ActionGroupContainsStepKeyInArgText(AcceptanceTester $I) { - $I->comment("Entering Action Group actionGroupContainsStepKeyInArgValue (actionGroup)"); - $I->see("arg1", ".selector"); - $I->comment("Exiting Action Group actionGroupContainsStepKeyInArgValue (actionGroup)"); + $I->comment("Entering Action Group [actionGroup] actionGroupContainsStepKeyInArgValue"); + $I->see("arg1", ".selector"); // stepKey: arg1ActionGroup + $I->comment("Exiting Action Group [actionGroup] actionGroupContainsStepKeyInArgValue"); } } diff --git a/dev/tests/verification/Resources/ActionGroupMergedViaInsertAfter.txt b/dev/tests/verification/Resources/ActionGroupMergedViaInsertAfter.txt index 1573c0d43..c607cb7b2 100644 --- a/dev/tests/verification/Resources/ActionGroupMergedViaInsertAfter.txt +++ b/dev/tests/verification/Resources/ActionGroupMergedViaInsertAfter.txt @@ -27,13 +27,13 @@ class ActionGroupMergedViaInsertAfterCest */ public function ActionGroupMergedViaInsertAfter(AcceptanceTester $I) { - $I->comment("Entering Action Group FunctionalActionGroupForMassMergeAfter (keyone)"); - $I->fillField("#foo", "foo"); - $I->fillField("#bar", "bar"); - $I->click("#foo2"); - $I->click("#bar2"); - $I->click("#baz2"); - $I->fillField("#baz", "baz"); - $I->comment("Exiting Action Group FunctionalActionGroupForMassMergeAfter (keyone)"); + $I->comment("Entering Action Group [keyone] FunctionalActionGroupForMassMergeAfter"); + $I->fillField("#foo", "foo"); // stepKey: fillField1Keyone + $I->fillField("#bar", "bar"); // stepKey: fillField2Keyone + $I->click("#foo2"); // stepKey: mergeAfterBarKeyone + $I->click("#bar2"); // stepKey: mergeAfterFoo2Keyone + $I->click("#baz2"); // stepKey: mergeAfterBar2Keyone + $I->fillField("#baz", "baz"); // stepKey: fillField3Keyone + $I->comment("Exiting Action Group [keyone] FunctionalActionGroupForMassMergeAfter"); } } diff --git a/dev/tests/verification/Resources/ActionGroupMergedViaInsertBefore.txt b/dev/tests/verification/Resources/ActionGroupMergedViaInsertBefore.txt index 5dda9af14..08281a965 100644 --- a/dev/tests/verification/Resources/ActionGroupMergedViaInsertBefore.txt +++ b/dev/tests/verification/Resources/ActionGroupMergedViaInsertBefore.txt @@ -27,13 +27,13 @@ class ActionGroupMergedViaInsertBeforeCest */ public function ActionGroupMergedViaInsertBefore(AcceptanceTester $I) { - $I->comment("Entering Action Group FunctionalActionGroupForMassMergeBefore (keyone)"); - $I->fillField("#foo", "foo"); - $I->click("#foo2"); - $I->click("#bar2"); - $I->click("#baz2"); - $I->fillField("#bar", "bar"); - $I->fillField("#baz", "baz"); - $I->comment("Exiting Action Group FunctionalActionGroupForMassMergeBefore (keyone)"); + $I->comment("Entering Action Group [keyone] FunctionalActionGroupForMassMergeBefore"); + $I->fillField("#foo", "foo"); // stepKey: fillField1Keyone + $I->click("#foo2"); // stepKey: mergeBeforeBarKeyone + $I->click("#bar2"); // stepKey: mergeAfterFoo2Keyone + $I->click("#baz2"); // stepKey: mergeAfterBar2Keyone + $I->fillField("#bar", "bar"); // stepKey: fillField2Keyone + $I->fillField("#baz", "baz"); // stepKey: fillField3Keyone + $I->comment("Exiting Action Group [keyone] FunctionalActionGroupForMassMergeBefore"); } } diff --git a/dev/tests/verification/Resources/ActionGroupToExtend.txt b/dev/tests/verification/Resources/ActionGroupToExtend.txt index 40fdedeb9..b91c06036 100644 --- a/dev/tests/verification/Resources/ActionGroupToExtend.txt +++ b/dev/tests/verification/Resources/ActionGroupToExtend.txt @@ -27,9 +27,9 @@ class ActionGroupToExtendCest */ public function ActionGroupToExtend(AcceptanceTester $I) { - $I->comment("Entering Action Group ActionGroupToExtend (actionGroup)"); - $grabProductsActionGroup = $I->grabMultiple("selector"); - $I->assertCount(99, $grabProductsActionGroup); - $I->comment("Exiting Action Group ActionGroupToExtend (actionGroup)"); + $I->comment("Entering Action Group [actionGroup] ActionGroupToExtend"); + $grabProductsActionGroup = $I->grabMultiple("selector"); // stepKey: grabProductsActionGroup + $I->assertCount(99, $grabProductsActionGroup); // stepKey: assertCountActionGroup + $I->comment("Exiting Action Group [actionGroup] ActionGroupToExtend"); } } diff --git a/dev/tests/verification/Resources/ActionGroupUsingCreateData.txt b/dev/tests/verification/Resources/ActionGroupUsingCreateData.txt index f011d307a..6831b0914 100644 --- a/dev/tests/verification/Resources/ActionGroupUsingCreateData.txt +++ b/dev/tests/verification/Resources/ActionGroupUsingCreateData.txt @@ -24,8 +24,8 @@ class ActionGroupUsingCreateDataCest */ public function _before(AcceptanceTester $I) { - $I->comment("Entering Action Group actionGroupWithCreateData (Key1)"); - $I->amGoingTo("create entity that has the stepKey: createCategoryKey1"); + $I->comment("Entering Action Group [Key1] actionGroupWithCreateData"); + $I->comment("[createCategoryKey1] create 'ApiCategory' entity"); PersistedObjectHandler::getInstance()->createEntity( "createCategoryKey1", "hook", @@ -33,7 +33,8 @@ class ActionGroupUsingCreateDataCest [], null ); - $I->amGoingTo("create entity that has the stepKey: createConfigProductKey1"); + + $I->comment("[createConfigProductKey1] create 'ApiConfigurableProduct' entity"); PersistedObjectHandler::getInstance()->createEntity( "createConfigProductKey1", "hook", @@ -41,7 +42,8 @@ class ActionGroupUsingCreateDataCest ["createCategoryKey1"], null ); - $I->comment("Exiting Action Group actionGroupWithCreateData (Key1)"); + + $I->comment("Exiting Action Group [Key1] actionGroupWithCreateData"); } /** diff --git a/dev/tests/verification/Resources/ActionGroupUsingNestedArgument.txt b/dev/tests/verification/Resources/ActionGroupUsingNestedArgument.txt index 8d6bf7a3a..13b67b10f 100644 --- a/dev/tests/verification/Resources/ActionGroupUsingNestedArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupUsingNestedArgument.txt @@ -27,9 +27,9 @@ class ActionGroupUsingNestedArgumentCest */ public function ActionGroupUsingNestedArgument(AcceptanceTester $I) { - $I->comment("Entering Action Group ActionGroupToExtend (actionGroup)"); - $grabProductsActionGroup = $I->grabMultiple("selector"); - $I->assertCount(99, $grabProductsActionGroup); - $I->comment("Exiting Action Group ActionGroupToExtend (actionGroup)"); + $I->comment("Entering Action Group [actionGroup] ActionGroupToExtend"); + $grabProductsActionGroup = $I->grabMultiple("selector"); // stepKey: grabProductsActionGroup + $I->assertCount(99, $grabProductsActionGroup); // stepKey: assertCountActionGroup + $I->comment("Exiting Action Group [actionGroup] ActionGroupToExtend"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithDataOverrideTest.txt b/dev/tests/verification/Resources/ActionGroupWithDataOverrideTest.txt index a584c0f50..3785b4dd6 100644 --- a/dev/tests/verification/Resources/ActionGroupWithDataOverrideTest.txt +++ b/dev/tests/verification/Resources/ActionGroupWithDataOverrideTest.txt @@ -25,7 +25,7 @@ class ActionGroupWithDataOverrideTestCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createPersonParam"); + $I->comment("[createPersonParam] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createPersonParam", "hook", @@ -33,10 +33,11 @@ class ActionGroupWithDataOverrideTestCest [], null ); - $I->comment("Entering Action Group FunctionalActionGroup (beforeGroup)"); - $I->fillField("#foo", "myData1"); - $I->fillField("#bar", "myData2"); - $I->comment("Exiting Action Group FunctionalActionGroup (beforeGroup)"); + + $I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup + $I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup"); } /** @@ -45,10 +46,10 @@ class ActionGroupWithDataOverrideTestCest */ public function _after(AcceptanceTester $I) { - $I->comment("Entering Action Group FunctionalActionGroup (afterGroup)"); - $I->fillField("#foo", "myData1"); - $I->fillField("#bar", "myData2"); - $I->comment("Exiting Action Group FunctionalActionGroup (afterGroup)"); + $I->comment("Entering Action Group [afterGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup + $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); } /** @@ -57,7 +58,7 @@ class ActionGroupWithDataOverrideTestCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** @@ -71,14 +72,14 @@ class ActionGroupWithDataOverrideTestCest */ public function ActionGroupWithDataOverrideTest(AcceptanceTester $I) { - $I->amOnPage("/someUrl"); - $I->comment("Entering Action Group FunctionalActionGroupWithData (actionGroupWithDataOverride1)"); - $I->amOnPage("/John/Doe.html"); - $I->fillField("#foo", "John"); - $I->fillField("#bar", "Doe"); - $I->searchAndMultiSelectOption("#foo", ["John", "Doe"]); - $I->see("#element .John"); - $I->comment("Exiting Action Group FunctionalActionGroupWithData (actionGroupWithDataOverride1)"); - $I->click("loginButton"); + $I->amOnPage("/someUrl"); // stepKey: step1 + $I->comment("Entering Action Group [actionGroupWithDataOverride1] FunctionalActionGroupWithData"); + $I->amOnPage("/John/Doe.html"); // stepKey: amOnPage1ActionGroupWithDataOverride1 + $I->fillField("#foo", "John"); // stepKey: fillField1ActionGroupWithDataOverride1 + $I->fillField("#bar", "Doe"); // stepKey: fillField2ActionGroupWithDataOverride1 + $I->searchAndMultiSelectOption("#foo", ["John", "Doe"]); // stepKey: multi1ActionGroupWithDataOverride1 + $I->see("#element .John"); // stepKey: see1ActionGroupWithDataOverride1 + $I->comment("Exiting Action Group [actionGroupWithDataOverride1] FunctionalActionGroupWithData"); + $I->click("loginButton"); // stepKey: step6 } } diff --git a/dev/tests/verification/Resources/ActionGroupWithDataTest.txt b/dev/tests/verification/Resources/ActionGroupWithDataTest.txt index 29d822831..3e812cdd0 100644 --- a/dev/tests/verification/Resources/ActionGroupWithDataTest.txt +++ b/dev/tests/verification/Resources/ActionGroupWithDataTest.txt @@ -25,7 +25,7 @@ class ActionGroupWithDataTestCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createPersonParam"); + $I->comment("[createPersonParam] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createPersonParam", "hook", @@ -33,10 +33,11 @@ class ActionGroupWithDataTestCest [], null ); - $I->comment("Entering Action Group FunctionalActionGroup (beforeGroup)"); - $I->fillField("#foo", "myData1"); - $I->fillField("#bar", "myData2"); - $I->comment("Exiting Action Group FunctionalActionGroup (beforeGroup)"); + + $I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup + $I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup"); } /** @@ -45,10 +46,10 @@ class ActionGroupWithDataTestCest */ public function _after(AcceptanceTester $I) { - $I->comment("Entering Action Group FunctionalActionGroup (afterGroup)"); - $I->fillField("#foo", "myData1"); - $I->fillField("#bar", "myData2"); - $I->comment("Exiting Action Group FunctionalActionGroup (afterGroup)"); + $I->comment("Entering Action Group [afterGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup + $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); } /** @@ -57,7 +58,7 @@ class ActionGroupWithDataTestCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** @@ -71,14 +72,14 @@ class ActionGroupWithDataTestCest */ public function ActionGroupWithDataTest(AcceptanceTester $I) { - $I->amOnPage("/someUrl"); - $I->comment("Entering Action Group FunctionalActionGroupWithData (actionGroupWithData1)"); - $I->amOnPage("/Jane/Dane.html"); - $I->fillField("#foo", "Jane"); - $I->fillField("#bar", "Dane"); - $I->searchAndMultiSelectOption("#foo", ["Jane", "Dane"]); - $I->see("#element .Jane"); - $I->comment("Exiting Action Group FunctionalActionGroupWithData (actionGroupWithData1)"); - $I->click("loginButton"); + $I->amOnPage("/someUrl"); // stepKey: step1 + $I->comment("Entering Action Group [actionGroupWithData1] FunctionalActionGroupWithData"); + $I->amOnPage("/Jane/Dane.html"); // stepKey: amOnPage1ActionGroupWithData1 + $I->fillField("#foo", "Jane"); // stepKey: fillField1ActionGroupWithData1 + $I->fillField("#bar", "Dane"); // stepKey: fillField2ActionGroupWithData1 + $I->searchAndMultiSelectOption("#foo", ["Jane", "Dane"]); // stepKey: multi1ActionGroupWithData1 + $I->see("#element .Jane"); // stepKey: see1ActionGroupWithData1 + $I->comment("Exiting Action Group [actionGroupWithData1] FunctionalActionGroupWithData"); + $I->click("loginButton"); // stepKey: step6 } } diff --git a/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt b/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt index a66759a89..68f95298d 100644 --- a/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt +++ b/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt @@ -29,8 +29,8 @@ class ActionGroupWithDefaultArgumentAndStringSelectorParamCest */ public function ActionGroupWithDefaultArgumentAndStringSelectorParam(AcceptanceTester $I) { - $I->comment("Entering Action Group actionGroupWithDefaultArgumentAndStringSelectorParam (actionGroup)"); - $I->see("John", "#element .test1"); - $I->comment("Exiting Action Group actionGroupWithDefaultArgumentAndStringSelectorParam (actionGroup)"); + $I->comment("Entering Action Group [actionGroup] actionGroupWithDefaultArgumentAndStringSelectorParam"); + $I->see("John", "#element .test1"); // stepKey: seeFirstNameActionGroup + $I->comment("Exiting Action Group [actionGroup] actionGroupWithDefaultArgumentAndStringSelectorParam"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithMultipleParameterSelectorsFromDefaultArgument.txt b/dev/tests/verification/Resources/ActionGroupWithMultipleParameterSelectorsFromDefaultArgument.txt index e726a178f..1c211ce4e 100644 --- a/dev/tests/verification/Resources/ActionGroupWithMultipleParameterSelectorsFromDefaultArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupWithMultipleParameterSelectorsFromDefaultArgument.txt @@ -29,8 +29,8 @@ class ActionGroupWithMultipleParameterSelectorsFromDefaultArgumentCest */ public function ActionGroupWithMultipleParameterSelectorsFromDefaultArgument(AcceptanceTester $I) { - $I->comment("Entering Action Group actionGroupWithMultipleParameterSelectorsFromArgument (actionGroup)"); - $I->see("Doe", "#John-Doe .test"); - $I->comment("Exiting Action Group actionGroupWithMultipleParameterSelectorsFromArgument (actionGroup)"); + $I->comment("Entering Action Group [actionGroup] actionGroupWithMultipleParameterSelectorsFromArgument"); + $I->see("Doe", "#John-Doe .test"); // stepKey: seeLastNameActionGroup + $I->comment("Exiting Action Group [actionGroup] actionGroupWithMultipleParameterSelectorsFromArgument"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithNoArguments.txt b/dev/tests/verification/Resources/ActionGroupWithNoArguments.txt index 751206193..11da2ddf6 100644 --- a/dev/tests/verification/Resources/ActionGroupWithNoArguments.txt +++ b/dev/tests/verification/Resources/ActionGroupWithNoArguments.txt @@ -29,8 +29,8 @@ class ActionGroupWithNoArgumentsCest */ public function ActionGroupWithNoArguments(AcceptanceTester $I) { - $I->comment("Entering Action Group actionGroupWithoutArguments (actionGroup)"); - $I->wait(1); - $I->comment("Exiting Action Group actionGroupWithoutArguments (actionGroup)"); + $I->comment("Entering Action Group [actionGroup] actionGroupWithoutArguments"); + $I->wait(1); // stepKey: waitForNothingActionGroup + $I->comment("Exiting Action Group [actionGroup] actionGroupWithoutArguments"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithNoDefaultTest.txt b/dev/tests/verification/Resources/ActionGroupWithNoDefaultTest.txt index fd5846c4a..955596301 100644 --- a/dev/tests/verification/Resources/ActionGroupWithNoDefaultTest.txt +++ b/dev/tests/verification/Resources/ActionGroupWithNoDefaultTest.txt @@ -25,7 +25,7 @@ class ActionGroupWithNoDefaultTestCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createPersonParam"); + $I->comment("[createPersonParam] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createPersonParam", "hook", @@ -33,10 +33,11 @@ class ActionGroupWithNoDefaultTestCest [], null ); - $I->comment("Entering Action Group FunctionalActionGroup (beforeGroup)"); - $I->fillField("#foo", "myData1"); - $I->fillField("#bar", "myData2"); - $I->comment("Exiting Action Group FunctionalActionGroup (beforeGroup)"); + + $I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup + $I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup"); } /** @@ -45,10 +46,10 @@ class ActionGroupWithNoDefaultTestCest */ public function _after(AcceptanceTester $I) { - $I->comment("Entering Action Group FunctionalActionGroup (afterGroup)"); - $I->fillField("#foo", "myData1"); - $I->fillField("#bar", "myData2"); - $I->comment("Exiting Action Group FunctionalActionGroup (afterGroup)"); + $I->comment("Entering Action Group [afterGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup + $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); } /** @@ -57,7 +58,7 @@ class ActionGroupWithNoDefaultTestCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** @@ -71,12 +72,12 @@ class ActionGroupWithNoDefaultTestCest */ public function ActionGroupWithNoDefaultTest(AcceptanceTester $I) { - $I->amOnPage("/someUrl"); - $I->comment("Entering Action Group FunctionalActionGroupNoDefault (actionGroupWithDataOverride1)"); - $I->fillField("#foo", "Jane"); - $I->fillField("#bar", "Dane"); - $I->see("#Jane .Dane"); - $I->comment("Exiting Action Group FunctionalActionGroupNoDefault (actionGroupWithDataOverride1)"); - $I->click("loginButton"); + $I->amOnPage("/someUrl"); // stepKey: step1 + $I->comment("Entering Action Group [actionGroupWithDataOverride1] FunctionalActionGroupNoDefault"); + $I->fillField("#foo", "Jane"); // stepKey: fillField1ActionGroupWithDataOverride1 + $I->fillField("#bar", "Dane"); // stepKey: fillField2ActionGroupWithDataOverride1 + $I->see("#Jane .Dane"); // stepKey: see2ActionGroupWithDataOverride1 + $I->comment("Exiting Action Group [actionGroupWithDataOverride1] FunctionalActionGroupNoDefault"); + $I->click("loginButton"); // stepKey: step6 } } diff --git a/dev/tests/verification/Resources/ActionGroupWithParameterizedElementWithHyphen.txt b/dev/tests/verification/Resources/ActionGroupWithParameterizedElementWithHyphen.txt index 989c5af5e..7d32e2e68 100644 --- a/dev/tests/verification/Resources/ActionGroupWithParameterizedElementWithHyphen.txt +++ b/dev/tests/verification/Resources/ActionGroupWithParameterizedElementWithHyphen.txt @@ -27,8 +27,8 @@ class ActionGroupWithParameterizedElementWithHyphenCest */ public function ActionGroupWithParameterizedElementWithHyphen(AcceptanceTester $I) { - $I->comment("Entering Action Group SectionArgumentWithParameterizedSelector (actionGroup)"); - $keyoneActionGroup = $I->executeJS("#element .full-width"); - $I->comment("Exiting Action Group SectionArgumentWithParameterizedSelector (actionGroup)"); + $I->comment("Entering Action Group [actionGroup] SectionArgumentWithParameterizedSelector"); + $keyoneActionGroup = $I->executeJS("#element .full-width"); // stepKey: keyoneActionGroup + $I->comment("Exiting Action Group [actionGroup] SectionArgumentWithParameterizedSelector"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt b/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt index 7df77e742..6b85f8b47 100644 --- a/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt +++ b/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt @@ -29,8 +29,8 @@ class ActionGroupWithPassedArgumentAndStringSelectorParamCest */ public function ActionGroupWithPassedArgumentAndStringSelectorParam(AcceptanceTester $I) { - $I->comment("Entering Action Group actionGroupWithDefaultArgumentAndStringSelectorParam (actionGroup)"); - $I->see("John" . msq("UniquePerson"), "#element .test1"); - $I->comment("Exiting Action Group actionGroupWithDefaultArgumentAndStringSelectorParam (actionGroup)"); + $I->comment("Entering Action Group [actionGroup] actionGroupWithDefaultArgumentAndStringSelectorParam"); + $I->see("John" . msq("UniquePerson"), "#element .test1"); // stepKey: seeFirstNameActionGroup + $I->comment("Exiting Action Group [actionGroup] actionGroupWithDefaultArgumentAndStringSelectorParam"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithPersistedData.txt b/dev/tests/verification/Resources/ActionGroupWithPersistedData.txt index 2f58e390c..aba5c5796 100644 --- a/dev/tests/verification/Resources/ActionGroupWithPersistedData.txt +++ b/dev/tests/verification/Resources/ActionGroupWithPersistedData.txt @@ -25,7 +25,7 @@ class ActionGroupWithPersistedDataCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createPersonParam"); + $I->comment("[createPersonParam] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createPersonParam", "hook", @@ -33,10 +33,11 @@ class ActionGroupWithPersistedDataCest [], null ); - $I->comment("Entering Action Group FunctionalActionGroup (beforeGroup)"); - $I->fillField("#foo", "myData1"); - $I->fillField("#bar", "myData2"); - $I->comment("Exiting Action Group FunctionalActionGroup (beforeGroup)"); + + $I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup + $I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup"); } /** @@ -45,10 +46,10 @@ class ActionGroupWithPersistedDataCest */ public function _after(AcceptanceTester $I) { - $I->comment("Entering Action Group FunctionalActionGroup (afterGroup)"); - $I->fillField("#foo", "myData1"); - $I->fillField("#bar", "myData2"); - $I->comment("Exiting Action Group FunctionalActionGroup (afterGroup)"); + $I->comment("Entering Action Group [afterGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup + $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); } /** @@ -57,7 +58,7 @@ class ActionGroupWithPersistedDataCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** @@ -71,7 +72,7 @@ class ActionGroupWithPersistedDataCest */ public function ActionGroupWithPersistedData(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createPerson"); + $I->comment("[createPerson] create 'DefaultPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createPerson", "test", @@ -79,12 +80,13 @@ class ActionGroupWithPersistedDataCest [], null ); - $I->comment("Entering Action Group FunctionalActionGroupWithData (actionGroupWithPersistedData1)"); - $I->amOnPage("/" . PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'firstname', 'test') . "/" . PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'lastname', 'test') . ".html"); - $I->fillField("#foo", PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'firstname', 'test')); - $I->fillField("#bar", PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'lastname', 'test')); - $I->searchAndMultiSelectOption("#foo", [PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'lastname', 'test')]); - $I->see("#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'firstname', 'test')); - $I->comment("Exiting Action Group FunctionalActionGroupWithData (actionGroupWithPersistedData1)"); + + $I->comment("Entering Action Group [actionGroupWithPersistedData1] FunctionalActionGroupWithData"); + $I->amOnPage("/" . PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'firstname', 'test') . "/" . PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'lastname', 'test') . ".html"); // stepKey: amOnPage1ActionGroupWithPersistedData1 + $I->fillField("#foo", PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'firstname', 'test')); // stepKey: fillField1ActionGroupWithPersistedData1 + $I->fillField("#bar", PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'lastname', 'test')); // stepKey: fillField2ActionGroupWithPersistedData1 + $I->searchAndMultiSelectOption("#foo", [PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'lastname', 'test')]); // stepKey: multi1ActionGroupWithPersistedData1 + $I->see("#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'firstname', 'test')); // stepKey: see1ActionGroupWithPersistedData1 + $I->comment("Exiting Action Group [actionGroupWithPersistedData1] FunctionalActionGroupWithData"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithSectionAndDataAsArguments.txt b/dev/tests/verification/Resources/ActionGroupWithSectionAndDataAsArguments.txt index 34c2a0ea1..20a9c5137 100644 --- a/dev/tests/verification/Resources/ActionGroupWithSectionAndDataAsArguments.txt +++ b/dev/tests/verification/Resources/ActionGroupWithSectionAndDataAsArguments.txt @@ -27,8 +27,8 @@ class ActionGroupWithSectionAndDataAsArgumentsCest */ public function ActionGroupWithSectionAndDataAsArguments(AcceptanceTester $I) { - $I->comment("Entering Action Group actionGroupWithSectionAndData (actionGroup)"); - $I->waitForElementVisible("#element .John", 10); - $I->comment("Exiting Action Group actionGroupWithSectionAndData (actionGroup)"); + $I->comment("Entering Action Group [actionGroup] actionGroupWithSectionAndData"); + $I->waitForElementVisible("#element .John", 10); // stepKey: arg1ActionGroup + $I->comment("Exiting Action Group [actionGroup] actionGroupWithSectionAndData"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromDefaultArgument.txt b/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromDefaultArgument.txt index f4840d88a..52cdeb83d 100644 --- a/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromDefaultArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromDefaultArgument.txt @@ -29,8 +29,8 @@ class ActionGroupWithSimpleDataUsageFromDefaultArgumentCest */ public function ActionGroupWithSimpleDataUsageFromDefaultArgument(AcceptanceTester $I) { - $I->comment("Entering Action Group actionGroupWithStringUsage (actionGroup)"); - $I->see("stringLiteral", "#element .stringLiteral"); - $I->comment("Exiting Action Group actionGroupWithStringUsage (actionGroup)"); + $I->comment("Entering Action Group [actionGroup] actionGroupWithStringUsage"); + $I->see("stringLiteral", "#element .stringLiteral"); // stepKey: see1ActionGroup + $I->comment("Exiting Action Group [actionGroup] actionGroupWithStringUsage"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromPassedArgument.txt b/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromPassedArgument.txt index 4f67da1aa..9ad3dd560 100644 --- a/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromPassedArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromPassedArgument.txt @@ -29,35 +29,35 @@ class ActionGroupWithSimpleDataUsageFromPassedArgumentCest */ public function ActionGroupWithSimpleDataUsageFromPassedArgument(AcceptanceTester $I) { - $I->comment("Entering Action Group actionGroupWithStringUsage (actionGroup1)"); - $I->see("overrideString", "#element .overrideString"); - $I->comment("Exiting Action Group actionGroupWithStringUsage (actionGroup1)"); - $I->comment("Entering Action Group actionGroupWithStringUsage (actionGroup11)"); - $I->see("1", "#element .1"); - $I->comment("Exiting Action Group actionGroupWithStringUsage (actionGroup11)"); - $I->comment("Entering Action Group actionGroupWithStringUsage (actionGroup12)"); - $I->see("1.5", "#element .1.5"); - $I->comment("Exiting Action Group actionGroupWithStringUsage (actionGroup12)"); - $I->comment("Entering Action Group actionGroupWithStringUsage (actionGroup13)"); - $I->see("true", "#element .true"); - $I->comment("Exiting Action Group actionGroupWithStringUsage (actionGroup13)"); - $I->comment("Entering Action Group actionGroupWithStringUsage (actionGroup2)"); - $I->see("simpleData.firstname", "#element .simpleData.firstname"); - $I->comment("Exiting Action Group actionGroupWithStringUsage (actionGroup2)"); - $I->comment("Entering Action Group actionGroupWithStringUsage (actionGroup3)"); - $I->see(PersistedObjectHandler::getInstance()->retrieveEntityField('persisted', 'data', 'test'), "#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('persisted', 'data', 'test')); - $I->comment("Exiting Action Group actionGroupWithStringUsage (actionGroup3)"); - $I->comment("Entering Action Group actionGroupWithEntityUsage (actionGroup4)"); - $I->see("John", "#element .John"); - $I->comment("Exiting Action Group actionGroupWithEntityUsage (actionGroup4)"); - $I->comment("Entering Action Group actionGroupWithEntityUsage (actionGroup5)"); - $I->see(PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname', 'test'), "#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname', 'test')); - $I->comment("Exiting Action Group actionGroupWithEntityUsage (actionGroup5)"); - $I->comment("Entering Action Group actionGroupWithEntityUsage (actionGroup6)"); - $I->see(PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname[0]', 'test'), "#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname[0]', 'test')); - $I->comment("Exiting Action Group actionGroupWithEntityUsage (actionGroup6)"); - $I->comment("Entering Action Group actionGroupWithEntityUsage (actionGroup7)"); - $I->see(PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname[data_index]', 'test'), "#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname[data_index]', 'test')); - $I->comment("Exiting Action Group actionGroupWithEntityUsage (actionGroup7)"); + $I->comment("Entering Action Group [actionGroup1] actionGroupWithStringUsage"); + $I->see("overrideString", "#element .overrideString"); // stepKey: see1ActionGroup1 + $I->comment("Exiting Action Group [actionGroup1] actionGroupWithStringUsage"); + $I->comment("Entering Action Group [actionGroup11] actionGroupWithStringUsage"); + $I->see("1", "#element .1"); // stepKey: see1ActionGroup11 + $I->comment("Exiting Action Group [actionGroup11] actionGroupWithStringUsage"); + $I->comment("Entering Action Group [actionGroup12] actionGroupWithStringUsage"); + $I->see("1.5", "#element .1.5"); // stepKey: see1ActionGroup12 + $I->comment("Exiting Action Group [actionGroup12] actionGroupWithStringUsage"); + $I->comment("Entering Action Group [actionGroup13] actionGroupWithStringUsage"); + $I->see("true", "#element .true"); // stepKey: see1ActionGroup13 + $I->comment("Exiting Action Group [actionGroup13] actionGroupWithStringUsage"); + $I->comment("Entering Action Group [actionGroup2] actionGroupWithStringUsage"); + $I->see("simpleData.firstname", "#element .simpleData.firstname"); // stepKey: see1ActionGroup2 + $I->comment("Exiting Action Group [actionGroup2] actionGroupWithStringUsage"); + $I->comment("Entering Action Group [actionGroup3] actionGroupWithStringUsage"); + $I->see(PersistedObjectHandler::getInstance()->retrieveEntityField('persisted', 'data', 'test'), "#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('persisted', 'data', 'test')); // stepKey: see1ActionGroup3 + $I->comment("Exiting Action Group [actionGroup3] actionGroupWithStringUsage"); + $I->comment("Entering Action Group [actionGroup4] actionGroupWithEntityUsage"); + $I->see("John", "#element .John"); // stepKey: see1ActionGroup4 + $I->comment("Exiting Action Group [actionGroup4] actionGroupWithEntityUsage"); + $I->comment("Entering Action Group [actionGroup5] actionGroupWithEntityUsage"); + $I->see(PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname', 'test'), "#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname', 'test')); // stepKey: see1ActionGroup5 + $I->comment("Exiting Action Group [actionGroup5] actionGroupWithEntityUsage"); + $I->comment("Entering Action Group [actionGroup6] actionGroupWithEntityUsage"); + $I->see(PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname[0]', 'test'), "#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname[0]', 'test')); // stepKey: see1ActionGroup6 + $I->comment("Exiting Action Group [actionGroup6] actionGroupWithEntityUsage"); + $I->comment("Entering Action Group [actionGroup7] actionGroupWithEntityUsage"); + $I->see(PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname[data_index]', 'test'), "#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname[data_index]', 'test')); // stepKey: see1ActionGroup7 + $I->comment("Exiting Action Group [actionGroup7] actionGroupWithEntityUsage"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromDefaultArgument.txt b/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromDefaultArgument.txt index 89979bf97..48fc52ff4 100644 --- a/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromDefaultArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromDefaultArgument.txt @@ -29,8 +29,8 @@ class ActionGroupWithSingleParameterSelectorFromDefaultArgumentCest */ public function ActionGroupWithSingleParameterSelectorFromDefaultArgument(AcceptanceTester $I) { - $I->comment("Entering Action Group actionGroupWithSingleParameterSelectorFromArgument (actionGroup)"); - $I->see("Doe", "#element .John"); - $I->comment("Exiting Action Group actionGroupWithSingleParameterSelectorFromArgument (actionGroup)"); + $I->comment("Entering Action Group [actionGroup] actionGroupWithSingleParameterSelectorFromArgument"); + $I->see("Doe", "#element .John"); // stepKey: seeLastNameActionGroup + $I->comment("Exiting Action Group [actionGroup] actionGroupWithSingleParameterSelectorFromArgument"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromPassedArgument.txt b/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromPassedArgument.txt index b4707ff0c..97c8bca5b 100644 --- a/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromPassedArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromPassedArgument.txt @@ -29,8 +29,8 @@ class ActionGroupWithSingleParameterSelectorFromPassedArgumentCest */ public function ActionGroupWithSingleParameterSelectorFromPassedArgument(AcceptanceTester $I) { - $I->comment("Entering Action Group actionGroupWithSingleParameterSelectorFromArgument (actionGroup)"); - $I->see("Doe", "#element .John" . msq("UniquePerson")); - $I->comment("Exiting Action Group actionGroupWithSingleParameterSelectorFromArgument (actionGroup)"); + $I->comment("Entering Action Group [actionGroup] actionGroupWithSingleParameterSelectorFromArgument"); + $I->see("Doe", "#element .John" . msq("UniquePerson")); // stepKey: seeLastNameActionGroup + $I->comment("Exiting Action Group [actionGroup] actionGroupWithSingleParameterSelectorFromArgument"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithStepKeyReferences.txt b/dev/tests/verification/Resources/ActionGroupWithStepKeyReferences.txt index 92b54622c..336cd6610 100644 --- a/dev/tests/verification/Resources/ActionGroupWithStepKeyReferences.txt +++ b/dev/tests/verification/Resources/ActionGroupWithStepKeyReferences.txt @@ -27,8 +27,8 @@ class ActionGroupWithStepKeyReferencesCest */ public function ActionGroupWithStepKeyReferences(AcceptanceTester $I) { - $I->comment("Entering Action Group FunctionActionGroupWithStepKeyReferences (actionGroup)"); - $I->amGoingTo("create entity that has the stepKey: createSimpleDataActionGroup"); + $I->comment("Entering Action Group [actionGroup] FunctionActionGroupWithStepKeyReferences"); + $I->comment("[createSimpleDataActionGroup] create 'simpleData' entity"); PersistedObjectHandler::getInstance()->createEntity( "createSimpleDataActionGroup", "test", @@ -36,26 +36,30 @@ class ActionGroupWithStepKeyReferencesCest [], null ); - $grabTextDataActionGroup = $I->grabTextFrom(".class"); - $I->fillField(".{$grabTextDataActionGroup}", PersistedObjectHandler::getInstance()->retrieveEntityField('createSimpleDataActionGroup', 'field', 'test')); + + $grabTextDataActionGroup = $I->grabTextFrom(".class"); // stepKey: grabTextDataActionGroup + $I->fillField(".{$grabTextDataActionGroup}", PersistedObjectHandler::getInstance()->retrieveEntityField('createSimpleDataActionGroup', 'field', 'test')); // stepKey: fill1ActionGroup $I->comment("Invocation stepKey will not be appended in non stepKey instances"); - $I->click($action0); - $I->fillField($action1); + $I->click($action0); // stepKey: action0ActionGroup + $I->fillField($action1); // stepKey: action1ActionGroup $I->comment("Invocation stepKey will be appended in non stepKey instances"); - $action3ActionGroup = $I->executeJS($action3ActionGroup); - $action4ActionGroup = $I->magentoCLI($action4ActionGroup, "\"stuffHere\""); + $action3ActionGroup = $I->executeJS($action3ActionGroup); // stepKey: action3ActionGroup + $action4ActionGroup = $I->magentoCLI($action4ActionGroup, "\"stuffHere\""); // stepKey: action4ActionGroup $I->comment($action4ActionGroup); + $date = new \DateTime(); $date->setTimestamp(strtotime("{$action5}")); $date->setTimezone(new \DateTimeZone("America/Los_Angeles")); $action5ActionGroup = $date->format("H:i:s"); - $action6ActionGroup = $I->formatMoney($action6ActionGroup); - $I->amGoingTo("delete entity that has the createDataKey: {$action7ActionGroupActionGroup}"); + + $action6ActionGroup = $I->formatMoney($action6ActionGroup); // stepKey: action6ActionGroup + $I->comment("[action7ActionGroup] delete entity '{$action7ActionGroupActionGroup}'"); PersistedObjectHandler::getInstance()->deleteEntity( "{$action7ActionGroupActionGroup}", "test" ); - $I->amGoingTo("get entity that has the stepKey: action8ActionGroup"); + + $I->comment("[action8ActionGroup] get '{$action8}' entity"); PersistedObjectHandler::getInstance()->getEntity( "action8ActionGroup", "test", @@ -63,14 +67,16 @@ class ActionGroupWithStepKeyReferencesCest [], null ); - $I->amGoingTo("update entity that has the createdDataKey: 1"); + + $I->comment("[action9ActionGroup] update '1' entity to '{$action9}'"); PersistedObjectHandler::getInstance()->updateEntity( "1", "test", "{$action9}", [] ); - $I->amGoingTo("create entity that has the stepKey: action10ActionGroup"); + + $I->comment("[action10ActionGroup] create '{$action10}' entity"); PersistedObjectHandler::getInstance()->createEntity( "action10ActionGroup", "test", @@ -78,12 +84,13 @@ class ActionGroupWithStepKeyReferencesCest [], null ); - $action11ActionGroup = $I->grabAttributeFrom($action11ActionGroup, "someInput"); - $action12ActionGroup = $I->grabCookie($action12ActionGroup, ['domain' => 'www.google.com']); - $action13ActionGroup = $I->grabFromCurrentUrl($action13ActionGroup); - $action14ActionGroup = $I->grabMultiple($action14ActionGroup); - $action15ActionGroup = $I->grabTextFrom($action15ActionGroup); - $action16ActionGroup = $I->grabValueFrom($action16ActionGroup); - $I->comment("Exiting Action Group FunctionActionGroupWithStepKeyReferences (actionGroup)"); + + $action11ActionGroup = $I->grabAttributeFrom($action11ActionGroup, "someInput"); // stepKey: action11ActionGroup + $action12ActionGroup = $I->grabCookie($action12ActionGroup, ['domain' => 'www.google.com']); // stepKey: action12ActionGroup + $action13ActionGroup = $I->grabFromCurrentUrl($action13ActionGroup); // stepKey: action13ActionGroup + $action14ActionGroup = $I->grabMultiple($action14ActionGroup); // stepKey: action14ActionGroup + $action15ActionGroup = $I->grabTextFrom($action15ActionGroup); // stepKey: action15ActionGroup + $action16ActionGroup = $I->grabValueFrom($action16ActionGroup); // stepKey: action16ActionGroup + $I->comment("Exiting Action Group [actionGroup] FunctionActionGroupWithStepKeyReferences"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithTopLevelPersistedData.txt b/dev/tests/verification/Resources/ActionGroupWithTopLevelPersistedData.txt index 463e5b307..fffaebbfd 100644 --- a/dev/tests/verification/Resources/ActionGroupWithTopLevelPersistedData.txt +++ b/dev/tests/verification/Resources/ActionGroupWithTopLevelPersistedData.txt @@ -25,7 +25,7 @@ class ActionGroupWithTopLevelPersistedDataCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createPersonParam"); + $I->comment("[createPersonParam] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createPersonParam", "hook", @@ -33,10 +33,11 @@ class ActionGroupWithTopLevelPersistedDataCest [], null ); - $I->comment("Entering Action Group FunctionalActionGroup (beforeGroup)"); - $I->fillField("#foo", "myData1"); - $I->fillField("#bar", "myData2"); - $I->comment("Exiting Action Group FunctionalActionGroup (beforeGroup)"); + + $I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup + $I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup"); } /** @@ -45,10 +46,10 @@ class ActionGroupWithTopLevelPersistedDataCest */ public function _after(AcceptanceTester $I) { - $I->comment("Entering Action Group FunctionalActionGroup (afterGroup)"); - $I->fillField("#foo", "myData1"); - $I->fillField("#bar", "myData2"); - $I->comment("Exiting Action Group FunctionalActionGroup (afterGroup)"); + $I->comment("Entering Action Group [afterGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup + $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); } /** @@ -57,7 +58,7 @@ class ActionGroupWithTopLevelPersistedDataCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** @@ -71,12 +72,12 @@ class ActionGroupWithTopLevelPersistedDataCest */ public function ActionGroupWithTopLevelPersistedData(AcceptanceTester $I) { - $I->comment("Entering Action Group FunctionalActionGroupWithData (actionGroupWithPersistedData1)"); - $I->amOnPage("/" . PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'firstname', 'test') . "/" . PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'lastname', 'test') . ".html"); - $I->fillField("#foo", PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'firstname', 'test')); - $I->fillField("#bar", PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'lastname', 'test')); - $I->searchAndMultiSelectOption("#foo", [PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'lastname', 'test')]); - $I->see("#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'firstname', 'test')); - $I->comment("Exiting Action Group FunctionalActionGroupWithData (actionGroupWithPersistedData1)"); + $I->comment("Entering Action Group [actionGroupWithPersistedData1] FunctionalActionGroupWithData"); + $I->amOnPage("/" . PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'firstname', 'test') . "/" . PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'lastname', 'test') . ".html"); // stepKey: amOnPage1ActionGroupWithPersistedData1 + $I->fillField("#foo", PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'firstname', 'test')); // stepKey: fillField1ActionGroupWithPersistedData1 + $I->fillField("#bar", PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'lastname', 'test')); // stepKey: fillField2ActionGroupWithPersistedData1 + $I->searchAndMultiSelectOption("#foo", [PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'lastname', 'test')]); // stepKey: multi1ActionGroupWithPersistedData1 + $I->see("#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'firstname', 'test')); // stepKey: see1ActionGroupWithPersistedData1 + $I->comment("Exiting Action Group [actionGroupWithPersistedData1] FunctionalActionGroupWithData"); } } diff --git a/dev/tests/verification/Resources/ArgumentWithSameNameAsElement.txt b/dev/tests/verification/Resources/ArgumentWithSameNameAsElement.txt index d1621fd73..4ccc2d169 100644 --- a/dev/tests/verification/Resources/ArgumentWithSameNameAsElement.txt +++ b/dev/tests/verification/Resources/ArgumentWithSameNameAsElement.txt @@ -25,7 +25,7 @@ class ArgumentWithSameNameAsElementCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createPersonParam"); + $I->comment("[createPersonParam] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createPersonParam", "hook", @@ -33,10 +33,11 @@ class ArgumentWithSameNameAsElementCest [], null ); - $I->comment("Entering Action Group FunctionalActionGroup (beforeGroup)"); - $I->fillField("#foo", "myData1"); - $I->fillField("#bar", "myData2"); - $I->comment("Exiting Action Group FunctionalActionGroup (beforeGroup)"); + + $I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup + $I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup"); } /** @@ -45,10 +46,10 @@ class ArgumentWithSameNameAsElementCest */ public function _after(AcceptanceTester $I) { - $I->comment("Entering Action Group FunctionalActionGroup (afterGroup)"); - $I->fillField("#foo", "myData1"); - $I->fillField("#bar", "myData2"); - $I->comment("Exiting Action Group FunctionalActionGroup (afterGroup)"); + $I->comment("Entering Action Group [afterGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup + $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); } /** @@ -57,7 +58,7 @@ class ArgumentWithSameNameAsElementCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** @@ -71,9 +72,9 @@ class ArgumentWithSameNameAsElementCest */ public function ArgumentWithSameNameAsElement(AcceptanceTester $I) { - $I->comment("Entering Action Group FunctionalActionGroupWithTrickyArgument (actionGroup1)"); - $I->seeElement("#element"); - $I->seeElement("#element .John"); - $I->comment("Exiting Action Group FunctionalActionGroupWithTrickyArgument (actionGroup1)"); + $I->comment("Entering Action Group [actionGroup1] FunctionalActionGroupWithTrickyArgument"); + $I->seeElement("#element"); // stepKey: see1ActionGroup1 + $I->seeElement("#element .John"); // stepKey: see2ActionGroup1 + $I->comment("Exiting Action Group [actionGroup1] FunctionalActionGroupWithTrickyArgument"); } } diff --git a/dev/tests/verification/Resources/AssertTest.txt b/dev/tests/verification/Resources/AssertTest.txt index adc764975..697bc3d21 100644 --- a/dev/tests/verification/Resources/AssertTest.txt +++ b/dev/tests/verification/Resources/AssertTest.txt @@ -24,7 +24,7 @@ class AssertTestCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createData1"); + $I->comment("[createData1] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createData1", "hook", @@ -32,6 +32,7 @@ class AssertTestCest [], null ); + } /** @@ -43,7 +44,7 @@ class AssertTestCest */ public function AssertTest(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createData2"); + $I->comment("[createData2] create 'UniquePerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createData2", "test", @@ -51,112 +52,121 @@ class AssertTestCest [], null ); - $grabTextFrom1 = $I->grabTextFrom(".copyright>span"); - $I->assertArrayIsSorted(["1", "2", "3", "4", "5"], "asc"); + + $grabTextFrom1 = $I->grabTextFrom(".copyright>span"); // stepKey: grabTextFrom1 + $I->comment("custom asserts"); + $I->assertArrayIsSorted(["1", "2", "3", "4", "5"], "asc"); // stepKey: assertSorted1 + $I->comment("asserts without variable replacement"); $I->comment("asserts without variable replacement"); - $I->assertArrayHasKey("apple", ['orange' => 2, 'apple' => 1], "pass"); - $I->assertArrayNotHasKey("kiwi", ['orange' => 2, 'apple' => 1], "pass"); - $I->assertArraySubset([1, 2], [1, 2, 3, 5], "pass"); - $I->assertContains("ab", ['item1' => 'a', 'item2' => 'ab'], "pass"); - $I->assertCount(2, ['a', 'b'], "pass"); - $I->assertEmpty([], "pass"); - $I->assertEquals($text, "Copyright © 2013-2017 Magento, Inc. All rights reserved.", "pass"); - $I->assertEquals("Copyright © 2013-2017 Magento, Inc. All rights reserved.", $text, "pass"); - $I->assertFalse(false, "pass"); - $I->assertFileNotExists("/out.txt", "pass"); - $I->assertFileNotExists($text, "pass"); - $I->assertGreaterOrEquals(2, 5, "pass"); - $I->assertGreaterThan(2, 5, "pass"); - $I->assertGreaterThanOrEqual(2, 5, "pass"); - $I->assertInternalType("string", "xyz", "pass"); - $I->assertInternalType("int", 21, "pass"); - $I->assertInternalType("string", $text, "pass"); - $I->assertLessOrEquals(5, 2, "pass"); - $I->assertLessThan(5, 2, "pass"); - $I->assertLessThanOrEqual(5, 2, "pass"); - $I->assertNotContains("bc", ['item1' => 'a', 'item2' => 'ab'], "pass"); - $I->assertNotContains("bc", $text, "pass"); - $I->assertNotEmpty([1, 2], "pass"); - $I->assertNotEmpty($text, "pass"); - $I->assertNotEquals(2, 5, "pass", 0); - $I->assertNotNull("abc", "pass"); - $I->assertNotNull($text, "pass"); - $I->assertNotRegExp("/foo/", "bar", "pass"); - $I->assertNotSame("log", "tag", "pass"); - $I->assertRegExp("/foo/", "foo", "pass"); - $I->assertSame("bar", "bar", "pass"); - $I->assertStringStartsNotWith("a", "banana", "pass"); - $I->assertStringStartsWith("a", "apple", "pass"); - $I->assertTrue(true, "pass"); + $I->assertArrayHasKey("apple", ['orange' => 2, 'apple' => 1], "pass"); // stepKey: assertArrayHasKey + $I->assertArrayNotHasKey("kiwi", ['orange' => 2, 'apple' => 1], "pass"); // stepKey: assertArrayNotHasKey + $I->assertArraySubset([1, 2], [1, 2, 3, 5], "pass"); // stepKey: assertArraySubset + $I->assertContains("ab", ['item1' => 'a', 'item2' => 'ab'], "pass"); // stepKey: assertContains + $I->assertCount(2, ['a', 'b'], "pass"); // stepKey: assertCount + $I->assertEmpty([], "pass"); // stepKey: assertEmpty + $I->assertEquals($text, "Copyright © 2013-2017 Magento, Inc. All rights reserved.", "pass"); // stepKey: assertEquals1 + $I->assertEquals("Copyright © 2013-2017 Magento, Inc. All rights reserved.", $text, "pass"); // stepKey: assertEquals2 + $I->assertFalse(false, "pass"); // stepKey: assertFalse1 + $I->assertFileNotExists("/out.txt", "pass"); // stepKey: assertFileNotExists1 + $I->assertFileNotExists($text, "pass"); // stepKey: assertFileNotExists2 + $I->assertGreaterOrEquals(2, 5, "pass"); // stepKey: assertGreaterOrEquals + $I->assertGreaterThan(2, 5, "pass"); // stepKey: assertGreaterthan + $I->assertGreaterThanOrEqual(2, 5, "pass"); // stepKey: assertGreaterThanOrEqual + $I->assertInternalType("string", "xyz", "pass"); // stepKey: assertInternalType1 + $I->assertInternalType("int", 21, "pass"); // stepKey: assertInternalType2 + $I->assertInternalType("string", $text, "pass"); // stepKey: assertInternalType3 + $I->assertLessOrEquals(5, 2, "pass"); // stepKey: assertLessOrEquals + $I->assertLessThan(5, 2, "pass"); // stepKey: assertLessThan + $I->assertLessThanOrEqual(5, 2, "pass"); // stepKey: assertLessThanOrEquals + $I->assertNotContains("bc", ['item1' => 'a', 'item2' => 'ab'], "pass"); // stepKey: assertNotContains1 + $I->assertNotContains("bc", $text, "pass"); // stepKey: assertNotContains2 + $I->assertNotEmpty([1, 2], "pass"); // stepKey: assertNotEmpty1 + $I->assertNotEmpty($text, "pass"); // stepKey: assertNotEmpty2 + $I->assertNotEquals(2, 5, "pass", 0); // stepKey: assertNotEquals + $I->assertNotNull("abc", "pass"); // stepKey: assertNotNull1 + $I->assertNotNull($text, "pass"); // stepKey: assertNotNull2 + $I->assertNotRegExp("/foo/", "bar", "pass"); // stepKey: assertNotRegExp + $I->assertNotSame("log", "tag", "pass"); // stepKey: assertNotSame + $I->assertRegExp("/foo/", "foo", "pass"); // stepKey: assertRegExp + $I->assertSame("bar", "bar", "pass"); // stepKey: assertSame + $I->assertStringStartsNotWith("a", "banana", "pass"); // stepKey: assertStringStartsNotWith + $I->assertStringStartsWith("a", "apple", "pass"); // stepKey: assertStringStartsWith + $I->assertTrue(true, "pass"); // stepKey: assertTrue $I->comment("asserts backward compatible"); - $I->assertArrayHasKey("apple", ['orange' => 2, 'apple' => 1], "pass"); - $I->assertArrayNotHasKey("kiwi", ['orange' => 2, 'apple' => 1], "pass"); - $I->assertArraySubset([1, 2], [1, 2, 3, 5], "pass"); - $I->assertContains("ab", ['item1' => 'a', 'item2' => 'ab'], "pass"); - $I->assertCount(2, ['a', 'b'], "pass"); - $I->assertEmpty([], "pass"); - $I->assertEquals($text, "Copyright © 2013-2017 Magento, Inc. All rights reserved.", "pass"); - $I->assertEquals("Copyright © 2013-2017 Magento, Inc. All rights reserved.", $text, "pass"); - $I->assertFalse(false, "pass"); - $I->assertFileNotExists("/out.txt", "pass"); - $I->assertFileNotExists($text, "pass"); - $I->assertGreaterOrEquals(2, 5, "pass"); - $I->assertGreaterThan(2, 5, "pass"); - $I->assertGreaterThanOrEqual(2, 5, "pass"); - $I->assertInternalType("string", "xyz", "pass"); - $I->assertInternalType("int", 21, "pass"); - $I->assertInternalType("string", $text, "pass"); - $I->assertLessOrEquals(5, 2, "pass"); - $I->assertLessThan(5, 2, "pass"); - $I->assertLessThanOrEqual(5, 2, "pass"); - $I->assertNotContains("bc", ['item1' => 'a', 'item2' => 'ab'], "pass"); - $I->assertNotContains("bc", $text, "pass"); - $I->assertNotEmpty([1, 2], "pass"); - $I->assertNotEmpty($text, "pass"); - $I->assertNotEquals(2, 5, "pass", 0); - $I->assertNotNull("abc", "pass"); - $I->assertNotNull($text, "pass"); - $I->assertNotRegExp("/foo/", "bar", "pass"); - $I->assertNotSame("log", "tag", "pass"); - $I->assertRegExp("/foo/", "foo", "pass"); - $I->assertSame("bar", "bar", "pass"); - $I->assertStringStartsNotWith("a", "banana", "pass"); - $I->assertStringStartsWith("a", "apple", "pass"); - $I->assertTrue(true, "pass"); - $I->assertElementContainsAttribute("#username", "class", "admin__control-text"); - $I->assertInstanceOf(User::class, $text, "pass"); - $I->assertNotInstanceOf(User::class, 21, "pass"); - $I->assertFileExists($text, "pass"); - $I->assertIsEmpty($text, "pass"); - $I->assertNull($text, "pass"); - $I->expectException(new MyException('exception msg'), function() {$this->doSomethingBad();}); + $I->comment("asserts backward compatible"); + $I->assertArrayHasKey("apple", ['orange' => 2, 'apple' => 1], "pass"); // stepKey: assertArrayHasKeyBackwardCompatible + $I->assertArrayNotHasKey("kiwi", ['orange' => 2, 'apple' => 1], "pass"); // stepKey: assertArrayNotHasKeyBackwardCompatible + $I->assertArraySubset([1, 2], [1, 2, 3, 5], "pass"); // stepKey: assertArraySubsetBackwardCompatible + $I->assertContains("ab", ['item1' => 'a', 'item2' => 'ab'], "pass"); // stepKey: assertContainsBackwardCompatible + $I->assertCount(2, ['a', 'b'], "pass"); // stepKey: assertCountBackwardCompatible + $I->assertEmpty([], "pass"); // stepKey: assertEmptyBackwardCompatible + $I->assertEquals($text, "Copyright © 2013-2017 Magento, Inc. All rights reserved.", "pass"); // stepKey: assertEquals1BackwardCompatible + $I->assertEquals("Copyright © 2013-2017 Magento, Inc. All rights reserved.", $text, "pass"); // stepKey: assertEquals2BackwardCompatible + $I->assertFalse(false, "pass"); // stepKey: assertFalse1BackwardCompatible + $I->assertFileNotExists("/out.txt", "pass"); // stepKey: assertFileNotExists1BackwardCompatible + $I->assertFileNotExists($text, "pass"); // stepKey: assertFileNotExists2BackwardCompatible + $I->assertGreaterOrEquals(2, 5, "pass"); // stepKey: assertGreaterOrEqualsBackwardCompatible + $I->assertGreaterThan(2, 5, "pass"); // stepKey: assertGreaterThanBackwardCompatible + $I->assertGreaterThanOrEqual(2, 5, "pass"); // stepKey: assertGreaterThanOrEqualBackwardCompatible + $I->assertInternalType("string", "xyz", "pass"); // stepKey: assertInternalType1BackwardCompatible + $I->assertInternalType("int", 21, "pass"); // stepKey: assertInternalType2BackwardCompatible + $I->assertInternalType("string", $text, "pass"); // stepKey: assertInternalType3BackwardCompatible + $I->assertLessOrEquals(5, 2, "pass"); // stepKey: assertLessOrEqualBackwardCompatibles + $I->assertLessThan(5, 2, "pass"); // stepKey: assertLessThanBackwardCompatible + $I->assertLessThanOrEqual(5, 2, "pass"); // stepKey: assertLessThanOrEqualBackwardCompatible + $I->assertNotContains("bc", ['item1' => 'a', 'item2' => 'ab'], "pass"); // stepKey: assertNotContains1BackwardCompatible + $I->assertNotContains("bc", $text, "pass"); // stepKey: assertNotContains2BackwardCompatible + $I->assertNotEmpty([1, 2], "pass"); // stepKey: assertNotEmpty1BackwardCompatible + $I->assertNotEmpty($text, "pass"); // stepKey: assertNotEmpty2BackwardCompatible + $I->assertNotEquals(2, 5, "pass", 0); // stepKey: assertNotEqualsBackwardCompatible + $I->assertNotNull("abc", "pass"); // stepKey: assertNotNull1BackwardCompatible + $I->assertNotNull($text, "pass"); // stepKey: assertNotNull2BackwardCompatible + $I->assertNotRegExp("/foo/", "bar", "pass"); // stepKey: assertNotRegExpBackwardCompatible + $I->assertNotSame("log", "tag", "pass"); // stepKey: assertNotSameBackwardCompatible + $I->assertRegExp("/foo/", "foo", "pass"); // stepKey: assertRegExpBackwardCompatible + $I->assertSame("bar", "bar", "pass"); // stepKey: assertSameBackwardCompatible + $I->assertStringStartsNotWith("a", "banana", "pass"); // stepKey: assertStringStartsNotWithBackwardCompatible + $I->assertStringStartsWith("a", "apple", "pass"); // stepKey: assertStringStartsWithBackwardCompatible + $I->assertTrue(true, "pass"); // stepKey: assertTrueBackwardCompatible + $I->assertElementContainsAttribute("#username", "class", "admin__control-text"); // stepKey: assertElementContainsAttributeBackwardCompatible + $I->assertInstanceOf(User::class, $text, "pass"); // stepKey: assertInstanceOfBackwardCompatible + $I->assertNotInstanceOf(User::class, 21, "pass"); // stepKey: assertNotInstanceOfBackwardCompatible + $I->assertFileExists($text, "pass"); // stepKey: assertFileExistsBackwardCompatible + $I->assertIsEmpty($text, "pass"); // stepKey: assertIsEmptyBackwardCompatible + $I->assertNull($text, "pass"); // stepKey: assertNullBackwardCompatible + $I->expectException(new MyException('exception msg'), function() {$this->doSomethingBad();}); // stepKey: expectExceptionBackwardCompatible + $I->comment("string type that use created data"); $I->comment("string type that use created data"); - $I->assertStringStartsWith("D", PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test') . ", " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test'), "fail"); - $I->assertStringStartsNotWith("W", PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test') . ", " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test'), "pass"); - $I->assertEquals(PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), "pass"); + $I->assertStringStartsWith("D", PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test') . ", " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test'), "fail"); // stepKey: assert1 + $I->assertStringStartsNotWith("W", PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test') . ", " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test'), "pass"); // stepKey: assert2 + $I->assertEquals(PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), "pass"); // stepKey: assert5 + $I->comment("array type that use created data"); $I->comment("array type that use created data"); - $I->assertArraySubset([PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test')], [PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test'), "1"], "pass"); - $I->assertArraySubset([PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test')], [PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test'), "1"], "pass"); - $I->assertArrayHasKey("lastname", ['lastname' => PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), 'firstname' => PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test')], "pass"); - $I->assertArrayHasKey("lastname", ['lastname' => PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test'), 'firstname' => PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test')], "pass"); - $I->assertInstanceOf(User::class, $text, "pass"); - $I->assertNotInstanceOf(User::class, 21, "pass"); - $I->assertFileExists($text, "pass"); - $I->assertFileExists("AssertCest.php", "pass"); - $I->assertIsEmpty($text, "pass"); - $I->assertNull($text, "pass"); - $I->expectException(new MyException('exception msg'), function() {$this->doSomethingBad();}); - $I->fail("fail"); - $I->fail(PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test') . " " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test')); - $I->fail(PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test') . " " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test')); - $I->assertElementContainsAttribute("#username", "class", "admin__control-text"); - $I->assertElementContainsAttribute("#username", "name", "login[username]"); - $I->assertElementContainsAttribute("#username", "autofocus", "true"); - $I->assertElementContainsAttribute("#username", "data-validate", "{required:true}"); - $I->assertElementContainsAttribute(".admin__menu-overlay", "style", "display: none;"); - $I->assertElementContainsAttribute(".admin__menu-overlay", "border", "0"); - $I->assertElementContainsAttribute("#username", "value", PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test')); - $I->assertElementContainsAttribute("#username", "value", PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test')); - $I->assertEquals("John", "Doe", "pass"); + $I->assertArraySubset([PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test')], [PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test'), "1"], "pass"); // stepKey: assert9 + $I->assertArraySubset([PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test')], [PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test'), "1"], "pass"); // stepKey: assert10 + $I->assertArrayHasKey("lastname", ['lastname' => PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), 'firstname' => PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test')], "pass"); // stepKey: assert3 + $I->assertArrayHasKey("lastname", ['lastname' => PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test'), 'firstname' => PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test')], "pass"); // stepKey: assert4 + $I->comment("this section can only be generated and cannot run"); + $I->assertInstanceOf(User::class, $text, "pass"); // stepKey: assertInstanceOf + $I->assertNotInstanceOf(User::class, 21, "pass"); // stepKey: assertNotInstanceOf + $I->assertFileExists($text, "pass"); // stepKey: assertFileExists2 + $I->assertFileExists("AssertCest.php", "pass"); // stepKey: assertFileExists3 + $I->assertIsEmpty($text, "pass"); // stepKey: assertIsEmpty + $I->assertNull($text, "pass"); // stepKey: assertNull + $I->expectException(new MyException('exception msg'), function() {$this->doSomethingBad();}); // stepKey: expectException + $I->fail("fail"); // stepKey: fail + $I->fail(PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test') . " " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test')); // stepKey: assert7 + $I->fail(PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test') . " " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test')); // stepKey: assert8 + $I->comment("assertElementContainsAttribute examples"); + $I->assertElementContainsAttribute("#username", "class", "admin__control-text"); // stepKey: assertElementContainsAttribute1 + $I->assertElementContainsAttribute("#username", "name", "login[username]"); // stepKey: assertElementContainsAttribute2 + $I->assertElementContainsAttribute("#username", "autofocus", "true"); // stepKey: assertElementContainsAttribute3 + $I->assertElementContainsAttribute("#username", "data-validate", "{required:true}"); // stepKey: assertElementContainsAttribute4 + $I->assertElementContainsAttribute(".admin__menu-overlay", "style", "display: none;"); // stepKey: assertElementContainsAttribute5 + $I->assertElementContainsAttribute(".admin__menu-overlay", "border", "0"); // stepKey: assertElementContainsAttribute6 + $I->assertElementContainsAttribute("#username", "value", PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test')); // stepKey: assertElementContainsAttribute7 + $I->assertElementContainsAttribute("#username", "value", PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test')); // stepKey: assertElementContainsAttribute8 + $I->comment("assert entity resolution"); + $I->assertEquals("John", "Doe", "pass"); // stepKey: assertEqualsEntity } } diff --git a/dev/tests/verification/Resources/BasicActionGroupTest.txt b/dev/tests/verification/Resources/BasicActionGroupTest.txt index d62c2919d..17e5e2bdf 100644 --- a/dev/tests/verification/Resources/BasicActionGroupTest.txt +++ b/dev/tests/verification/Resources/BasicActionGroupTest.txt @@ -25,7 +25,7 @@ class BasicActionGroupTestCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createPersonParam"); + $I->comment("[createPersonParam] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createPersonParam", "hook", @@ -33,10 +33,11 @@ class BasicActionGroupTestCest [], null ); - $I->comment("Entering Action Group FunctionalActionGroup (beforeGroup)"); - $I->fillField("#foo", "myData1"); - $I->fillField("#bar", "myData2"); - $I->comment("Exiting Action Group FunctionalActionGroup (beforeGroup)"); + + $I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup + $I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup"); } /** @@ -50,11 +51,11 @@ class BasicActionGroupTestCest */ public function BasicActionGroupTest(AcceptanceTester $I) { - $I->amOnPage("/someUrl"); - $I->comment("Entering Action Group FunctionalActionGroup (actionGroup1)"); - $I->fillField("#foo", "myData1"); - $I->fillField("#bar", "myData2"); - $I->comment("Exiting Action Group FunctionalActionGroup (actionGroup1)"); - $I->click("loginButton"); + $I->amOnPage("/someUrl"); // stepKey: step1 + $I->comment("Entering Action Group [actionGroup1] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1ActionGroup1 + $I->fillField("#bar", "myData2"); // stepKey: fillField2ActionGroup1 + $I->comment("Exiting Action Group [actionGroup1] FunctionalActionGroup"); + $I->click("loginButton"); // stepKey: step6 } } diff --git a/dev/tests/verification/Resources/BasicFunctionalTest.txt b/dev/tests/verification/Resources/BasicFunctionalTest.txt index fd5f0f165..3cb373a4c 100644 --- a/dev/tests/verification/Resources/BasicFunctionalTest.txt +++ b/dev/tests/verification/Resources/BasicFunctionalTest.txt @@ -26,7 +26,7 @@ class BasicFunctionalTestCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/beforeUrl"); + $I->amOnPage("/beforeUrl"); // stepKey: beforeAmOnPageKey } /** @@ -35,7 +35,7 @@ class BasicFunctionalTestCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey } /** @@ -44,7 +44,7 @@ class BasicFunctionalTestCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** @@ -61,110 +61,115 @@ class BasicFunctionalTestCest $I->comment(""); $I->comment(""); $I->comment("seeComment"); - $someVarDefinition = $I->grabValueFrom(); - $I->acceptPopup(); - $I->amOnPage("/test/url"); - $I->appendField(".functionalTestSelector"); - $I->attachFile(".functionalTestSelector", "testFileAttachment"); - $I->cancelPopup(); - $I->checkOption(".functionalTestSelector"); - $I->click(".functionalTestSelector"); - $I->clickWithLeftButton(".functionalTestSelector"); - $I->clickWithRightButton(".functionalTestSelector"); - $I->clickWithLeftButton("#element#element .200", 200, 300); - $I->clickWithRightButton("#element .4123#element", 200, 300); - $I->closeTab(); - $I->conditionalClick(".functionalTestSelector", ".functionalDependentTestSelector", true); - $I->amGoingTo("delete entity that has the createDataKey: createKey1"); + $someVarDefinition = $I->grabValueFrom(); // stepKey: someVarDefinition + $I->acceptPopup(); // stepKey: acceptPopupKey1 + $I->amOnPage("/test/url"); // stepKey: amOnPageKey1 + $I->appendField(".functionalTestSelector"); // stepKey: appendFieldKey1 + $I->attachFile(".functionalTestSelector", "testFileAttachment"); // stepKey: attachFileKey1 + $I->cancelPopup(); // stepKey: cancelPopupKey1 + $I->checkOption(".functionalTestSelector"); // stepKey: checkOptionKey1 + $I->click(".functionalTestSelector"); // stepKey: clickKey1 + $I->clickWithLeftButton(".functionalTestSelector"); // stepKey: clickWithLeftButtonKey1 + $I->clickWithRightButton(".functionalTestSelector"); // stepKey: clickWithRightButtonKey1 + $I->clickWithLeftButton("#element#element .200", 200, 300); // stepKey: clickWithLeftButtonKeyXY1 + $I->clickWithRightButton("#element .4123#element", 200, 300); // stepKey: clickWithRightButtonKeyXY1 + $I->closeTab(); // stepKey: closeTabKey1 + $I->conditionalClick(".functionalTestSelector", ".functionalDependentTestSelector", true); // stepKey: conditionalClickKey1 + $I->comment("[deleteKey1] delete entity 'createKey1'"); PersistedObjectHandler::getInstance()->deleteEntity( "createKey1", "test" ); + $I->deleteEntityByUrl("/V1/categories{$grabbedData}"); - $I->dontSee("someInput", ".functionalTestSelector"); - $I->dontSeeCheckboxIsChecked(".functionalTestSelector"); - $I->dontSeeCookie("someInput"); - $I->dontSeeCurrentUrlEquals("/functionalUrl"); - $I->dontSeeCurrentUrlMatches("/[0-9]+/"); - $I->dontSeeElement(".functionalTestSelector"); - $I->dontSeeElementInDOM(".functionalTestSelector"); - $I->dontSeeInCurrentUrl("/functionalUrl"); - $I->dontSeeInField(".functionalTestSelector"); - $I->dontSeeInPageSource("someInput"); - $I->dontSeeInSource("<myHtmlHere>"); - $I->dontSeeInTitle("someInput"); - $I->dontSeeLink("someInput", "/functionalUrl"); - $I->dontSeeOptionIsSelected(".functionalTestSelector", "someInput"); - $I->doubleClick(".functionalTestSelector"); - $I->dragAndDrop(".functionalTestSelector", ".functionalTestSelector2"); - $I->dragAndDrop(".functionalTestSelector", ".functionalTestSelector2", 100, 900); - $executeJSKey1 = $I->executeJS("someJSFunction"); - $I->fillField(".functionalTestSelector", "someInput"); - $I->fillField(".functionalTestSelector", "0"); + + $I->dontSee("someInput", ".functionalTestSelector"); // stepKey: dontSeeKey1 + $I->dontSeeCheckboxIsChecked(".functionalTestSelector"); // stepKey: dontSeeCheckboxIsCheckedKey1 + $I->dontSeeCookie("someInput"); // stepKey: dontSeeCookieKey1 + $I->dontSeeCurrentUrlEquals("/functionalUrl"); // stepKey: dontSeeCurrentUrlEqualsKey1 + $I->dontSeeCurrentUrlMatches("/[0-9]+/"); // stepKey: dontSeeCurrentUrlMatchesKey1 + $I->dontSeeElement(".functionalTestSelector"); // stepKey: dontSeeElementKey1 + $I->dontSeeElementInDOM(".functionalTestSelector"); // stepKey: dontSeeElementInDOMKey1 + $I->dontSeeInCurrentUrl("/functionalUrl"); // stepKey: dontSeeInCurrentUrlKey1 + $I->dontSeeInField(".functionalTestSelector"); // stepKey: dontSeeInFieldKey1 + $I->dontSeeInPageSource("someInput"); // stepKey: dontSeeInPageSourceKey1 + $I->dontSeeInSource("<myHtmlHere>"); // stepKey: dontSeeInSourceKey1 + $I->dontSeeInTitle("someInput"); // stepKey: dontSeeInTitleKey1 + $I->dontSeeLink("someInput", "/functionalUrl"); // stepKey: dontSeeLinkKey1 + $I->dontSeeOptionIsSelected(".functionalTestSelector", "someInput"); // stepKey: dontSeeOptionIsSelectedKey1 + $I->doubleClick(".functionalTestSelector"); // stepKey: doubleClickKey1 + $I->dragAndDrop(".functionalTestSelector", ".functionalTestSelector2"); // stepKey: dragAndDropKey1 + $I->dragAndDrop(".functionalTestSelector", ".functionalTestSelector2", 100, 900); // stepKey: dragAndDropKey2 + $executeJSKey1 = $I->executeJS("someJSFunction"); // stepKey: executeJSKey1 + $I->fillField(".functionalTestSelector", "someInput"); // stepKey: fillFieldKey1 + $I->fillField(".functionalTestSelector", "0"); // stepKey: fillFieldKey2 $date = new \DateTime(); $date->setTimestamp(strtotime("Now")); $date->setTimezone(new \DateTimeZone("America/Los_Angeles")); $generateDateKey = $date->format("H:i:s"); + $date = new \DateTime(); $date->setTimestamp(strtotime("Now")); $date->setTimezone(new \DateTimeZone("UTC")); $generateDateKey2 = $date->format("H:i:s"); - $grabAttributeFromKey1 = $I->grabAttributeFrom(".functionalTestSelector", "someInput"); - $grabCookieKey1 = $I->grabCookie("grabCookieInput", ['domain' => 'www.google.com']); - $grabFromCurrentUrlKey1 = $I->grabFromCurrentUrl("/grabCurrentUrl"); - $grabMultipleKey1 = $I->grabMultiple(".functionalTestSelector"); - $grabTextFromKey1 = $I->grabTextFrom(".functionalTestSelector"); - $grabValueFromKey1 = $I->grabValueFrom(".functionalTestSelector"); - $magentoCli1 = $I->magentoCLI("maintenance:enable", "\"stuffHere\""); + + $grabAttributeFromKey1 = $I->grabAttributeFrom(".functionalTestSelector", "someInput"); // stepKey: grabAttributeFromKey1 + $grabCookieKey1 = $I->grabCookie("grabCookieInput", ['domain' => 'www.google.com']); // stepKey: grabCookieKey1 + $grabFromCurrentUrlKey1 = $I->grabFromCurrentUrl("/grabCurrentUrl"); // stepKey: grabFromCurrentUrlKey1 + $grabMultipleKey1 = $I->grabMultiple(".functionalTestSelector"); // stepKey: grabMultipleKey1 + $grabTextFromKey1 = $I->grabTextFrom(".functionalTestSelector"); // stepKey: grabTextFromKey1 + $grabValueFromKey1 = $I->grabValueFrom(".functionalTestSelector"); // stepKey: grabValueFromKey1 + $magentoCli1 = $I->magentoCLI("maintenance:enable", "\"stuffHere\""); // stepKey: magentoCli1 $I->comment($magentoCli1); - $I->makeScreenshot("screenShotInput"); - $I->maximizeWindow(); - $I->moveBack(); - $I->moveForward(); - $I->moveMouseOver(".functionalTestSelector"); - $I->openNewTab(); - $I->pauseExecution(); - $I->performOn("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();}, 10); - $I->pressKey("#page", "a"); - $I->pressKey("#page", ['ctrl', 'a'],'new'); - $I->pressKey("#page", ['shift', '111'],'1','x'); - $I->pressKey("#page", ['ctrl', 'a'],\Facebook\WebDriver\WebDriverKeys::DELETE); - $I->reloadPage(); - $I->resetCookie("cookieInput"); - $I->resizeWindow(0, 0); - $I->scrollTo(".functionalTestSelector"); - $I->see("someInput", ".functionalTestSelector"); - $I->seeCheckboxIsChecked(".functionalTestSelector"); - $I->seeCookie("someInput"); - $I->seeCurrentUrlEquals("/functionalUrl"); - $I->seeCurrentUrlMatches("/[0-9]+/"); - $I->seeElement(".functionalTestSelector"); - $I->seeElementInDOM(".functionalTestSelector"); - $I->seeInCurrentUrl("/functionalUrl"); - $I->seeInField(".functionalTestSelector", "someInput"); - $I->seeInPageSource("<myHtmlHere>"); - $I->seeInPopup("someInput"); - $I->seeInSource("<myHtmlHere>"); - $I->seeInTitle("someInput"); - $I->seeLink("someInput", "/functionalUrl"); - $I->seeNumberOfElements(".functionalTestSelector"); - $I->seeOptionIsSelected(".functionalTestSelector", "someInput"); - $I->selectOption(".functionalTestSelector"); - $I->selectMultipleOptions(".filter", ".option", ['opt1', 'opt2']); - $I->setCookie("someInput", "someCookieValue"); - $I->switchToIFrame("someInput"); - $I->switchToNextTab(); - $I->switchToPreviousTab(); - $I->switchToWindow(); - $I->typeInPopup("someInput"); - $I->uncheckOption(".functionalTestSelector"); - $I->unselectOption(".functionalTestSelector", "someInput"); - $I->wait(30); - $I->waitForElement(".functionalTestSelector", 30); - $I->waitForElementNotVisible(".functionalTestSelector", 30); - $I->waitForElementVisible(".functionalTestSelector", 30); - $I->waitForElementChange("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();}, 10); - $I->waitForJS("someJsFunction", 30); - $I->waitForText("someInput", 30, ".functionalTestSelector"); + + $I->makeScreenshot("screenShotInput"); // stepKey: makeScreenshotKey1 + $I->maximizeWindow(); // stepKey: maximizeWindowKey1 + $I->moveBack(); // stepKey: moveBackKey1 + $I->moveForward(); // stepKey: moveForwardKey1 + $I->moveMouseOver(".functionalTestSelector"); // stepKey: moveMouseOverKey1 + $I->openNewTab(); // stepKey: openNewTabKey1 + $I->pauseExecution(); // stepKey: pauseExecutionKey1 + $I->performOn("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();}, 10); // stepKey: performOnKey1 + $I->pressKey("#page", "a"); // stepKey: pressKey1 + $I->pressKey("#page", ['ctrl', 'a'],'new'); // stepKey: pressKey2 + $I->pressKey("#page", ['shift', '111'],'1','x'); // stepKey: pressKey3 + $I->pressKey("#page", ['ctrl', 'a'],\Facebook\WebDriver\WebDriverKeys::DELETE); // stepKey: pressKey4 + $I->reloadPage(); // stepKey: reloadPageKey1 + $I->resetCookie("cookieInput"); // stepKey: resetCookieKey1 + $I->resizeWindow(0, 0); // stepKey: resizeWindowKey1 + $I->scrollTo(".functionalTestSelector"); // stepKey: scrollToKey1 + $I->see("someInput", ".functionalTestSelector"); // stepKey: seeKey1 + $I->seeCheckboxIsChecked(".functionalTestSelector"); // stepKey: seeCheckboxIsCheckedKey1 + $I->seeCookie("someInput"); // stepKey: seeCookieKey1 + $I->seeCurrentUrlEquals("/functionalUrl"); // stepKey: seeCurrentUrlEqualsKey1 + $I->seeCurrentUrlMatches("/[0-9]+/"); // stepKey: seeCurrentUrlMatchesKey1 + $I->seeElement(".functionalTestSelector"); // stepKey: seeElementKey1 + $I->seeElementInDOM(".functionalTestSelector"); // stepKey: seeElementInDOMKey1 + $I->seeInCurrentUrl("/functionalUrl"); // stepKey: seeInCurrentUrlKey1 + $I->seeInField(".functionalTestSelector", "someInput"); // stepKey: seeInFieldKey1 + $I->seeInPageSource("<myHtmlHere>"); // stepKey: seeInPageSourceKey1 + $I->seeInPopup("someInput"); // stepKey: seeInPopupKey1 + $I->seeInSource("<myHtmlHere>"); // stepKey: seeInSourceKey1 + $I->seeInTitle("someInput"); // stepKey: seeInTitleKey1 + $I->seeLink("someInput", "/functionalUrl"); // stepKey: seeLinkKey1 + $I->seeNumberOfElements(".functionalTestSelector"); // stepKey: seeNumberOfElementsKey1 + $I->seeOptionIsSelected(".functionalTestSelector", "someInput"); // stepKey: seeOptionIsSelectedKey1 + $I->selectOption(".functionalTestSelector"); // stepKey: selectOptionKey1 + $I->selectMultipleOptions(".filter", ".option", ['opt1', 'opt2']); // stepKey: selectMultipleOpts1 + $I->setCookie("someInput", "someCookieValue"); // stepKey: setCookieKey1 + $I->switchToIFrame("someInput"); // stepKey: switchToIFrameKey1 + $I->switchToNextTab(); // stepKey: switchToNextTabKey1 + $I->switchToPreviousTab(); // stepKey: switchToPreviousTabKey1 + $I->switchToWindow(); // stepKey: switchToWindowKey1 + $I->typeInPopup("someInput"); // stepKey: typeInPopupKey1 + $I->uncheckOption(".functionalTestSelector"); // stepKey: uncheckOptionKey1 + $I->unselectOption(".functionalTestSelector", "someInput"); // stepKey: unselectOptionKey1 + $I->wait(30); // stepKey: waitKey1 + $I->waitForElement(".functionalTestSelector", 30); // stepKey: waitForElementKey1 + $I->waitForElementNotVisible(".functionalTestSelector", 30); // stepKey: waitForElementNotVisibleKey1 + $I->waitForElementVisible(".functionalTestSelector", 30); // stepKey: waitForElementVisibleKey1 + $I->waitForElementChange("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();}, 10); // stepKey: waitForElementChangeKey1 + $I->waitForJS("someJsFunction", 30); // stepKey: waitForJSKey1 + $I->waitForText("someInput", 30, ".functionalTestSelector"); // stepKey: waitForText1 } } diff --git a/dev/tests/verification/Resources/BasicMergeTest.txt b/dev/tests/verification/Resources/BasicMergeTest.txt index 2f66f2ce4..8b311dac2 100644 --- a/dev/tests/verification/Resources/BasicMergeTest.txt +++ b/dev/tests/verification/Resources/BasicMergeTest.txt @@ -27,8 +27,8 @@ class BasicMergeTestCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/beforeUrl"); - $I->see("#before2"); + $I->amOnPage("/beforeUrl"); // stepKey: before1 + $I->see("#before2"); // stepKey: before2 } /** @@ -37,7 +37,7 @@ class BasicMergeTestCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl1"); + $I->amOnPage("/afterUrl1"); // stepKey: after1 } /** @@ -46,7 +46,7 @@ class BasicMergeTestCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** @@ -60,20 +60,20 @@ class BasicMergeTestCest */ public function BasicMergeTest(AcceptanceTester $I) { - $I->amOnPage("/step1"); - $I->click("#step2"); - $I->fillField("#username", "step3"); - $I->click("#step4"); - $I->fillField("#password", "step5"); - $I->click("#step6Merged"); - $I->click("#element .Jane .step7Merge"); - $I->comment("Entering Action Group FunctionalActionGroupWithData (step8Merge)"); - $I->amOnPage("/Jane/Dane.html"); - $I->fillField("#foo", "Jane"); - $I->fillField("#bar", "Dane"); - $I->searchAndMultiSelectOption("#foo", ["Jane", "Dane"]); - $I->see("#element .Jane"); - $I->comment("Exiting Action Group FunctionalActionGroupWithData (step8Merge)"); - $I->click("#step10MergedInResult"); + $I->amOnPage("/step1"); // stepKey: step1 + $I->click("#step2"); // stepKey: step2 + $I->fillField("#username", "step3"); // stepKey: step3 + $I->click("#step4"); // stepKey: step4 + $I->fillField("#password", "step5"); // stepKey: step5 + $I->click("#step6Merged"); // stepKey: step6Merge + $I->click("#element .Jane .step7Merge"); // stepKey: step7Merge + $I->comment("Entering Action Group [step8Merge] FunctionalActionGroupWithData"); + $I->amOnPage("/Jane/Dane.html"); // stepKey: amOnPage1Step8Merge + $I->fillField("#foo", "Jane"); // stepKey: fillField1Step8Merge + $I->fillField("#bar", "Dane"); // stepKey: fillField2Step8Merge + $I->searchAndMultiSelectOption("#foo", ["Jane", "Dane"]); // stepKey: multi1Step8Merge + $I->see("#element .Jane"); // stepKey: see1Step8Merge + $I->comment("Exiting Action Group [step8Merge] FunctionalActionGroupWithData"); + $I->click("#step10MergedInResult"); // stepKey: step10 } } diff --git a/dev/tests/verification/Resources/CharacterReplacementTest.txt b/dev/tests/verification/Resources/CharacterReplacementTest.txt index c1fddf69b..94459d3b1 100644 --- a/dev/tests/verification/Resources/CharacterReplacementTest.txt +++ b/dev/tests/verification/Resources/CharacterReplacementTest.txt @@ -27,13 +27,13 @@ class CharacterReplacementTestCest */ public function CharacterReplacementTest(AcceptanceTester $I) { - $I->click("#element"); - $I->fillField("#element", "7700 West Parmer Lane"); - $I->click("#element .abcdefghijklmnopqrstuvwxyz1234567890"); - $I->click("#element .`~!@#$%^&*()-_=+{}[]|\;:\".,></?()3., "); - $I->click("#element .words, and, commas, and, spaces"); - $I->click("#abcdefghijklmnopqrstuvwxyz1234567890 .abcdefghijklmnopqrstuvwxyz1234567890"); - $I->click("#`~!@#$%^&*()-_=+{}[]|\;:\".,></?() .`~!@#$%^&*()-_=+{}[]|\;:\".,></?()"); - $I->click("#words, and, commas, and, spaces .words, and, commas, and, spaces"); + $I->click("#element"); // stepKey: charsInSectionElement + $I->fillField("#element", "7700 West Parmer Lane"); // stepKey: charsInDataRef + $I->click("#element .abcdefghijklmnopqrstuvwxyz1234567890"); // stepKey: allChars1 + $I->click("#element .`~!@#$%^&*()-_=+{}[]|\;:\".,></?()3., "); // stepKey: allChars2 + $I->click("#element .words, and, commas, and, spaces"); // stepKey: allChars3 + $I->click("#abcdefghijklmnopqrstuvwxyz1234567890 .abcdefghijklmnopqrstuvwxyz1234567890"); // stepKey: allChars4 + $I->click("#`~!@#$%^&*()-_=+{}[]|\;:\".,></?() .`~!@#$%^&*()-_=+{}[]|\;:\".,></?()"); // stepKey: allChars5 + $I->click("#words, and, commas, and, spaces .words, and, commas, and, spaces"); // stepKey: allChars6 } } diff --git a/dev/tests/verification/Resources/ChildExtendedTestAddHooks.txt b/dev/tests/verification/Resources/ChildExtendedTestAddHooks.txt index 27c9a99c6..4c8ec1ea1 100644 --- a/dev/tests/verification/Resources/ChildExtendedTestAddHooks.txt +++ b/dev/tests/verification/Resources/ChildExtendedTestAddHooks.txt @@ -26,7 +26,7 @@ class ChildExtendedTestAddHooksCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/beforeUrl"); + $I->amOnPage("/beforeUrl"); // stepKey: beforeAmOnPageKey } /** @@ -35,7 +35,7 @@ class ChildExtendedTestAddHooksCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey } /** @@ -44,7 +44,7 @@ class ChildExtendedTestAddHooksCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** diff --git a/dev/tests/verification/Resources/ChildExtendedTestMerging.txt b/dev/tests/verification/Resources/ChildExtendedTestMerging.txt index 788818272..a59d141b4 100644 --- a/dev/tests/verification/Resources/ChildExtendedTestMerging.txt +++ b/dev/tests/verification/Resources/ChildExtendedTestMerging.txt @@ -26,9 +26,9 @@ class ChildExtendedTestMergingCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/firstUrl"); - $I->amOnPage("/beforeUrl"); - $I->amOnPage("/lastUrl"); + $I->amOnPage("/firstUrl"); // stepKey: firstBeforeAmOnPageKey + $I->amOnPage("/beforeUrl"); // stepKey: beforeAmOnPageKey + $I->amOnPage("/lastUrl"); // stepKey: lastBefore } /** @@ -37,7 +37,7 @@ class ChildExtendedTestMergingCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey } /** @@ -46,7 +46,7 @@ class ChildExtendedTestMergingCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** diff --git a/dev/tests/verification/Resources/ChildExtendedTestRemoveAction.txt b/dev/tests/verification/Resources/ChildExtendedTestRemoveAction.txt index 40a3184c9..b1eb8340b 100644 --- a/dev/tests/verification/Resources/ChildExtendedTestRemoveAction.txt +++ b/dev/tests/verification/Resources/ChildExtendedTestRemoveAction.txt @@ -26,7 +26,7 @@ class ChildExtendedTestRemoveActionCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/beforeUrl"); + $I->amOnPage("/beforeUrl"); // stepKey: beforeAmOnPageKey } /** @@ -35,7 +35,7 @@ class ChildExtendedTestRemoveActionCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey } /** @@ -44,7 +44,7 @@ class ChildExtendedTestRemoveActionCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** diff --git a/dev/tests/verification/Resources/ChildExtendedTestRemoveHookAction.txt b/dev/tests/verification/Resources/ChildExtendedTestRemoveHookAction.txt index 7419e681a..cd0e6b049 100644 --- a/dev/tests/verification/Resources/ChildExtendedTestRemoveHookAction.txt +++ b/dev/tests/verification/Resources/ChildExtendedTestRemoveHookAction.txt @@ -34,7 +34,7 @@ class ChildExtendedTestRemoveHookActionCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey } /** @@ -43,7 +43,7 @@ class ChildExtendedTestRemoveHookActionCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** diff --git a/dev/tests/verification/Resources/ChildExtendedTestReplace.txt b/dev/tests/verification/Resources/ChildExtendedTestReplace.txt index 18b1984c0..6c699b7db 100644 --- a/dev/tests/verification/Resources/ChildExtendedTestReplace.txt +++ b/dev/tests/verification/Resources/ChildExtendedTestReplace.txt @@ -26,7 +26,7 @@ class ChildExtendedTestReplaceCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/beforeUrl"); + $I->amOnPage("/beforeUrl"); // stepKey: beforeAmOnPageKey } /** @@ -35,7 +35,7 @@ class ChildExtendedTestReplaceCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey } /** @@ -44,7 +44,7 @@ class ChildExtendedTestReplaceCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** diff --git a/dev/tests/verification/Resources/ChildExtendedTestReplaceHook.txt b/dev/tests/verification/Resources/ChildExtendedTestReplaceHook.txt index 90ebf3676..82184a206 100644 --- a/dev/tests/verification/Resources/ChildExtendedTestReplaceHook.txt +++ b/dev/tests/verification/Resources/ChildExtendedTestReplaceHook.txt @@ -26,7 +26,7 @@ class ChildExtendedTestReplaceHookCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/slightlyDifferentBeforeUrl"); + $I->amOnPage("/slightlyDifferentBeforeUrl"); // stepKey: beforeAmOnPageKey } /** @@ -35,7 +35,7 @@ class ChildExtendedTestReplaceHookCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey } /** @@ -44,7 +44,7 @@ class ChildExtendedTestReplaceHookCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** diff --git a/dev/tests/verification/Resources/DataActionsTest.txt b/dev/tests/verification/Resources/DataActionsTest.txt index cac3b72cd..5d1ee9e00 100644 --- a/dev/tests/verification/Resources/DataActionsTest.txt +++ b/dev/tests/verification/Resources/DataActionsTest.txt @@ -24,7 +24,7 @@ class DataActionsTestCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createdInBefore"); + $I->comment("[createdInBefore] create 'entity' entity"); PersistedObjectHandler::getInstance()->createEntity( "createdInBefore", "hook", @@ -32,18 +32,21 @@ class DataActionsTestCest [], null ); - $I->amGoingTo("update entity that has the createdDataKey: createdInBefore"); + + $I->comment("[updateInBefore] update 'createdInBefore' entity to 'entity'"); PersistedObjectHandler::getInstance()->updateEntity( "createdInBefore", "hook", "entity", [] ); - $I->amGoingTo("delete entity that has the createDataKey: createdInBefore"); + + $I->comment("[deleteInBefore] delete entity 'createdInBefore'"); PersistedObjectHandler::getInstance()->deleteEntity( "createdInBefore", "hook" ); + } /** @@ -55,7 +58,7 @@ class DataActionsTestCest */ public function DataActionsTest(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createdInTest"); + $I->comment("[createdInTest] create 'entity' entity"); PersistedObjectHandler::getInstance()->createEntity( "createdInTest", "test", @@ -63,29 +66,34 @@ class DataActionsTestCest [], null ); - $I->amGoingTo("update entity that has the createdDataKey: createdInTest"); + + $I->comment("[updateInTest] update 'createdInTest' entity to 'entity'"); PersistedObjectHandler::getInstance()->updateEntity( "createdInTest", "test", "entity", [] ); - $I->amGoingTo("delete entity that has the createDataKey: createdInTest"); + + $I->comment("[deleteInTest] delete entity 'createdInTest'"); PersistedObjectHandler::getInstance()->deleteEntity( "createdInTest", "test" ); - $I->amGoingTo("update entity that has the createdDataKey: createdInBefore"); + + $I->comment("[updatedDataOutOfScope] update 'createdInBefore' entity to 'entity'"); PersistedObjectHandler::getInstance()->updateEntity( "createdInBefore", "test", "entity", [] ); - $I->amGoingTo("delete entity that has the createDataKey: createdInBefore"); + + $I->comment("[deleteDataOutOfScope] delete entity 'createdInBefore'"); PersistedObjectHandler::getInstance()->deleteEntity( "createdInBefore", "test" ); + } } diff --git a/dev/tests/verification/Resources/DataReplacementTest.txt b/dev/tests/verification/Resources/DataReplacementTest.txt index 60dd2faae..211dfd5a1 100644 --- a/dev/tests/verification/Resources/DataReplacementTest.txt +++ b/dev/tests/verification/Resources/DataReplacementTest.txt @@ -27,31 +27,32 @@ class DataReplacementTestCest */ public function DataReplacementTest(AcceptanceTester $I) { - $I->fillField("#selector", "StringBefore John StringAfter"); - $I->seeCurrentUrlMatches("~\/John~i"); - $I->fillField("#John", "input"); - $I->dragAndDrop("#John", "Doe"); - $I->conditionalClick("Doe", "#John", true); - $I->amOnUrl("John.html"); - $I->searchAndMultiSelectOption("#selector", ["John", "Doe"]); - $I->fillField("#selector", "StringBefore " . msq("uniqueData") . "John StringAfter"); - $I->fillField("#" . msq("uniqueData") . "John", "input"); - $I->dragAndDrop("#" . msq("uniqueData") . "John", msq("uniqueData") . "John"); - $I->conditionalClick(msq("uniqueData") . "John", "#" . msq("uniqueData") . "John", true); - $I->amOnUrl(msq("uniqueData") . "John.html"); - $I->searchAndMultiSelectOption("#selector", [msq("uniqueData") . "John", "Doe"]); - $I->click("#" . msq("uniqueData") . "John#" . msq("uniqueData") . "John"); - $I->click("#Doe" . msq("uniqueData") . "#Doe" . msq("uniqueData")); - $I->fillField("#selector", "StringBefore Doe" . msq("uniqueData") . " StringAfter"); - $I->fillField("#Doe" . msq("uniqueData"), "input"); - $I->dragAndDrop("#Doe" . msq("uniqueData"), "Doe" . msq("uniqueData")); - $I->conditionalClick("Doe" . msq("uniqueData"), "#Doe" . msq("uniqueData"), true); - $I->amOnUrl("Doe" . msq("uniqueData") . ".html"); - $I->searchAndMultiSelectOption("#selector", ["John", "Doe" . msq("uniqueData")]); - $I->searchAndMultiSelectOption("#selector", [msq("uniqueData") . "John", "Doe" . msq("uniqueData")]); - $I->selectMultipleOptions("#Doe" . msq("uniqueData"), "#element", [msq("uniqueData") . "John", "Doe" . msq("uniqueData")]); - $I->fillField(".selector", "0"); - $insertCommand = $I->magentoCLI("do something Doe" . msq("uniqueData") . " with uniqueness"); + $I->fillField("#selector", "StringBefore John StringAfter"); // stepKey: inputReplace + $I->seeCurrentUrlMatches("~\/John~i"); // stepKey: seeInRegex + $I->fillField("#John", "input"); // stepKey: selectorReplace + $I->dragAndDrop("#John", "Doe"); // stepKey: selector12Replace + $I->conditionalClick("Doe", "#John", true); // stepKey: dependentSelectorReplace + $I->amOnUrl("John.html"); // stepKey: urlReplace + $I->searchAndMultiSelectOption("#selector", ["John", "Doe"]); // stepKey: parameterArrayReplacement + $I->fillField("#selector", "StringBefore " . msq("uniqueData") . "John StringAfter"); // stepKey: inputPrefixReplaceMSQPrefix + $I->fillField("#" . msq("uniqueData") . "John", "input"); // stepKey: selectorReplaceMSQPrefix + $I->dragAndDrop("#" . msq("uniqueData") . "John", msq("uniqueData") . "John"); // stepKey: selector12ReplaceMSQPrefix + $I->conditionalClick(msq("uniqueData") . "John", "#" . msq("uniqueData") . "John", true); // stepKey: dependentSelectorReplaceMSQPrefix + $I->amOnUrl(msq("uniqueData") . "John.html"); // stepKey: urlReplaceMSQPrefix + $I->searchAndMultiSelectOption("#selector", [msq("uniqueData") . "John", "Doe"]); // stepKey: parameterArrayReplacementMSQPrefix + $I->click("#" . msq("uniqueData") . "John#" . msq("uniqueData") . "John"); // stepKey: selectorReplaceDupedMSQPrefix + $I->click("#Doe" . msq("uniqueData") . "#Doe" . msq("uniqueData")); // stepKey: selectorReplaceDupedMSQSuffix + $I->fillField("#selector", "StringBefore Doe" . msq("uniqueData") . " StringAfter"); // stepKey: inputReplaceMSQSuffix + $I->fillField("#Doe" . msq("uniqueData"), "input"); // stepKey: selectorReplaceMSQSuffix + $I->dragAndDrop("#Doe" . msq("uniqueData"), "Doe" . msq("uniqueData")); // stepKey: selector12ReplaceMSQSuffix + $I->conditionalClick("Doe" . msq("uniqueData"), "#Doe" . msq("uniqueData"), true); // stepKey: dependentSelectorReplaceMSQSuffix + $I->amOnUrl("Doe" . msq("uniqueData") . ".html"); // stepKey: urlReplaceMSQSuffix + $I->searchAndMultiSelectOption("#selector", ["John", "Doe" . msq("uniqueData")]); // stepKey: parameterArrayReplacementMSQSuffix + $I->searchAndMultiSelectOption("#selector", [msq("uniqueData") . "John", "Doe" . msq("uniqueData")]); // stepKey: parameterArrayReplacementMSQBoth + $I->selectMultipleOptions("#Doe" . msq("uniqueData"), "#element", [msq("uniqueData") . "John", "Doe" . msq("uniqueData")]); // stepKey: multiSelectDataReplacement + $I->fillField(".selector", "0"); // stepKey: insertZero + $insertCommand = $I->magentoCLI("do something Doe" . msq("uniqueData") . " with uniqueness"); // stepKey: insertCommand $I->comment($insertCommand); + } } diff --git a/dev/tests/verification/Resources/ExecuteInSeleniumTest.txt b/dev/tests/verification/Resources/ExecuteInSeleniumTest.txt index 323b2ffb9..0fbee0550 100644 --- a/dev/tests/verification/Resources/ExecuteInSeleniumTest.txt +++ b/dev/tests/verification/Resources/ExecuteInSeleniumTest.txt @@ -27,6 +27,6 @@ class ExecuteInSeleniumTestCest */ public function ExecuteInSeleniumTest(AcceptanceTester $I) { - $I->executeInSelenium(function ($webdriver) { return 'Hello, World!'}); + $I->executeInSelenium(function ($webdriver) { return 'Hello, World!'}); // stepKey: executeInSeleniumStep } } diff --git a/dev/tests/verification/Resources/ExecuteJsEscapingTest.txt b/dev/tests/verification/Resources/ExecuteJsEscapingTest.txt index 6dd8ef3db..19140eaf9 100644 --- a/dev/tests/verification/Resources/ExecuteJsEscapingTest.txt +++ b/dev/tests/verification/Resources/ExecuteJsEscapingTest.txt @@ -27,10 +27,10 @@ class ExecuteJsEscapingTestCest */ public function ExecuteJsEscapingTest(AcceptanceTester $I) { - $javaVariableEscape = $I->executeJS("return \$javascriptVariable"); - $mftfVariableNotEscaped = $I->executeJS("return {$doNotEscape}"); - $persistedDataNotEscaped = $I->executeJS("return " . PersistedObjectHandler::getInstance()->retrieveEntityField('persisted', 'data', 'test')); - $hookPersistedDataNotEscaped = $I->executeJS("return " . PersistedObjectHandler::getInstance()->retrieveEntityField('persisted', 'data', 'test')); - $addNewAttributeForRule = $I->executeJS("document.querySelector('entity option[value=" . PersistedObjectHandler::getInstance()->retrieveEntityField('productAttribute', 'attribute_code', 'test') . "]').setAttribute('selected', 'selected')"); + $javaVariableEscape = $I->executeJS("return \$javascriptVariable"); // stepKey: javaVariableEscape + $mftfVariableNotEscaped = $I->executeJS("return {$doNotEscape}"); // stepKey: mftfVariableNotEscaped + $persistedDataNotEscaped = $I->executeJS("return " . PersistedObjectHandler::getInstance()->retrieveEntityField('persisted', 'data', 'test')); // stepKey: persistedDataNotEscaped + $hookPersistedDataNotEscaped = $I->executeJS("return " . PersistedObjectHandler::getInstance()->retrieveEntityField('persisted', 'data', 'test')); // stepKey: hookPersistedDataNotEscaped + $addNewAttributeForRule = $I->executeJS("document.querySelector('entity option[value=" . PersistedObjectHandler::getInstance()->retrieveEntityField('productAttribute', 'attribute_code', 'test') . "]').setAttribute('selected', 'selected')"); // stepKey: addNewAttributeForRule } } diff --git a/dev/tests/verification/Resources/ExtendParentDataTest.txt b/dev/tests/verification/Resources/ExtendParentDataTest.txt index 41bea9d6f..a80f3cf19 100644 --- a/dev/tests/verification/Resources/ExtendParentDataTest.txt +++ b/dev/tests/verification/Resources/ExtendParentDataTest.txt @@ -27,7 +27,7 @@ class ExtendParentDataTestCest */ public function ExtendParentDataTest(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: simpleDataKey"); + $I->comment("[simpleDataKey] create 'extendParentData' entity"); PersistedObjectHandler::getInstance()->createEntity( "simpleDataKey", "test", @@ -35,10 +35,11 @@ class ExtendParentDataTestCest [], null ); - $I->searchAndMultiSelectOption("#selector", ["otherName"]); - $I->searchAndMultiSelectOption("#selector", ["extendName"]); - $I->searchAndMultiSelectOption("#selector", ["item"]); - $I->searchAndMultiSelectOption("#selector", [msq("extendParentData") . "prename"]); - $I->searchAndMultiSelectOption("#selector", ["postnameExtend" . msq("extendParentData")]); + + $I->searchAndMultiSelectOption("#selector", ["otherName"]); // stepKey: getName + $I->searchAndMultiSelectOption("#selector", ["extendName"]); // stepKey: getNameExtend + $I->searchAndMultiSelectOption("#selector", ["item"]); // stepKey: emptyPost + $I->searchAndMultiSelectOption("#selector", [msq("extendParentData") . "prename"]); // stepKey: originalPre + $I->searchAndMultiSelectOption("#selector", ["postnameExtend" . msq("extendParentData")]); // stepKey: secondUniquePre } } diff --git a/dev/tests/verification/Resources/ExtendedActionGroup.txt b/dev/tests/verification/Resources/ExtendedActionGroup.txt index e321bfec1..66ecdbd8a 100644 --- a/dev/tests/verification/Resources/ExtendedActionGroup.txt +++ b/dev/tests/verification/Resources/ExtendedActionGroup.txt @@ -27,12 +27,12 @@ class ExtendedActionGroupCest */ public function ExtendedActionGroup(AcceptanceTester $I) { - $I->comment("Entering Action Group extendTestActionGroup (actionGroup)"); + $I->comment("Entering Action Group [actionGroup] extendTestActionGroup"); $I->comment("New Input Before"); - $grabProductsActionGroup = $I->grabMultiple("notASelector"); + $grabProductsActionGroup = $I->grabMultiple("notASelector"); // stepKey: grabProductsActionGroup $I->comment("New Input After"); - $I->assertCount(99, $grabProductsActionGroup); - $I->assertCount(8000, $grabProductsActionGroup); - $I->comment("Exiting Action Group extendTestActionGroup (actionGroup)"); + $I->assertCount(99, $grabProductsActionGroup); // stepKey: assertCountActionGroup + $I->assertCount(8000, $grabProductsActionGroup); // stepKey: assertSecondCountActionGroup + $I->comment("Exiting Action Group [actionGroup] extendTestActionGroup"); } } diff --git a/dev/tests/verification/Resources/ExtendedChildTestInSuiteCest.txt b/dev/tests/verification/Resources/ExtendedChildTestInSuiteCest.txt index da343e0e1..2483617d1 100644 --- a/dev/tests/verification/Resources/ExtendedChildTestInSuiteCest.txt +++ b/dev/tests/verification/Resources/ExtendedChildTestInSuiteCest.txt @@ -26,7 +26,7 @@ class ExtendedChildTestInSuiteCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/beforeUrl"); + $I->amOnPage("/beforeUrl"); // stepKey: beforeAmOnPageKey } /** @@ -35,7 +35,7 @@ class ExtendedChildTestInSuiteCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey } /** @@ -44,7 +44,7 @@ class ExtendedChildTestInSuiteCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** diff --git a/dev/tests/verification/Resources/ExtendedChildTestNotInSuite.txt b/dev/tests/verification/Resources/ExtendedChildTestNotInSuite.txt index cba6db454..cb5fc2e12 100644 --- a/dev/tests/verification/Resources/ExtendedChildTestNotInSuite.txt +++ b/dev/tests/verification/Resources/ExtendedChildTestNotInSuite.txt @@ -25,7 +25,7 @@ class ExtendedChildTestNotInSuiteCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/beforeUrl"); + $I->amOnPage("/beforeUrl"); // stepKey: beforeAmOnPageKey } /** @@ -34,7 +34,7 @@ class ExtendedChildTestNotInSuiteCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey } /** @@ -43,7 +43,7 @@ class ExtendedChildTestNotInSuiteCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** diff --git a/dev/tests/verification/Resources/ExtendedRemoveActionGroup.txt b/dev/tests/verification/Resources/ExtendedRemoveActionGroup.txt index 6d7e26d87..eed17340e 100644 --- a/dev/tests/verification/Resources/ExtendedRemoveActionGroup.txt +++ b/dev/tests/verification/Resources/ExtendedRemoveActionGroup.txt @@ -27,7 +27,7 @@ class ExtendedRemoveActionGroupCest */ public function ExtendedRemoveActionGroup(AcceptanceTester $I) { - $I->comment("Entering Action Group extendRemoveTestActionGroup (actionGroup)"); - $I->comment("Exiting Action Group extendRemoveTestActionGroup (actionGroup)"); + $I->comment("Entering Action Group [actionGroup] extendRemoveTestActionGroup"); + $I->comment("Exiting Action Group [actionGroup] extendRemoveTestActionGroup"); } } diff --git a/dev/tests/verification/Resources/ExtendingSkippedTest.txt b/dev/tests/verification/Resources/ExtendingSkippedTest.txt index 2275de057..b5632c030 100644 --- a/dev/tests/verification/Resources/ExtendingSkippedTest.txt +++ b/dev/tests/verification/Resources/ExtendingSkippedTest.txt @@ -26,7 +26,7 @@ class ExtendingSkippedTestCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/beforeUrl"); + $I->amOnPage("/beforeUrl"); // stepKey: beforeAmOnPageKey } /** @@ -35,7 +35,7 @@ class ExtendingSkippedTestCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey } /** @@ -44,7 +44,7 @@ class ExtendingSkippedTestCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** diff --git a/dev/tests/verification/Resources/HookActionsTest.txt b/dev/tests/verification/Resources/HookActionsTest.txt index 70e4ece10..74a49eca3 100644 --- a/dev/tests/verification/Resources/HookActionsTest.txt +++ b/dev/tests/verification/Resources/HookActionsTest.txt @@ -24,7 +24,7 @@ class HookActionsTestCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: sampleCreateBefore"); + $I->comment("[sampleCreateBefore] create 'sampleCreatedEntity' entity"); PersistedObjectHandler::getInstance()->createEntity( "sampleCreateBefore", "hook", @@ -32,12 +32,14 @@ class HookActionsTestCest [], null ); - $I->amGoingTo("delete entity that has the createDataKey: sampleCreateBefore"); + + $I->comment("[sampleDeleteBefore] delete entity 'sampleCreateBefore'"); PersistedObjectHandler::getInstance()->deleteEntity( "sampleCreateBefore", "hook" ); - $I->amGoingTo("create entity that has the stepKey: sampleCreateForAfter"); + + $I->comment("[sampleCreateForAfter] create 'sampleCreatedEntity' entity"); PersistedObjectHandler::getInstance()->createEntity( "sampleCreateForAfter", "hook", @@ -45,6 +47,7 @@ class HookActionsTestCest [], null ); + } /** @@ -53,7 +56,7 @@ class HookActionsTestCest */ public function _after(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: sampleCreateAfter"); + $I->comment("[sampleCreateAfter] create 'sampleCreatedEntity' entity"); PersistedObjectHandler::getInstance()->createEntity( "sampleCreateAfter", "hook", @@ -61,11 +64,13 @@ class HookActionsTestCest [], null ); - $I->amGoingTo("delete entity that has the createDataKey: sampleCreateForAfter"); + + $I->comment("[sampleDeleteAfter] delete entity 'sampleCreateForAfter'"); PersistedObjectHandler::getInstance()->deleteEntity( "sampleCreateForAfter", "hook" ); + } /** @@ -74,7 +79,7 @@ class HookActionsTestCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** diff --git a/dev/tests/verification/Resources/LocatorFunctionTest.txt b/dev/tests/verification/Resources/LocatorFunctionTest.txt index bde511aac..4c96f100b 100644 --- a/dev/tests/verification/Resources/LocatorFunctionTest.txt +++ b/dev/tests/verification/Resources/LocatorFunctionTest.txt @@ -27,7 +27,7 @@ class LocatorFunctionTestCest */ public function LocatorFunctionTest(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: data"); + $I->comment("[data] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "data", "test", @@ -35,17 +35,18 @@ class LocatorFunctionTestCest [], null ); - $I->click(Locator::contains("'label'", "'Name'")); - $I->click(Locator::contains("'label'", "'Name'")); - $I->click(Locator::find("'img'", ['title' => 'diagram'])); - $I->click(Locator::contains("string", "'Name'")); - $I->click(Locator::contains("John", "'Name'")); - $I->click(Locator::contains(PersistedObjectHandler::getInstance()->retrieveEntityField('data', 'key', 'test'), "'Name'")); - $I->click(Locator::contains("string1", "string2")); - $I->click(Locator::contains("John", "Doe")); - $I->click(Locator::contains(PersistedObjectHandler::getInstance()->retrieveEntityField('data', 'key1', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('data', 'key2', 'test'))); - $I->click(Locator::contains("string1", "John")); - $I->click(Locator::contains("string1", PersistedObjectHandler::getInstance()->retrieveEntityField('data', 'key1', 'test'))); - $I->click(Locator::contains("John", PersistedObjectHandler::getInstance()->retrieveEntityField('data', 'key1', 'test'))); + + $I->click(Locator::contains("'label'", "'Name'")); // stepKey: SimpleLocator + $I->click(Locator::contains("'label'", "'Name'")); // stepKey: SimpleLocatorNonShorthand + $I->click(Locator::find("'img'", ['title' => 'diagram'])); // stepKey: ArrayLocator + $I->click(Locator::contains("string", "'Name'")); // stepKey: OneParamLiteral + $I->click(Locator::contains("John", "'Name'")); // stepKey: OneParamData + $I->click(Locator::contains(PersistedObjectHandler::getInstance()->retrieveEntityField('data', 'key', 'test'), "'Name'")); // stepKey: OneParamPersisted + $I->click(Locator::contains("string1", "string2")); // stepKey: TwoParamLiteral + $I->click(Locator::contains("John", "Doe")); // stepKey: TwoParamData + $I->click(Locator::contains(PersistedObjectHandler::getInstance()->retrieveEntityField('data', 'key1', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('data', 'key2', 'test'))); // stepKey: TwoParamPersisted + $I->click(Locator::contains("string1", "John")); // stepKey: TwoParamMix1 + $I->click(Locator::contains("string1", PersistedObjectHandler::getInstance()->retrieveEntityField('data', 'key1', 'test'))); // stepKey: TwoParamMix2 + $I->click(Locator::contains("John", PersistedObjectHandler::getInstance()->retrieveEntityField('data', 'key1', 'test'))); // stepKey: TwoParamMix3 } } diff --git a/dev/tests/verification/Resources/MergeMassViaInsertAfter.txt b/dev/tests/verification/Resources/MergeMassViaInsertAfter.txt index 5c5091566..2588e679a 100644 --- a/dev/tests/verification/Resources/MergeMassViaInsertAfter.txt +++ b/dev/tests/verification/Resources/MergeMassViaInsertAfter.txt @@ -27,11 +27,11 @@ class MergeMassViaInsertAfterCest */ public function MergeMassViaInsertAfter(AcceptanceTester $I) { - $I->fillField("#foo", "foo"); - $I->fillField("#bar", "bar"); - $I->click("#mergeOne"); - $I->click("#mergeTwo"); - $I->click("#mergeThree"); - $I->fillField("#baz", "baz"); + $I->fillField("#foo", "foo"); // stepKey: fillField1 + $I->fillField("#bar", "bar"); // stepKey: fillField2 + $I->click("#mergeOne"); // stepKey: clickOne + $I->click("#mergeTwo"); // stepKey: clickTwo + $I->click("#mergeThree"); // stepKey: clickThree + $I->fillField("#baz", "baz"); // stepKey: fillField3 } } diff --git a/dev/tests/verification/Resources/MergeMassViaInsertBefore.txt b/dev/tests/verification/Resources/MergeMassViaInsertBefore.txt index 94982ec21..7f220c2b7 100644 --- a/dev/tests/verification/Resources/MergeMassViaInsertBefore.txt +++ b/dev/tests/verification/Resources/MergeMassViaInsertBefore.txt @@ -27,11 +27,11 @@ class MergeMassViaInsertBeforeCest */ public function MergeMassViaInsertBefore(AcceptanceTester $I) { - $I->fillField("#foo", "foo"); - $I->click("#mergeOne"); - $I->click("#mergeTwo"); - $I->click("#mergeThree"); - $I->fillField("#bar", "bar"); - $I->fillField("#baz", "baz"); + $I->fillField("#foo", "foo"); // stepKey: fillField1 + $I->click("#mergeOne"); // stepKey: clickOne + $I->click("#mergeTwo"); // stepKey: clickTwo + $I->click("#mergeThree"); // stepKey: clickThree + $I->fillField("#bar", "bar"); // stepKey: fillField2 + $I->fillField("#baz", "baz"); // stepKey: fillField3 } } diff --git a/dev/tests/verification/Resources/MergedActionGroupTest.txt b/dev/tests/verification/Resources/MergedActionGroupTest.txt index 3a5da8725..03ab1287b 100644 --- a/dev/tests/verification/Resources/MergedActionGroupTest.txt +++ b/dev/tests/verification/Resources/MergedActionGroupTest.txt @@ -25,7 +25,7 @@ class MergedActionGroupTestCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createPersonParam"); + $I->comment("[createPersonParam] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createPersonParam", "hook", @@ -33,10 +33,11 @@ class MergedActionGroupTestCest [], null ); - $I->comment("Entering Action Group FunctionalActionGroup (beforeGroup)"); - $I->fillField("#foo", "myData1"); - $I->fillField("#bar", "myData2"); - $I->comment("Exiting Action Group FunctionalActionGroup (beforeGroup)"); + + $I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup + $I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup"); } /** @@ -45,10 +46,10 @@ class MergedActionGroupTestCest */ public function _after(AcceptanceTester $I) { - $I->comment("Entering Action Group FunctionalActionGroup (afterGroup)"); - $I->fillField("#foo", "myData1"); - $I->fillField("#bar", "myData2"); - $I->comment("Exiting Action Group FunctionalActionGroup (afterGroup)"); + $I->comment("Entering Action Group [afterGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup + $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); } /** @@ -57,7 +58,7 @@ class MergedActionGroupTestCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** @@ -71,11 +72,11 @@ class MergedActionGroupTestCest */ public function MergedActionGroupTest(AcceptanceTester $I) { - $I->comment("Entering Action Group FunctionalActionGroupForMerge (actionGroupForMerge)"); - $I->see(".merge .Jane"); - $I->see("#element .Jane"); - $I->amOnPage("/Jane/Dane.html"); - $I->click(".merge .Dane"); - $I->comment("Exiting Action Group FunctionalActionGroupForMerge (actionGroupForMerge)"); + $I->comment("Entering Action Group [actionGroupForMerge] FunctionalActionGroupForMerge"); + $I->see(".merge .Jane"); // stepKey: myMergedSeeElementActionGroupForMerge + $I->see("#element .Jane"); // stepKey: see1ActionGroupForMerge + $I->amOnPage("/Jane/Dane.html"); // stepKey: amOnPage1ActionGroupForMerge + $I->click(".merge .Dane"); // stepKey: myMergedClickActionGroupForMerge + $I->comment("Exiting Action Group [actionGroupForMerge] FunctionalActionGroupForMerge"); } } diff --git a/dev/tests/verification/Resources/MergedReferencesTest.txt b/dev/tests/verification/Resources/MergedReferencesTest.txt index 3f47703b9..456f66cc1 100644 --- a/dev/tests/verification/Resources/MergedReferencesTest.txt +++ b/dev/tests/verification/Resources/MergedReferencesTest.txt @@ -26,7 +26,7 @@ class MergedReferencesTestCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/beforeUrl"); + $I->amOnPage("/beforeUrl"); // stepKey: before1 } /** @@ -35,7 +35,7 @@ class MergedReferencesTestCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: after1 } /** @@ -44,7 +44,7 @@ class MergedReferencesTestCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** @@ -58,7 +58,7 @@ class MergedReferencesTestCest */ public function MergedReferencesTest(AcceptanceTester $I) { - $I->fillField("#merge", "merged"); - $I->fillField("#newElement", "newField"); + $I->fillField("#merge", "merged"); // stepKey: fillField1 + $I->fillField("#newElement", "newField"); // stepKey: fillField2 } } diff --git a/dev/tests/verification/Resources/MultipleActionGroupsTest.txt b/dev/tests/verification/Resources/MultipleActionGroupsTest.txt index ba99de0cb..e0796ae39 100644 --- a/dev/tests/verification/Resources/MultipleActionGroupsTest.txt +++ b/dev/tests/verification/Resources/MultipleActionGroupsTest.txt @@ -25,7 +25,7 @@ class MultipleActionGroupsTestCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createPersonParam"); + $I->comment("[createPersonParam] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createPersonParam", "hook", @@ -33,10 +33,11 @@ class MultipleActionGroupsTestCest [], null ); - $I->comment("Entering Action Group FunctionalActionGroup (beforeGroup)"); - $I->fillField("#foo", "myData1"); - $I->fillField("#bar", "myData2"); - $I->comment("Exiting Action Group FunctionalActionGroup (beforeGroup)"); + + $I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup + $I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup"); } /** @@ -45,10 +46,10 @@ class MultipleActionGroupsTestCest */ public function _after(AcceptanceTester $I) { - $I->comment("Entering Action Group FunctionalActionGroup (afterGroup)"); - $I->fillField("#foo", "myData1"); - $I->fillField("#bar", "myData2"); - $I->comment("Exiting Action Group FunctionalActionGroup (afterGroup)"); + $I->comment("Entering Action Group [afterGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup + $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); } /** @@ -57,7 +58,7 @@ class MultipleActionGroupsTestCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** @@ -71,21 +72,21 @@ class MultipleActionGroupsTestCest */ public function MultipleActionGroupsTest(AcceptanceTester $I) { - $I->amOnPage("/someUrl"); - $I->comment("Entering Action Group FunctionalActionGroupWithData (actionGroup1)"); - $I->amOnPage("/Jane/Dane.html"); - $I->fillField("#foo", "Jane"); - $I->fillField("#bar", "Dane"); - $I->searchAndMultiSelectOption("#foo", ["Jane", "Dane"]); - $I->see("#element .Jane"); - $I->comment("Exiting Action Group FunctionalActionGroupWithData (actionGroup1)"); - $I->click("loginButton"); - $I->comment("Entering Action Group FunctionalActionGroupWithData (actionGroupWithDataOverride2)"); - $I->amOnPage("/John/Doe.html"); - $I->fillField("#foo", "John"); - $I->fillField("#bar", "Doe"); - $I->searchAndMultiSelectOption("#foo", ["John", "Doe"]); - $I->see("#element .John"); - $I->comment("Exiting Action Group FunctionalActionGroupWithData (actionGroupWithDataOverride2)"); + $I->amOnPage("/someUrl"); // stepKey: step1 + $I->comment("Entering Action Group [actionGroup1] FunctionalActionGroupWithData"); + $I->amOnPage("/Jane/Dane.html"); // stepKey: amOnPage1ActionGroup1 + $I->fillField("#foo", "Jane"); // stepKey: fillField1ActionGroup1 + $I->fillField("#bar", "Dane"); // stepKey: fillField2ActionGroup1 + $I->searchAndMultiSelectOption("#foo", ["Jane", "Dane"]); // stepKey: multi1ActionGroup1 + $I->see("#element .Jane"); // stepKey: see1ActionGroup1 + $I->comment("Exiting Action Group [actionGroup1] FunctionalActionGroupWithData"); + $I->click("loginButton"); // stepKey: step6 + $I->comment("Entering Action Group [actionGroupWithDataOverride2] FunctionalActionGroupWithData"); + $I->amOnPage("/John/Doe.html"); // stepKey: amOnPage1ActionGroupWithDataOverride2 + $I->fillField("#foo", "John"); // stepKey: fillField1ActionGroupWithDataOverride2 + $I->fillField("#bar", "Doe"); // stepKey: fillField2ActionGroupWithDataOverride2 + $I->searchAndMultiSelectOption("#foo", ["John", "Doe"]); // stepKey: multi1ActionGroupWithDataOverride2 + $I->see("#element .John"); // stepKey: see1ActionGroupWithDataOverride2 + $I->comment("Exiting Action Group [actionGroupWithDataOverride2] FunctionalActionGroupWithData"); } } diff --git a/dev/tests/verification/Resources/PageReplacementTest.txt b/dev/tests/verification/Resources/PageReplacementTest.txt index 01ddedf78..6b27b55b1 100644 --- a/dev/tests/verification/Resources/PageReplacementTest.txt +++ b/dev/tests/verification/Resources/PageReplacementTest.txt @@ -27,7 +27,7 @@ class PageReplacementTestCest */ public function PageReplacementTest(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: datakey"); + $I->comment("[datakey] create 'simpleData' entity"); PersistedObjectHandler::getInstance()->createEntity( "datakey", "test", @@ -35,16 +35,17 @@ class PageReplacementTestCest [], null ); - $I->amOnPage("/page.html"); - $I->amOnPage("/StringLiteral/page.html"); - $I->amOnPage("/John/page.html"); - $I->amOnPage("/" . PersistedObjectHandler::getInstance()->retrieveEntityField('datakey', 'firstname', 'test') . "/page.html"); - $I->amOnPage("/StringLiteral1/StringLiteral2.html"); - $I->amOnPage("/John/StringLiteral2.html"); - $I->amOnPage("/John/" . PersistedObjectHandler::getInstance()->retrieveEntityField('datakey', 'firstname', 'test') . ".html"); - $I->amOnPage("/" . PersistedObjectHandler::getInstance()->retrieveEntityField('datakey', 'firstname', 'test') . "/StringLiteral2.html"); - $I->amOnPage("/" . getenv("MAGENTO_BACKEND_NAME") . "/backend"); - $I->amOnPage("/" . getenv("MAGENTO_BACKEND_NAME") . "/StringLiteral/page.html"); - $I->amOnUrl("http://myFullUrl.com/"); + + $I->amOnPage("/page.html"); // stepKey: noParamPage + $I->amOnPage("/StringLiteral/page.html"); // stepKey: oneParamPageString + $I->amOnPage("/John/page.html"); // stepKey: oneParamPageData + $I->amOnPage("/" . PersistedObjectHandler::getInstance()->retrieveEntityField('datakey', 'firstname', 'test') . "/page.html"); // stepKey: oneParamPagePersist + $I->amOnPage("/StringLiteral1/StringLiteral2.html"); // stepKey: twoParamPageString + $I->amOnPage("/John/StringLiteral2.html"); // stepKey: twoParamPageStringData + $I->amOnPage("/John/" . PersistedObjectHandler::getInstance()->retrieveEntityField('datakey', 'firstname', 'test') . ".html"); // stepKey: twoParamPageDataPersist + $I->amOnPage("/" . PersistedObjectHandler::getInstance()->retrieveEntityField('datakey', 'firstname', 'test') . "/StringLiteral2.html"); // stepKey: twoParamPagePersistString + $I->amOnPage("/" . getenv("MAGENTO_BACKEND_NAME") . "/backend"); // stepKey: onAdminPage + $I->amOnPage("/" . getenv("MAGENTO_BACKEND_NAME") . "/StringLiteral/page.html"); // stepKey: oneParamAdminPageString + $I->amOnUrl("http://myFullUrl.com/"); // stepKey: onExternalPage } } diff --git a/dev/tests/verification/Resources/ParameterArrayTest.txt b/dev/tests/verification/Resources/ParameterArrayTest.txt index 76e1bed32..8f49ca05c 100644 --- a/dev/tests/verification/Resources/ParameterArrayTest.txt +++ b/dev/tests/verification/Resources/ParameterArrayTest.txt @@ -27,7 +27,7 @@ class ParameterArrayTestCest */ public function ParameterArrayTest(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: simpleDataKey"); + $I->comment("[simpleDataKey] create 'simpleParamData' entity"); PersistedObjectHandler::getInstance()->createEntity( "simpleDataKey", "test", @@ -35,27 +35,28 @@ class ParameterArrayTestCest [], null ); - $I->searchAndMultiSelectOption("#selector", ["name"]); - $I->searchAndMultiSelectOption("#selector", [msq("simpleParamData") . "prename"]); - $I->searchAndMultiSelectOption("#selector", ["postname" . msq("simpleParamData")]); - $I->searchAndMultiSelectOption("#selector", [PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); - $I->searchAndMultiSelectOption("#selector", ["name", PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); - $I->searchAndMultiSelectOption("#selector", ['someKey' => PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); - $I->searchAndMultiSelectOption("#selector", ['someKey' => "name"]); - $I->searchAndMultiSelectOption("#selector", ['someKey' => msq("simpleParamData") . "prename"]); - $I->searchAndMultiSelectOption("#selector", ['someKey' => "postname" . msq("simpleParamData")]); - $I->unselectOption("#selector", ['foo']); - $I->unselectOption("#selector", ['foo', 'bar']); - $I->unselectOption("#selector", ["name"]); - $I->unselectOption("#selector", [msq("simpleParamData") . "prename"]); - $I->unselectOption("#selector", ["postname" . msq("simpleParamData")]); - $I->unselectOption("#selector", [PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); - $I->unselectOption("#selector", ["name", PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); - $I->pressKey("#selector", PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test'), ['ctrl', 'a'],\Facebook\WebDriver\WebDriverKeys::DELETE,PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')); - $I->pressKey("#selector", ['ctrl', 'a'], 10, 20,\Facebook\WebDriver\WebDriverKeys::DELETE,PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')); - $I->pressKey("#selector", ['ctrl', 'a'],'new', 10, 20,\Facebook\WebDriver\WebDriverKeys::DELETE,PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')); - $I->pressKey("#selector", ['ctrl', 'a'],'new', 1, ['ctrl'], ['shift', 'ctrl', 'del'], [PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test'), 'a', "name"]); - $I->pressKey("#selector", ['ctrl', 'a'],'new', 1, ['ctrl'], ['shift', 'ctrl', 'del'], 0, [PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); - $I->pressKey("#selector", ['ctrl', 'a'],'new', 1, ['ctrl'], ['shift', 'ctrl', 'del'], [msq("simpleParamData") . "prename", "postname" . msq("simpleParamData")]); + + $I->searchAndMultiSelectOption("#selector", ["name"]); // stepKey: xmlSimpleReplace + $I->searchAndMultiSelectOption("#selector", [msq("simpleParamData") . "prename"]); // stepKey: xmlPrefix + $I->searchAndMultiSelectOption("#selector", ["postname" . msq("simpleParamData")]); // stepKey: xmlSuffix + $I->searchAndMultiSelectOption("#selector", [PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); // stepKey: persistSimple + $I->searchAndMultiSelectOption("#selector", ["name", PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); // stepKey: persistXmlSimple + $I->searchAndMultiSelectOption("#selector", ['someKey' => PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); // stepKey: literalKeyToPersist + $I->searchAndMultiSelectOption("#selector", ['someKey' => "name"]); // stepKey: literalKeyToStatic + $I->searchAndMultiSelectOption("#selector", ['someKey' => msq("simpleParamData") . "prename"]); // stepKey: literalKeyToPrefixUnique + $I->searchAndMultiSelectOption("#selector", ['someKey' => "postname" . msq("simpleParamData")]); // stepKey: literalKeyToSuffixUnique + $I->unselectOption("#selector", ['foo']); // stepKey: 000 + $I->unselectOption("#selector", ['foo', 'bar']); // stepKey: 001 + $I->unselectOption("#selector", ["name"]); // stepKey: 002 + $I->unselectOption("#selector", [msq("simpleParamData") . "prename"]); // stepKey: 003 + $I->unselectOption("#selector", ["postname" . msq("simpleParamData")]); // stepKey: 004 + $I->unselectOption("#selector", [PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); // stepKey: 005 + $I->unselectOption("#selector", ["name", PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); // stepKey: 006 + $I->pressKey("#selector", PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test'), ['ctrl', 'a'],\Facebook\WebDriver\WebDriverKeys::DELETE,PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')); // stepKey: pressKey001 + $I->pressKey("#selector", ['ctrl', 'a'], 10, 20,\Facebook\WebDriver\WebDriverKeys::DELETE,PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')); // stepKey: pressKey002 + $I->pressKey("#selector", ['ctrl', 'a'],'new', 10, 20,\Facebook\WebDriver\WebDriverKeys::DELETE,PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')); // stepKey: pressKey003 + $I->pressKey("#selector", ['ctrl', 'a'],'new', 1, ['ctrl'], ['shift', 'ctrl', 'del'], [PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test'), 'a', "name"]); // stepKey: pressKey004 + $I->pressKey("#selector", ['ctrl', 'a'],'new', 1, ['ctrl'], ['shift', 'ctrl', 'del'], 0, [PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); // stepKey: pressKey005 + $I->pressKey("#selector", ['ctrl', 'a'],'new', 1, ['ctrl'], ['shift', 'ctrl', 'del'], [msq("simpleParamData") . "prename", "postname" . msq("simpleParamData")]); // stepKey: pressKey006 } } diff --git a/dev/tests/verification/Resources/ParentExtendedTest.txt b/dev/tests/verification/Resources/ParentExtendedTest.txt index c3d7217b3..7c0375190 100644 --- a/dev/tests/verification/Resources/ParentExtendedTest.txt +++ b/dev/tests/verification/Resources/ParentExtendedTest.txt @@ -26,7 +26,7 @@ class ParentExtendedTestCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/beforeUrl"); + $I->amOnPage("/beforeUrl"); // stepKey: beforeAmOnPageKey } /** @@ -35,7 +35,7 @@ class ParentExtendedTestCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey } /** @@ -44,7 +44,7 @@ class ParentExtendedTestCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** diff --git a/dev/tests/verification/Resources/PersistedAndXmlEntityArguments.txt b/dev/tests/verification/Resources/PersistedAndXmlEntityArguments.txt index 510e99018..7840afc76 100644 --- a/dev/tests/verification/Resources/PersistedAndXmlEntityArguments.txt +++ b/dev/tests/verification/Resources/PersistedAndXmlEntityArguments.txt @@ -27,8 +27,8 @@ class PersistedAndXmlEntityArgumentsCest */ public function PersistedAndXmlEntityArguments(AcceptanceTester $I) { - $I->comment("Entering Action Group FunctionalActionGroupWithXmlAndPersistedData (afterGroup)"); - $I->seeInCurrentUrl("/" . PersistedObjectHandler::getInstance()->retrieveEntityField('persistedInTest', 'urlKey', 'test') . ".html?___store=" . msq("uniqueData") . "John"); - $I->comment("Exiting Action Group FunctionalActionGroupWithXmlAndPersistedData (afterGroup)"); + $I->comment("Entering Action Group [afterGroup] FunctionalActionGroupWithXmlAndPersistedData"); + $I->seeInCurrentUrl("/" . PersistedObjectHandler::getInstance()->retrieveEntityField('persistedInTest', 'urlKey', 'test') . ".html?___store=" . msq("uniqueData") . "John"); // stepKey: checkUrlAfterGroup + $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroupWithXmlAndPersistedData"); } } diff --git a/dev/tests/verification/Resources/PersistedReplacementTest.txt b/dev/tests/verification/Resources/PersistedReplacementTest.txt index c19e33ee7..2c5d99bc2 100644 --- a/dev/tests/verification/Resources/PersistedReplacementTest.txt +++ b/dev/tests/verification/Resources/PersistedReplacementTest.txt @@ -24,7 +24,7 @@ class PersistedReplacementTestCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createData1"); + $I->comment("[createData1] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createData1", "hook", @@ -32,6 +32,7 @@ class PersistedReplacementTestCest [], null ); + } /** @@ -43,7 +44,7 @@ class PersistedReplacementTestCest */ public function PersistedReplacementTest(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createdData"); + $I->comment("[createdData] create 'simpleData' entity"); PersistedObjectHandler::getInstance()->createEntity( "createdData", "test", @@ -51,15 +52,16 @@ class PersistedReplacementTestCest [], null ); - $I->fillField("#selector", "StringBefore " . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " StringAfter"); - $I->fillField("#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), "input"); - $I->fillField("#" . getenv("MAGENTO_BASE_URL") . "#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), "input"); - $I->fillSecretField("#" . CredentialStore::getInstance()->getSecret("SECRET_PARAM") . "#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), "input"); - $I->dragAndDrop("#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'lastname', 'test')); - $I->conditionalClick(PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'lastname', 'test'), "#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), true); - $I->amOnUrl(PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . ".html"); - $I->searchAndMultiSelectOption("#selector", [PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'lastname', 'test')]); - $I->fillField("#selector", "John " . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " stringLiteral"); - $I->searchAndMultiSelectOption("#selector", [PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), "John", "stringLiteral"]); + + $I->fillField("#selector", "StringBefore " . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " StringAfter"); // stepKey: inputReplace + $I->fillField("#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), "input"); // stepKey: selectorReplace + $I->fillField("#" . getenv("MAGENTO_BASE_URL") . "#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), "input"); // stepKey: selectorReplace2 + $I->fillSecretField("#" . CredentialStore::getInstance()->getSecret("SECRET_PARAM") . "#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), "input"); // stepKey: selectorReplace3 + $I->dragAndDrop("#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'lastname', 'test')); // stepKey: selector12Replace + $I->conditionalClick(PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'lastname', 'test'), "#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), true); // stepKey: dependentSelectorReplace + $I->amOnUrl(PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . ".html"); // stepKey: urlReplace + $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 } } diff --git a/dev/tests/verification/Resources/PersistenceActionGroupAppendingTest.txt b/dev/tests/verification/Resources/PersistenceActionGroupAppendingTest.txt index e255a0338..af6507abc 100644 --- a/dev/tests/verification/Resources/PersistenceActionGroupAppendingTest.txt +++ b/dev/tests/verification/Resources/PersistenceActionGroupAppendingTest.txt @@ -24,8 +24,8 @@ class PersistenceActionGroupAppendingTestCest */ public function _before(AcceptanceTester $I) { - $I->comment("Entering Action Group DataPersistenceAppendingActionGroup (ACTIONGROUPBEFORE)"); - $I->amGoingTo("create entity that has the stepKey: createDataACTIONGROUPBEFORE"); + $I->comment("Entering Action Group [ACTIONGROUPBEFORE] DataPersistenceAppendingActionGroup"); + $I->comment("[createDataACTIONGROUPBEFORE] create 'entity' entity"); PersistedObjectHandler::getInstance()->createEntity( "createDataACTIONGROUPBEFORE", "hook", @@ -33,19 +33,22 @@ class PersistenceActionGroupAppendingTestCest [], null ); - $I->amGoingTo("update entity that has the createdDataKey: createDataACTIONGROUPBEFORE"); + + $I->comment("[updateDataACTIONGROUPBEFORE] update 'createDataACTIONGROUPBEFORE' entity to 'newEntity'"); PersistedObjectHandler::getInstance()->updateEntity( "createDataACTIONGROUPBEFORE", "hook", "newEntity", [] ); - $I->amGoingTo("delete entity that has the createDataKey: createDataACTIONGROUPBEFORE"); + + $I->comment("[deleteDataACTIONGROUPBEFORE] delete entity 'createDataACTIONGROUPBEFORE'"); PersistedObjectHandler::getInstance()->deleteEntity( "createDataACTIONGROUPBEFORE", "hook" ); - $I->amGoingTo("get entity that has the stepKey: getDataACTIONGROUPBEFORE"); + + $I->comment("[getDataACTIONGROUPBEFORE] get 'someEneity' entity"); PersistedObjectHandler::getInstance()->getEntity( "getDataACTIONGROUPBEFORE", "hook", @@ -53,8 +56,9 @@ class PersistenceActionGroupAppendingTestCest [], null ); + $I->comment(PersistedObjectHandler::getInstance()->retrieveEntityField('createData', 'field', 'hook')); - $I->comment("Exiting Action Group DataPersistenceAppendingActionGroup (ACTIONGROUPBEFORE)"); + $I->comment("Exiting Action Group [ACTIONGROUPBEFORE] DataPersistenceAppendingActionGroup"); } /** @@ -66,8 +70,8 @@ class PersistenceActionGroupAppendingTestCest */ public function PersistenceActionGroupAppendingTest(AcceptanceTester $I) { - $I->comment("Entering Action Group DataPersistenceAppendingActionGroup (ACTIONGROUP)"); - $I->amGoingTo("create entity that has the stepKey: createDataACTIONGROUP"); + $I->comment("Entering Action Group [ACTIONGROUP] DataPersistenceAppendingActionGroup"); + $I->comment("[createDataACTIONGROUP] create 'entity' entity"); PersistedObjectHandler::getInstance()->createEntity( "createDataACTIONGROUP", "test", @@ -75,19 +79,22 @@ class PersistenceActionGroupAppendingTestCest [], null ); - $I->amGoingTo("update entity that has the createdDataKey: createDataACTIONGROUP"); + + $I->comment("[updateDataACTIONGROUP] update 'createDataACTIONGROUP' entity to 'newEntity'"); PersistedObjectHandler::getInstance()->updateEntity( "createDataACTIONGROUP", "test", "newEntity", [] ); - $I->amGoingTo("delete entity that has the createDataKey: createDataACTIONGROUP"); + + $I->comment("[deleteDataACTIONGROUP] delete entity 'createDataACTIONGROUP'"); PersistedObjectHandler::getInstance()->deleteEntity( "createDataACTIONGROUP", "test" ); - $I->amGoingTo("get entity that has the stepKey: getDataACTIONGROUP"); + + $I->comment("[getDataACTIONGROUP] get 'someEneity' entity"); PersistedObjectHandler::getInstance()->getEntity( "getDataACTIONGROUP", "test", @@ -95,7 +102,8 @@ class PersistenceActionGroupAppendingTestCest [], null ); + $I->comment(PersistedObjectHandler::getInstance()->retrieveEntityField('createDataACTIONGROUP', 'field', 'test')); - $I->comment("Exiting Action Group DataPersistenceAppendingActionGroup (ACTIONGROUP)"); + $I->comment("Exiting Action Group [ACTIONGROUP] DataPersistenceAppendingActionGroup"); } } diff --git a/dev/tests/verification/Resources/PersistenceCustomFieldsTest.txt b/dev/tests/verification/Resources/PersistenceCustomFieldsTest.txt index 2db1b498f..68ded6711 100644 --- a/dev/tests/verification/Resources/PersistenceCustomFieldsTest.txt +++ b/dev/tests/verification/Resources/PersistenceCustomFieldsTest.txt @@ -25,8 +25,10 @@ class PersistenceCustomFieldsTestCest public function _before(AcceptanceTester $I) { $createData1Fields['firstname'] = "Mac"; + $createData1Fields['lastname'] = "Doe"; - $I->amGoingTo("create entity that has the stepKey: createData1"); + + $I->comment("[createData1] create 'DefaultPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createData1", "hook", @@ -34,8 +36,10 @@ class PersistenceCustomFieldsTestCest [], $createData1Fields ); + $createData2Fields['firstname'] = PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'hook'); - $I->amGoingTo("create entity that has the stepKey: createData2"); + + $I->comment("[createData2] create 'uniqueData' entity"); PersistedObjectHandler::getInstance()->createEntity( "createData2", "hook", @@ -43,6 +47,7 @@ class PersistenceCustomFieldsTestCest ["createData1"], $createData2Fields ); + } /** @@ -55,8 +60,10 @@ class PersistenceCustomFieldsTestCest public function PersistenceCustomFieldsTest(AcceptanceTester $I) { $createdDataFields['favoriteIndex'] = "1"; + $createdDataFields['middlename'] = "Kovacs"; - $I->amGoingTo("create entity that has the stepKey: createdData"); + + $I->comment("[createdData] create 'simpleData' entity"); PersistedObjectHandler::getInstance()->createEntity( "createdData", "test", @@ -64,9 +71,12 @@ class PersistenceCustomFieldsTestCest [], $createdDataFields ); + $createdData3Fields['firstname'] = "Takeshi"; + $createdData3Fields['lastname'] = "Kovacs"; - $I->amGoingTo("create entity that has the stepKey: createdData3"); + + $I->comment("[createdData3] create 'UniquePerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createdData3", "test", @@ -74,9 +84,11 @@ class PersistenceCustomFieldsTestCest ["createdData"], $createdData3Fields ); - $I->comment("Entering Action Group PersistenceActionGroup (createdAG)"); + + $I->comment("Entering Action Group [createdAG] PersistenceActionGroup"); $createDataAG1CreatedAGFields['firstname'] = "string1"; - $I->amGoingTo("create entity that has the stepKey: createDataAG1CreatedAG"); + + $I->comment("[createDataAG1CreatedAG] create 'simpleData' entity"); PersistedObjectHandler::getInstance()->createEntity( "createDataAG1CreatedAG", "test", @@ -84,8 +96,10 @@ class PersistenceCustomFieldsTestCest [], $createDataAG1CreatedAGFields ); + $createDataAG2CreatedAGFields['firstname'] = "Jane"; - $I->amGoingTo("create entity that has the stepKey: createDataAG2CreatedAG"); + + $I->comment("[createDataAG2CreatedAG] create 'simpleData' entity"); PersistedObjectHandler::getInstance()->createEntity( "createDataAG2CreatedAG", "test", @@ -93,8 +107,10 @@ class PersistenceCustomFieldsTestCest [], $createDataAG2CreatedAGFields ); + $createDataAG3CreatedAGFields['firstname'] = PersistedObjectHandler::getInstance()->retrieveEntityField('createdData3', 'firstname', 'test'); - $I->amGoingTo("create entity that has the stepKey: createDataAG3CreatedAG"); + + $I->comment("[createDataAG3CreatedAG] create 'simpleData' entity"); PersistedObjectHandler::getInstance()->createEntity( "createDataAG3CreatedAG", "test", @@ -102,6 +118,7 @@ class PersistenceCustomFieldsTestCest [], $createDataAG3CreatedAGFields ); - $I->comment("Exiting Action Group PersistenceActionGroup (createdAG)"); + + $I->comment("Exiting Action Group [createdAG] PersistenceActionGroup"); } } diff --git a/dev/tests/verification/Resources/SectionReplacementTest.txt b/dev/tests/verification/Resources/SectionReplacementTest.txt index c4d738811..a237faf38 100644 --- a/dev/tests/verification/Resources/SectionReplacementTest.txt +++ b/dev/tests/verification/Resources/SectionReplacementTest.txt @@ -27,26 +27,26 @@ class SectionReplacementTestCest */ public function SectionReplacementTest(AcceptanceTester $I) { - $I->click("#element"); - $I->click("#foo"); - $I->waitForPageLoad(30); - $I->click("#element .stringLiteral"); - $I->click("#stringLiteral1 .stringLiteral2"); - $I->click("#stringLiteral1-stringLiteral2 .stringLiteral3"); - $I->click("#stringLiteral1-stringLiteral2 .stringLiteral1 [stringLiteral3]"); - $I->click("#element .John"); - $I->click("#John .Doe"); - $I->click("#John-Doe .Tiberius"); - $I->click("#John-Doe .John [Tiberius]"); - $I->click("#element ." . msq("uniqueData") . "John"); - $I->click("#" . msq("uniqueData") . "John .stringLiteral2"); - $I->click("#" . msq("uniqueData") . "John-stringLiteral2 .stringLiteral3"); - $I->click("#" . msq("uniqueData") . "John-stringLiteral2 ." . msq("uniqueData") . "John [stringLiteral3]"); - $I->click("#element .Doe" . msq("uniqueData")); - $I->click("#Doe" . msq("uniqueData") . " .stringLiteral2"); - $I->click("#Doe" . msq("uniqueData") . "-stringLiteral2 .stringLiteral3"); - $I->click("#Doe" . msq("uniqueData") . "-stringLiteral2 .Doe" . msq("uniqueData") . " [stringLiteral3]"); - $I->amGoingTo("create entity that has the stepKey: createdData"); + $I->click("#element"); // stepKey: selectorReplace + $I->click("#foo"); // stepKey: selectorReplaceTimeout + $I->waitForPageLoad(30); // stepKey: selectorReplaceTimeoutWaitForPageLoad + $I->click("#element .stringLiteral"); // stepKey: selectorReplaceOneParam + $I->click("#stringLiteral1 .stringLiteral2"); // stepKey: selectorReplaceTwoParam + $I->click("#stringLiteral1-stringLiteral2 .stringLiteral3"); // stepKey: selectorReplaceThreeParam + $I->click("#stringLiteral1-stringLiteral2 .stringLiteral1 [stringLiteral3]"); // stepKey: selectorReplaceThreeParamOneDupe + $I->click("#element .John"); // stepKey: selectorReplaceOneParamDataRef + $I->click("#John .Doe"); // stepKey: selectorReplaceTwoParamDataRef + $I->click("#John-Doe .Tiberius"); // stepKey: selectorReplaceThreeParamDataRef + $I->click("#John-Doe .John [Tiberius]"); // stepKey: selectorReplaceThreeParamOneDupeDataRef + $I->click("#element ." . msq("uniqueData") . "John"); // stepKey: selectorReplaceOneParamDataRefMSQPrefix + $I->click("#" . msq("uniqueData") . "John .stringLiteral2"); // stepKey: selectorReplaceTwoParamDataRefMSQPrefix + $I->click("#" . msq("uniqueData") . "John-stringLiteral2 .stringLiteral3"); // stepKey: selectorReplaceThreeParamDataRefMSQPrefix + $I->click("#" . msq("uniqueData") . "John-stringLiteral2 ." . msq("uniqueData") . "John [stringLiteral3]"); // stepKey: selectorReplaceThreeParamOneDupeDataRefMSQPrefix + $I->click("#element .Doe" . msq("uniqueData")); // stepKey: selectorReplaceOneParamDataRefMSQSuffix + $I->click("#Doe" . msq("uniqueData") . " .stringLiteral2"); // stepKey: selectorReplaceTwoParamDataRefMSQSuffix + $I->click("#Doe" . msq("uniqueData") . "-stringLiteral2 .stringLiteral3"); // stepKey: selectorReplaceThreeParamDataRefMSQSuffix + $I->click("#Doe" . msq("uniqueData") . "-stringLiteral2 .Doe" . msq("uniqueData") . " [stringLiteral3]"); // stepKey: selectorReplaceThreeParamOneDupeDataRefMSQSuffix + $I->comment("[createdData] create 'simpleData' entity"); PersistedObjectHandler::getInstance()->createEntity( "createdData", "test", @@ -54,21 +54,22 @@ class SectionReplacementTestCest [], null ); - $I->click("#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test')); - $I->click("#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " .stringLiteral2"); - $I->click("#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . "-stringLiteral2 .stringLiteral3"); - $I->click("#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . "-stringLiteral2 ." . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " [stringLiteral3]"); - $I->click("#element .{$data}"); - $I->click("#{$data1} .{$data2}"); - $I->click("#{$data1}-{$data2} .{$data3}"); - $I->click("#John-Doe .John [Tiberius]"); - $I->click("#stringLiteral1-" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " .John"); - $I->click("#stringLiteral1-" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " .{$data}"); - $I->click("#stringLiteral1-" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " ." . msq("uniqueData") . "John"); - $I->click("#stringLiteral1-" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " .Doe" . msq("uniqueData")); - $I->click("#element .1#element .2"); - $I->click("#element .1#element .{$data}"); - $I->click("(//div[@data-role='slide'])[1]/a[@data-element='link'][contains(@href,'')]"); - $I->click("(//div[@data-role='slide'])[1]/a[@data-element='link'][contains(@href,' ')]"); + + $I->click("#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test')); // stepKey: selectorReplaceOneParamPersisted + $I->click("#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " .stringLiteral2"); // stepKey: selectorReplaceTwoParamPersisted + $I->click("#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . "-stringLiteral2 .stringLiteral3"); // stepKey: selectorReplaceThreeParamPersisted + $I->click("#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . "-stringLiteral2 ." . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " [stringLiteral3]"); // stepKey: selectorReplaceThreeParamOneDupePersisted + $I->click("#element .{$data}"); // stepKey: selectorReplaceOneParamVariable + $I->click("#{$data1} .{$data2}"); // stepKey: selectorReplaceTwoParamVariable + $I->click("#{$data1}-{$data2} .{$data3}"); // stepKey: selectorReplaceThreeParamVariable + $I->click("#John-Doe .John [Tiberius]"); // stepKey: selectorReplaceThreeParamVariableOneDupe + $I->click("#stringLiteral1-" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " .John"); // stepKey: selectorReplaceThreeParamMixed1 + $I->click("#stringLiteral1-" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " .{$data}"); // stepKey: selectorReplaceThreeParamMixed2 + $I->click("#stringLiteral1-" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " ." . msq("uniqueData") . "John"); // stepKey: selectorReplaceThreeParamMixedMSQPrefix + $I->click("#stringLiteral1-" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " .Doe" . msq("uniqueData")); // stepKey: selectorReplaceThreeParamMixedMSQSuffix + $I->click("#element .1#element .2"); // stepKey: selectorReplaceTwoParamElements + $I->click("#element .1#element .{$data}"); // stepKey: selectorReplaceTwoParamMixedTypes + $I->click("(//div[@data-role='slide'])[1]/a[@data-element='link'][contains(@href,'')]"); // stepKey: selectorParamWithEmptyString + $I->click("(//div[@data-role='slide'])[1]/a[@data-element='link'][contains(@href,' ')]"); // stepKey: selectorParamWithASpace } } diff --git a/dev/tests/verification/Resources/XmlCommentedActionGroupTest.txt b/dev/tests/verification/Resources/XmlCommentedActionGroupTest.txt new file mode 100644 index 000000000..4605cc350 --- /dev/null +++ b/dev/tests/verification/Resources/XmlCommentedActionGroupTest.txt @@ -0,0 +1,37 @@ +<?php +namespace Magento\AcceptanceTest\_default\Backend; + +use Magento\FunctionalTestingFramework\AcceptanceTester; +use Magento\FunctionalTestingFramework\DataGenerator\Handlers\CredentialStore; +use Magento\FunctionalTestingFramework\DataGenerator\Handlers\PersistedObjectHandler; +use \Codeception\Util\Locator; +use Yandex\Allure\Adapter\Annotation\Features; +use Yandex\Allure\Adapter\Annotation\Stories; +use Yandex\Allure\Adapter\Annotation\Title; +use Yandex\Allure\Adapter\Annotation\Description; +use Yandex\Allure\Adapter\Annotation\Parameter; +use Yandex\Allure\Adapter\Annotation\Severity; +use Yandex\Allure\Adapter\Model\SeverityLevel; +use Yandex\Allure\Adapter\Annotation\TestCaseId; + +/** + * @Title("[NO TESTCASEID]: Action Group With comment block in arguments and action group body") + */ +class XmlCommentedActionGroupTestCest +{ + /** + * @Severity(level = SeverityLevel::CRITICAL) + * @Features({"TestModule"}) + * @Parameter(name = "AcceptanceTester", value="$I") + * @param AcceptanceTester $I + * @return void + * @throws \Exception + */ + public function XmlCommentedActionGroupTest(AcceptanceTester $I) + { + $I->comment("Entering Action Group [actionGroup] XmlCommentedActionGroup"); + $I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id\">/"); + $I->see("John", "#element .test1"); // stepKey: seeFirstNameActionGroup + $I->comment("Exiting Action Group [actionGroup] XmlCommentedActionGroup"); + } +} diff --git a/dev/tests/verification/Resources/XmlCommentedTest.txt b/dev/tests/verification/Resources/XmlCommentedTest.txt new file mode 100644 index 000000000..1d8bca5aa --- /dev/null +++ b/dev/tests/verification/Resources/XmlCommentedTest.txt @@ -0,0 +1,74 @@ +<?php +namespace Magento\AcceptanceTest\_default\Backend; + +use Magento\FunctionalTestingFramework\AcceptanceTester; +use Magento\FunctionalTestingFramework\DataGenerator\Handlers\CredentialStore; +use Magento\FunctionalTestingFramework\DataGenerator\Handlers\PersistedObjectHandler; +use \Codeception\Util\Locator; +use Yandex\Allure\Adapter\Annotation\Features; +use Yandex\Allure\Adapter\Annotation\Stories; +use Yandex\Allure\Adapter\Annotation\Title; +use Yandex\Allure\Adapter\Annotation\Description; +use Yandex\Allure\Adapter\Annotation\Parameter; +use Yandex\Allure\Adapter\Annotation\Severity; +use Yandex\Allure\Adapter\Model\SeverityLevel; +use Yandex\Allure\Adapter\Annotation\TestCaseId; + +/** + * @Title("[NO TESTCASEID]: Test With comment blocks in root element 'tests', in annotations and in test body.") + */ +class XmlCommentedTestCest +{ + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _before(AcceptanceTester $I) + { + $I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id_1\">/"); + $I->amOnPage("/beforeUrl"); // stepKey: beforeAmOnPageKey + $I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id_2\">/"); + } + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + $I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id_1\">/"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey + $I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id_2\">/"); + } + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _failed(AcceptanceTester $I) + { + $I->saveScreenshot(); // stepKey: saveScreenshot + } + + /** + * @Severity(level = SeverityLevel::CRITICAL) + * @Features({"TestModule"}) + * @Parameter(name = "AcceptanceTester", value="$I") + * @param AcceptanceTester $I + * @return void + * @throws \Exception + */ + public function XmlCommentedTest(AcceptanceTester $I) + { + $I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id_1\">/"); + $someVarDefinition = $I->grabValueFrom(); // stepKey: someVarDefinition + $I->acceptPopup(); // stepKey: acceptPopupKey1 + $I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id_2\">/"); + $I->amOnPage("/test/url"); // stepKey: amOnPageKey1 + $I->appendField(".functionalTestSelector"); // stepKey: appendFieldKey1 + $I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id_3\">/"); + $I->attachFile(".functionalTestSelector", "testFileAttachment"); // stepKey: attachFileKey1 + $I->comment("<cancelPopup stepKey=\"cancelPopupKey1\"/>"); + $I->checkOption(".functionalTestSelector"); // stepKey: checkOptionKey1 + } +} diff --git a/dev/tests/verification/Resources/functionalSuiteHooks.txt b/dev/tests/verification/Resources/functionalSuiteHooks.txt index d9ff2a344..4df805329 100644 --- a/dev/tests/verification/Resources/functionalSuiteHooks.txt +++ b/dev/tests/verification/Resources/functionalSuiteHooks.txt @@ -51,7 +51,7 @@ class functionalSuiteHooks extends \Codeception\GroupObject // initialize the webdriver session $webDriver->_initializeSession(); - $webDriver->amOnPage("some.url"); + $webDriver->amOnPage("some.url"); // stepKey: before $createFields['someKey'] = "dataHere"; PersistedObjectHandler::getInstance()->createEntity( "create", @@ -59,10 +59,10 @@ class functionalSuiteHooks extends \Codeception\GroupObject "createThis", $createFields ); - $webDriver->click(PersistedObjectHandler::getInstance()->retrieveEntityField('create', 'data', 'suite')); - print("Entering Action Group actionGroupWithTwoArguments (AC)"); - $webDriver->see("John", msq("uniqueData") . "John"); - print("Exiting Action Group actionGroupWithTwoArguments (AC)"); + $webDriver->click(PersistedObjectHandler::getInstance()->retrieveEntityField('create', 'data', 'suite')); // stepKey: clickWithData + print("Entering Action Group [AC] actionGroupWithTwoArguments"); + $webDriver->see("John", msq("uniqueData") . "John"); // stepKey: seeFirstNameAC + print("Exiting Action Group [AC] actionGroupWithTwoArguments"); // reset configuration and close session $this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoWebDriver')->_resetConfig(); @@ -120,11 +120,11 @@ class functionalSuiteHooks extends \Codeception\GroupObject // initialize the webdriver session $webDriver->_initializeSession(); - $webDriver->amOnPage("some.url"); + $webDriver->amOnPage("some.url"); // stepKey: after $webDriver->deleteEntityByUrl("deleteThis"); - print("Entering Action Group actionGroupWithTwoArguments (AC)"); - $webDriver->see("John", msq("uniqueData") . "John"); - print("Exiting Action Group actionGroupWithTwoArguments (AC)"); + print("Entering Action Group [AC] actionGroupWithTwoArguments"); + $webDriver->see("John", msq("uniqueData") . "John"); // stepKey: seeFirstNameAC + print("Exiting Action Group [AC] actionGroupWithTwoArguments"); } catch (\Exception $exception) { print $exception->getMessage(); } diff --git a/dev/tests/verification/Resources/functionalSuiteWithComments.txt b/dev/tests/verification/Resources/functionalSuiteWithComments.txt new file mode 100644 index 000000000..d0e059aab --- /dev/null +++ b/dev/tests/verification/Resources/functionalSuiteWithComments.txt @@ -0,0 +1,134 @@ +<?php + +namespace Group; + +use Magento\FunctionalTestingFramework\DataGenerator\Handlers\PersistedObjectHandler; + +/** + * Group class is Codeception Extension which is allowed to handle to all internal events. + * This class itself can be used to listen events for test execution of one particular group. + * It may be especially useful to create fixtures data, prepare server, etc. + * + * INSTALLATION: + * + * To use this group extension, include it to "extensions" option of global Codeception config. + */ +class functionalSuiteWithComments extends \Codeception\GroupObject +{ + public static $group = 'functionalSuiteWithComments'; + private $testCount = 1; + private $preconditionFailure = null; + private $currentTestRun = 0; + private static $HOOK_EXECUTION_INIT = "\n/******** Beginning execution of functionalSuiteWithComments suite %s block ********/\n"; + private static $HOOK_EXECUTION_END = "\n/******** Execution of functionalSuiteWithComments suite %s block complete ********/\n"; + + public function _before(\Codeception\Event\TestEvent $e) + { + // increment test count per execution + $this->currentTestRun++; + $this->executePreConditions(); + + if ($this->preconditionFailure != null) { + //if our preconditions fail, we need to mark all the tests as incomplete. + $e->getTest()->getMetadata()->setIncomplete("SUITE PRECONDITION FAILED:" . PHP_EOL . $this->preconditionFailure); + } + } + + + private function executePreConditions() + { + if ($this->currentTestRun == 1) { + print sprintf(self::$HOOK_EXECUTION_INIT, "before"); + + try { + $webDriver = $this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoWebDriver'); + + // close any open sessions + if ($webDriver->webDriver != null) { + $webDriver->webDriver->close(); + $webDriver->webDriver = null; + } + + // initialize the webdriver session + $webDriver->_initializeSession(); + print("Comment in Before"); + $webDriver->amOnPage("some.url"); // stepKey: before + $createFields['someKey'] = "dataHere"; + PersistedObjectHandler::getInstance()->createEntity( + "create", + "suite", + "createThis", + $createFields + ); + print("<click stepKey=\"comment with element\" userInput=\"helloworld\"/>"); + $webDriver->click(PersistedObjectHandler::getInstance()->retrieveEntityField('create', 'data', 'suite')); // stepKey: clickWithData + print("Entering Action Group [AC] actionGroupWithTwoArguments"); + $webDriver->see("John", msq("uniqueData") . "John"); // stepKey: seeFirstNameAC + print("Exiting Action Group [AC] actionGroupWithTwoArguments"); + + // reset configuration and close session + $this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoWebDriver')->_resetConfig(); + $webDriver->webDriver->close(); + $webDriver->webDriver = null; + + } catch (\Exception $exception) { + $this->preconditionFailure = $exception->getMessage(); + } + + print sprintf(self::$HOOK_EXECUTION_END, "before"); + } + } + + public function _after(\Codeception\Event\TestEvent $e) + { + $this->executePostConditions($e); + } + + + private function executePostConditions(\Codeception\Event\TestEvent $e) + { + if ($this->currentTestRun == $this->testCount) { + print sprintf(self::$HOOK_EXECUTION_INIT, "after"); + + try { + // Find out if Test in Suite failed, will cause potential failures in suite after + $cest = $e->getTest(); + + //Access private TestResultObject to find stack and if there are any errors (as opposed to failures) + $testResultObject = call_user_func(\Closure::bind( + function () use ($cest) { + return $cest->getTestResultObject(); + }, + $cest + )); + $errors = $testResultObject->errors(); + + if (!empty($errors)) { + foreach ($errors as $error) { + if ($error->failedTest()->getTestMethod() == $cest->getName()) { + // Do not attempt to run _after if failure was in the _after block + // Try to run _after but catch exceptions to prevent them from overwriting original failure. + print("LAST TEST IN SUITE FAILED, TEST AFTER MAY NOT BE SUCCESSFUL\n"); + } + } + } + $webDriver = $this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoWebDriver'); + + // close any open sessions + if ($webDriver->webDriver != null) { + $webDriver->webDriver->close(); + $webDriver->webDriver = null; + } + + // initialize the webdriver session + $webDriver->_initializeSession(); + print("afterBlock"); + } catch (\Exception $exception) { + print $exception->getMessage(); + } + + PersistedObjectHandler::getInstance()->clearSuiteObjects(); + print sprintf(self::$HOOK_EXECUTION_END, "after"); + } + } +} diff --git a/dev/tests/verification/TestModule/ActionGroup/XmlCommentedActionGroup.xml b/dev/tests/verification/TestModule/ActionGroup/XmlCommentedActionGroup.xml new file mode 100644 index 000000000..a46dab939 --- /dev/null +++ b/dev/tests/verification/TestModule/ActionGroup/XmlCommentedActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd"> + <actionGroup name="XmlCommentedActionGroup"> + <arguments> + <!-- Comments in arguments are not affecting test generation --> + <!-- <argument name="someArgument" defaultValue="ReplacementPerson" /> --> + <argument name="someArgument" defaultValue="ReplacementPerson" /> + </arguments> + + <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id">/--> + <see selector="{{SampleSection.oneParamElement('test1')}}" userInput="{{someArgument.firstname}}" stepKey="seeFirstName" /> + </actionGroup> +</actionGroups> diff --git a/dev/tests/verification/TestModule/Test/XmlCommentedActionGroupTest.xml b/dev/tests/verification/TestModule/Test/XmlCommentedActionGroupTest.xml new file mode 100644 index 000000000..f7fbd8dd6 --- /dev/null +++ b/dev/tests/verification/TestModule/Test/XmlCommentedActionGroupTest.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> + <test name="XmlCommentedActionGroupTest"> + <annotations> + <severity value="CRITICAL"/> + <title value="Action Group With comment block in arguments and action group body"/> + </annotations> + <actionGroup ref="XmlCommentedActionGroup" stepKey="actionGroup"/> + </test> +</tests> diff --git a/dev/tests/verification/TestModule/Test/XmlCommentedTest.xml b/dev/tests/verification/TestModule/Test/XmlCommentedTest.xml new file mode 100644 index 000000000..133588872 --- /dev/null +++ b/dev/tests/verification/TestModule/Test/XmlCommentedTest.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> + <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id">/--> + <test name="XmlCommentedTest"> + <annotations> + <!-- Comments in Test annotations are not affecting test generation --> + <!-- <severity value="BLOCKER"/> --> + <severity value="CRITICAL"/> + <title value="Test With comment blocks in root element 'tests', in annotations and in test body."/> + </annotations> + <before> + <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id_1">/--> + <amOnPage url="/beforeUrl" stepKey="beforeAmOnPageKey"/> + <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id_2">/--> + </before> + <after> + <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id_1">/--> + <amOnPage url="/afterUrl" stepKey="afterAmOnPageKey"/> + <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id_2">/--> + </after> + + <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id_1">/--> + <grabValueFrom stepKey="someVarDefinition"/> + <acceptPopup stepKey="acceptPopupKey1"/> + + <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id_2">/--> + <amOnPage stepKey="amOnPageKey1" url="/test/url"/> + <appendField selector=".functionalTestSelector" stepKey="appendFieldKey1" /> + + <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id_3">/--> + <attachFile userInput="testFileAttachment" selector=".functionalTestSelector" stepKey="attachFileKey1" /> +<!-- <cancelPopup stepKey="cancelPopupKey1"/>--> + <checkOption selector=".functionalTestSelector" stepKey="checkOptionKey1"/> + </test> +</tests> diff --git a/dev/tests/verification/Tests/ActionGroupGenerationTest.php b/dev/tests/verification/Tests/ActionGroupGenerationTest.php index 613d6cb72..604f546b2 100644 --- a/dev/tests/verification/Tests/ActionGroupGenerationTest.php +++ b/dev/tests/verification/Tests/ActionGroupGenerationTest.php @@ -206,4 +206,15 @@ public function testActionGroupWithHyphen() { $this->generateAndCompareTest('ActionGroupWithParameterizedElementWithHyphen'); } + + /** + * Test generation of a test referencing an action group with xml comment in arguments and action group body. + * + * @throws \Exception + * @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException + */ + public function testActionGroupWithXmlComments() + { + $this->generateAndCompareTest('XmlCommentedActionGroupTest'); + } } diff --git a/dev/tests/verification/Tests/BasicCestGenerationTest.php b/dev/tests/verification/Tests/BasicCestGenerationTest.php index b03cbc487..793b2a502 100644 --- a/dev/tests/verification/Tests/BasicCestGenerationTest.php +++ b/dev/tests/verification/Tests/BasicCestGenerationTest.php @@ -19,4 +19,19 @@ public function testBasicGeneration() { $this->generateAndCompareTest('BasicFunctionalTest'); } + + /** + * Tests flat generation of a hardcoded test file with no external references and with XML comments in: + * - root `tests` element + * - test body + * - test before and after blocks + * - annotations block + * + * @throws \Exception + * @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException + */ + public function testWithXmlComments() + { + $this->generateAndCompareTest('XmlCommentedTest'); + } } diff --git a/dev/tests/verification/Tests/SuiteGenerationTest.php b/dev/tests/verification/Tests/SuiteGenerationTest.php index f305e565f..d2242fb52 100644 --- a/dev/tests/verification/Tests/SuiteGenerationTest.php +++ b/dev/tests/verification/Tests/SuiteGenerationTest.php @@ -327,6 +327,65 @@ public function testSuiteGenerationWithExtends() } } + /** + * Test comments generated during suite generation + */ + public function testSuiteCommentsGeneration() + { + $groupName = 'functionalSuiteWithComments'; + + $expectedContents = [ + 'IncludeTestCest.php' + ]; + + // Generate the Suite + SuiteGenerator::getInstance()->generateSuite($groupName); + + // Validate log message and add group name for later deletion + TestLoggingUtil::getInstance()->validateMockLogStatement( + 'info', + "suite generated", + ['suite' => $groupName, 'relative_path' => "_generated" . DIRECTORY_SEPARATOR . $groupName] + ); + self::$TEST_GROUPS[] = $groupName; + + // Validate Yaml file updated + $yml = Yaml::parse(file_get_contents(self::CONFIG_YML_FILE)); + $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)); + } + + //assert group file created and contains correct contents + $groupFile = PROJECT_ROOT . + DIRECTORY_SEPARATOR . + "src" . + DIRECTORY_SEPARATOR . + "Magento" . + DIRECTORY_SEPARATOR . + "FunctionalTestingFramework" . + DIRECTORY_SEPARATOR . + "Group" . + DIRECTORY_SEPARATOR . + $groupName . + ".php"; + + $this->assertTrue(file_exists($groupFile)); + $this->assertFileEquals( + self::RESOURCES_PATH . DIRECTORY_SEPARATOR . $groupName . ".txt", + $groupFile + ); + } + /** * revert any changes made to config.yml * remove _generated directory diff --git a/dev/tests/verification/_suite/functionalSuite.xml b/dev/tests/verification/_suite/functionalSuite.xml index 439445c24..cfdaa3557 100644 --- a/dev/tests/verification/_suite/functionalSuite.xml +++ b/dev/tests/verification/_suite/functionalSuite.xml @@ -29,4 +29,28 @@ <test name="ExcludeTest2"/> </exclude> </suite> + <suite name="functionalSuiteWithComments"> + <include> + <!-- Comment Block--> + <test name="IncludeTest"/> + </include> + <before> + <!-- Comment in Before--> + <amOnPage url="some.url" stepKey="before"/> + <createData entity="createThis" stepKey="create"> + <!--Comment in Nested Element--> + <field key="someKey">dataHere</field> + </createData> + <!-- <click stepKey="comment with element" userInput="helloworld"/> --> + <click stepKey="clickWithData" userInput="$create.data$"/> + <actionGroup ref="actionGroupWithTwoArguments" stepKey="AC"> + <!--Comment in AG Args--> + <argument name="somePerson" value="simpleData"/> + <argument name="anotherPerson" value="uniqueData"/> + </actionGroup> + </before> + <after> + <comment userInput="afterBlock" stepKey="afterBlock"/> + </after> + </suite> </suites> diff --git a/etc/config/codeception.dist.yml b/etc/config/codeception.dist.yml index e6b03fab8..30697dc8f 100755 --- a/etc/config/codeception.dist.yml +++ b/etc/config/codeception.dist.yml @@ -8,10 +8,12 @@ paths: support: src/Magento/FunctionalTestingFramework envs: etc/_envs settings: + silent: true colors: true memory_limit: 1024M extensions: enabled: + - Magento\FunctionalTestingFramework\Codeception\Subscriber\Console - Magento\FunctionalTestingFramework\Extension\TestContextExtension - Magento\FunctionalTestingFramework\Allure\Adapter\MagentoAllureAdapter config: diff --git a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php index 65be8ea84..68dbe09ae 100644 --- a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php +++ b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php @@ -5,8 +5,10 @@ */ namespace Magento\FunctionalTestingFramework\Allure\Adapter; +use Codeception\Step\Comment; use Magento\FunctionalTestingFramework\Suite\Handlers\SuiteObjectHandler; use Magento\FunctionalTestingFramework\Test\Objects\ActionGroupObject; +use \Magento\FunctionalTestingFramework\Util\TestGenerator; use Yandex\Allure\Adapter\Model\Step; use Yandex\Allure\Codeception\AllureCodeception; use Yandex\Allure\Adapter\Event\StepStartedEvent; @@ -30,6 +32,12 @@ class MagentoAllureAdapter extends AllureCodeception { const STEP_PASSED = "passed"; + /** + * Test files cache. + * + * @var array + */ + private $testFiles = []; /** * Array of group values passed to test runner command @@ -107,6 +115,7 @@ private function sanitizeGroupName($group) * Override of parent method: * prevent replacing of . to • * strips control characters + * inserts stepKey into step name * * @param StepEvent $stepEvent * @return void @@ -116,9 +125,16 @@ public function stepBefore(StepEvent $stepEvent) { //Hard set to 200; we don't expose this config in MFTF $argumentsLength = 200; + $stepKey = null; + + if (!($stepEvent->getStep() instanceof Comment)) { + $stepKey = $this->retrieveStepKey($stepEvent->getStep()->getLine()); + } // DO NOT alter action if actionGroup is starting, need the exact actionGroup name for good logging - if (strpos($stepEvent->getStep()->getAction(), ActionGroupObject::ACTION_GROUP_CONTEXT_START) !== false) { + if (strpos($stepEvent->getStep()->getAction(), ActionGroupObject::ACTION_GROUP_CONTEXT_START) !== false + || $stepEvent->getStep() instanceof Comment + ) { $stepAction = $stepEvent->getStep()->getAction(); } else { $stepAction = $stepEvent->getStep()->getHumanizedActionWithoutArguments(); @@ -130,7 +146,11 @@ public function stepBefore(StepEvent $stepEvent) $stepArgs = $stepEvent->getStep()->getMetaStep()->getArgumentsAsString($argumentsLength); } - $stepName = $stepAction . ' ' . $stepArgs; + $stepName = ''; + if ($stepKey !== null) { + $stepName .= '[' . $stepKey . '] '; + } + $stepName .= $stepAction . ' ' . $stepArgs; // Strip control characters so that report generation does not fail $stepName = preg_replace('/[[:cntrl:]]/', '', $stepName); @@ -179,17 +199,29 @@ public function testEnd() $formattedSteps = []; $actionGroupStepContainer = null; + $actionGroupStepKey = null; foreach ($rootStep->getSteps() as $step) { + $stepKey = str_replace($actionGroupStepKey, '', $step->getName()); + if ($stepKey !== '[]' && $stepKey !== null) { + $step->setName($stepKey); + } // if actionGroup flag, start nesting if (strpos($step->getName(), ActionGroupObject::ACTION_GROUP_CONTEXT_START) !== false) { $step->setName(str_replace(ActionGroupObject::ACTION_GROUP_CONTEXT_START, '', $step->getName())); $actionGroupStepContainer = $step; + + preg_match(TestGenerator::ACTION_GROUP_STEP_KEY_REGEX, $step->getName(), $matches); + if (!empty($matches['actionGroupStepKey'])) { + $actionGroupStepKey = ucfirst($matches['actionGroupStepKey']); + } continue; } + // if actionGroup ended, add stack to steps if (stripos($step->getName(), ActionGroupObject::ACTION_GROUP_CONTEXT_END) !== false) { $formattedSteps[] = $actionGroupStepContainer; $actionGroupStepContainer = null; + $actionGroupStepKey = null; continue; } @@ -220,4 +252,28 @@ function () use ($rootStep, $formattedSteps) { $this->getLifecycle()->fire(new TestCaseFinishedEvent()); } + + /** + * Reading stepKey from file. + * + * @param string $stepLine + * @return string|null + */ + private function retrieveStepKey($stepLine) + { + $stepKey = null; + list($filePath, $stepLine) = explode(":", $stepLine); + $stepLine = $stepLine - 1; + + if (!array_key_exists($filePath, $this->testFiles)) { + $this->testFiles[$filePath] = explode(PHP_EOL, file_get_contents($filePath)); + } + + preg_match(TestGenerator::ACTION_STEP_KEY_REGEX, $this->testFiles[$filePath][$stepLine], $matches); + if (!empty($matches['stepKey'])) { + $stepKey = $matches['stepKey']; + } + + return $stepKey; + } } diff --git a/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php b/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php new file mode 100644 index 000000000..8c56e7733 --- /dev/null +++ b/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php @@ -0,0 +1,169 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\FunctionalTestingFramework\Codeception\Subscriber; + +use Codeception\Event\StepEvent; +use Codeception\Lib\Console\Message; +use Codeception\Step; +use Codeception\Step\Comment; +use Codeception\Test\Interfaces\ScenarioDriven; +use Magento\FunctionalTestingFramework\Test\Objects\ActionGroupObject; +use Magento\FunctionalTestingFramework\Util\TestGenerator; +use Symfony\Component\Console\Formatter\OutputFormatter; + +class Console extends \Codeception\Subscriber\Console +{ + /** + * Test files cache. + * + * @var array + */ + private $testFiles = []; + + /** + * Action group step key. + * + * @var null|string + */ + private $actionGroupStepKey = null; + + /** + * Printing stepKey in before step action. + * + * @param StepEvent $e + * @return void + */ + public function beforeStep(StepEvent $e) + { + if ($this->silent or !$this->steps or !$e->getTest() instanceof ScenarioDriven) { + return; + } + + $metaStep = $e->getStep()->getMetaStep(); + if ($metaStep and $this->metaStep != $metaStep) { + $this->message(' ' . $metaStep->getPrefix()) + ->style('bold') + ->append($metaStep->__toString()) + ->writeln(); + } + $this->metaStep = $metaStep; + + $this->printStepKeys($e->getStep()); + } + + /** + * If step failed we move back from action group to test scope + * + * @param StepEvent $e + * @return void + */ + public function afterStep(StepEvent $e) + { + parent::afterStep($e); + if ($e->getStep()->hasFailed()) { + $this->actionGroupStepKey = null; + } + } + + /** + * Print output to cli with stepKey. + * + * @param Step $step + * @return void + * @SuppressWarnings(PHPMD) + */ + private function printStepKeys(Step $step) + { + if ($step instanceof Comment and $step->__toString() == '') { + return; // don't print empty comments + } + + $stepKey = $this->retrieveStepKey($step->getLine()); + + $isActionGroup = (strpos($step->__toString(), ActionGroupObject::ACTION_GROUP_CONTEXT_START) !== false); + if ($isActionGroup) { + preg_match(TestGenerator::ACTION_GROUP_STEP_KEY_REGEX, $step->__toString(), $matches); + if (!empty($matches['actionGroupStepKey'])) { + $this->actionGroupStepKey = ucfirst($matches['actionGroupStepKey']); + } + } + + if (strpos($step->__toString(), ActionGroupObject::ACTION_GROUP_CONTEXT_END) !== false) { + $this->actionGroupStepKey = null; + return; + } + + $msg = $this->message(); + if ($this->metaStep || ($this->actionGroupStepKey !== null && !$isActionGroup)) { + $msg->append(' '); + } + if ($stepKey !== null) { + $msg->append(OutputFormatter::escape("[" . $stepKey . "] ")); + $msg->style('bold'); + } + + if (!$this->metaStep) { + $msg->style('bold'); + } + + $stepString = str_replace( + [ActionGroupObject::ACTION_GROUP_CONTEXT_START, ActionGroupObject::ACTION_GROUP_CONTEXT_END], + '', + $step->toString(150) + ); + + $msg->append(OutputFormatter::escape($stepString)); + if ($isActionGroup) { + $msg->style('comment'); + } + if ($this->metaStep || ($this->actionGroupStepKey !== null && !$isActionGroup)) { + $msg->style('info'); + } + $msg->writeln(); + } + + /** + * Message instance. + * + * @param string $string + * @return Message + */ + private function message($string = '') + { + return $this->messageFactory->message($string); + } + + /** + * Reading stepKey from file. + * + * @param string $stepLine + * @return string|null + */ + private function retrieveStepKey($stepLine) + { + $stepKey = null; + list($filePath, $stepLine) = explode(":", $stepLine); + $stepLine = $stepLine - 1; + + if (!array_key_exists($filePath, $this->testFiles)) { + $this->testFiles[$filePath] = explode(PHP_EOL, file_get_contents($filePath)); + } + + preg_match(TestGenerator::ACTION_STEP_KEY_REGEX, $this->testFiles[$filePath][$stepLine], $matches); + if (!empty($matches['stepKey'])) { + $stepKey = $matches['stepKey']; + } + + if ($this->actionGroupStepKey !== null) { + $stepKey = str_replace($this->actionGroupStepKey, '', $stepKey); + } + + $stepKey = $stepKey === '[]' ? null : $stepKey; + + return $stepKey; + } +} diff --git a/src/Magento/FunctionalTestingFramework/Suite/Generators/GroupClassGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/Generators/GroupClassGenerator.php index a84f6b1b3..415d884b6 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/Generators/GroupClassGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/Generators/GroupClassGenerator.php @@ -172,10 +172,11 @@ private function buildHookMustacheArray($hookObj) private function buildWebDriverActionsMustacheArray($action, $actionEntries) { $step = TestGenerator::getInstance()->generateStepsPhp([$action], TestGenerator::SUITE_SCOPE, 'webDriver'); - $rawPhp = str_replace(["\t", "\n"], "", $step); - $multipleCommands = explode(";", $rawPhp, -1); + $rawPhp = str_replace(["\t"], "", $step); + $multipleCommands = explode(PHP_EOL, $rawPhp, -1); + $multipleCommands = array_filter($multipleCommands); foreach ($multipleCommands as $command) { - $actionEntries = $this->replaceReservedTesterFunctions($command . ";", $actionEntries, 'webDriver'); + $actionEntries = $this->replaceReservedTesterFunctions($command . PHP_EOL, $actionEntries, 'webDriver'); } return $actionEntries; @@ -192,6 +193,7 @@ private function buildWebDriverActionsMustacheArray($action, $actionEntries) */ private function replaceReservedTesterFunctions($formattedStep, $actionEntries, $actor) { + $formattedStep = rtrim($formattedStep); foreach (self::REPLACEMENT_ACTIONS as $testAction => $replacement) { $testActionCall = "\${$actor}->{$testAction}"; if (substr($formattedStep, 0, strlen($testActionCall)) == $testActionCall) { diff --git a/src/Magento/FunctionalTestingFramework/Test/Config/Converter/Dom/Flat.php b/src/Magento/FunctionalTestingFramework/Test/Config/Converter/Dom/Flat.php index dd72264b9..6d08c367c 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Config/Converter/Dom/Flat.php +++ b/src/Magento/FunctionalTestingFramework/Test/Config/Converter/Dom/Flat.php @@ -124,6 +124,12 @@ public function convertXml(\DOMNode $source, $basePath = '') ) { $value = $node->nodeValue; break; + } elseif ($node->nodeType == XML_COMMENT_NODE) { + $uniqid = uniqid($node->nodeName); + $value[$uniqid] = [ + 'value' => trim($node->nodeValue), + 'nodeName' => $node->nodeName, + ]; } } $result = $this->getNodeAttributes($source); diff --git a/src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php b/src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php index d4a46adb9..18a6402ea 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php +++ b/src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php @@ -107,9 +107,9 @@ private function initActionGroups() $parsedActionGroups = $actionGroupParser->readActionGroupData(); $actionGroupObjectExtractor = new ActionGroupObjectExtractor(); + $neededActionGroup = $parsedActionGroups[ActionGroupObjectHandler::ACTION_GROUP_ROOT]; - foreach ($parsedActionGroups[ActionGroupObjectHandler::ACTION_GROUP_ROOT] as - $actionGroupName => $actionGroupData) { + foreach ($neededActionGroup as $actionGroupName => $actionGroupData) { if (!is_array($actionGroupData)) { continue; } diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php index ef2e11c03..1e86cff77 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php @@ -532,8 +532,8 @@ private function replaceCreateDataKeys($action, $replacementStepKeys) */ private function addContextCommentsToActionList($actionList, $actionReferenceKey) { - $actionStartComment = self::ACTION_GROUP_CONTEXT_START . $this->name . " (" . $actionReferenceKey . ")"; - $actionEndComment = self::ACTION_GROUP_CONTEXT_END . $this->name . " (" . $actionReferenceKey . ")"; + $actionStartComment = self::ACTION_GROUP_CONTEXT_START . "[" . $actionReferenceKey . "] " . $this->name; + $actionEndComment = self::ACTION_GROUP_CONTEXT_END . "[" . $actionReferenceKey . "] " . $this->name; $startAction = new ActionObject( $actionStartComment, ActionObject::ACTION_TYPE_COMMENT, diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php index 8a3bb27a6..19bd58721 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php @@ -23,6 +23,7 @@ */ class ActionObject { + const COMMENT_ACTION = '#comment'; const __ENV = "_ENV"; const __CREDS = "_CREDS"; const RUNTIME_REFERENCES = [ @@ -148,7 +149,7 @@ public function __construct( $actionOrigin = null ) { $this->stepKey = $stepKey; - $this->type = $type; + $this->type = $type === self::COMMENT_ACTION ? self::ACTION_TYPE_COMMENT : $type; $this->actionAttributes = $actionAttributes; $this->linkedAction = $linkedAction; $this->actionOrigin = $actionOrigin; @@ -554,7 +555,7 @@ private function findAndReplaceReferences($objectHandler, $inputString) } if ($replacement === null) { - if (get_class($objectHandler) != DataObjectHandler::class) { + if (!($objectHandler instanceof DataObjectHandler)) { return $this->findAndReplaceReferences(DataObjectHandler::getInstance(), $outputString); } else { throw new TestReferenceException( diff --git a/src/Magento/FunctionalTestingFramework/Test/Util/ActionGroupObjectExtractor.php b/src/Magento/FunctionalTestingFramework/Test/Util/ActionGroupObjectExtractor.php index 74665cf75..e41329cb3 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Util/ActionGroupObjectExtractor.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/ActionGroupObjectExtractor.php @@ -9,6 +9,7 @@ use Magento\FunctionalTestingFramework\Data\Argument\Interpreter\Argument; use Magento\FunctionalTestingFramework\Exceptions\XmlException; use Magento\FunctionalTestingFramework\Test\Objects\ActionGroupObject; +use Magento\FunctionalTestingFramework\Test\Objects\ActionObject; use Magento\FunctionalTestingFramework\Test\Objects\ArgumentObject; /** @@ -117,6 +118,11 @@ private function extractArguments($arguments) self::NODE_NAME ); + // Filtering XML comments from action group arguments. + $argData = array_filter($argData, function ($key) { + return strpos($key, ActionObject::COMMENT_ACTION) === false; + }, ARRAY_FILTER_USE_KEY); + foreach ($argData as $argName => $argValue) { $parsedArguments[] = new ArgumentObject( $argValue[ArgumentObject::ARGUMENT_NAME], diff --git a/src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php b/src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php index 5cd7b7ac5..fc874fa24 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php @@ -58,7 +58,10 @@ public function extractActions($testActions, $testName = null) $stepKeyRefs = []; foreach ($testActions as $actionName => $actionData) { - $stepKey = $actionData[self::TEST_STEP_MERGE_KEY]; + // Removing # from nodeName to match stepKey requirements + $stepKey = strpos($actionData[self::NODE_NAME], ActionObject::COMMENT_ACTION) === false + ? $actionData[self::TEST_STEP_MERGE_KEY] + : str_replace("#", "", $actionName); $actionType = $actionData[self::NODE_NAME]; if (empty($stepKey)) { diff --git a/src/Magento/FunctionalTestingFramework/Test/Util/AnnotationExtractor.php b/src/Magento/FunctionalTestingFramework/Test/Util/AnnotationExtractor.php index 3b857e29f..d30ed351e 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Util/AnnotationExtractor.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/AnnotationExtractor.php @@ -8,6 +8,7 @@ use Magento\FunctionalTestingFramework\Config\MftfApplicationConfig; use Magento\FunctionalTestingFramework\Exceptions\XmlException; +use Magento\FunctionalTestingFramework\Test\Objects\ActionObject; use Magento\FunctionalTestingFramework\Util\Logger\LoggingUtil; /** @@ -67,6 +68,9 @@ public function extractAnnotations($testAnnotations, $filename) // parse the Test annotations foreach ($annotations as $annotationKey => $annotationData) { + if (strpos($annotationKey, ActionObject::ACTION_TYPE_COMMENT) !== false) { + continue; + } $annotationValues = []; // Only transform severity annotation if ($annotationKey == "severity") { diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 07cb96b3a..9e878277e 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -31,6 +31,8 @@ */ class TestGenerator { + const ACTION_GROUP_STEP_KEY_REGEX = "/\[(?<actionGroupStepKey>.*)\]/"; + const ACTION_STEP_KEY_REGEX = "/\/\/ stepKey: (?<stepKey>.*)/"; const REQUIRED_ENTITY_REFERENCE = 'createDataKey'; const GENERATED_DIR = '_generated'; const DEFAULT_DIR = 'default'; @@ -39,6 +41,17 @@ class TestGenerator const SUITE_SCOPE = 'suite'; const PRESSKEY_ARRAY_ANCHOR_KEY = '987654321098765432109876543210'; const PERSISTED_OBJECT_NOTATION_REGEX = '/\${1,2}[\w.\[\]]+\${1,2}/'; + const NO_STEPKEY_ACTIONS = [ + 'comment', + 'createData', + 'deleteData', + 'updateData', + 'getData', + 'magentoCLI', + 'generateDate', + 'field' + ]; + const STEP_KEY_ANNOTATION = " // stepKey: %s"; /** * Path to the export dir. @@ -697,14 +710,16 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato if (isset($customActionAttributes['storeCode'])) { $storeCode = $customActionAttributes['storeCode']; } + switch ($actionObject->getType()) { case "createData": $entity = $customActionAttributes['entity']; //Add an informative statement to help the user debug test runs $testSteps .= sprintf( - "\t\t$%s->amGoingTo(\"create entity that has the stepKey: %s\");\n", + "\t\t$%s->comment(\"[%s] create '%s' entity\");\n", $actor, - $stepKey + $stepKey, + $entity ); //TODO refactor entity field override to not be individual actionObjects @@ -731,7 +746,7 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato } elseif ($generationScope == TestGenerator::SUITE_SCOPE) { $scope = PersistedObjectHandler::SUITE_SCOPE; } - + $createEntityFunctionCall = "\t\tPersistedObjectHandler::getInstance()->createEntity("; $createEntityFunctionCall .= "\n\t\t\t\"{$stepKey}\","; $createEntityFunctionCall .= "\n\t\t\t\"{$scope}\","; @@ -759,8 +774,9 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato $key .= $actionGroup; //Add an informative statement to help the user debug test runs $contextSetter = sprintf( - "\t\t$%s->amGoingTo(\"delete entity that has the createDataKey: %s\");\n", + "\t\t$%s->comment(\"[%s] delete entity '%s'\");\n", $actor, + $stepKey, $key ); @@ -802,11 +818,13 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato //Add an informative statement to help the user debug test runs $testSteps .= sprintf( - "\t\t$%s->amGoingTo(\"update entity that has the createdDataKey: %s\");\n", + "\t\t$%s->comment(\"[%s] update '%s' entity to '%s'\");\n", $actor, - $key + $stepKey, + $key, + $updateEntity ); - + // Build array of requiredEntities $requiredEntityKeys = []; foreach ($actionObject->getCustomActionAttributes() as $actionAttribute) { @@ -848,9 +866,10 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato } //Add an informative statement to help the user debug test runs $testSteps .= sprintf( - "\t\t$%s->amGoingTo(\"get entity that has the stepKey: %s\");\n", + "\t\t$%s->comment(\"[%s] get '%s' entity\");\n", $actor, - $stepKey + $stepKey, + $entity ); // Build array of requiredEntities @@ -1254,6 +1273,7 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato $command, $arguments ); + $testSteps .= sprintf(self::STEP_KEY_ANNOTATION, $stepKey) . PHP_EOL; $testSteps .= sprintf( "\t\t$%s->comment(\$%s);\n", $actor, @@ -1286,6 +1306,9 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato case "skipReadinessCheck": $testSteps .= $this->wrapFunctionCall($actor, $actionObject, $customActionAttributes['state']); break; + case "comment": + $input = $input === null ? strtr($value, ['$' => '\$', '{' => '\{', '}' => '\}']) : $input; + // Combining userInput from native XML comment and <comment/> action to fall-through 'default' case default: $testSteps .= $this->wrapFunctionCall( $actor, @@ -1295,6 +1318,10 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato $parameter ); } + if (!in_array($actionObject->getType(), self::NO_STEPKEY_ACTIONS)) { + $testSteps .= sprintf(self::STEP_KEY_ANNOTATION, $stepKey); + } + $testSteps .= PHP_EOL; } return $testSteps; @@ -1791,7 +1818,7 @@ private function wrapFunctionCall($actor, $action, ...$args) } $args = $this->resolveAllRuntimeReferences($args); $args = $this->resolveTestVariable($args, $action->getActionOrigin()); - $output .= implode(", ", array_filter($args, function($value) { return $value !== null; })) . ");\n"; + $output .= implode(", ", array_filter($args, function($value) { return $value !== null; })) . ");"; return $output; } @@ -1823,7 +1850,7 @@ private function wrapFunctionCallWithReturnValue($returnVariable, $actor, $actio } $args = $this->resolveAllRuntimeReferences($args); $args = $this->resolveTestVariable($args, $action->getActionOrigin()); - $output .= implode(", ", array_filter($args, function($value) { return $value !== null; })) . ");\n"; + $output .= implode(", ", array_filter($args, function($value) { return $value !== null; })) . ");"; return $output; } // @codingStandardsIgnoreEnd