Skip to content

Commit 722c74f

Browse files
Ashish.Kumar18Ashish.Kumar18
authored andcommitted
MQE-2903:Implement rapid times X clicks on UI element in MFTF
1 parent 5228185 commit 722c74f

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,21 @@ public function searchAndMultiSelectOption($select, array $options, $requireActi
390390
}
391391
}
392392

393+
/**
394+
* Simple rapid click as per given count number.
395+
*
396+
* @param string $selector
397+
* @param string $count
398+
* @return void
399+
* @throws \Exception
400+
*/
401+
public function rapidClick($selector, $count)
402+
{
403+
for ($i = 0; $i < $count; $i++) {
404+
$this->click($selector);
405+
}
406+
}
407+
393408
/**
394409
* Select multiple options from a drop down using a filter and text field to narrow results.
395410
*

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
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="rapidClickType" name="rapidClick" minOccurs="0" maxOccurs="unbounded"/>
3738
<xs:element type="executeJSType" name="executeJS" minOccurs="0" maxOccurs="unbounded"/>
3839
<xs:element type="fillFieldType" name="fillField" minOccurs="0" maxOccurs="unbounded"/>
3940
<xs:element type="loadSessionSnapshotType" name="loadSessionSnapshot" minOccurs="0" maxOccurs="unbounded"/>
@@ -253,6 +254,33 @@
253254
</xs:simpleContent>
254255
</xs:complexType>
255256

257+
<xs:complexType name="rapidClickType">
258+
<xs:annotation>
259+
<xs:documentation>
260+
Performs simple mouse rapid click as per given count.
261+
</xs:documentation>
262+
</xs:annotation>
263+
<xs:simpleContent>
264+
<xs:extension base="xs:string">
265+
<xs:attribute type="xs:string" name="selector" use="required">
266+
<xs:annotation>
267+
<xs:documentation>
268+
Selector for rapid click.
269+
</xs:documentation>
270+
</xs:annotation>
271+
</xs:attribute>
272+
<xs:attribute type="xs:string" name="count" use="required">
273+
<xs:annotation>
274+
<xs:documentation>
275+
Click count.
276+
</xs:documentation>
277+
</xs:annotation>
278+
</xs:attribute>
279+
<xs:attributeGroup ref="commonActionAttributes"/>
280+
</xs:extension>
281+
</xs:simpleContent>
282+
</xs:complexType>
283+
256284
<xs:complexType name="dragAndDropType">
257285
<xs:annotation>
258286
<xs:documentation>

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,14 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato
11591159
$y
11601160
);
11611161
break;
1162+
case "rapidClick":
1163+
$testSteps .= $this->wrapFunctionCall(
1164+
$actor,
1165+
$actionObject,
1166+
$selector,
1167+
$countValue
1168+
);
1169+
break;
11621170
case "selectMultipleOptions":
11631171
$testSteps .= $this->wrapFunctionCall(
11641172
$actor,

0 commit comments

Comments
 (0)