Skip to content

Commit 29f770c

Browse files
committed
MQE-1379: Fix MFTF custom actions to fully support Codeception dry-run functionality
1 parent 9b8d375 commit 29f770c

30 files changed

+196
-580
lines changed

dev/tests/verification/Resources/ActionGroupUsingCreateData.txt

+2-18
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,8 @@ class ActionGroupUsingCreateDataCest
2424
public function _before(AcceptanceTester $I)
2525
{
2626
$I->comment("Entering Action Group [Key1] actionGroupWithCreateData");
27-
$I->comment("[createCategoryKey1] create 'ApiCategory' entity");
28-
$I->createEntity(
29-
"createCategoryKey1",
30-
"hook",
31-
"ApiCategory",
32-
[],
33-
[]
34-
);
35-
36-
$I->comment("[createConfigProductKey1] create 'ApiConfigurableProduct' entity");
37-
$I->createEntity(
38-
"createConfigProductKey1",
39-
"hook",
40-
"ApiConfigurableProduct",
41-
["createCategoryKey1"],
42-
[]
43-
);
44-
27+
$I->createEntity("createCategoryKey1", "hook", "ApiCategory", [], []); // stepKey: createCategoryKey1
28+
$I->createEntity("createConfigProductKey1", "hook", "ApiConfigurableProduct", ["createCategoryKey1"], []); // stepKey: createConfigProductKey1
4529
$I->comment("Exiting Action Group [Key1] actionGroupWithCreateData");
4630
}
4731

dev/tests/verification/Resources/ActionGroupWithDataOverrideTest.txt

+1-9
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,7 @@ class ActionGroupWithDataOverrideTestCest
2424
*/
2525
public function _before(AcceptanceTester $I)
2626
{
27-
$I->comment("[createPersonParam] create 'ReplacementPerson' entity");
28-
$I->createEntity(
29-
"createPersonParam",
30-
"hook",
31-
"ReplacementPerson",
32-
[],
33-
[]
34-
);
35-
27+
$I->createEntity("createPersonParam", "hook", "ReplacementPerson", [], []); // stepKey: createPersonParam
3628
$I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup");
3729
$I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup
3830
$I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup

dev/tests/verification/Resources/ActionGroupWithDataTest.txt

+1-9
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,7 @@ class ActionGroupWithDataTestCest
2424
*/
2525
public function _before(AcceptanceTester $I)
2626
{
27-
$I->comment("[createPersonParam] create 'ReplacementPerson' entity");
28-
$I->createEntity(
29-
"createPersonParam",
30-
"hook",
31-
"ReplacementPerson",
32-
[],
33-
[]
34-
);
35-
27+
$I->createEntity("createPersonParam", "hook", "ReplacementPerson", [], []); // stepKey: createPersonParam
3628
$I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup");
3729
$I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup
3830
$I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup

dev/tests/verification/Resources/ActionGroupWithNoDefaultTest.txt

+1-9
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,7 @@ class ActionGroupWithNoDefaultTestCest
2424
*/
2525
public function _before(AcceptanceTester $I)
2626
{
27-
$I->comment("[createPersonParam] create 'ReplacementPerson' entity");
28-
$I->createEntity(
29-
"createPersonParam",
30-
"hook",
31-
"ReplacementPerson",
32-
[],
33-
[]
34-
);
35-
27+
$I->createEntity("createPersonParam", "hook", "ReplacementPerson", [], []); // stepKey: createPersonParam
3628
$I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup");
3729
$I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup
3830
$I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup

dev/tests/verification/Resources/ActionGroupWithParameterizedElementsWithStepKeyReferences.txt

+1-9
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,7 @@ class ActionGroupWithParameterizedElementsWithStepKeyReferencesCest
2929
$I->comment("Entering Action Group [actionGroup] actionGroupWithParametrizedSelectors");
3030
$testVariableActionGroup = $I->executeJS("return 1"); // stepKey: testVariableActionGroup
3131
$testVariable2ActionGroup = $I->executeJS("return 'test'"); // stepKey: testVariable2ActionGroup
32-
$I->comment("[createSimpleDataActionGroup] create 'simpleData' entity");
33-
$I->createEntity(
34-
"createSimpleDataActionGroup",
35-
"test",
36-
"simpleData",
37-
[],
38-
[]
39-
);
40-
32+
$I->createEntity("createSimpleDataActionGroup", "test", "simpleData", [], []); // stepKey: createSimpleDataActionGroup
4133
$I->click("#{$testVariable2ActionGroup} .John"); // stepKey: click1ActionGroup
4234
$I->click("#Doe-" . msq("simpleParamData") . "prename .{$testVariableActionGroup}"); // stepKey: click2ActionGroup
4335
$I->seeElement("//div[@name='Tiberius'][@class={$testVariableActionGroup}][@data-element='{$testVariable2ActionGroup}'][" . $I->retrieveEntityField('createSimpleData', 'name', 'test') . "]"); // stepKey: see1ActionGroup

dev/tests/verification/Resources/ActionGroupWithPersistedData.txt

+2-18
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,7 @@ class ActionGroupWithPersistedDataCest
2424
*/
2525
public function _before(AcceptanceTester $I)
2626
{
27-
$I->comment("[createPersonParam] create 'ReplacementPerson' entity");
28-
$I->createEntity(
29-
"createPersonParam",
30-
"hook",
31-
"ReplacementPerson",
32-
[],
33-
[]
34-
);
35-
27+
$I->createEntity("createPersonParam", "hook", "ReplacementPerson", [], []); // stepKey: createPersonParam
3628
$I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup");
3729
$I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup
3830
$I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup
@@ -71,15 +63,7 @@ class ActionGroupWithPersistedDataCest
7163
*/
7264
public function ActionGroupWithPersistedData(AcceptanceTester $I)
7365
{
74-
$I->comment("[createPerson] create 'DefaultPerson' entity");
75-
$I->createEntity(
76-
"createPerson",
77-
"test",
78-
"DefaultPerson",
79-
[],
80-
[]
81-
);
82-
66+
$I->createEntity("createPerson", "test", "DefaultPerson", [], []); // stepKey: createPerson
8367
$I->comment("Entering Action Group [actionGroupWithPersistedData1] FunctionalActionGroupWithData");
8468
$I->amOnPage("/" . $I->retrieveEntityField('createPerson', 'firstname', 'test') . "/" . $I->retrieveEntityField('createPerson', 'lastname', 'test') . ".html"); // stepKey: amOnPage1ActionGroupWithPersistedData1
8569
$I->fillField("#foo", $I->retrieveEntityField('createPerson', 'firstname', 'test')); // stepKey: fillField1ActionGroupWithPersistedData1

dev/tests/verification/Resources/ActionGroupWithStepKeyReferences.txt

+5-41
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,7 @@ class ActionGroupWithStepKeyReferencesCest
2727
public function ActionGroupWithStepKeyReferences(AcceptanceTester $I)
2828
{
2929
$I->comment("Entering Action Group [actionGroup] FunctionActionGroupWithStepKeyReferences");
30-
$I->comment("[createSimpleDataActionGroup] create 'simpleData' entity");
31-
$I->createEntity(
32-
"createSimpleDataActionGroup",
33-
"test",
34-
"simpleData",
35-
[],
36-
[]
37-
);
38-
30+
$I->createEntity("createSimpleDataActionGroup", "test", "simpleData", [], []); // stepKey: createSimpleDataActionGroup
3931
$grabTextDataActionGroup = $I->grabTextFrom(".class"); // stepKey: grabTextDataActionGroup
4032
$I->fillField(".{$grabTextDataActionGroup}", $I->retrieveEntityField('createSimpleDataActionGroup', 'field', 'test')); // stepKey: fill1ActionGroup
4133
$I->comment("Invocation stepKey will not be appended in non stepKey instances");
@@ -51,38 +43,10 @@ class ActionGroupWithStepKeyReferencesCest
5143
$action5ActionGroup = $date->format("H:i:s");
5244

5345
$action6ActionGroup = $I->formatMoney($action6ActionGroup); // stepKey: action6ActionGroup
54-
$I->comment("[action7ActionGroup] delete entity '{$action7ActionGroupActionGroup}'");
55-
$I->deleteEntity(
56-
"{$action7ActionGroupActionGroup}",
57-
"test"
58-
);
59-
60-
$I->comment("[action8ActionGroup] get '{$action8}' entity");
61-
$I->getEntity(
62-
"action8ActionGroup",
63-
"test",
64-
"{$action8}",
65-
[],
66-
null
67-
);
68-
69-
$I->comment("[action9ActionGroup] update '1' entity to '{$action9}'");
70-
$I->updateEntity(
71-
"1",
72-
"test",
73-
"{$action9}",
74-
[]
75-
);
76-
77-
$I->comment("[action10ActionGroup] create '{$action10}' entity");
78-
$I->createEntity(
79-
"action10ActionGroup",
80-
"test",
81-
"{$action10}",
82-
[],
83-
[]
84-
);
85-
46+
$I->deleteEntity("{$action7ActionGroupActionGroup}", "test"); // stepKey: action7ActionGroup
47+
$I->getEntity("action8ActionGroup", "test", "{$action8}", [], null); // stepKey: action8ActionGroup
48+
$I->updateEntity("1", "test", "{$action9}",[]); // stepKey: action9ActionGroup
49+
$I->createEntity("action10ActionGroup", "test", "{$action10}", [], []); // stepKey: action10ActionGroup
8650
$action11ActionGroup = $I->grabAttributeFrom($action11ActionGroup, "someInput"); // stepKey: action11ActionGroup
8751
$action12ActionGroup = $I->grabCookie($action12ActionGroup, ['domain' => 'www.google.com']); // stepKey: action12ActionGroup
8852
$action13ActionGroup = $I->grabFromCurrentUrl($action13ActionGroup); // stepKey: action13ActionGroup

dev/tests/verification/Resources/ActionGroupWithTopLevelPersistedData.txt

+1-9
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,7 @@ class ActionGroupWithTopLevelPersistedDataCest
2424
*/
2525
public function _before(AcceptanceTester $I)
2626
{
27-
$I->comment("[createPersonParam] create 'ReplacementPerson' entity");
28-
$I->createEntity(
29-
"createPersonParam",
30-
"hook",
31-
"ReplacementPerson",
32-
[],
33-
[]
34-
);
35-
27+
$I->createEntity("createPersonParam", "hook", "ReplacementPerson", [], []); // stepKey: createPersonParam
3628
$I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup");
3729
$I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup
3830
$I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup

dev/tests/verification/Resources/ArgumentWithSameNameAsElement.txt

+1-9
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,7 @@ class ArgumentWithSameNameAsElementCest
2424
*/
2525
public function _before(AcceptanceTester $I)
2626
{
27-
$I->comment("[createPersonParam] create 'ReplacementPerson' entity");
28-
$I->createEntity(
29-
"createPersonParam",
30-
"hook",
31-
"ReplacementPerson",
32-
[],
33-
[]
34-
);
35-
27+
$I->createEntity("createPersonParam", "hook", "ReplacementPerson", [], []); // stepKey: createPersonParam
3628
$I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup");
3729
$I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup
3830
$I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup

dev/tests/verification/Resources/AssertTest.txt

+2-18
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,7 @@ class AssertTestCest
2323
*/
2424
public function _before(AcceptanceTester $I)
2525
{
26-
$I->comment("[createData1] create 'ReplacementPerson' entity");
27-
$I->createEntity(
28-
"createData1",
29-
"hook",
30-
"ReplacementPerson",
31-
[],
32-
[]
33-
);
34-
26+
$I->createEntity("createData1", "hook", "ReplacementPerson", [], []); // stepKey: createData1
3527
}
3628

3729
/**
@@ -43,15 +35,7 @@ class AssertTestCest
4335
*/
4436
public function AssertTest(AcceptanceTester $I)
4537
{
46-
$I->comment("[createData2] create 'UniquePerson' entity");
47-
$I->createEntity(
48-
"createData2",
49-
"test",
50-
"UniquePerson",
51-
[],
52-
[]
53-
);
54-
38+
$I->createEntity("createData2", "test", "UniquePerson", [], []); // stepKey: createData2
5539
$grabTextFrom1 = $I->grabTextFrom(".copyright>span"); // stepKey: grabTextFrom1
5640
$I->comment("custom asserts");
5741
$I->assertArrayIsSorted(["1", "2", "3", "4", "5"], "asc"); // stepKey: assertSorted1

dev/tests/verification/Resources/BasicActionGroupTest.txt

+1-9
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,7 @@ class BasicActionGroupTestCest
2424
*/
2525
public function _before(AcceptanceTester $I)
2626
{
27-
$I->comment("[createPersonParam] create 'ReplacementPerson' entity");
28-
$I->createEntity(
29-
"createPersonParam",
30-
"hook",
31-
"ReplacementPerson",
32-
[],
33-
[]
34-
);
35-
27+
$I->createEntity("createPersonParam", "hook", "ReplacementPerson", [], []); // stepKey: createPersonParam
3628
$I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup");
3729
$I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup
3830
$I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup

dev/tests/verification/Resources/BasicFunctionalTest.txt

+2-8
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,8 @@ class BasicFunctionalTestCest
7474
$I->clickWithRightButton("#element .4123#element", 200, 300); // stepKey: clickWithRightButtonKeyXY1
7575
$I->closeTab(); // stepKey: closeTabKey1
7676
$I->conditionalClick(".functionalTestSelector", ".functionalDependentTestSelector", true); // stepKey: conditionalClickKey1
77-
$I->comment("[deleteKey1] delete entity 'createKey1'");
78-
$I->deleteEntity(
79-
"createKey1",
80-
"test"
81-
);
82-
83-
$I->deleteEntityByUrl("/V1/categories{$grabbedData}");
84-
77+
$I->deleteEntity("createKey1", "test"); // stepKey: deleteKey1
78+
$I->deleteEntityByUrl("/V1/categories{$grabbedData}"); // stepKey: deleteKey2
8579
$I->dontSee("someInput", ".functionalTestSelector"); // stepKey: dontSeeKey1
8680
$I->dontSeeCheckboxIsChecked(".functionalTestSelector"); // stepKey: dontSeeCheckboxIsCheckedKey1
8781
$I->dontSeeCookie("someInput"); // stepKey: dontSeeCookieKey1

dev/tests/verification/Resources/DataActionsTest.txt

+8-60
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,9 @@ class DataActionsTestCest
2323
*/
2424
public function _before(AcceptanceTester $I)
2525
{
26-
$I->comment("[createdInBefore] create 'entity' entity");
27-
$I->createEntity(
28-
"createdInBefore",
29-
"hook",
30-
"entity",
31-
[],
32-
[]
33-
);
34-
35-
$I->comment("[updateInBefore] update 'createdInBefore' entity to 'entity'");
36-
$I->updateEntity(
37-
"createdInBefore",
38-
"hook",
39-
"entity",
40-
[]
41-
);
42-
43-
$I->comment("[deleteInBefore] delete entity 'createdInBefore'");
44-
$I->deleteEntity(
45-
"createdInBefore",
46-
"hook"
47-
);
48-
26+
$I->createEntity("createdInBefore", "hook", "entity", [], []); // stepKey: createdInBefore
27+
$I->updateEntity("createdInBefore", "hook", "entity",[]); // stepKey: updateInBefore
28+
$I->deleteEntity("createdInBefore", "hook"); // stepKey: deleteInBefore
4929
}
5030

5131
/**
@@ -57,42 +37,10 @@ class DataActionsTestCest
5737
*/
5838
public function DataActionsTest(AcceptanceTester $I)
5939
{
60-
$I->comment("[createdInTest] create 'entity' entity");
61-
$I->createEntity(
62-
"createdInTest",
63-
"test",
64-
"entity",
65-
[],
66-
[]
67-
);
68-
69-
$I->comment("[updateInTest] update 'createdInTest' entity to 'entity'");
70-
$I->updateEntity(
71-
"createdInTest",
72-
"test",
73-
"entity",
74-
[]
75-
);
76-
77-
$I->comment("[deleteInTest] delete entity 'createdInTest'");
78-
$I->deleteEntity(
79-
"createdInTest",
80-
"test"
81-
);
82-
83-
$I->comment("[updatedDataOutOfScope] update 'createdInBefore' entity to 'entity'");
84-
$I->updateEntity(
85-
"createdInBefore",
86-
"test",
87-
"entity",
88-
[]
89-
);
90-
91-
$I->comment("[deleteDataOutOfScope] delete entity 'createdInBefore'");
92-
$I->deleteEntity(
93-
"createdInBefore",
94-
"test"
95-
);
96-
40+
$I->createEntity("createdInTest", "test", "entity", [], []); // stepKey: createdInTest
41+
$I->updateEntity("createdInTest", "test", "entity",[]); // stepKey: updateInTest
42+
$I->deleteEntity("createdInTest", "test"); // stepKey: deleteInTest
43+
$I->updateEntity("createdInBefore", "test", "entity",[]); // stepKey: updatedDataOutOfScope
44+
$I->deleteEntity("createdInBefore", "test"); // stepKey: deleteDataOutOfScope
9745
}
9846
}

dev/tests/verification/Resources/ExtendParentDataTest.txt

+1-9
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,7 @@ class ExtendParentDataTestCest
2626
*/
2727
public function ExtendParentDataTest(AcceptanceTester $I)
2828
{
29-
$I->comment("[simpleDataKey] create 'extendParentData' entity");
30-
$I->createEntity(
31-
"simpleDataKey",
32-
"test",
33-
"extendParentData",
34-
[],
35-
[]
36-
);
37-
29+
$I->createEntity("simpleDataKey", "test", "extendParentData", [], []); // stepKey: simpleDataKey
3830
$I->searchAndMultiSelectOption("#selector", ["otherName"]); // stepKey: getName
3931
$I->searchAndMultiSelectOption("#selector", ["extendName"]); // stepKey: getNameExtend
4032
$I->searchAndMultiSelectOption("#selector", ["item"]); // stepKey: emptyPost

0 commit comments

Comments
 (0)