Skip to content

Commit 4f6812d

Browse files
committed
MQE-1961: Remove deprecated actions
executeInSelenium performOn + fixed verification tests
1 parent 55ac3b8 commit 4f6812d

File tree

12 files changed

+4
-157
lines changed

12 files changed

+4
-157
lines changed

dev/tests/verification/Resources/BasicFunctionalTest.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ class BasicFunctionalTestCest
139139
$I->moveMouseOver(".functionalTestSelector"); // stepKey: moveMouseOverKey1
140140
$I->openNewTab(); // stepKey: openNewTabKey1
141141
$I->pauseExecution(); // stepKey: pauseExecutionKey1
142-
$I->performOn("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();}, 10); // stepKey: performOnKey1
143142
$I->pressKey("#page", "a"); // stepKey: pressKey1
144143
$I->pressKey("#page", ['ctrl', 'a'],'new'); // stepKey: pressKey2
145144
$I->pressKey("#page", ['shift', '111'],'1','x'); // stepKey: pressKey3

dev/tests/verification/Resources/ExecuteInSeleniumTest.txt

Lines changed: 0 additions & 31 deletions
This file was deleted.

dev/tests/verification/TestModule/ActionGroup/XmlDuplicateActionGroup.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@
7878
<doubleClick selector="1" stepKey="dblclick2"/>
7979
<dragAndDrop selector1="1" selector2="2" stepKey="dragndrop1"/>
8080
<dragAndDrop selector1="1" selector2="2" stepKey="dragndrop2"/>
81-
<executeInSelenium function="1" stepKey="executeSelenium1"/>
82-
<executeInSelenium function="1" stepKey="executeSelenium2"/>
8381
<executeJS function="1" stepKey="execJS1"/>
8482
<executeJS function="1" stepKey="execJS2"/>
8583
<fillField stepKey="fill1"/>
@@ -126,8 +124,6 @@
126124
<parseFloat stepKey="parsefloat12"/>
127125
<pauseExecution stepKey="pause1"/>
128126
<pauseExecution stepKey="pause12"/>
129-
<performOn selector="1" function="1" stepKey="performon1"/>
130-
<performOn selector="1" function="1" stepKey="performon12"/>
131127
<pressKey selector="1" stepKey="press1"/>
132128
<pressKey selector="1" stepKey="press12"/>
133129
<reloadPage stepKey="reload1"/>

dev/tests/verification/TestModule/Test/BasicFunctionalTest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
<moveMouseOver selector=".functionalTestSelector" stepKey="moveMouseOverKey1"/>
9090
<openNewTab stepKey="openNewTabKey1"/>
9191
<pauseExecution stepKey="pauseExecutionKey1"/>
92-
<performOn selector="#selector" function="function(\WebDriverElement $el) {return $el->isDisplayed();}" stepKey="performOnKey1"/>
9392
<pressKey selector="#page" userInput="a" stepKey="pressKey1"/>
9493
<pressKey selector="#page" parameterArray="[['ctrl','a'],'new']" stepKey="pressKey2"/>
9594
<pressKey selector="#page" parameterArray="[['shift','111'],'1','x']" stepKey="pressKey3"/>

dev/tests/verification/TestModule/Test/ExecuteInSeleniumTest.xml

Lines changed: 0 additions & 14 deletions
This file was deleted.

dev/tests/verification/TestModule/Test/XmlDuplicateTest.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@
8282
<doubleClick selector="1" stepKey="dblclick2"/>
8383
<dragAndDrop selector1="1" selector2="2" stepKey="dragndrop1"/>
8484
<dragAndDrop selector1="1" selector2="2" stepKey="dragndrop2"/>
85-
<executeInSelenium function="1" stepKey="executeSelenium1"/>
86-
<executeInSelenium function="1" stepKey="executeSelenium2"/>
8785
<executeJS function="1" stepKey="execJS1"/>
8886
<executeJS function="1" stepKey="execJS2"/>
8987
<fillField stepKey="fill1"/>
@@ -130,8 +128,6 @@
130128
<parseFloat stepKey="parsefloat12"/>
131129
<pauseExecution stepKey="pause1"/>
132130
<pauseExecution stepKey="pause12"/>
133-
<performOn selector="1" function="1" stepKey="performon1"/>
134-
<performOn selector="1" function="1" stepKey="performon12"/>
135131
<pressKey selector="1" stepKey="press1"/>
136132
<pressKey selector="1" stepKey="press12"/>
137133
<reloadPage stepKey="reload1"/>
@@ -298,8 +294,6 @@
298294
<doubleClick selector="1" stepKey="dblclick2"/>
299295
<dragAndDrop selector1="1" selector2="2" stepKey="dragndrop1"/>
300296
<dragAndDrop selector1="1" selector2="2" stepKey="dragndrop2"/>
301-
<executeInSelenium function="1" stepKey="executeSelenium1"/>
302-
<executeInSelenium function="1" stepKey="executeSelenium2"/>
303297
<executeJS function="1" stepKey="execJS1"/>
304298
<executeJS function="1" stepKey="execJS2"/>
305299
<fillField stepKey="fill1"/>
@@ -346,8 +340,6 @@
346340
<parseFloat stepKey="parsefloat12"/>
347341
<pauseExecution stepKey="pause1"/>
348342
<pauseExecution stepKey="pause12"/>
349-
<performOn selector="1" function="1" stepKey="performon1"/>
350-
<performOn selector="1" function="1" stepKey="performon12"/>
351343
<pressKey selector="1" stepKey="press1"/>
352344
<pressKey selector="1" stepKey="press12"/>
353345
<reloadPage stepKey="reload1"/>
@@ -513,8 +505,6 @@
513505
<doubleClick selector="1" stepKey="dblclick2"/>
514506
<dragAndDrop selector1="1" selector2="2" stepKey="dragndrop1"/>
515507
<dragAndDrop selector1="1" selector2="2" stepKey="dragndrop2"/>
516-
<executeInSelenium function="1" stepKey="executeSelenium1"/>
517-
<executeInSelenium function="1" stepKey="executeSelenium2"/>
518508
<executeJS function="1" stepKey="execJS1"/>
519509
<executeJS function="1" stepKey="execJS2"/>
520510
<fillField stepKey="fill1"/>
@@ -561,8 +551,6 @@
561551
<parseFloat stepKey="parsefloat12"/>
562552
<pauseExecution stepKey="pause1"/>
563553
<pauseExecution stepKey="pause12"/>
564-
<performOn selector="1" function="1" stepKey="performon1"/>
565-
<performOn selector="1" function="1" stepKey="performon12"/>
566554
<pressKey selector="1" stepKey="press1"/>
567555
<pressKey selector="1" stepKey="press12"/>
568556
<reloadPage stepKey="reload1"/>

dev/tests/verification/Tests/ExecuteInSeleniumTest.php

Lines changed: 0 additions & 22 deletions
This file was deleted.

docs/test/actions.md

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -971,24 +971,6 @@ Attribute|Type|Use|Description
971971
<dragAndDrop selector1="#block1" selector2="#block2" x="50" y="50" stepKey="dragAndDrop"/>
972972
```
973973

974-
### executeInSelenium
975-
976-
See [executeInSelenium docs on codeception.com](http://codeception.com/docs/modules/WebDriver#executeInSelenium).
977-
978-
Attribute|Type|Use|Description
979-
---|---|---|---
980-
`function`|string|optional| Name of Selenium function to run.
981-
`stepKey`|string|required| A unique identifier of the action.
982-
`before`|string|optional| `stepKey` of action that must be executed next.
983-
`after`|string|optional| `stepKey` of preceding action.
984-
985-
#### Example
986-
987-
```xml
988-
<!-- Execute the Selenium function `function(\Facebook\WebDriver\Remote\RemoteWebDriver $webdriver) {$webdriver->get('http://google.com');}`. -->
989-
<executeInSelenium function="function(\Facebook\WebDriver\Remote\RemoteWebDriver $webdriver) {$webdriver->get('http://google.com');}" stepKey="executeInSelenium"/>
990-
```
991-
992974
### executeJS
993975

994976
See [executeJS docs on codeception.com](http://codeception.com/docs/modules/WebDriver#executeJS).
@@ -1458,18 +1440,6 @@ Attribute|Type|Use|Description
14581440
<pauseExecution stepKey="pause"/>
14591441
```
14601442

1461-
### performOn
1462-
1463-
See [performOn docs on codeception.com](http://codeception.com/docs/modules/WebDriver#performOn).
1464-
1465-
Attribute|Type|Use|Description
1466-
---|---|---|---
1467-
`selector`|string|optional| The selector identifying the corresponding HTML element.
1468-
`function`|string|optional| Function or actions to be taken on the selected element.
1469-
`stepKey`|string|required| A unique identifier of the action.
1470-
`before`|string|optional| `stepKey` of action that must be executed next.
1471-
`after`|string|optional| `stepKey` of preceding action.
1472-
14731443
### pressKey
14741444

14751445
See [pressKey docs on codeception.com](http://codeception.com/docs/modules/WebDriver#pressKey).
@@ -1484,7 +1454,7 @@ Attribute|Type|Use|Description
14841454
`after`|string|optional| `stepKey` of preceding action.
14851455

14861456
#### Examples
1487-
1457+
F
14881458
```xml
14891459
<!-- Press the `a` key within the selected area. -->
14901460
<pressKey userInput="a" selector="#targetElement" stepKey="pressA"/>

etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<!-- Entity value gets replaced in Dom.php before reading $xml -->
1010
<!DOCTYPE config [
11-
<!ENTITY commonTestActions "acceptPopup|actionGroup|amOnPage|amOnUrl|amOnSubdomain|appendField|assertArrayIsSorted|assertArraySubset|assertElementContainsAttribute|attachFile|cancelPopup|checkOption|clearField|click|clickWithLeftButton|clickWithRightButton|closeAdminNotification|closeTab|comment|conditionalClick|createData|deleteData|updateData|getData|dontSee|dontSeeJsError|dontSeeCheckboxIsChecked|dontSeeCookie|dontSeeCurrentUrlEquals|dontSeeCurrentUrlMatches|dontSeeElement|dontSeeElementInDOM|dontSeeInCurrentUrl|dontSeeInField|dontSeeInFormFields|dontSeeInPageSource|dontSeeInSource|dontSeeInTitle|dontSeeLink|dontSeeOptionIsSelected|doubleClick|dragAndDrop|entity|executeJS|executeInSelenium|fillField|formatMoney|generateDate|grabAttributeFrom|grabCookie|grabFromCurrentUrl|grabMultiple|grabPageSource|grabTextFrom|grabValueFrom|loadSessionSnapshot|loginAsAdmin|magentoCLI|magentoCron|makeScreenshot|maximizeWindow|moveBack|moveForward|moveMouseOver|mSetLocale|mResetLocale|openNewTab|pauseExecution|parseFloat|performOn|pressKey|reloadPage|resetCookie|submitForm|resizeWindow|saveSessionSnapshot|scrollTo|scrollToTopOfPage|searchAndMultiSelectOption|see|seeCheckboxIsChecked|seeCookie|seeCurrentUrlEquals|seeCurrentUrlMatches|seeElement|seeElementInDOM|seeInCurrentUrl|seeInField|seeInFormFields|seeInPageSource|seeInPopup|seeInSource|seeInTitle|seeLink|seeNumberOfElements|seeOptionIsSelected|selectOption|setCookie|submitForm|switchToIFrame|switchToNextTab|switchToPreviousTab|switchToWindow|typeInPopup|uncheckOption|unselectOption|wait|waitForAjaxLoad|waitForElement|waitForElementChange|waitForElementNotVisible|waitForElementVisible|waitForPwaElementNotVisible|waitForPwaElementVisible|waitForJS|waitForLoadingMaskToDisappear|waitForPageLoad|waitForText|assertArrayHasKey|assertArrayNotHasKey|assertArraySubset|assertContains|assertCount|assertEmpty|assertEquals|assertFalse|assertFileExists|assertFileNotExists|assertGreaterOrEquals|assertGreaterThan|assertGreaterThanOrEqual|assertInstanceOf|assertInternalType|assertIsEmpty|assertLessOrEquals|assertLessThan|assertLessThanOrEqual|assertNotContains|assertNotEmpty|assertNotEquals|assertNotInstanceOf|assertNotNull|assertNotRegExp|assertNotSame|assertNull|assertRegExp|assertSame|assertStringStartsNotWith|assertStringStartsWith|assertTrue|expectException|fail|dontSeeFullUrlEquals|dontSee|dontSeeFullUrlMatches|dontSeeInFullUrl|seeFullUrlEquals|seeFullUrlMatches|seeInFullUrl|grabFromFullUrl">
11+
<!ENTITY commonTestActions "acceptPopup|actionGroup|amOnPage|amOnUrl|amOnSubdomain|appendField|assertArrayIsSorted|assertArraySubset|assertElementContainsAttribute|attachFile|cancelPopup|checkOption|clearField|click|clickWithLeftButton|clickWithRightButton|closeAdminNotification|closeTab|comment|conditionalClick|createData|deleteData|updateData|getData|dontSee|dontSeeJsError|dontSeeCheckboxIsChecked|dontSeeCookie|dontSeeCurrentUrlEquals|dontSeeCurrentUrlMatches|dontSeeElement|dontSeeElementInDOM|dontSeeInCurrentUrl|dontSeeInField|dontSeeInFormFields|dontSeeInPageSource|dontSeeInSource|dontSeeInTitle|dontSeeLink|dontSeeOptionIsSelected|doubleClick|dragAndDrop|entity|executeJS|fillField|formatMoney|generateDate|grabAttributeFrom|grabCookie|grabFromCurrentUrl|grabMultiple|grabPageSource|grabTextFrom|grabValueFrom|loadSessionSnapshot|loginAsAdmin|magentoCLI|magentoCron|makeScreenshot|maximizeWindow|moveBack|moveForward|moveMouseOver|mSetLocale|mResetLocale|openNewTab|pauseExecution|parseFloat|pressKey|reloadPage|resetCookie|submitForm|resizeWindow|saveSessionSnapshot|scrollTo|scrollToTopOfPage|searchAndMultiSelectOption|see|seeCheckboxIsChecked|seeCookie|seeCurrentUrlEquals|seeCurrentUrlMatches|seeElement|seeElementInDOM|seeInCurrentUrl|seeInField|seeInFormFields|seeInPageSource|seeInPopup|seeInSource|seeInTitle|seeLink|seeNumberOfElements|seeOptionIsSelected|selectOption|setCookie|submitForm|switchToIFrame|switchToNextTab|switchToPreviousTab|switchToWindow|typeInPopup|uncheckOption|unselectOption|wait|waitForAjaxLoad|waitForElement|waitForElementChange|waitForElementNotVisible|waitForElementVisible|waitForPwaElementNotVisible|waitForPwaElementVisible|waitForJS|waitForLoadingMaskToDisappear|waitForPageLoad|waitForText|assertArrayHasKey|assertArrayNotHasKey|assertArraySubset|assertContains|assertCount|assertEmpty|assertEquals|assertFalse|assertFileExists|assertFileNotExists|assertGreaterOrEquals|assertGreaterThan|assertGreaterThanOrEqual|assertInstanceOf|assertInternalType|assertIsEmpty|assertLessOrEquals|assertLessThan|assertLessThanOrEqual|assertNotContains|assertNotEmpty|assertNotEquals|assertNotInstanceOf|assertNotNull|assertNotRegExp|assertNotSame|assertNull|assertRegExp|assertSame|assertStringStartsNotWith|assertStringStartsWith|assertTrue|expectException|fail|dontSeeFullUrlEquals|dontSee|dontSeeFullUrlMatches|dontSeeInFullUrl|seeFullUrlEquals|seeFullUrlMatches|seeInFullUrl|grabFromFullUrl">
1212
]>
1313

1414
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../src/Magento/FunctionalTestingFramework/ObjectManager/etc/config.xsd">

src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class ActionObject
6262
const ASSERTION_VALUE_ATTRIBUTE = "value";
6363
const DELETE_DATA_MUTUAL_EXCLUSIVE_ATTRIBUTES = ["url", "createDataKey"];
6464
const EXTERNAL_URL_AREA_INVALID_ACTIONS = ['amOnPage'];
65-
const FUNCTION_CLOSURE_ACTIONS = ['waitForElementChange', 'performOn', 'executeInSelenium'];
65+
const FUNCTION_CLOSURE_ACTIONS = ['waitForElementChange'];
6666
const COMMAND_ACTION_ATTRIBUTES = ['magentoCLI', 'magentoCLISecret'];
6767
const MERGE_ACTION_ORDER_AFTER = 'after';
6868
const MERGE_ACTION_ORDER_BEFORE = 'before';

src/Magento/FunctionalTestingFramework/Test/etc/actionTypeTags.xsd

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
<xs:element type="closeTabType" name="closeTab" minOccurs="0" maxOccurs="unbounded"/>
3535
<xs:element type="commentType" name="comment" minOccurs="0" maxOccurs="unbounded"/>
3636
<xs:element type="dragAndDropType" name="dragAndDrop" minOccurs="0" maxOccurs="unbounded"/>
37-
<xs:element type="executeInSeleniumType" name="executeInSelenium" minOccurs="0" maxOccurs="unbounded"/>
3837
<xs:element type="executeJSType" name="executeJS" minOccurs="0" maxOccurs="unbounded"/>
3938
<xs:element type="fillFieldType" name="fillField" minOccurs="0" maxOccurs="unbounded"/>
4039
<xs:element type="loadSessionSnapshotType" name="loadSessionSnapshot" minOccurs="0" maxOccurs="unbounded"/>
@@ -45,7 +44,6 @@
4544
<xs:element type="moveMouseOverType" name="moveMouseOver" minOccurs="0" maxOccurs="unbounded"/>
4645
<xs:element type="openNewTabType" name="openNewTab" minOccurs="0" maxOccurs="unbounded"/>
4746
<xs:element type="pauseExecutionType" name="pauseExecution" minOccurs="0" maxOccurs="unbounded"/>
48-
<xs:element type="performOnType" name="performOn" minOccurs="0" maxOccurs="unbounded"/>
4947
<xs:element type="pressKeyType" name="pressKey" minOccurs="0" maxOccurs="unbounded"/>
5048
<xs:element type="reloadPageType" name="reloadPage" minOccurs="0" maxOccurs="unbounded"/>
5149
<xs:element type="resetCookieType" name="resetCookie" minOccurs="0" maxOccurs="unbounded"/>
@@ -290,20 +288,6 @@
290288
</xs:simpleContent>
291289
</xs:complexType>
292290

293-
<xs:complexType name="executeInSeleniumType">
294-
<xs:annotation>
295-
<xs:documentation>
296-
Allows you to use Selenium WebDriver methods directly; last resort method, do not use regularly.
297-
</xs:documentation>
298-
</xs:annotation>
299-
<xs:simpleContent>
300-
<xs:extension base="xs:string">
301-
<xs:attribute ref="function" use="required"/>
302-
<xs:attributeGroup ref="commonActionAttributes"/>
303-
</xs:extension>
304-
</xs:simpleContent>
305-
</xs:complexType>
306-
307291
<xs:complexType name="executeJSType">
308292
<xs:annotation>
309293
<xs:documentation>
@@ -444,21 +428,6 @@
444428
</xs:simpleContent>
445429
</xs:complexType>
446430

447-
<xs:complexType name="performOnType">
448-
<xs:annotation>
449-
<xs:documentation>
450-
Performs given function on element.
451-
</xs:documentation>
452-
</xs:annotation>
453-
<xs:simpleContent>
454-
<xs:extension base="xs:string">
455-
<xs:attribute ref="selector" use="required"/>
456-
<xs:attribute ref="function" use="required"/>
457-
<xs:attributeGroup ref="commonActionAttributes"/>
458-
</xs:extension>
459-
</xs:simpleContent>
460-
</xs:complexType>
461-
462431
<xs:complexType name="pressKeyType">
463432
<xs:annotation>
464433
<xs:documentation>

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -711,10 +711,7 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato
711711
}
712712

713713
if (isset($customActionAttributes['function'])) {
714-
$function = $this->addUniquenessFunctionCall(
715-
$customActionAttributes['function'],
716-
$actionObject->getType() !== "executeInSelenium"
717-
);
714+
$function = $this->addUniquenessFunctionCall($customActionAttributes['function']);
718715
if (in_array($actionObject->getType(), ActionObject::FUNCTION_CLOSURE_ACTIONS)) {
719716
// Argument must be a closure function, not a string.
720717
$function = trim($function, '"');
@@ -1040,9 +1037,6 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato
10401037
$parameterArray
10411038
);
10421039
break;
1043-
case "executeInSelenium":
1044-
$testSteps .= $this->wrapFunctionCall($actor, $actionObject, $function);
1045-
break;
10461040
case "executeJS":
10471041
$testSteps .= $this->wrapFunctionCallWithReturnValue(
10481042
$stepKey,
@@ -1051,7 +1045,6 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato
10511045
$function
10521046
);
10531047
break;
1054-
case "performOn":
10551048
case "waitForElementChange":
10561049
$testSteps .= $this->wrapFunctionCall(
10571050
$actor,

0 commit comments

Comments
 (0)