Skip to content

Commit 7adbae6

Browse files
authored
Merge pull request #146 from magento-gl/MQE-1518
MQE-1518 : Added new action WaitForElementClickable
2 parents 6fc5d26 + 1ca4978 commit 7adbae6

File tree

4 files changed

+39
-2
lines changed

4 files changed

+39
-2
lines changed

dev/tests/verification/Resources/DataActionsTest.txt

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class DataActionsTestCest
5353
*/
5454
public function DataActionsTest(AcceptanceTester $I)
5555
{
56+
$I->waitForElementClickable(".functionalTestSelector"); // stepKey: waitForElementClickable
5657
$I->createEntity("createdInTest", "test", "entity", [], []); // stepKey: createdInTest
5758
$I->updateEntity("createdInTest", "test", "entity",[]); // stepKey: updateInTest
5859
$I->deleteEntity("createdInTest", "test"); // stepKey: deleteInTest

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
<createData entity="entity" stepKey="createdInBefore"/>
1414
<updateData entity="entity" createDataKey="createdInBefore" stepKey="updateInBefore"/>
1515
<deleteData createDataKey="createdInBefore" stepKey="deleteInBefore"/>
16-
</before>
1716

17+
</before>
18+
<waitForElementClickable selector=".functionalTestSelector" time="30" stepKey="waitForElementClickable" />
1819
<createData entity="entity" stepKey="createdInTest"/>
1920
<updateData entity="entity" createDataKey="createdInTest" stepKey="updateInTest"/>
2021
<deleteData createDataKey="createdInTest" stepKey="deleteInTest"/>

docs/test/actions.md

+19-1
Original file line numberDiff line numberDiff line change
@@ -2374,10 +2374,28 @@ Attribute|Type|Use|Description
23742374
#### Example
23752375

23762376
```xml
2377-
<!-- Wait up to 30 seconds for `<div id="changedElement" ... >...</div>` to become visible on the page before continuing. -->
23782377
<waitForElementVisible selector="#changedElement" stepKey="waitForElementVisible"/>
23792378
```
23802379

2380+
### waitForElementClickable
2381+
2382+
See [waitForElementClickable docs on codeception.com](http://codeception.com/docs/modules/WebDriver#waitForElementClickable).
2383+
2384+
Attribute|Type|Use|Description
2385+
---|---|---|---
2386+
`selector`|string|optional| The selector identifying the corresponding HTML element.
2387+
`time`|string|optional| The number of seconds to wait for the element to appear.
2388+
`stepKey`|string|required| A unique identifier of the action.
2389+
`before`|string|optional| `stepKey` of action that must be executed next.
2390+
`after`|string|optional| `stepKey` of preceding action.
2391+
2392+
#### Example
2393+
2394+
```xml
2395+
<!-- Waits up to $timeout seconds for the given element to be clickable. If element doesn’t become clickable, a timeout exception is thrown. -->
2396+
<waitForElementClickable selector="#changedElement" stepKey="waitForElementClickable"/>
2397+
```
2398+
23812399
### waitForJS
23822400

23832401
See [waitForJS docs on codeception.com](http://codeception.com/docs/modules/WebDriver#waitForJS).

src/Magento/FunctionalTestingFramework/Test/etc/Actions/waitActions.xsd

+17
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
<xs:element type="waitForPwaElementNotVisibleType" name="waitForPwaElementNotVisible" minOccurs="0" maxOccurs="unbounded"/>
2424
<xs:element type="waitForPwaElementVisibleType" name="waitForPwaElementVisible" minOccurs="0" maxOccurs="unbounded"/>
2525
<xs:element type="waitForTextType" name="waitForText" minOccurs="0" maxOccurs="unbounded"/>
26+
<xs:element type="waitForElementClickableType" name="waitForElementClickable" minOccurs="0" maxOccurs="unbounded"/>
27+
2628
</xs:choice>
2729
</xs:group>
2830

@@ -224,4 +226,19 @@
224226
</xs:extension>
225227
</xs:simpleContent>
226228
</xs:complexType>
229+
<xs:complexType name="waitForElementClickableType">
230+
<xs:annotation>
231+
<xs:documentation>
232+
Waits up to $timeout seconds for the given element to be clickable.
233+
If element doesn’t become clickable, a timeout exception is thrown.
234+
</xs:documentation>
235+
</xs:annotation>
236+
<xs:simpleContent>
237+
<xs:extension base="xs:string">
238+
<xs:attribute ref="selector" use="required"/>
239+
<xs:attribute ref="time"/>
240+
<xs:attributeGroup ref="commonActionAttributes"/>
241+
</xs:extension>
242+
</xs:simpleContent>
243+
</xs:complexType>
227244
</xs:schema>

0 commit comments

Comments
 (0)