@sap_oss/wdio-qmate-service 2.9.9 → 2.11.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 +417 -1
- package/lib/index.js +5 -2
- package/lib/index.js.map +1 -1
- package/lib/reuse/helper/elementResolving.js +1 -2
- package/lib/reuse/helper/elementResolving.js.map +1 -1
- package/lib/reuse/helper/inputValidation.js +1 -2
- package/lib/reuse/helper/inputValidation.js.map +1 -1
- package/lib/reuse/index.js +19 -1
- package/lib/reuse/index.js.map +1 -1
- package/lib/reuse/modules/common/date.d.ts +1 -1
- package/lib/reuse/modules/common/date.js +9 -9
- package/lib/reuse/modules/common/date.js.map +1 -1
- package/lib/reuse/modules/mobile/Mobile.d.ts +16 -0
- package/lib/reuse/modules/mobile/Mobile.js +25 -0
- package/lib/reuse/modules/mobile/Mobile.js.map +1 -0
- package/lib/reuse/modules/mobile/android.d.ts +29 -0
- package/lib/reuse/modules/mobile/android.js +84 -0
- package/lib/reuse/modules/mobile/android.js.map +1 -0
- package/lib/reuse/modules/mobile/device.d.ts +29 -0
- package/lib/reuse/modules/mobile/device.js +63 -0
- package/lib/reuse/modules/mobile/device.js.map +1 -0
- package/lib/reuse/modules/mobile/element.d.ts +76 -0
- package/lib/reuse/modules/mobile/element.js +132 -0
- package/lib/reuse/modules/mobile/element.js.map +1 -0
- package/lib/reuse/modules/mobile/gestures.d.ts +22 -0
- package/lib/reuse/modules/mobile/gestures.js +46 -0
- package/lib/reuse/modules/mobile/gestures.js.map +1 -0
- package/lib/reuse/modules/mobile/ios.d.ts +10 -0
- package/lib/reuse/modules/mobile/ios.js +21 -0
- package/lib/reuse/modules/mobile/ios.js.map +1 -0
- package/lib/reuse/modules/mobile/userInteraction.d.ts +28 -0
- package/lib/reuse/modules/mobile/userInteraction.js +75 -0
- package/lib/reuse/modules/mobile/userInteraction.js.map +1 -0
- package/lib/reuse/modules/ui5/session.js +3 -0
- package/lib/reuse/modules/ui5/session.js.map +1 -1
- package/lib/reuse/modules/util/Util.d.ts +3 -1
- package/lib/reuse/modules/util/Util.js +2 -0
- package/lib/reuse/modules/util/Util.js.map +1 -1
- package/lib/reuse/modules/util/browser.d.ts +24 -0
- package/lib/reuse/modules/util/browser.js +36 -0
- package/lib/reuse/modules/util/browser.js.map +1 -1
- package/lib/reuse/modules/util/constants/formatter.constants.d.ts +7 -1
- package/lib/reuse/modules/util/constants/formatter.constants.js +6 -0
- package/lib/reuse/modules/util/constants/formatter.constants.js.map +1 -1
- package/lib/reuse/modules/util/data.d.ts +2 -2
- package/lib/reuse/modules/util/data.js +1 -1
- package/lib/reuse/modules/util/data.js.map +1 -1
- package/lib/reuse/modules/util/file.d.ts +0 -1
- package/lib/reuse/modules/util/formatter.d.ts +1 -1
- package/lib/reuse/modules/util/formatter.js +19 -1
- package/lib/reuse/modules/util/formatter.js.map +1 -1
- package/lib/reuse/modules/util/userSettings.d.ts +27 -0
- package/lib/reuse/modules/util/userSettings.js +181 -0
- package/lib/reuse/modules/util/userSettings.js.map +1 -0
- package/lib/reuse/runner/runner.js +1 -2
- package/lib/reuse/runner/runner.js.map +1 -1
- package/lib/scripts/dataExchange/dataExchange.js +48 -31
- package/lib/scripts/dataExchange/dataExchange.js.map +1 -1
- package/lib/scripts/dataExchange/dataExchangeUtil.d.ts +3 -3
- package/lib/scripts/dataExchange/dataExchangeUtil.js +10 -10
- package/lib/scripts/dataExchange/dataExchangeUtil.js.map +1 -1
- package/lib/scripts/hooks/after.js +1 -1
- package/lib/scripts/hooks/after.js.map +1 -1
- package/lib/scripts/hooks/before.js +1 -1
- package/lib/scripts/hooks/before.js.map +1 -1
- package/lib/scripts/hooks/beforeSession.js +2 -2
- package/lib/scripts/hooks/beforeSession.js.map +1 -1
- package/lib/scripts/hooks/onComplete.js +1 -1
- package/lib/scripts/hooks/onComplete.js.map +1 -1
- package/lib/scripts/hooks/onPrepare.js +1 -1
- package/lib/scripts/hooks/onPrepare.js.map +1 -1
- package/lib/scripts/hooks/utils/isBrowserDefined.d.ts +1 -0
- package/lib/scripts/hooks/utils/isBrowserDefined.js +7 -0
- package/lib/scripts/hooks/utils/isBrowserDefined.js.map +1 -0
- package/package.json +12 -4
- package/test/helper/configurations/mobile.conf.js +16 -0
- package/test/reuse/ui5/date/pick.spec.js +4 -4
- package/test/reuse/util/userSettings/data/data.json +6 -0
- package/test/reuse/util/userSettings/getDateFormatFromUserSettings.spec.js +21 -0
- package/test/reuse/util/userSettings/getLanguageFromUserSettings.spec.js +15 -0
- package/test/reuse/util/userSettings/getTimeFormatFromUserSettings.spec.js +17 -0
- package/test/reuse/util/userSettings/getTimeZoneFromUserSettings.spec.js +16 -0
- package/test/reuse/util/userSettings/setDateFormatFromUserSettings.spec.js +33 -0
- package/test/reuse/util/userSettings/setLanguageFromUserSettings.spec.js +16 -0
- package/test/reuse/util/userSettings/setNumberFormatFromUserSettings.spec.js +16 -0
- package/test/reuse/util/userSettings/setS4UserSettings.spec.js +37 -0
- package/test/reuse/util/userSettings/setTimeFormatFromUserSettings.spec.js +17 -0
- package/test/reuse/util/userSettings/setTimeZoneFromUserSettings.spec.js +16 -0
- package/test/reuse/util/userSettings/test.userSettings.apply.conf.js +16 -0
- package/test/reuse/util/userSettings/test.userSettings.conf.js +24 -0
- package/test/watchMode/config.js +18 -0
- package/test/watchMode/navigateToUrlAndClick.spec.js +16 -0
package/docs/doc.md
CHANGED
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
<dt><a href="#service">service</a></dt>
|
|
17
17
|
<dd><p>Global namespace for service modules.</p>
|
|
18
18
|
</dd>
|
|
19
|
+
<dt><a href="#mobile">mobile</a></dt>
|
|
20
|
+
<dd><p>Global namespace for mobile modules.</p>
|
|
21
|
+
</dd>
|
|
19
22
|
</dl>
|
|
20
23
|
|
|
21
24
|
<a name="common"></a>
|
|
@@ -571,6 +574,9 @@ Global namespace for util modules.
|
|
|
571
574
|
* [.log(message)](#util.browser.log)
|
|
572
575
|
* [.warn(message)](#util.browser.warn)
|
|
573
576
|
* [.error(message)](#util.browser.error)
|
|
577
|
+
* [.isMobile()](#util.browser.isMobile) ⇒ <code>boolean</code>
|
|
578
|
+
* [.isAndroid()](#util.browser.isAndroid) ⇒ <code>boolean</code>
|
|
579
|
+
* [.isIos()](#util.browser.isIos) ⇒ <code>boolean</code>
|
|
574
580
|
* [.component](#util.component)
|
|
575
581
|
* [new component()](#new_util.component_new)
|
|
576
582
|
* [.loadEntryPoint([folderPath])](#util.component.loadEntryPoint) ⇒ <code>Object</code>
|
|
@@ -644,6 +650,9 @@ Global namespace for util modules.
|
|
|
644
650
|
* [.log(message)](#util.browser.log)
|
|
645
651
|
* [.warn(message)](#util.browser.warn)
|
|
646
652
|
* [.error(message)](#util.browser.error)
|
|
653
|
+
* [.isMobile()](#util.browser.isMobile) ⇒ <code>boolean</code>
|
|
654
|
+
* [.isAndroid()](#util.browser.isAndroid) ⇒ <code>boolean</code>
|
|
655
|
+
* [.isIos()](#util.browser.isIos) ⇒ <code>boolean</code>
|
|
647
656
|
|
|
648
657
|
<a name="util.browser.getBaseUrl"></a>
|
|
649
658
|
|
|
@@ -960,6 +969,39 @@ add error message to browser logs, can be viewed in the html report
|
|
|
960
969
|
```js
|
|
961
970
|
await util.browser.error("This is an error message");
|
|
962
971
|
```
|
|
972
|
+
<a name="util.browser.isMobile"></a>
|
|
973
|
+
|
|
974
|
+
#### browser.isMobile() ⇒ <code>boolean</code>
|
|
975
|
+
Indicates a mobile session
|
|
976
|
+
|
|
977
|
+
**Kind**: static method of [<code>browser</code>](#util.browser)
|
|
978
|
+
**Returns**: <code>boolean</code> - Return true if its a mobile session driver.
|
|
979
|
+
**Example**
|
|
980
|
+
```js
|
|
981
|
+
await util.browser.isMobile();
|
|
982
|
+
```
|
|
983
|
+
<a name="util.browser.isAndroid"></a>
|
|
984
|
+
|
|
985
|
+
#### browser.isAndroid() ⇒ <code>boolean</code>
|
|
986
|
+
Indicates a mobile session
|
|
987
|
+
|
|
988
|
+
**Kind**: static method of [<code>browser</code>](#util.browser)
|
|
989
|
+
**Returns**: <code>boolean</code> - Return true if its a Android session driver.
|
|
990
|
+
**Example**
|
|
991
|
+
```js
|
|
992
|
+
await util.browser.isAndroid();
|
|
993
|
+
```
|
|
994
|
+
<a name="util.browser.isIos"></a>
|
|
995
|
+
|
|
996
|
+
#### browser.isIos() ⇒ <code>boolean</code>
|
|
997
|
+
Indicates an iOS session
|
|
998
|
+
|
|
999
|
+
**Kind**: static method of [<code>browser</code>](#util.browser)
|
|
1000
|
+
**Returns**: <code>boolean</code> - Return true if its a iOS session driver.
|
|
1001
|
+
**Example**
|
|
1002
|
+
```js
|
|
1003
|
+
await util.browser.isIos();
|
|
1004
|
+
```
|
|
963
1005
|
<a name="util.component"></a>
|
|
964
1006
|
|
|
965
1007
|
### util.component
|
|
@@ -1185,7 +1227,7 @@ Decrypts the passed input data.
|
|
|
1185
1227
|
|
|
1186
1228
|
| Param | Type | Description |
|
|
1187
1229
|
| --- | --- | --- |
|
|
1188
|
-
| data | <code>String</code> | The encrypted data to decrypt. |
|
|
1230
|
+
| data | <code>String</code> \| <code>Array.<String></code> | The encrypted data to decrypt. Single value or array of values for different keys. |
|
|
1189
1231
|
|
|
1190
1232
|
**Example**
|
|
1191
1233
|
```js
|
|
@@ -5722,3 +5764,377 @@ const config = {
|
|
|
5722
5764
|
},
|
|
5723
5765
|
let res = await service.rest.put(`${browser.config.baseUrl}/posts/99`, payload, config);
|
|
5724
5766
|
```
|
|
5767
|
+
<a name="mobile"></a>
|
|
5768
|
+
|
|
5769
|
+
## mobile
|
|
5770
|
+
Global namespace for mobile modules.
|
|
5771
|
+
|
|
5772
|
+
**Kind**: global constant
|
|
5773
|
+
|
|
5774
|
+
* [mobile](#mobile)
|
|
5775
|
+
* [.android](#mobile.android)
|
|
5776
|
+
* [.pressKeyByName(keyName)](#mobile.android.pressKeyByName)
|
|
5777
|
+
* [.pressKeyByCode(keyCode)](#mobile.android.pressKeyByCode)
|
|
5778
|
+
* [.device](#mobile.device)
|
|
5779
|
+
* [.isAppInstalled(packageIdorBundleId)](#mobile.device.isAppInstalled) ⇒ <code>boolean</code>
|
|
5780
|
+
* [.installApp(appPath)](#mobile.device.installApp)
|
|
5781
|
+
* [.element](#mobile.element)
|
|
5782
|
+
* [.isVisible(element, [strict])](#mobile.element.isVisible) ⇒ <code>Boolean</code>
|
|
5783
|
+
* [.isPresent(elem)](#mobile.element.isPresent) ⇒ <code>Boolean</code>
|
|
5784
|
+
* [.waitToBePresent(selector, [timeout])](#mobile.element.waitToBePresent)
|
|
5785
|
+
* [.waitToBeVisible(selector, [timeout])](#mobile.element.waitToBeVisible)
|
|
5786
|
+
* [.waitToBeClickable(selector, [timeout])](#mobile.element.waitToBeClickable)
|
|
5787
|
+
* [.isSelected(elem)](#mobile.element.isSelected) ⇒ <code>boolean</code>
|
|
5788
|
+
* [.gestures](#mobile.gestures)
|
|
5789
|
+
* [.waitToBeClickable(startX, startY, endX, endY, duration)](#mobile.gestures.waitToBeClickable) ⇒ <code>Promise.<void></code>
|
|
5790
|
+
* [.ios](#mobile.ios)
|
|
5791
|
+
* [.userInteraction](#mobile.userInteraction)
|
|
5792
|
+
* [.tap(element, [timeout])](#mobile.userInteraction.tap)
|
|
5793
|
+
* [.check(element)](#mobile.userInteraction.check)
|
|
5794
|
+
|
|
5795
|
+
<a name="mobile.android"></a>
|
|
5796
|
+
|
|
5797
|
+
### mobile.android
|
|
5798
|
+
**Kind**: static class of [<code>mobile</code>](#mobile)
|
|
5799
|
+
|
|
5800
|
+
* [.android](#mobile.android)
|
|
5801
|
+
* [.pressKeyByName(keyName)](#mobile.android.pressKeyByName)
|
|
5802
|
+
* [.pressKeyByCode(keyCode)](#mobile.android.pressKeyByCode)
|
|
5803
|
+
|
|
5804
|
+
<a name="mobile.android.pressKeyByName"></a>
|
|
5805
|
+
|
|
5806
|
+
#### android.pressKeyByName(keyName)
|
|
5807
|
+
Simulate pressing a hardware key on the android device (e.g., back button, home button, etc.),
|
|
5808
|
+
|
|
5809
|
+
**Kind**: static method of [<code>android</code>](#mobile.android)
|
|
5810
|
+
|
|
5811
|
+
| Param | Type | Description |
|
|
5812
|
+
| --- | --- | --- |
|
|
5813
|
+
| keyName | <code>string</code> | The name of the key (e.g., "back", "home", "volumeUp", etc.) |
|
|
5814
|
+
|
|
5815
|
+
**Example**
|
|
5816
|
+
```js
|
|
5817
|
+
await mobile.device.pressKeyByName("back");
|
|
5818
|
+
```
|
|
5819
|
+
**Example**
|
|
5820
|
+
```js
|
|
5821
|
+
await mobile.device.pressKeyByName("home");
|
|
5822
|
+
```
|
|
5823
|
+
**Example**
|
|
5824
|
+
```js
|
|
5825
|
+
await mobile.device.pressKeyByName("volumeUp");
|
|
5826
|
+
```
|
|
5827
|
+
**Example**
|
|
5828
|
+
```js
|
|
5829
|
+
await mobile.device.pressKeyByName("volumeDown");
|
|
5830
|
+
```
|
|
5831
|
+
**Example**
|
|
5832
|
+
```js
|
|
5833
|
+
await mobile.device.pressKeyByName("volumeMute");
|
|
5834
|
+
```
|
|
5835
|
+
**Example**
|
|
5836
|
+
```js
|
|
5837
|
+
await mobile.device.pressKeyByName("power");
|
|
5838
|
+
```
|
|
5839
|
+
**Example**
|
|
5840
|
+
```js
|
|
5841
|
+
await mobile.device.pressKeyByName("enter");
|
|
5842
|
+
```
|
|
5843
|
+
**Example**
|
|
5844
|
+
```js
|
|
5845
|
+
await mobile.device.pressKeyByName("space");
|
|
5846
|
+
```
|
|
5847
|
+
**Example**
|
|
5848
|
+
```js
|
|
5849
|
+
await mobile.device.pressKeyByName("delete");
|
|
5850
|
+
```
|
|
5851
|
+
**Example**
|
|
5852
|
+
```js
|
|
5853
|
+
await mobile.device.pressKeyByName("menu");
|
|
5854
|
+
```
|
|
5855
|
+
**Example**
|
|
5856
|
+
```js
|
|
5857
|
+
await mobile.device.pressKeyByName("search");
|
|
5858
|
+
```
|
|
5859
|
+
**Example**
|
|
5860
|
+
```js
|
|
5861
|
+
await mobile.device.pressKeyByName("camera");
|
|
5862
|
+
```
|
|
5863
|
+
**Example**
|
|
5864
|
+
```js
|
|
5865
|
+
await mobile.device.pressKeyByName("focus");
|
|
5866
|
+
```
|
|
5867
|
+
**Example**
|
|
5868
|
+
```js
|
|
5869
|
+
await mobile.device.pressKeyByName("notification");
|
|
5870
|
+
```
|
|
5871
|
+
**Example**
|
|
5872
|
+
```js
|
|
5873
|
+
await mobile.device.pressKeyByName("call");
|
|
5874
|
+
```
|
|
5875
|
+
**Example**
|
|
5876
|
+
```js
|
|
5877
|
+
await mobile.device.pressKeyByName("calendar");
|
|
5878
|
+
```
|
|
5879
|
+
**Example**
|
|
5880
|
+
```js
|
|
5881
|
+
await mobile.device.pressKeyByName("recent");
|
|
5882
|
+
```
|
|
5883
|
+
**Example**
|
|
5884
|
+
```js
|
|
5885
|
+
await mobile.device.pressKeyByName("settings");
|
|
5886
|
+
```
|
|
5887
|
+
<a name="mobile.android.pressKeyByCode"></a>
|
|
5888
|
+
|
|
5889
|
+
#### android.pressKeyByCode(keyCode)
|
|
5890
|
+
Simulate pressing a hardware key on the android device (e.g., back button, home button, etc.),
|
|
5891
|
+
|
|
5892
|
+
**Kind**: static method of [<code>android</code>](#mobile.android)
|
|
5893
|
+
|
|
5894
|
+
| Param | Type | Description |
|
|
5895
|
+
| --- | --- | --- |
|
|
5896
|
+
| keyCode | <code>string</code> | The code of the key (e.g., 4 (back), 3 (home) , etc.) |
|
|
5897
|
+
|
|
5898
|
+
**Example**
|
|
5899
|
+
```js
|
|
5900
|
+
await mobile.android.pressKeyByCode(4);
|
|
5901
|
+
```
|
|
5902
|
+
<a name="mobile.device"></a>
|
|
5903
|
+
|
|
5904
|
+
### mobile.device
|
|
5905
|
+
**Kind**: static class of [<code>mobile</code>](#mobile)
|
|
5906
|
+
|
|
5907
|
+
* [.device](#mobile.device)
|
|
5908
|
+
* [.isAppInstalled(packageIdorBundleId)](#mobile.device.isAppInstalled) ⇒ <code>boolean</code>
|
|
5909
|
+
* [.installApp(appPath)](#mobile.device.installApp)
|
|
5910
|
+
|
|
5911
|
+
<a name="mobile.device.isAppInstalled"></a>
|
|
5912
|
+
|
|
5913
|
+
#### device.isAppInstalled(packageIdorBundleId) ⇒ <code>boolean</code>
|
|
5914
|
+
Check wether given package/bundle app is installed or not in the device.
|
|
5915
|
+
|
|
5916
|
+
**Kind**: static method of [<code>device</code>](#mobile.device)
|
|
5917
|
+
**Returns**: <code>boolean</code> - Returns true if specified app package/bundled installed in the device, or false.
|
|
5918
|
+
|
|
5919
|
+
| Param | Type | Description |
|
|
5920
|
+
| --- | --- | --- |
|
|
5921
|
+
| packageIdorBundleId | <code>string</code> | Android package Id, or iOS bundle Id. |
|
|
5922
|
+
|
|
5923
|
+
**Example**
|
|
5924
|
+
```js
|
|
5925
|
+
await mobile.device.isAppInstalled("com.google.android.apps.maps");
|
|
5926
|
+
```
|
|
5927
|
+
<a name="mobile.device.installApp"></a>
|
|
5928
|
+
|
|
5929
|
+
#### device.installApp(appPath)
|
|
5930
|
+
Install the appropriate app based on the platform the test is being executed on.
|
|
5931
|
+
|
|
5932
|
+
**Kind**: static method of [<code>device</code>](#mobile.device)
|
|
5933
|
+
|
|
5934
|
+
| Param | Type | Description |
|
|
5935
|
+
| --- | --- | --- |
|
|
5936
|
+
| appPath | <code>string</code> | Path of the app(.apk, .ipa) |
|
|
5937
|
+
|
|
5938
|
+
**Example**
|
|
5939
|
+
```js
|
|
5940
|
+
await mobile.device.installApp("/path/to/your/app.apk");
|
|
5941
|
+
await mobile.device.installApp("/path/to/your/app.ipa");
|
|
5942
|
+
```
|
|
5943
|
+
<a name="mobile.element"></a>
|
|
5944
|
+
|
|
5945
|
+
### mobile.element
|
|
5946
|
+
**Kind**: static class of [<code>mobile</code>](#mobile)
|
|
5947
|
+
|
|
5948
|
+
* [.element](#mobile.element)
|
|
5949
|
+
* [.isVisible(element, [strict])](#mobile.element.isVisible) ⇒ <code>Boolean</code>
|
|
5950
|
+
* [.isPresent(elem)](#mobile.element.isPresent) ⇒ <code>Boolean</code>
|
|
5951
|
+
* [.waitToBePresent(selector, [timeout])](#mobile.element.waitToBePresent)
|
|
5952
|
+
* [.waitToBeVisible(selector, [timeout])](#mobile.element.waitToBeVisible)
|
|
5953
|
+
* [.waitToBeClickable(selector, [timeout])](#mobile.element.waitToBeClickable)
|
|
5954
|
+
* [.isSelected(elem)](#mobile.element.isSelected) ⇒ <code>boolean</code>
|
|
5955
|
+
|
|
5956
|
+
<a name="mobile.element.isVisible"></a>
|
|
5957
|
+
|
|
5958
|
+
#### element.isVisible(element, [strict]) ⇒ <code>Boolean</code>
|
|
5959
|
+
Returns a boolean if the mobile element is visible to the user.
|
|
5960
|
+
|
|
5961
|
+
**Kind**: static method of [<code>element</code>](#mobile.element)
|
|
5962
|
+
**Returns**: <code>Boolean</code> - Returns true or false.
|
|
5963
|
+
|
|
5964
|
+
| Param | Type | Default | Description |
|
|
5965
|
+
| --- | --- | --- | --- |
|
|
5966
|
+
| element | <code>Object</code> | | The Mobile Ui element. |
|
|
5967
|
+
| [strict] | <code>Boolean</code> | <code>true</code> | If strict mode is enabled it will only return "true" if the element is visible on the mobile view and within the viewport. If "false", it will be sufficient if the element is visible on the view but not inside the current viewport. |
|
|
5968
|
+
|
|
5969
|
+
**Example**
|
|
5970
|
+
```js
|
|
5971
|
+
const elem = await mobile.element.isVisible("button01");
|
|
5972
|
+
await mobile.element.isVisible(elem);
|
|
5973
|
+
```
|
|
5974
|
+
<a name="mobile.element.isPresent"></a>
|
|
5975
|
+
|
|
5976
|
+
#### element.isPresent(elem) ⇒ <code>Boolean</code>
|
|
5977
|
+
Returns a boolean if the element is present at the DOM or not. It might be hidden.
|
|
5978
|
+
|
|
5979
|
+
**Kind**: static method of [<code>element</code>](#mobile.element)
|
|
5980
|
+
**Returns**: <code>Boolean</code> - Returns true or false.
|
|
5981
|
+
|
|
5982
|
+
| Param | Type | Description |
|
|
5983
|
+
| --- | --- | --- |
|
|
5984
|
+
| elem | <code>Object</code> | The element. |
|
|
5985
|
+
|
|
5986
|
+
**Example**
|
|
5987
|
+
```js
|
|
5988
|
+
await mobile.element.isPresent(elem);
|
|
5989
|
+
```
|
|
5990
|
+
<a name="mobile.element.waitToBePresent"></a>
|
|
5991
|
+
|
|
5992
|
+
#### element.waitToBePresent(selector, [timeout])
|
|
5993
|
+
Waits until the element with the given selector is present.
|
|
5994
|
+
|
|
5995
|
+
**Kind**: static method of [<code>element</code>](#mobile.element)
|
|
5996
|
+
|
|
5997
|
+
| Param | Type | Default | Description |
|
|
5998
|
+
| --- | --- | --- | --- |
|
|
5999
|
+
| selector | <code>Object</code> | | The CSS selector describing the element. |
|
|
6000
|
+
| [timeout] | <code>Number</code> | <code>30000</code> | The timeout to wait (ms). |
|
|
6001
|
+
|
|
6002
|
+
**Example**
|
|
6003
|
+
```js
|
|
6004
|
+
await mobile.element.waitToBePresent(".input01");
|
|
6005
|
+
```
|
|
6006
|
+
**Example**
|
|
6007
|
+
```js
|
|
6008
|
+
await mobile.element.waitToBePresent("#button12");
|
|
6009
|
+
```
|
|
6010
|
+
**Example**
|
|
6011
|
+
```js
|
|
6012
|
+
await mobile.element.waitToBePresent("p:first-child");
|
|
6013
|
+
```
|
|
6014
|
+
<a name="mobile.element.waitToBeVisible"></a>
|
|
6015
|
+
|
|
6016
|
+
#### element.waitToBeVisible(selector, [timeout])
|
|
6017
|
+
Waits until the element with the given selector is visible.
|
|
6018
|
+
|
|
6019
|
+
**Kind**: static method of [<code>element</code>](#mobile.element)
|
|
6020
|
+
|
|
6021
|
+
| Param | Type | Default | Description |
|
|
6022
|
+
| --- | --- | --- | --- |
|
|
6023
|
+
| selector | <code>Object</code> | | The CSS selector describing the element. |
|
|
6024
|
+
| [timeout] | <code>Number</code> | <code>30000</code> | The timeout to wait (ms). |
|
|
6025
|
+
|
|
6026
|
+
**Example**
|
|
6027
|
+
```js
|
|
6028
|
+
await mobile.element.waitToBeVisible(".input01");
|
|
6029
|
+
```
|
|
6030
|
+
**Example**
|
|
6031
|
+
```js
|
|
6032
|
+
await mobile.element.waitToBeVisible("#button12");
|
|
6033
|
+
```
|
|
6034
|
+
**Example**
|
|
6035
|
+
```js
|
|
6036
|
+
await mobile.element.waitToBeVisible("p:first-child");
|
|
6037
|
+
```
|
|
6038
|
+
<a name="mobile.element.waitToBeClickable"></a>
|
|
6039
|
+
|
|
6040
|
+
#### element.waitToBeClickable(selector, [timeout])
|
|
6041
|
+
Waits until the element with the given selector is clickable.
|
|
6042
|
+
|
|
6043
|
+
**Kind**: static method of [<code>element</code>](#mobile.element)
|
|
6044
|
+
|
|
6045
|
+
| Param | Type | Default | Description |
|
|
6046
|
+
| --- | --- | --- | --- |
|
|
6047
|
+
| selector | <code>Object</code> | | The CSS selector describing the element. |
|
|
6048
|
+
| [timeout] | <code>Number</code> | <code>30000</code> | The timeout to wait (ms). |
|
|
6049
|
+
|
|
6050
|
+
**Example**
|
|
6051
|
+
```js
|
|
6052
|
+
await mobile.element.waitToBeClickable(".input01");
|
|
6053
|
+
```
|
|
6054
|
+
**Example**
|
|
6055
|
+
```js
|
|
6056
|
+
await mobile.element.waitToBeClickable("#button12");
|
|
6057
|
+
```
|
|
6058
|
+
**Example**
|
|
6059
|
+
```js
|
|
6060
|
+
await mobile.element.waitToBeClickable("p:first-child");
|
|
6061
|
+
```
|
|
6062
|
+
<a name="mobile.element.isSelected"></a>
|
|
6063
|
+
|
|
6064
|
+
#### element.isSelected(elem) ⇒ <code>boolean</code>
|
|
6065
|
+
Returns a boolean if the element (e.g. checkbox) is selected.
|
|
6066
|
+
|
|
6067
|
+
**Kind**: static method of [<code>element</code>](#mobile.element)
|
|
6068
|
+
|
|
6069
|
+
| Param | Type | Description |
|
|
6070
|
+
| --- | --- | --- |
|
|
6071
|
+
| elem | <code>Object</code> | The element. |
|
|
6072
|
+
|
|
6073
|
+
**Example**
|
|
6074
|
+
```js
|
|
6075
|
+
const elem = await mobile.element.getById("elem01");
|
|
6076
|
+
const isSelected = await mobile.element.isSelected(elem);
|
|
6077
|
+
```
|
|
6078
|
+
<a name="mobile.gestures"></a>
|
|
6079
|
+
|
|
6080
|
+
### mobile.gestures
|
|
6081
|
+
**Kind**: static class of [<code>mobile</code>](#mobile)
|
|
6082
|
+
<a name="mobile.gestures.waitToBeClickable"></a>
|
|
6083
|
+
|
|
6084
|
+
#### gestures.waitToBeClickable(startX, startY, endX, endY, duration) ⇒ <code>Promise.<void></code>
|
|
6085
|
+
Swipe from one point to another on the screen.
|
|
6086
|
+
|
|
6087
|
+
**Kind**: static method of [<code>gestures</code>](#mobile.gestures)
|
|
6088
|
+
|
|
6089
|
+
| Param | Type | Description |
|
|
6090
|
+
| --- | --- | --- |
|
|
6091
|
+
| startX | <code>number</code> | The starting X coordinate of the swipe |
|
|
6092
|
+
| startY | <code>number</code> | The starting Y coordinate of the swipe |
|
|
6093
|
+
| endX | <code>number</code> | The ending X coordinate of the swipe |
|
|
6094
|
+
| endY | <code>number</code> | The ending Y coordinate of the swipe |
|
|
6095
|
+
| duration | <code>number</code> | The duration of the swipe in milliseconds (optional, default is 1000ms) |
|
|
6096
|
+
|
|
6097
|
+
<a name="mobile.ios"></a>
|
|
6098
|
+
|
|
6099
|
+
### mobile.ios
|
|
6100
|
+
**Kind**: static class of [<code>mobile</code>](#mobile)
|
|
6101
|
+
<a name="mobile.userInteraction"></a>
|
|
6102
|
+
|
|
6103
|
+
### mobile.userInteraction
|
|
6104
|
+
**Kind**: static class of [<code>mobile</code>](#mobile)
|
|
6105
|
+
|
|
6106
|
+
* [.userInteraction](#mobile.userInteraction)
|
|
6107
|
+
* [.tap(element, [timeout])](#mobile.userInteraction.tap)
|
|
6108
|
+
* [.check(element)](#mobile.userInteraction.check)
|
|
6109
|
+
|
|
6110
|
+
<a name="mobile.userInteraction.tap"></a>
|
|
6111
|
+
|
|
6112
|
+
#### userInteraction.tap(element, [timeout])
|
|
6113
|
+
Tap's on the mobile element.
|
|
6114
|
+
|
|
6115
|
+
**Kind**: static method of [<code>userInteraction</code>](#mobile.userInteraction)
|
|
6116
|
+
|
|
6117
|
+
| Param | Type | Default | Description |
|
|
6118
|
+
| --- | --- | --- | --- |
|
|
6119
|
+
| element | <code>Element</code> \| <code>string</code> | | The element or CSS selector describing the element. |
|
|
6120
|
+
| [timeout] | <code>Number</code> | <code>30000</code> | The timeout to wait (ms). |
|
|
6121
|
+
|
|
6122
|
+
**Example**
|
|
6123
|
+
```js
|
|
6124
|
+
const elem = await mobile.userInteraction.tap(elem);
|
|
6125
|
+
```
|
|
6126
|
+
<a name="mobile.userInteraction.check"></a>
|
|
6127
|
+
|
|
6128
|
+
#### userInteraction.check(element)
|
|
6129
|
+
Checks the given checkbox.
|
|
6130
|
+
|
|
6131
|
+
**Kind**: static method of [<code>userInteraction</code>](#mobile.userInteraction)
|
|
6132
|
+
|
|
6133
|
+
| Param | Type | Description |
|
|
6134
|
+
| --- | --- | --- |
|
|
6135
|
+
| element | <code>Element</code> | The element or CSS selector describing the element. |
|
|
6136
|
+
|
|
6137
|
+
**Example**
|
|
6138
|
+
```js
|
|
6139
|
+
await mobile.userInteraction.check(selector);
|
|
6140
|
+
```
|
package/lib/index.js
CHANGED
|
@@ -9,6 +9,7 @@ const before_1 = __importDefault(require("./scripts/hooks/before"));
|
|
|
9
9
|
const onPrepare_1 = __importDefault(require("./scripts/hooks/onPrepare"));
|
|
10
10
|
const onComplete_1 = __importDefault(require("./scripts/hooks/onComplete"));
|
|
11
11
|
const after_1 = __importDefault(require("./scripts/hooks/after"));
|
|
12
|
+
const isBrowserDefined_1 = require("./scripts/hooks/utils/isBrowserDefined");
|
|
12
13
|
const pj = require("../package.json");
|
|
13
14
|
module.exports = class CustomWorkerService {
|
|
14
15
|
/**
|
|
@@ -57,9 +58,11 @@ module.exports = class CustomWorkerService {
|
|
|
57
58
|
// @ts-ignore
|
|
58
59
|
async beforeSession(config, capabilities, specs) {
|
|
59
60
|
try {
|
|
60
|
-
|
|
61
|
+
if ((0, isBrowserDefined_1.isBrowserDefined)()) {
|
|
62
|
+
browser.config = config;
|
|
63
|
+
}
|
|
61
64
|
await (0, beforeSession_1.default)(config, capabilities, specs);
|
|
62
|
-
this.config =
|
|
65
|
+
this.config = config;
|
|
63
66
|
}
|
|
64
67
|
catch (e) {
|
|
65
68
|
if (specs && specs[0]) {
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,YAAY,CAAC;;;;;AAEb,kFAA+D;AAC/D,oEAAiD;AACjD,0EAAsD;AACtD,4EAAwD;AACxD,kEAA8C;AAC9C,MAAM,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEtC,MAAM,CAAC,OAAO,GAAG,MAAM,mBAAmB;IAExC;;;;;;;;;OASG;IACH,aAAa;IACb,YAAY,cAAc,EAAE,YAAY,EAAE,MAAM;QAC9C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,aAAa;IACb,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,YAAY;QAClC,MAAM,IAAI,GAAG;;;;;4BAKW,EAAE,CAAC,OAAO;OAC/B,CAAC;QACJ,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,IAAI,CAAC;YACH,MAAM,IAAA,mBAAa,EAAC,MAAM,EAAE,YAAY,CAAC,CAAC;QAC5C,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,EAAE,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED;;;;;;OAMG;IACH,aAAa;IACb,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK;QAC7C,IAAI,CAAC;YACH,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"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ement =
|
|
3
|
+
exports.resolveCssSelectorOrElement = resolveCssSelectorOrElement;
|
|
4
4
|
async function resolveCssSelectorOrElement(elementOrSelector) {
|
|
5
5
|
if (!elementOrSelector) {
|
|
6
6
|
throw new Error("Please provide an element or a CSS selector as first argument.");
|
|
@@ -12,5 +12,4 @@ async function resolveCssSelectorOrElement(elementOrSelector) {
|
|
|
12
12
|
return elementOrSelector;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
exports.resolveCssSelectorOrElement = resolveCssSelectorOrElement;
|
|
16
15
|
//# sourceMappingURL=elementResolving.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elementResolving.js","sourceRoot":"","sources":["../../../src/reuse/helper/elementResolving.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"elementResolving.js","sourceRoot":"","sources":["../../../src/reuse/helper/elementResolving.ts"],"names":[],"mappings":";;AAEA,kEAUC;AAVM,KAAK,UAAU,2BAA2B,CAAC,iBAAmC;IACnF,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;IACpF,CAAC;IAED,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE,CAAC;QAC1C,OAAO,MAAM,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IAC1D,CAAC;SAAM,CAAC;QACN,OAAO,iBAAiB,CAAC;IAC3B,CAAC;AACH,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateValue =
|
|
3
|
+
exports.validateValue = validateValue;
|
|
4
4
|
function validateValue(value) {
|
|
5
5
|
if (typeof value !== "string" && typeof value !== "number") {
|
|
6
6
|
throw new Error("value is invalid. It must be of type 'string' or 'number'");
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
exports.validateValue = validateValue;
|
|
10
9
|
//# sourceMappingURL=inputValidation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputValidation.js","sourceRoot":"","sources":["../../../src/reuse/helper/inputValidation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inputValidation.js","sourceRoot":"","sources":["../../../src/reuse/helper/inputValidation.ts"],"names":[],"mappings":";;AAAA,sCAIC;AAJD,SAAgB,aAAa,CAAC,KAAU;IACtC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC3D,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAC/E,CAAC;AACH,CAAC"}
|
package/lib/reuse/index.js
CHANGED
|
@@ -11,6 +11,7 @@ const Common_1 = __importDefault(require("./modules/common/Common"));
|
|
|
11
11
|
const Ui5_1 = __importDefault(require("./modules/ui5/Ui5"));
|
|
12
12
|
const NonUi5_1 = __importDefault(require("./modules/nonUi5/NonUi5"));
|
|
13
13
|
const Service_1 = __importDefault(require("./modules/service/Service"));
|
|
14
|
+
const Mobile_1 = __importDefault(require("./modules/mobile/Mobile"));
|
|
14
15
|
// data
|
|
15
16
|
const authenticators_json_1 = __importDefault(require("./data/authenticators.json"));
|
|
16
17
|
class ReuseLibrary {
|
|
@@ -44,7 +45,8 @@ class ReuseLibrary {
|
|
|
44
45
|
formatter: Util_1.default.formatter,
|
|
45
46
|
function: Util_1.default.function,
|
|
46
47
|
system: Util_1.default.system,
|
|
47
|
-
component: Util_1.default.component
|
|
48
|
+
component: Util_1.default.component,
|
|
49
|
+
userSettings: Util_1.default.userSettings
|
|
48
50
|
};
|
|
49
51
|
global.util = {
|
|
50
52
|
...util,
|
|
@@ -103,6 +105,22 @@ class ReuseLibrary {
|
|
|
103
105
|
...service,
|
|
104
106
|
...global.service
|
|
105
107
|
};
|
|
108
|
+
/**
|
|
109
|
+
* @global
|
|
110
|
+
* @description Global namespace for mobile modules.
|
|
111
|
+
*/
|
|
112
|
+
const mobile = {
|
|
113
|
+
element: Mobile_1.default.element,
|
|
114
|
+
userInteraction: Mobile_1.default.userInteraction,
|
|
115
|
+
gestures: Mobile_1.default.gestures,
|
|
116
|
+
device: Mobile_1.default.device,
|
|
117
|
+
android: Mobile_1.default.android,
|
|
118
|
+
ios: Mobile_1.default.ios
|
|
119
|
+
};
|
|
120
|
+
global.mobile = {
|
|
121
|
+
...mobile,
|
|
122
|
+
...global.mobile
|
|
123
|
+
};
|
|
106
124
|
}
|
|
107
125
|
}
|
|
108
126
|
exports.default = new ReuseLibrary();
|
package/lib/reuse/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/reuse/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAEb,YAAY;AACZ,4CAAsC;AAEtC,UAAU;AACV,+DAA4C;AAC5C,qEAAkD;AAClD,4DAAyC;AACzC,qEAAkD;AAClD,wEAAqD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/reuse/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAEb,YAAY;AACZ,4CAAsC;AAEtC,UAAU;AACV,+DAA4C;AAC5C,qEAAkD;AAClD,4DAAyC;AACzC,qEAAkD;AAClD,wEAAqD;AACrD,qEAAkD;AAElD,OAAO;AACP,qFAAwD;AAIxD,MAAM,YAAY;IAChB,IAAI;QACF,mBAAmB;QACnB,aAAa;QACb,MAAM,CAAC,GAAG,GAAG,YAAG,CAAC;QAEjB;;;WAGG;QACH,MAAM,MAAM,GAAG;YACb,SAAS,EAAE,gBAAW,CAAC,SAAS;YAChC,IAAI,EAAE,gBAAW,CAAC,IAAI;YACtB,UAAU,EAAE,gBAAW,CAAC,UAAU;YAClC,eAAe,EAAE,gBAAW,CAAC,eAAe;SAC7C,CAAC;QACF,MAAM,CAAC,MAAM,GAAG;YACd,GAAG,MAAM;YACT,GAAG,M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AG;YACb,SAAS,EAAE,gBAAW,CAAC,SAAS;YAChC,OAAO,EAAE,gBAAW,CAAC,OAAO;YAC5B,UAAU,EAAE,gBAAW,CAAC,UAAU;YAClC,eAAe,EAAE,gBAAW,CAAC,eAAe;YAC5C,OAAO,EAAE,gBAAW,CAAC,OAAO;SAC7B,CAAC;QACF,MAAM,CAAC,MAAM,GAAG;YACd,GAAG,MAAM;YACT,GAAG,MAAM,CAAC,MAAM;SACjB,CAAC;QAEF;;;WAGG;QACH,MAAM,OAAO,GAAG;YACd,KAAK,EAAE,iBAAY,CAAC,KAAK;YACzB,IAAI,EAAE,iBAAY,CAAC,IAAI;SACxB,CAAC;QACF,MAAM,CAAC,OAAO,GAAG;YACf,GAAG,OAAO;YACV,GAAG,MAAM,CAAC,OAAO;SAClB,CAAC;QAEF;;;WAGG;QACH,MAAM,MAAM,GAAG;YACb,OAAO,EAAE,gBAAW,CAAC,OAAO;YAC5B,eAAe,EAAE,gBAAW,CAAC,eAAe;YAC5C,QAAQ,EAAE,gBAAW,CAAC,QAAQ;YAC9B,MAAM,EAAE,gBAAW,CAAC,MAAM;YAC1B,OAAO,EAAE,gBAAW,CAAC,OAAO;YAC5B,GAAG,EAAE,gBAAW,CAAC,GAAG;SACrB,CAAC;QACF,MAAM,CAAC,MAAM,GAAG;YACd,GAAG,MAAM;YACT,GAAG,MAAM,CAAC,MAAM;SACjB,CAAC;IACJ,CAAC;CACF;AAED,kBAAe,IAAI,YAAY,EAAE,CAAC"}
|
|
@@ -76,7 +76,7 @@ export declare class DateModule {
|
|
|
76
76
|
* @description Calculates the date based on the input parameter and returns it in the given format.
|
|
77
77
|
* @param {String} [date="today"] - Supported values: today, tomorrow, nextMonth, previousMonth, nextYear, previousYear
|
|
78
78
|
* @param {String} [format="object"] - The expected format ("mm/dd/yyyy", "dd.mm.yyyy", "dd/mm/yyyy", "yyyymmdd", "yyyy/mm/dd", "mmm dd, yyyy", "mmm d, yyyy", "datetime", "object").
|
|
79
|
-
* @returns {String} The calculated date in the given format.
|
|
79
|
+
* @returns {String | Date} The calculated date in the given format.
|
|
80
80
|
* @example const date = await common.date.calculate("today", "mm/dd/yyyy");
|
|
81
81
|
*/
|
|
82
82
|
calculate(date?: CalculateDatesType, format?: DateFormatsType): Date | string;
|
|
@@ -21,7 +21,7 @@ class DateModule {
|
|
|
21
21
|
* @returns {String} The date in the given format.
|
|
22
22
|
* @example const date = await common.date.getToday("mm/dd/yyyy");
|
|
23
23
|
*/
|
|
24
|
-
getToday(format = formatter_constants_1.DateFormats.OBJECT) {
|
|
24
|
+
getToday(format = process.env.USER_SETTINGS_DATE_FORMAT ? process.env.USER_SETTINGS_DATE_FORMAT : formatter_constants_1.DateFormats.OBJECT) {
|
|
25
25
|
const vl = this.vlf.initLog(this.getToday);
|
|
26
26
|
const date = new Date();
|
|
27
27
|
vl.log(date.toISOString());
|
|
@@ -35,7 +35,7 @@ class DateModule {
|
|
|
35
35
|
* @returns {String} The date in the given format.
|
|
36
36
|
* @example const date = await common.date.getTomorrow("mm/dd/yyyy");
|
|
37
37
|
*/
|
|
38
|
-
getTomorrow(format = formatter_constants_1.DateFormats.OBJECT) {
|
|
38
|
+
getTomorrow(format = process.env.USER_SETTINGS_DATE_FORMAT ? process.env.USER_SETTINGS_DATE_FORMAT : formatter_constants_1.DateFormats.OBJECT) {
|
|
39
39
|
const vl = this.vlf.initLog(this.getTomorrow);
|
|
40
40
|
const date = new Date();
|
|
41
41
|
date.setDate(date.getDate() + 1);
|
|
@@ -50,7 +50,7 @@ class DateModule {
|
|
|
50
50
|
* @returns {String} The date in the given format.
|
|
51
51
|
* @example const date = await common.date.getNextMonth("mm/dd/yyyy");
|
|
52
52
|
*/
|
|
53
|
-
getNextMonth(format = formatter_constants_1.DateFormats.OBJECT) {
|
|
53
|
+
getNextMonth(format = process.env.USER_SETTINGS_DATE_FORMAT ? process.env.USER_SETTINGS_DATE_FORMAT : formatter_constants_1.DateFormats.OBJECT) {
|
|
54
54
|
const vl = this.vlf.initLog(this.getTomorrow);
|
|
55
55
|
const date = new Date();
|
|
56
56
|
date.setMonth(date.getMonth() + 1);
|
|
@@ -65,7 +65,7 @@ class DateModule {
|
|
|
65
65
|
* @returns {String} The date in the given format.
|
|
66
66
|
* @example const date = await common.date.getPreviousMonth("mm/dd/yyyy");
|
|
67
67
|
*/
|
|
68
|
-
getPreviousMonth(format = formatter_constants_1.DateFormats.OBJECT) {
|
|
68
|
+
getPreviousMonth(format = process.env.USER_SETTINGS_DATE_FORMAT ? process.env.USER_SETTINGS_DATE_FORMAT : formatter_constants_1.DateFormats.OBJECT) {
|
|
69
69
|
const vl = this.vlf.initLog(this.getPreviousMonth);
|
|
70
70
|
const date = new Date();
|
|
71
71
|
date.setMonth(date.getMonth() - 1);
|
|
@@ -80,7 +80,7 @@ class DateModule {
|
|
|
80
80
|
* @returns {String} The date in the given format.
|
|
81
81
|
* @example const date = await common.date.getNextYear("mm/dd/yyyy");
|
|
82
82
|
*/
|
|
83
|
-
getNextYear(format = formatter_constants_1.DateFormats.OBJECT) {
|
|
83
|
+
getNextYear(format = process.env.USER_SETTINGS_DATE_FORMAT ? process.env.USER_SETTINGS_DATE_FORMAT : formatter_constants_1.DateFormats.OBJECT) {
|
|
84
84
|
const vl = this.vlf.initLog(this.getNextYear);
|
|
85
85
|
const date = new Date();
|
|
86
86
|
date.setFullYear(date.getFullYear() + 1);
|
|
@@ -95,7 +95,7 @@ class DateModule {
|
|
|
95
95
|
* @returns {String} The date in the given format.
|
|
96
96
|
* @example const date = await common.date.getPreviousYear("mm/dd/yyyy");
|
|
97
97
|
*/
|
|
98
|
-
getPreviousYear(format = formatter_constants_1.DateFormats.OBJECT) {
|
|
98
|
+
getPreviousYear(format = process.env.USER_SETTINGS_DATE_FORMAT ? process.env.USER_SETTINGS_DATE_FORMAT : formatter_constants_1.DateFormats.OBJECT) {
|
|
99
99
|
const vl = this.vlf.initLog(this.getPreviousYear);
|
|
100
100
|
const date = new Date();
|
|
101
101
|
date.setFullYear(date.getFullYear() - 1);
|
|
@@ -111,7 +111,7 @@ class DateModule {
|
|
|
111
111
|
* @returns {String} The date in the given format.
|
|
112
112
|
* @example const date = await common.date.getSpecific("2020, 0, 17", "mm/dd/yyyy");
|
|
113
113
|
*/
|
|
114
|
-
getSpecific(date, format = formatter_constants_1.DateFormats.OBJECT) {
|
|
114
|
+
getSpecific(date, format = process.env.USER_SETTINGS_DATE_FORMAT ? process.env.USER_SETTINGS_DATE_FORMAT : formatter_constants_1.DateFormats.OBJECT) {
|
|
115
115
|
const vl = this.vlf.initLog(this.getSpecific);
|
|
116
116
|
if (!date) {
|
|
117
117
|
throw new Error("Function 'getSpecific' failed: Please provide a date string ('2020, 0, 17') as first argument.");
|
|
@@ -127,10 +127,10 @@ class DateModule {
|
|
|
127
127
|
* @description Calculates the date based on the input parameter and returns it in the given format.
|
|
128
128
|
* @param {String} [date="today"] - Supported values: today, tomorrow, nextMonth, previousMonth, nextYear, previousYear
|
|
129
129
|
* @param {String} [format="object"] - The expected format ("mm/dd/yyyy", "dd.mm.yyyy", "dd/mm/yyyy", "yyyymmdd", "yyyy/mm/dd", "mmm dd, yyyy", "mmm d, yyyy", "datetime", "object").
|
|
130
|
-
* @returns {String} The calculated date in the given format.
|
|
130
|
+
* @returns {String | Date} The calculated date in the given format.
|
|
131
131
|
* @example const date = await common.date.calculate("today", "mm/dd/yyyy");
|
|
132
132
|
*/
|
|
133
|
-
calculate(date = date_constants_1.CalculateDates.TODAY, format = formatter_constants_1.DateFormats.OBJECT) {
|
|
133
|
+
calculate(date = date_constants_1.CalculateDates.TODAY, format = process.env.USER_SETTINGS_DATE_FORMAT ? process.env.USER_SETTINGS_DATE_FORMAT : formatter_constants_1.DateFormats.OBJECT) {
|
|
134
134
|
const vl = this.vlf.initLog(this.calculate);
|
|
135
135
|
if (date === null) {
|
|
136
136
|
date = date_constants_1.CalculateDates.TODAY;
|