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

Lines changed: 2 additions & 18 deletions
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

Lines changed: 1 addition & 9 deletions
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

Lines changed: 1 addition & 9 deletions
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

Lines changed: 1 addition & 9 deletions
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

Lines changed: 1 addition & 9 deletions
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

Lines changed: 2 additions & 18 deletions
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

Lines changed: 5 additions & 41 deletions
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

Lines changed: 1 addition & 9 deletions
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

Lines changed: 1 addition & 9 deletions
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

Lines changed: 2 additions & 18 deletions
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

0 commit comments

Comments
 (0)