@sap_oss/wdio-qmate-service 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/doc.md +118 -28
- package/docs/index.md +2 -3
- package/lib/reuse/helper/jsonDocGen.js +49 -2
- package/lib/reuse/helper/jsonDocGen.js.map +1 -1
- package/lib/reuse/modules/ui5/control.d.ts +11 -0
- package/lib/reuse/modules/ui5/control.js +27 -0
- package/lib/reuse/modules/ui5/control.js.map +1 -1
- package/package.json +1 -1
- package/test/reuse/ui5/control/focus.spec.js +100 -0
- package/test/reuse/ui5/control/test.control.conf.js +1 -0
- package/test/reuse/ui5/control/test.control.sauceLab.conf.js +1 -0
package/docs/doc.md
CHANGED
|
@@ -390,7 +390,7 @@ Fills the active input with the given value.
|
|
|
390
390
|
|
|
391
391
|
| Param | Type | Description |
|
|
392
392
|
| --- | --- | --- |
|
|
393
|
-
| value | <code>String</code> | The value
|
|
393
|
+
| value | <code>String</code> \| <code>Number</code> | The value to enter. |
|
|
394
394
|
|
|
395
395
|
**Example**
|
|
396
396
|
```js
|
|
@@ -405,7 +405,7 @@ Enters the given value to the active input field and retries the action in case
|
|
|
405
405
|
|
|
406
406
|
| Param | Type | Default | Description |
|
|
407
407
|
| --- | --- | --- | --- |
|
|
408
|
-
| value | <code>String</code> | | The value
|
|
408
|
+
| value | <code>String</code> | | The value to enter. |
|
|
409
409
|
| [retries] | <code>Number</code> | <code>3</code> | The number of retries, can be set in config for all functions under params stepsRetries. |
|
|
410
410
|
| [interval] | <code>Number</code> | <code>5000</code> | The delay between the retries (ms). Can be set in config for all functions under params.stepRetriesIntervals. |
|
|
411
411
|
|
|
@@ -1598,8 +1598,9 @@ Global namespace for UI5 modules.
|
|
|
1598
1598
|
* [.doubleClick(selector, [index], [timeout])](#ui5.userInteraction.doubleClick)
|
|
1599
1599
|
* [.rightClick(selector, [index], [timeout])](#ui5.userInteraction.rightClick)
|
|
1600
1600
|
* [.clickTab(selector, [index], [timeout])](#ui5.userInteraction.clickTab)
|
|
1601
|
-
* [.selectFromTab(selector, value, [index], [timeout])](#ui5.userInteraction.selectFromTab)
|
|
1602
1601
|
* [.clickListItem(selector, [index], [timeout])](#ui5.userInteraction.clickListItem)
|
|
1602
|
+
* [.check(selector, [index], [timeout])](#ui5.userInteraction.check)
|
|
1603
|
+
* [.uncheck(selector, [index], [timeout])](#ui5.userInteraction.uncheck)
|
|
1603
1604
|
* [.fill(selector, value, [index], [timeout])](#ui5.userInteraction.fill)
|
|
1604
1605
|
* [.fillAndRetry(selector, value, [index], [timeout], [retries], [interval])](#ui5.userInteraction.fillAndRetry)
|
|
1605
1606
|
* [.clear(selector, [index], [timeout])](#ui5.userInteraction.clear)
|
|
@@ -1614,6 +1615,7 @@ Global namespace for UI5 modules.
|
|
|
1614
1615
|
* [.selectMultiComboBox(selector, values, [index])](#ui5.userInteraction.selectMultiComboBox)
|
|
1615
1616
|
* [.clickSelectArrow(selector, [index])](#ui5.userInteraction.clickSelectArrow)
|
|
1616
1617
|
* [.clickSelectArrowAndRetry(selector, [index], [retries], [interval])](#ui5.userInteraction.clickSelectArrowAndRetry)
|
|
1618
|
+
* [.selectFromTab(selector, value, [index], [timeout])](#ui5.userInteraction.selectFromTab)
|
|
1617
1619
|
* [.mouseOverElement(selector, [index], [timeout])](#ui5.userInteraction.mouseOverElement)
|
|
1618
1620
|
* [.scrollToElement(selector, [index], [alignment], [timeout])](#ui5.userInteraction.scrollToElement)
|
|
1619
1621
|
* [.selectAll([selector], [index], [timeout])](#ui5.userInteraction.selectAll)
|
|
@@ -3495,8 +3497,9 @@ await ui5.table.clickSettingsButton(glAccountItemsTable);
|
|
|
3495
3497
|
* [.doubleClick(selector, [index], [timeout])](#ui5.userInteraction.doubleClick)
|
|
3496
3498
|
* [.rightClick(selector, [index], [timeout])](#ui5.userInteraction.rightClick)
|
|
3497
3499
|
* [.clickTab(selector, [index], [timeout])](#ui5.userInteraction.clickTab)
|
|
3498
|
-
* [.selectFromTab(selector, value, [index], [timeout])](#ui5.userInteraction.selectFromTab)
|
|
3499
3500
|
* [.clickListItem(selector, [index], [timeout])](#ui5.userInteraction.clickListItem)
|
|
3501
|
+
* [.check(selector, [index], [timeout])](#ui5.userInteraction.check)
|
|
3502
|
+
* [.uncheck(selector, [index], [timeout])](#ui5.userInteraction.uncheck)
|
|
3500
3503
|
* [.fill(selector, value, [index], [timeout])](#ui5.userInteraction.fill)
|
|
3501
3504
|
* [.fillAndRetry(selector, value, [index], [timeout], [retries], [interval])](#ui5.userInteraction.fillAndRetry)
|
|
3502
3505
|
* [.clear(selector, [index], [timeout])](#ui5.userInteraction.clear)
|
|
@@ -3511,6 +3514,7 @@ await ui5.table.clickSettingsButton(glAccountItemsTable);
|
|
|
3511
3514
|
* [.selectMultiComboBox(selector, values, [index])](#ui5.userInteraction.selectMultiComboBox)
|
|
3512
3515
|
* [.clickSelectArrow(selector, [index])](#ui5.userInteraction.clickSelectArrow)
|
|
3513
3516
|
* [.clickSelectArrowAndRetry(selector, [index], [retries], [interval])](#ui5.userInteraction.clickSelectArrowAndRetry)
|
|
3517
|
+
* [.selectFromTab(selector, value, [index], [timeout])](#ui5.userInteraction.selectFromTab)
|
|
3514
3518
|
* [.mouseOverElement(selector, [index], [timeout])](#ui5.userInteraction.mouseOverElement)
|
|
3515
3519
|
* [.scrollToElement(selector, [index], [alignment], [timeout])](#ui5.userInteraction.scrollToElement)
|
|
3516
3520
|
* [.selectAll([selector], [index], [timeout])](#ui5.userInteraction.selectAll)
|
|
@@ -3607,31 +3611,29 @@ The function retries the click for maximal 3 times if the selection of the tab (
|
|
|
3607
3611
|
```js
|
|
3608
3612
|
await ui5.userInteraction.clickTab(selector);
|
|
3609
3613
|
```
|
|
3610
|
-
<a name="ui5.userInteraction.
|
|
3614
|
+
<a name="ui5.userInteraction.clickListItem"></a>
|
|
3611
3615
|
|
|
3612
|
-
#### userInteraction.
|
|
3613
|
-
|
|
3614
|
-
|
|
3616
|
+
#### userInteraction.clickListItem(selector, [index], [timeout])
|
|
3617
|
+
Clicks or opens the list item with the given selector (e.g. ColumnListItem, StandardListItem).
|
|
3618
|
+
In some cases the default click function is not working correctly (clicks an element within the list item).
|
|
3619
|
+
Therefore we recommend to use this function to open a specific list item.
|
|
3615
3620
|
|
|
3616
3621
|
**Kind**: static method of [<code>userInteraction</code>](#ui5.userInteraction)
|
|
3617
3622
|
|
|
3618
3623
|
| Param | Type | Default | Description |
|
|
3619
3624
|
| --- | --- | --- | --- |
|
|
3620
3625
|
| selector | <code>Object</code> | | The selector describing the element. |
|
|
3621
|
-
| value | <code>String</code> | | The value to select. |
|
|
3622
3626
|
| [index] | <code>Number</code> | <code>0</code> | The index of the selector (in case there are more than one elements visible at the same time). |
|
|
3623
3627
|
| [timeout] | <code>Number</code> | <code>30000</code> | The timeout to wait (ms). |
|
|
3624
3628
|
|
|
3625
3629
|
**Example**
|
|
3626
3630
|
```js
|
|
3627
|
-
await ui5.userInteraction.
|
|
3631
|
+
await ui5.userInteraction.clickListItem(selector);
|
|
3628
3632
|
```
|
|
3629
|
-
<a name="ui5.userInteraction.
|
|
3633
|
+
<a name="ui5.userInteraction.check"></a>
|
|
3630
3634
|
|
|
3631
|
-
#### userInteraction.
|
|
3632
|
-
|
|
3633
|
-
In some cases the default click function is not working correctly (clicks an element within the list item).
|
|
3634
|
-
Therefore we recommend to use this function to open a specific list item.
|
|
3635
|
+
#### userInteraction.check(selector, [index], [timeout])
|
|
3636
|
+
Checks the checkbox with the given selector.
|
|
3635
3637
|
|
|
3636
3638
|
**Kind**: static method of [<code>userInteraction</code>](#ui5.userInteraction)
|
|
3637
3639
|
|
|
@@ -3643,7 +3645,24 @@ Therefore we recommend to use this function to open a specific list item.
|
|
|
3643
3645
|
|
|
3644
3646
|
**Example**
|
|
3645
3647
|
```js
|
|
3646
|
-
await ui5.userInteraction.
|
|
3648
|
+
await ui5.userInteraction.check(selector);
|
|
3649
|
+
```
|
|
3650
|
+
<a name="ui5.userInteraction.uncheck"></a>
|
|
3651
|
+
|
|
3652
|
+
#### userInteraction.uncheck(selector, [index], [timeout])
|
|
3653
|
+
Unchecks the checkbox with the given selector.
|
|
3654
|
+
|
|
3655
|
+
**Kind**: static method of [<code>userInteraction</code>](#ui5.userInteraction)
|
|
3656
|
+
|
|
3657
|
+
| Param | Type | Default | Description |
|
|
3658
|
+
| --- | --- | --- | --- |
|
|
3659
|
+
| selector | <code>Object</code> | | The selector describing the element. |
|
|
3660
|
+
| [index] | <code>Number</code> | <code>0</code> | The index of the selector (in case there are more than one elements visible at the same time). |
|
|
3661
|
+
| [timeout] | <code>Number</code> | <code>30000</code> | The timeout to wait (ms). |
|
|
3662
|
+
|
|
3663
|
+
**Example**
|
|
3664
|
+
```js
|
|
3665
|
+
await ui5.userInteraction.uncheck(selector);
|
|
3647
3666
|
```
|
|
3648
3667
|
<a name="ui5.userInteraction.fill"></a>
|
|
3649
3668
|
|
|
@@ -3655,7 +3674,7 @@ Fills the input field with the given selector.
|
|
|
3655
3674
|
| Param | Type | Default | Description |
|
|
3656
3675
|
| --- | --- | --- | --- |
|
|
3657
3676
|
| selector | <code>Object</code> | | The selector describing the element. |
|
|
3658
|
-
| value | <code>String</code> | | The value to
|
|
3677
|
+
| value | <code>String</code> \| <code>Number</code> | | The value to enter. |
|
|
3659
3678
|
| [index] | <code>Number</code> | <code>0</code> | The index of the selector (in case there are more than one elements visible at the same time). |
|
|
3660
3679
|
| [timeout] | <code>Number</code> | <code>30000</code> | The timeout to wait (ms). |
|
|
3661
3680
|
|
|
@@ -3673,7 +3692,7 @@ Fills the input field with the given selector and retries the action in case of
|
|
|
3673
3692
|
| Param | Type | Default | Description |
|
|
3674
3693
|
| --- | --- | --- | --- |
|
|
3675
3694
|
| selector | <code>Object</code> | | The selector describing the element. |
|
|
3676
|
-
| value | <code>String</code> | | The value to
|
|
3695
|
+
| value | <code>String</code> \| <code>Number</code> | | The value to enter. |
|
|
3677
3696
|
| [index] | <code>Number</code> | <code>0</code> | The index of the selector (in case there are more than one elements visible at the same time). |
|
|
3678
3697
|
| [timeout] | <code>Number</code> | <code>30000</code> | The timeout to wait (ms). |
|
|
3679
3698
|
| [retries] | <code>Number</code> | <code>3</code> | The number of retries, can be set in config for all functions under params stepsRetries. |
|
|
@@ -3729,7 +3748,7 @@ Clears the input field with the given selector and fills the given value.
|
|
|
3729
3748
|
| Param | Type | Default | Description |
|
|
3730
3749
|
| --- | --- | --- | --- |
|
|
3731
3750
|
| selector | <code>Object</code> | | The selector describing the element. |
|
|
3732
|
-
| value | <code>String</code> | | The value to
|
|
3751
|
+
| value | <code>String</code> \| <code>Number</code> | | The value to enter. |
|
|
3733
3752
|
| [index] | <code>Number</code> | <code>0</code> | The index of the selector (in case there are more than one elements visible at the same time). |
|
|
3734
3753
|
| [timeout] | <code>Number</code> | <code>30000</code> | The timeout to wait (ms). |
|
|
3735
3754
|
|
|
@@ -3747,7 +3766,7 @@ Clears the input field with the given selector and fills the given value. Retrie
|
|
|
3747
3766
|
| Param | Type | Default | Description |
|
|
3748
3767
|
| --- | --- | --- | --- |
|
|
3749
3768
|
| selector | <code>Object</code> | | The selector describing the element. |
|
|
3750
|
-
| value | <code>String</code> | | The value to
|
|
3769
|
+
| value | <code>String</code> | | The value to enter. |
|
|
3751
3770
|
| [index] | <code>Number</code> | <code>0</code> | The index of the selector (in case there are more than one elements visible at the same time). |
|
|
3752
3771
|
| [timeout] | <code>Number</code> | <code>30000</code> | The timeout to wait (ms). |
|
|
3753
3772
|
| [retries] | <code>Number</code> | <code>3</code> | The number of retries, can be set in config for all functions under params stepsRetries. |
|
|
@@ -3785,7 +3804,7 @@ Clears the smart filed with the given selector and fills the given value.
|
|
|
3785
3804
|
| Param | Type | Default | Description |
|
|
3786
3805
|
| --- | --- | --- | --- |
|
|
3787
3806
|
| selector | <code>Object</code> | | The selector describing the element. |
|
|
3788
|
-
| value | <code>String</code> | | The value to
|
|
3807
|
+
| value | <code>String</code> | | The value to enter. |
|
|
3789
3808
|
| [index] | <code>Number</code> | <code>0</code> | The index of the selector (in case there are more than one elements visible at the same time). |
|
|
3790
3809
|
| [timeout] | <code>Number</code> | <code>30000</code> | The timeout to wait (ms). |
|
|
3791
3810
|
|
|
@@ -3803,7 +3822,7 @@ Clears the smart filed with the given selector and fills the given value and ret
|
|
|
3803
3822
|
| Param | Type | Default | Description |
|
|
3804
3823
|
| --- | --- | --- | --- |
|
|
3805
3824
|
| selector | <code>Object</code> | | The selector describing the element. |
|
|
3806
|
-
| value | <code>String</code> | | The value to
|
|
3825
|
+
| value | <code>String</code> | | The value to enter. |
|
|
3807
3826
|
| [index] | <code>Number</code> | <code>0</code> | The index of the selector (in case there are more than one elements visible at the same time). |
|
|
3808
3827
|
| [timeout] | <code>Number</code> | <code>30000</code> | The timeout to wait (ms). |
|
|
3809
3828
|
| [retries] | <code>Number</code> | <code>3</code> | The number of retries, can be set in config for all functions under params stepsRetries. |
|
|
@@ -3904,6 +3923,25 @@ Clicks the arrow icon at the passed selector (select box), and retries in case i
|
|
|
3904
3923
|
```js
|
|
3905
3924
|
await ui5.userInteraction.clickSelectArrowAndRetry(selector);
|
|
3906
3925
|
```
|
|
3926
|
+
<a name="ui5.userInteraction.selectFromTab"></a>
|
|
3927
|
+
|
|
3928
|
+
#### userInteraction.selectFromTab(selector, value, [index], [timeout])
|
|
3929
|
+
Selects the passed value on the tab with the given selector and checks if the tab got selected successfully.
|
|
3930
|
+
The function retries the click for maximal 3 times if the selection of the tab (blue underline) was not successful.
|
|
3931
|
+
|
|
3932
|
+
**Kind**: static method of [<code>userInteraction</code>](#ui5.userInteraction)
|
|
3933
|
+
|
|
3934
|
+
| Param | Type | Default | Description |
|
|
3935
|
+
| --- | --- | --- | --- |
|
|
3936
|
+
| selector | <code>Object</code> | | The selector describing the element. |
|
|
3937
|
+
| value | <code>String</code> | | The value to select. |
|
|
3938
|
+
| [index] | <code>Number</code> | <code>0</code> | The index of the selector (in case there are more than one elements visible at the same time). |
|
|
3939
|
+
| [timeout] | <code>Number</code> | <code>30000</code> | The timeout to wait (ms). |
|
|
3940
|
+
|
|
3941
|
+
**Example**
|
|
3942
|
+
```js
|
|
3943
|
+
await ui5.userInteraction.selectFromTab(selector);
|
|
3944
|
+
```
|
|
3907
3945
|
<a name="ui5.userInteraction.mouseOverElement"></a>
|
|
3908
3946
|
|
|
3909
3947
|
#### userInteraction.mouseOverElement(selector, [index], [timeout])
|
|
@@ -4047,6 +4085,7 @@ Global namespace for non UI5 modules.
|
|
|
4047
4085
|
* [.isPresent(elem)](#nonUi5.element.isPresent) ⇒ <code>Boolean</code>
|
|
4048
4086
|
* [.isPresentByCss(css, [index], [timeout])](#nonUi5.element.isPresentByCss) ⇒ <code>boolean</code>
|
|
4049
4087
|
* [.isPresentByXPath(xpath, [index], [timeout])](#nonUi5.element.isPresentByXPath) ⇒ <code>boolean</code>
|
|
4088
|
+
* [.isSelected(elem)](#nonUi5.element.isSelected) ⇒ <code>boolean</code>
|
|
4050
4089
|
* [.getAttributeValue(elem, [attribute])](#nonUi5.element.getAttributeValue) ⇒ <code>String</code>
|
|
4051
4090
|
* [.getValue(elem)](#nonUi5.element.getValue) ⇒ <code>String</code>
|
|
4052
4091
|
* [.setInnerHTML(elem)](#nonUi5.element.setInnerHTML) ⇒ <code>String</code>
|
|
@@ -4062,6 +4101,8 @@ Global namespace for non UI5 modules.
|
|
|
4062
4101
|
* [.clickAndRetry(element, [timeout], [retries], [interval])](#nonUi5.userInteraction.clickAndRetry)
|
|
4063
4102
|
* [.doubleClick(element, [timeout])](#nonUi5.userInteraction.doubleClick)
|
|
4064
4103
|
* [.rightClick(element, [timeout])](#nonUi5.userInteraction.rightClick)
|
|
4104
|
+
* [.check(element)](#nonUi5.userInteraction.check)
|
|
4105
|
+
* [.uncheck(element)](#nonUi5.userInteraction.uncheck)
|
|
4065
4106
|
* [.fill(element, value)](#nonUi5.userInteraction.fill)
|
|
4066
4107
|
* [.fillAndRetry(element, value, [retries], [interval])](#nonUi5.userInteraction.fillAndRetry)
|
|
4067
4108
|
* [.clear(element)](#nonUi5.userInteraction.clear)
|
|
@@ -4201,6 +4242,7 @@ await nonUi5.assertion.expectToBeNotVisible(elem, 5000);
|
|
|
4201
4242
|
* [.isPresent(elem)](#nonUi5.element.isPresent) ⇒ <code>Boolean</code>
|
|
4202
4243
|
* [.isPresentByCss(css, [index], [timeout])](#nonUi5.element.isPresentByCss) ⇒ <code>boolean</code>
|
|
4203
4244
|
* [.isPresentByXPath(xpath, [index], [timeout])](#nonUi5.element.isPresentByXPath) ⇒ <code>boolean</code>
|
|
4245
|
+
* [.isSelected(elem)](#nonUi5.element.isSelected) ⇒ <code>boolean</code>
|
|
4204
4246
|
* [.getAttributeValue(elem, [attribute])](#nonUi5.element.getAttributeValue) ⇒ <code>String</code>
|
|
4205
4247
|
* [.getValue(elem)](#nonUi5.element.getValue) ⇒ <code>String</code>
|
|
4206
4248
|
* [.setInnerHTML(elem)](#nonUi5.element.setInnerHTML) ⇒ <code>String</code>
|
|
@@ -4543,7 +4585,7 @@ await nonUi5.element.isPresentByCss(".button01");
|
|
|
4543
4585
|
<a name="nonUi5.element.isPresentByXPath"></a>
|
|
4544
4586
|
|
|
4545
4587
|
#### element.isPresentByXPath(xpath, [index], [timeout]) ⇒ <code>boolean</code>
|
|
4546
|
-
|
|
4588
|
+
Returns a boolean if the element is present at the DOM or not.
|
|
4547
4589
|
|
|
4548
4590
|
**Kind**: static method of [<code>element</code>](#nonUi5.element)
|
|
4549
4591
|
|
|
@@ -4557,6 +4599,22 @@ returns a boolean if the element is present at the DOM or not.
|
|
|
4557
4599
|
```js
|
|
4558
4600
|
await nonUi5.element.isPresentByXPath(".//*[text()='Create']");
|
|
4559
4601
|
```
|
|
4602
|
+
<a name="nonUi5.element.isSelected"></a>
|
|
4603
|
+
|
|
4604
|
+
#### element.isSelected(elem) ⇒ <code>boolean</code>
|
|
4605
|
+
Returns a boolean if the element (e.g. checkbox) is selected.
|
|
4606
|
+
|
|
4607
|
+
**Kind**: static method of [<code>element</code>](#nonUi5.element)
|
|
4608
|
+
|
|
4609
|
+
| Param | Type | Description |
|
|
4610
|
+
| --- | --- | --- |
|
|
4611
|
+
| elem | <code>Object</code> | The element. |
|
|
4612
|
+
|
|
4613
|
+
**Example**
|
|
4614
|
+
```js
|
|
4615
|
+
const elem = await nonUi5.element.getById("elem01");
|
|
4616
|
+
const isSelected = await nonUi5.element.isSelected(elem);
|
|
4617
|
+
```
|
|
4560
4618
|
<a name="nonUi5.element.getAttributeValue"></a>
|
|
4561
4619
|
|
|
4562
4620
|
#### element.getAttributeValue(elem, [attribute]) ⇒ <code>String</code>
|
|
@@ -4721,6 +4779,8 @@ await nonUi5.session.loginSapNetWeaver("john", "abc123!");
|
|
|
4721
4779
|
* [.clickAndRetry(element, [timeout], [retries], [interval])](#nonUi5.userInteraction.clickAndRetry)
|
|
4722
4780
|
* [.doubleClick(element, [timeout])](#nonUi5.userInteraction.doubleClick)
|
|
4723
4781
|
* [.rightClick(element, [timeout])](#nonUi5.userInteraction.rightClick)
|
|
4782
|
+
* [.check(element)](#nonUi5.userInteraction.check)
|
|
4783
|
+
* [.uncheck(element)](#nonUi5.userInteraction.uncheck)
|
|
4724
4784
|
* [.fill(element, value)](#nonUi5.userInteraction.fill)
|
|
4725
4785
|
* [.fillAndRetry(element, value, [retries], [interval])](#nonUi5.userInteraction.fillAndRetry)
|
|
4726
4786
|
* [.clear(element)](#nonUi5.userInteraction.clear)
|
|
@@ -4803,6 +4863,36 @@ Right Clicks on the passed element.
|
|
|
4803
4863
|
const elem = await nonUi5.element.getById("button01");
|
|
4804
4864
|
await nonUi5.userInteraction.rightClick(elem);
|
|
4805
4865
|
```
|
|
4866
|
+
<a name="nonUi5.userInteraction.check"></a>
|
|
4867
|
+
|
|
4868
|
+
#### userInteraction.check(element)
|
|
4869
|
+
Checks the given checkbox.
|
|
4870
|
+
|
|
4871
|
+
**Kind**: static method of [<code>userInteraction</code>](#nonUi5.userInteraction)
|
|
4872
|
+
|
|
4873
|
+
| Param | Type | Description |
|
|
4874
|
+
| --- | --- | --- |
|
|
4875
|
+
| element | <code>Object</code> | The element. |
|
|
4876
|
+
|
|
4877
|
+
**Example**
|
|
4878
|
+
```js
|
|
4879
|
+
await nonUi5.userInteraction.check(selector);
|
|
4880
|
+
```
|
|
4881
|
+
<a name="nonUi5.userInteraction.uncheck"></a>
|
|
4882
|
+
|
|
4883
|
+
#### userInteraction.uncheck(element)
|
|
4884
|
+
Unchecks the given checkbox.
|
|
4885
|
+
|
|
4886
|
+
**Kind**: static method of [<code>userInteraction</code>](#nonUi5.userInteraction)
|
|
4887
|
+
|
|
4888
|
+
| Param | Type | Description |
|
|
4889
|
+
| --- | --- | --- |
|
|
4890
|
+
| element | <code>Object</code> | The element. |
|
|
4891
|
+
|
|
4892
|
+
**Example**
|
|
4893
|
+
```js
|
|
4894
|
+
await nonUi5.userInteraction.uncheck(selector);
|
|
4895
|
+
```
|
|
4806
4896
|
<a name="nonUi5.userInteraction.fill"></a>
|
|
4807
4897
|
|
|
4808
4898
|
#### userInteraction.fill(element, value)
|
|
@@ -4813,7 +4903,7 @@ Fills the given value into the passed input.
|
|
|
4813
4903
|
| Param | Type | Description |
|
|
4814
4904
|
| --- | --- | --- |
|
|
4815
4905
|
| element | <code>Object</code> | The element. |
|
|
4816
|
-
| value | <code>String</code> | The value to
|
|
4906
|
+
| value | <code>String</code> \| <code>Number</code> | The value to enter. |
|
|
4817
4907
|
|
|
4818
4908
|
**Example**
|
|
4819
4909
|
```js
|
|
@@ -4830,7 +4920,7 @@ Fills the given value into the passed input, retries in case of a failure.
|
|
|
4830
4920
|
| Param | Type | Default | Description |
|
|
4831
4921
|
| --- | --- | --- | --- |
|
|
4832
4922
|
| element | <code>Object</code> | | The element. |
|
|
4833
|
-
| value | <code>String</code> | | The value to
|
|
4923
|
+
| value | <code>String</code> \| <code>Number</code> | | The value to enter. |
|
|
4834
4924
|
| [retries] | <code>Number</code> | <code>3</code> | The number of retries, can be set in config for all functions under params stepsRetries. |
|
|
4835
4925
|
| [interval] | <code>Number</code> | <code>5000</code> | The delay between the retries (ms). Can be set in config for all functions under params.stepRetriesIntervals. |
|
|
4836
4926
|
|
|
@@ -4883,7 +4973,7 @@ Clears and fills the passed input element.
|
|
|
4883
4973
|
| Param | Type | Description |
|
|
4884
4974
|
| --- | --- | --- |
|
|
4885
4975
|
| element | <code>Object</code> | The element. |
|
|
4886
|
-
| value | <code>String</code> | The value to
|
|
4976
|
+
| value | <code>String</code> \| <code>Number</code> | The value to enter in. |
|
|
4887
4977
|
|
|
4888
4978
|
**Example**
|
|
4889
4979
|
```js
|
|
@@ -4900,7 +4990,7 @@ Clears and fills the passed input, retries in case it fails.
|
|
|
4900
4990
|
| Param | Type | Default | Description |
|
|
4901
4991
|
| --- | --- | --- | --- |
|
|
4902
4992
|
| element | <code>Object</code> | | The element. |
|
|
4903
|
-
| value | <code>String</code> | | The value to
|
|
4993
|
+
| value | <code>String</code> \| <code>Number</code> | | The value to enter in. |
|
|
4904
4994
|
| [retries] | <code>Number</code> | <code>3</code> | The number of retries, can be set in config for all functions under params stepsRetries. |
|
|
4905
4995
|
| [interval] | <code>Number</code> | <code>5000</code> | The delay between the retries (ms). Can be set in config for all functions under params.stepRetriesIntervals. |
|
|
4906
4996
|
| [verify] | <code>Boolean</code> | <code>true</code> | Specifies if the filled value should be verified. |
|
|
@@ -4919,7 +5009,7 @@ Moves the cursor/focus to the passed element.
|
|
|
4919
5009
|
|
|
4920
5010
|
| Param | Type | Description |
|
|
4921
5011
|
| --- | --- | --- |
|
|
4922
|
-
| element | <code>Object</code> | The
|
|
5012
|
+
| element | <code>Object</code> | The element. |
|
|
4923
5013
|
| [xOffset] | <code>Number</code> | X offset to move to, relative to the top-left corner of the element. If not specified, the mouse will move to the middle of the element. |
|
|
4924
5014
|
| [yOffset] | <code>Number</code> | Y offset to move to, relative to the top-left corner of the element. If not specified, the mouse will move to the middle of the element. |
|
|
4925
5015
|
|
package/docs/index.md
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# **Qmate** Service
|
|
2
2
|
**Qmate Service** is a custom [WebdriverIO](https://webdriver.io/) service for testing web applications and APIs.
|
|
3
3
|
|
|
4
|
-
!!!
|
|
5
|
-
The latest
|
|
6
|
-
|
|
4
|
+
!!! note
|
|
5
|
+
The latest release of the Qmate Service is compatible with **WebdriverIO V8**.
|
|
7
6
|
## Main features
|
|
8
7
|
The main features of this service are:
|
|
9
8
|
|
|
@@ -105,8 +105,8 @@ function getReturnType(tags) {
|
|
|
105
105
|
function mapTagToArgument(tag) {
|
|
106
106
|
return {
|
|
107
107
|
name: tag.name,
|
|
108
|
-
type: (tag
|
|
109
|
-
default: tag
|
|
108
|
+
type: getArgumentType(tag),
|
|
109
|
+
default: getArgumentDefaultValue(tag)
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
112
|
function parseReturnTypeFromReturnTag(tag) {
|
|
@@ -118,4 +118,51 @@ function parseReturnTypeFromReturnTag(tag) {
|
|
|
118
118
|
}
|
|
119
119
|
return undefined;
|
|
120
120
|
}
|
|
121
|
+
function getArgumentType(tag) {
|
|
122
|
+
if (cannotParseArgumentTypeFromTag(tag)) {
|
|
123
|
+
return "string";
|
|
124
|
+
}
|
|
125
|
+
if (canParseArgumentTypeFromTagName(tag)) {
|
|
126
|
+
return parseArgumentTypeFromTagName(tag);
|
|
127
|
+
}
|
|
128
|
+
else if (canParseArgumentTypeFromTagExpression(tag)) {
|
|
129
|
+
return parseArgumentTypeFromTagExpression(tag);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
function getArgumentDefaultValue(tag) {
|
|
133
|
+
if (!tag.default) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
return getArgumentDefaultValueBasedOnType(tag);
|
|
137
|
+
}
|
|
138
|
+
function cannotParseArgumentTypeFromTag(tag) {
|
|
139
|
+
return !canParseArgumentTypeFromTag(tag);
|
|
140
|
+
}
|
|
141
|
+
function canParseArgumentTypeFromTag(tag) {
|
|
142
|
+
return tag.type
|
|
143
|
+
&& (canParseArgumentTypeFromTagName(tag)
|
|
144
|
+
|| canParseArgumentTypeFromTagExpression(tag));
|
|
145
|
+
}
|
|
146
|
+
function canParseArgumentTypeFromTagName(tag) {
|
|
147
|
+
return !!tag.type.name;
|
|
148
|
+
}
|
|
149
|
+
function parseArgumentTypeFromTagName(tag) {
|
|
150
|
+
return tag.type.name.toLowerCase();
|
|
151
|
+
}
|
|
152
|
+
function canParseArgumentTypeFromTagExpression(tag) {
|
|
153
|
+
return tag.type.expression && tag.type.expression.name;
|
|
154
|
+
}
|
|
155
|
+
function parseArgumentTypeFromTagExpression(tag) {
|
|
156
|
+
return tag.type.expression.name.toLowerCase();
|
|
157
|
+
}
|
|
158
|
+
function getArgumentDefaultValueBasedOnType(tag) {
|
|
159
|
+
const type = getArgumentType(tag);
|
|
160
|
+
if (type === "number") {
|
|
161
|
+
return parseInt(tag.default);
|
|
162
|
+
}
|
|
163
|
+
if (type === "boolean") {
|
|
164
|
+
return Boolean(tag.default);
|
|
165
|
+
}
|
|
166
|
+
return tag.default;
|
|
167
|
+
}
|
|
121
168
|
//# sourceMappingURL=jsonDocGen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonDocGen.js","sourceRoot":"","sources":["../../../src/reuse/helper/jsonDocGen.js"],"names":[],"mappings":";AAAA,+BAA+B;AAC/B,kBAAkB;AAClB,MAAM,QAAQ,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAC1C,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACzB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAErC,MAAM,mBAAmB,GAAG,CAAC,SAAS,CAAC,CAAC;AAExC,MAAM,SAAS,GAAG,GAAG,QAAQ,oBAAoB,CAAC;AAClD,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;AACnC,K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S,EAAE;QACtB,OAAO,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;KAC7B;IACD,OAAO,GAAG,CAAC,OAAO,CAAC;AACrB,CAAC"}
|
|
@@ -23,6 +23,17 @@ export declare class Control {
|
|
|
23
23
|
* }, selector, args);
|
|
24
24
|
**/
|
|
25
25
|
execute(callbackFunction: Function, selectorOrElement: Element | Ui5Selector | Ui5SelectorWithOptions, args?: any): Promise<any>;
|
|
26
|
+
/**
|
|
27
|
+
* @function focus
|
|
28
|
+
* @memberOf ui5.control
|
|
29
|
+
* @description Focuses on the element with the given selector to get it into view. If focus is not possible scrollToElement is used.
|
|
30
|
+
* @param {Object} selector - The selector describing the element.
|
|
31
|
+
* @param {Number} [index=0] - The index of the selector (in case there are more than one elements visible at the same time).
|
|
32
|
+
* @param {Number} [timeout=30000] - The timeout to wait (ms).
|
|
33
|
+
* @example await ui5.control.focus(selector);
|
|
34
|
+
* @example await ui5.control.focus(selector, 0, 5000);
|
|
35
|
+
*/
|
|
36
|
+
focus(selector: any, index?: number, timeout?: string | number): Promise<void>;
|
|
26
37
|
/**
|
|
27
38
|
* @function getProperty
|
|
28
39
|
* @memberOf ui5.control
|
|
@@ -31,6 +31,33 @@ class Control {
|
|
|
31
31
|
const vl = this.vlf.initLog(this.execute);
|
|
32
32
|
return this.lib.controlActionInBrowser(callbackFunction, selectorOrElement, args);
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* @function focus
|
|
36
|
+
* @memberOf ui5.control
|
|
37
|
+
* @description Focuses on the element with the given selector to get it into view. If focus is not possible scrollToElement is used.
|
|
38
|
+
* @param {Object} selector - The selector describing the element.
|
|
39
|
+
* @param {Number} [index=0] - The index of the selector (in case there are more than one elements visible at the same time).
|
|
40
|
+
* @param {Number} [timeout=30000] - The timeout to wait (ms).
|
|
41
|
+
* @example await ui5.control.focus(selector);
|
|
42
|
+
* @example await ui5.control.focus(selector, 0, 5000);
|
|
43
|
+
*/
|
|
44
|
+
async focus(selector, index = 0, timeout = process.env.QMATE_CUSTOM_TIMEOUT || 30000) {
|
|
45
|
+
const elem = await ui5.element.getDisplayed(selector, index, timeout);
|
|
46
|
+
const id = await elem.getAttribute("id");
|
|
47
|
+
const focused = await browser.execute(function (id) {
|
|
48
|
+
const elem = sap.ui.getCore().getElementById(id);
|
|
49
|
+
if (elem && elem.focus) {
|
|
50
|
+
elem.focus();
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}, id);
|
|
57
|
+
if (!focused) {
|
|
58
|
+
ui5.userInteraction.scrollToElement(selector, index, "center", timeout);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
34
61
|
// =================================== GET ===================================
|
|
35
62
|
/**
|
|
36
63
|
* @function getProperty
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.js","sourceRoot":"","sources":["../../../../src/reuse/modules/ui5/control.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAGb,8DAAkE;AAGlE;;;GAGG;AACH,MAAa,OAAO;IAApB;QACU,QAAG,GAAG,IAAI,oCAAoB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAEjD,QAAG,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;QAClD,oBAAe,GAAG,OAAO,CAAC,8CAA8C,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"control.js","sourceRoot":"","sources":["../../../../src/reuse/modules/ui5/control.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAGb,8DAAkE;AAGlE;;;GAGG;AACH,MAAa,OAAO;IAApB;QACU,QAAG,GAAG,IAAI,oCAAoB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAEjD,QAAG,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;QAClD,oBAAe,GAAG,OAAO,CAAC,8CAA8C,CAAC,CAAC;IAgIpF,CAAC;IA9HC,kFAAkF;IAClF;;;;;;;;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HANGED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const { handleCookiesConsent } = require("../../../helper/utils");
|
|
3
|
+
|
|
4
|
+
describe("control - focus - for a input field", function () {
|
|
5
|
+
it("Preparation", async function () {
|
|
6
|
+
await common.navigation.navigateToUrl("https://sapui5.hana.ondemand.com/1.99.0/#/entity/sap.ui.comp.smartfield.SmartField/sample/sap.ui.comp.sample.smartfield.TextInEditModeSource");
|
|
7
|
+
await handleCookiesConsent();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it("Execution & Verification", async function () {
|
|
11
|
+
const lastInputSelector = {
|
|
12
|
+
"elementProperties": {
|
|
13
|
+
"viewName": "sap.ui.comp.sample.smartfield.TextInEditModeSource.Main",
|
|
14
|
+
"metadata": "sap.m.Input",
|
|
15
|
+
"id": "*idValueListNoValidation-input"
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
await ui5.control.focus(lastInputSelector);
|
|
19
|
+
await ui5.userInteraction.clearAndFillAndRetry(lastInputSelector, "LN");
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
describe("control - focus", function () {
|
|
24
|
+
it("Preparation", async function () {
|
|
25
|
+
await common.navigation.navigateToUrl("https://sapui5.hana.ondemand.com/1.99.0/#/entity/sap.m.ActionSheet");
|
|
26
|
+
await handleCookiesConsent();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it("Execution and Verification", async function () {
|
|
30
|
+
const selector = {
|
|
31
|
+
"elementProperties": {
|
|
32
|
+
"viewName": "sap.ui.documentation.sdk.view.ControlsMaster",
|
|
33
|
+
"metadata": "sap.m.StandardListItem",
|
|
34
|
+
"bindingContextPath": "/entities/199"
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
await ui5.control.focus(selector); //can see the scroll take place during this step
|
|
38
|
+
await ui5.assertion.expectToBeVisible(selector);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
describe("control - focus - outside of viewpoint", function () {
|
|
43
|
+
it("Preparation", async function () {
|
|
44
|
+
await common.navigation.navigateToUrl("https://sapui5.hana.ondemand.com/1.99.0/#/entity/sap.m.MultiComboBox/sample/sap.m.sample.MultiComboBox");
|
|
45
|
+
await handleCookiesConsent();
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it("Execution", async function () {
|
|
49
|
+
const selectorForDropdownList = {
|
|
50
|
+
"elementProperties": {
|
|
51
|
+
"viewName": "sap.m.sample.MultiComboBox.view.MultiComboBox",
|
|
52
|
+
"metadata": "sap.m.MultiComboBox"
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const selector = {
|
|
56
|
+
"elementProperties": {
|
|
57
|
+
"viewName": "sap.m.sample.MultiComboBox.view.MultiComboBox",
|
|
58
|
+
"metadata": "sap.m.StandardListItem",
|
|
59
|
+
"title": "Smart Games"
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
await ui5.userInteraction.clickSelectArrow(selectorForDropdownList);
|
|
64
|
+
await ui5.control.focus(selector);
|
|
65
|
+
await ui5.userInteraction.click(selector);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it("Verification", async function () {
|
|
69
|
+
const selector = {
|
|
70
|
+
"elementProperties": {
|
|
71
|
+
"viewName": "sap.m.sample.MultiComboBox.view.MultiComboBox",
|
|
72
|
+
"metadata": "sap.m.Token"
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
await ui5.assertion.expectAttributeToBe(selector, "text", "Smart Games");
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
describe("control - focus - no selector found and catch error", function () {
|
|
80
|
+
|
|
81
|
+
it("Preparation", async function () {
|
|
82
|
+
await browser.navigateTo("https://sapui5.hana.ondemand.com/1.99.0/test-resources/sap/m/demokit/cart/webapp/index.html");
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it("Execution & Verification", async function () {
|
|
86
|
+
const selector = {
|
|
87
|
+
"elementProperties": {
|
|
88
|
+
"viewName": "ghgjho.cart.view.Welcome",
|
|
89
|
+
"metadata": "",
|
|
90
|
+
"text": [{
|
|
91
|
+
"path": "i18n>promotedTitle"
|
|
92
|
+
}]
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
const index = 0;
|
|
96
|
+
const timeout = 30000;
|
|
97
|
+
await expect(ui5.control.focus(selector, index, timeout))
|
|
98
|
+
.rejects.toThrow(/uiControlExecuteLocator\(\): No visible elements found/);
|
|
99
|
+
});
|
|
100
|
+
});
|
|
@@ -10,6 +10,7 @@ exports.config = merge(profile.config, {
|
|
|
10
10
|
|
|
11
11
|
specs: [
|
|
12
12
|
path.resolve(__dirname, "execute.spec.js"),
|
|
13
|
+
path.resolve(__dirname, "focus.spec.js"),
|
|
13
14
|
path.resolve(__dirname, "getAggregationProperty.spec.js"),
|
|
14
15
|
path.resolve(__dirname, "getAssociationProperty.spec.js"),
|
|
15
16
|
path.resolve(__dirname, "getBindingContextPathProperty.spec.js"),
|
|
@@ -14,6 +14,7 @@ exports.config = merge(profile.config, {
|
|
|
14
14
|
|
|
15
15
|
specs: [
|
|
16
16
|
path.resolve(__dirname, "execute.spec.js"),
|
|
17
|
+
path.resolve(__dirname, "focus.spec.js"),
|
|
17
18
|
path.resolve(__dirname, "getAggregationProperty.spec.js"),
|
|
18
19
|
path.resolve(__dirname, "getAssociationProperty.spec.js"),
|
|
19
20
|
path.resolve(__dirname, "getBindingContextPathProperty.spec.js"),
|