oxygen-cli 1.27.2 → 1.27.4
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/build/ox_modules/module-mob/commands/alertAccept.js +8 -3
- package/build/ox_modules/module-mob/commands/alertDismiss.js +8 -3
- package/build/ox_modules/module-mob/commands/assertAlert.js +8 -3
- package/build/ox_modules/module-mob/commands/assertText.js +8 -3
- package/build/ox_modules/module-mob/commands/assertTitle.js +8 -3
- package/build/ox_modules/module-mob/commands/assertValue.js +8 -3
- package/build/ox_modules/module-mob/commands/back.js +8 -3
- package/build/ox_modules/module-mob/commands/clear.js +8 -3
- package/build/ox_modules/module-mob/commands/click.js +8 -3
- package/build/ox_modules/module-mob/commands/clickHidden.js +8 -3
- package/build/ox_modules/module-mob/commands/clickLong.js +8 -3
- package/build/ox_modules/module-mob/commands/clickMultipleTimes.js +8 -3
- package/build/ox_modules/module-mob/commands/closeApp.js +8 -3
- package/build/ox_modules/module-mob/commands/debug.js +8 -3
- package/build/ox_modules/module-mob/commands/dragAndDrop.js +8 -3
- package/build/ox_modules/module-mob/commands/enableNetwork.js +8 -3
- package/build/ox_modules/module-mob/commands/execute.js +8 -3
- package/build/ox_modules/module-mob/commands/findElement.js +8 -3
- package/build/ox_modules/module-mob/commands/findElements.js +8 -3
- package/build/ox_modules/module-mob/commands/getAlertText.js +8 -3
- package/build/ox_modules/module-mob/commands/getAppiumLogs.js +8 -3
- package/build/ox_modules/module-mob/commands/getBrowserLogs.js +8 -3
- package/build/ox_modules/module-mob/commands/getCurrentActivity.js +8 -3
- package/build/ox_modules/module-mob/commands/getCurrentPackage.js +8 -3
- package/build/ox_modules/module-mob/commands/getDeviceLogs.js +8 -3
- package/build/ox_modules/module-mob/commands/getDeviceTime.js +8 -3
- package/build/ox_modules/module-mob/commands/getLocation.js +8 -3
- package/build/ox_modules/module-mob/commands/getSource.js +8 -3
- package/build/ox_modules/module-mob/commands/getText.js +8 -3
- package/build/ox_modules/module-mob/commands/getTitle.js +8 -3
- package/build/ox_modules/module-mob/commands/getUrl.js +8 -3
- package/build/ox_modules/module-mob/commands/getValue.js +8 -3
- package/build/ox_modules/module-mob/commands/getWindowHandles.js +8 -3
- package/build/ox_modules/module-mob/commands/hideKeyboard.js +8 -3
- package/build/ox_modules/module-mob/commands/index.js +949 -586
- package/build/ox_modules/module-mob/commands/installApp.js +8 -3
- package/build/ox_modules/module-mob/commands/isAppInstalled.js +8 -3
- package/build/ox_modules/module-mob/commands/isCheckable.js +8 -3
- package/build/ox_modules/module-mob/commands/isChecked.js +8 -3
- package/build/ox_modules/module-mob/commands/isClickable.js +8 -3
- package/build/ox_modules/module-mob/commands/isExist.js +8 -3
- package/build/ox_modules/module-mob/commands/isSelected.js +8 -3
- package/build/ox_modules/module-mob/commands/isVisible.js +8 -3
- package/build/ox_modules/module-mob/commands/isWebViewContext.js +8 -3
- package/build/ox_modules/module-mob/commands/launchApp.js +8 -3
- package/build/ox_modules/module-mob/commands/longPressKeyCode.js +8 -3
- package/build/ox_modules/module-mob/commands/open.js +8 -3
- package/build/ox_modules/module-mob/commands/pause.js +8 -3
- package/build/ox_modules/module-mob/commands/removeApp.js +8 -3
- package/build/ox_modules/module-mob/commands/resetApp.js +8 -3
- package/build/ox_modules/module-mob/commands/scrollIntoElement.js +8 -3
- package/build/ox_modules/module-mob/commands/scrollIntoView.js +8 -3
- package/build/ox_modules/module-mob/commands/select.js +8 -3
- package/build/ox_modules/module-mob/commands/selectFrame.js +8 -3
- package/build/ox_modules/module-mob/commands/selectWindow.js +8 -3
- package/build/ox_modules/module-mob/commands/sendKeys.js +8 -3
- package/build/ox_modules/module-mob/commands/setContext.js +8 -3
- package/build/ox_modules/module-mob/commands/setNativeContext.js +8 -3
- package/build/ox_modules/module-mob/commands/setTimeout.js +8 -3
- package/build/ox_modules/module-mob/commands/setWebViewContext.js +8 -3
- package/build/ox_modules/module-mob/commands/shake.js +8 -3
- package/build/ox_modules/module-mob/commands/smsClickLink.js +8 -3
- package/build/ox_modules/module-mob/commands/smsGetText.js +8 -3
- package/build/ox_modules/module-mob/commands/swipe.js +8 -3
- package/build/ox_modules/module-mob/commands/swipeElement.js +8 -3
- package/build/ox_modules/module-mob/commands/swipeScreen.js +12 -7
- package/build/ox_modules/module-mob/commands/takeScreenshot.js +8 -3
- package/build/ox_modules/module-mob/commands/tap.js +8 -3
- package/build/ox_modules/module-mob/commands/type.js +8 -3
- package/build/ox_modules/module-mob/commands/unlockPattern.js +8 -3
- package/build/ox_modules/module-mob/commands/waitForExist.js +8 -3
- package/build/ox_modules/module-mob/commands/waitForInteractable.js +8 -3
- package/build/ox_modules/module-mob/commands/waitForVisible.js +8 -3
- package/build/ox_modules/module-web/commands/alertAccept.js +8 -3
- package/build/ox_modules/module-web/commands/alertDismiss.js +8 -3
- package/build/ox_modules/module-web/commands/assertAlert.js +8 -3
- package/build/ox_modules/module-web/commands/assertExist.js +8 -3
- package/build/ox_modules/module-web/commands/assertSelectedLabel.js +8 -3
- package/build/ox_modules/module-web/commands/assertSelectedValue.js +8 -3
- package/build/ox_modules/module-web/commands/assertText.js +8 -3
- package/build/ox_modules/module-web/commands/assertTextNotPresent.js +8 -3
- package/build/ox_modules/module-web/commands/assertTextPresent.js +8 -3
- package/build/ox_modules/module-web/commands/assertTitle.js +8 -3
- package/build/ox_modules/module-web/commands/assertValue.js +8 -3
- package/build/ox_modules/module-web/commands/back.js +8 -3
- package/build/ox_modules/module-web/commands/clear.js +8 -3
- package/build/ox_modules/module-web/commands/click.js +8 -3
- package/build/ox_modules/module-web/commands/clickHidden.js +8 -3
- package/build/ox_modules/module-web/commands/closeWindow.js +8 -3
- package/build/ox_modules/module-web/commands/debug.js +8 -3
- package/build/ox_modules/module-web/commands/deleteCookies.js +8 -3
- package/build/ox_modules/module-web/commands/deselect.js +8 -3
- package/build/ox_modules/module-web/commands/doubleClick.js +8 -3
- package/build/ox_modules/module-web/commands/dragAndDrop.js +8 -3
- package/build/ox_modules/module-web/commands/execute.js +8 -3
- package/build/ox_modules/module-web/commands/fileBrowse.js +8 -3
- package/build/ox_modules/module-web/commands/findElement.js +8 -3
- package/build/ox_modules/module-web/commands/findElements.js +8 -3
- package/build/ox_modules/module-web/commands/fullscreenWindow.js +8 -3
- package/build/ox_modules/module-web/commands/getAlertText.js +8 -3
- package/build/ox_modules/module-web/commands/getAttribute.js +8 -3
- package/build/ox_modules/module-web/commands/getBrowserLogs.js +8 -3
- package/build/ox_modules/module-web/commands/getCookies.js +8 -3
- package/build/ox_modules/module-web/commands/getCssValue.js +8 -3
- package/build/ox_modules/module-web/commands/getElementCount.js +8 -3
- package/build/ox_modules/module-web/commands/getHTML.js +8 -3
- package/build/ox_modules/module-web/commands/getSource.js +8 -3
- package/build/ox_modules/module-web/commands/getText.js +8 -3
- package/build/ox_modules/module-web/commands/getTitle.js +8 -3
- package/build/ox_modules/module-web/commands/getUrl.js +8 -3
- package/build/ox_modules/module-web/commands/getValue.js +8 -3
- package/build/ox_modules/module-web/commands/getWindowHandles.js +8 -3
- package/build/ox_modules/module-web/commands/getWindowSize.js +8 -3
- package/build/ox_modules/module-web/commands/getXMLPageSource.js +8 -3
- package/build/ox_modules/module-web/commands/index.js +1027 -634
- package/build/ox_modules/module-web/commands/isAlertPresent.js +8 -3
- package/build/ox_modules/module-web/commands/isChecked.js +8 -3
- package/build/ox_modules/module-web/commands/isExist.js +8 -3
- package/build/ox_modules/module-web/commands/isInteractable.js +8 -3
- package/build/ox_modules/module-web/commands/isSelected.js +8 -3
- package/build/ox_modules/module-web/commands/isVisible.js +8 -3
- package/build/ox_modules/module-web/commands/makeVisible.js +8 -3
- package/build/ox_modules/module-web/commands/maximizeWindow.js +8 -3
- package/build/ox_modules/module-web/commands/minimizeWindow.js +8 -3
- package/build/ox_modules/module-web/commands/newWindow.js +8 -3
- package/build/ox_modules/module-web/commands/open.js +8 -3
- package/build/ox_modules/module-web/commands/pause.js +8 -3
- package/build/ox_modules/module-web/commands/point.js +8 -3
- package/build/ox_modules/module-web/commands/pointJS.js +8 -3
- package/build/ox_modules/module-web/commands/refresh.js +8 -3
- package/build/ox_modules/module-web/commands/rightClick.js +8 -3
- package/build/ox_modules/module-web/commands/rightClickActions.js +8 -3
- package/build/ox_modules/module-web/commands/scrollToElement.js +8 -3
- package/build/ox_modules/module-web/commands/select.js +8 -3
- package/build/ox_modules/module-web/commands/selectFrame.js +8 -3
- package/build/ox_modules/module-web/commands/selectWindow.js +8 -3
- package/build/ox_modules/module-web/commands/sendKeys.js +8 -3
- package/build/ox_modules/module-web/commands/setAutoWaitForAngular.js +8 -3
- package/build/ox_modules/module-web/commands/setTimeout.js +8 -3
- package/build/ox_modules/module-web/commands/setWindowSize.js +8 -3
- package/build/ox_modules/module-web/commands/takeScreenshot.js +8 -3
- package/build/ox_modules/module-web/commands/type.js +8 -3
- package/build/ox_modules/module-web/commands/waitForAngular.js +8 -3
- package/build/ox_modules/module-web/commands/waitForExist.js +8 -3
- package/build/ox_modules/module-web/commands/waitForInteractable.js +8 -3
- package/build/ox_modules/module-web/commands/waitForNotExist.js +8 -3
- package/build/ox_modules/module-web/commands/waitForNotText.js +8 -3
- package/build/ox_modules/module-web/commands/waitForNotValue.js +8 -3
- package/build/ox_modules/module-web/commands/waitForText.js +8 -3
- package/build/ox_modules/module-web/commands/waitForValue.js +8 -3
- package/build/ox_modules/module-web/commands/waitForVisible.js +8 -3
- package/build/ox_modules/module-web/commands/waitForWindow.js +8 -3
- package/build/ox_modules/module-win/commands/assertText.js +8 -3
- package/build/ox_modules/module-win/commands/assertTitle.js +8 -3
- package/build/ox_modules/module-win/commands/assertValue.js +8 -3
- package/build/ox_modules/module-win/commands/back.js +8 -3
- package/build/ox_modules/module-win/commands/clear.js +8 -3
- package/build/ox_modules/module-win/commands/click.js +8 -3
- package/build/ox_modules/module-win/commands/clickLong.js +8 -3
- package/build/ox_modules/module-win/commands/clickMultipleTimes.js +8 -3
- package/build/ox_modules/module-win/commands/findElement.js +8 -3
- package/build/ox_modules/module-win/commands/findElements.js +8 -3
- package/build/ox_modules/module-win/commands/getAppiumLogs.js +8 -3
- package/build/ox_modules/module-win/commands/getCurrentWindowHandle.js +8 -3
- package/build/ox_modules/module-win/commands/getLocation.js +8 -3
- package/build/ox_modules/module-win/commands/getSource.js +8 -3
- package/build/ox_modules/module-win/commands/getText.js +8 -3
- package/build/ox_modules/module-win/commands/getValue.js +8 -3
- package/build/ox_modules/module-win/commands/getWindowHandles.js +8 -3
- package/build/ox_modules/module-win/commands/index.js +468 -290
- package/build/ox_modules/module-win/commands/isCheckable.js +8 -3
- package/build/ox_modules/module-win/commands/isChecked.js +8 -3
- package/build/ox_modules/module-win/commands/isClickable.js +8 -3
- package/build/ox_modules/module-win/commands/isExist.js +8 -3
- package/build/ox_modules/module-win/commands/isSelected.js +8 -3
- package/build/ox_modules/module-win/commands/isVisible.js +8 -3
- package/build/ox_modules/module-win/commands/open.js +8 -3
- package/build/ox_modules/module-win/commands/pause.js +8 -3
- package/build/ox_modules/module-win/commands/rightClick.js +8 -3
- package/build/ox_modules/module-win/commands/selectWindow.js +8 -3
- package/build/ox_modules/module-win/commands/sendKeys.js +8 -3
- package/build/ox_modules/module-win/commands/setTimeout.js +8 -3
- package/build/ox_modules/module-win/commands/takeScreenshot.js +8 -3
- package/build/ox_modules/module-win/commands/tap.js +8 -3
- package/build/ox_modules/module-win/commands/type.js +8 -3
- package/build/ox_modules/module-win/commands/waitForExist.js +8 -3
- package/build/ox_modules/module-win/commands/waitForInteractable.js +8 -3
- package/build/ox_modules/module-win/commands/waitForVisible.js +8 -3
- package/build/runners/WorkerProcess.js +40 -13
- package/build/runners/oxygen/OxygenWorker.js +7 -3
- package/build/runners/oxygen/index.js +80 -80
- package/build/runners/oxygen/worker.js +4 -1
- package/package.json +11 -2
- package/types/index.d.ts +71 -0
- package/types/module-eyes.d.ts +39 -0
- package/types/module-http.d.ts +163 -0
- package/types/module-log.d.ts +35 -0
- package/types/module-mob.d.ts +967 -0
- package/types/module-pdf.d.ts +41 -0
- package/types/module-proxy.d.ts +100 -0
- package/types/module-shell.d.ts +24 -0
- package/types/module-utils.d.ts +99 -0
- package/types/module-web.d.ts +1050 -0
- package/types/module-win.d.ts +352 -0
- package/types/oxygen.d.ts +53 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
declare namespace Oxygen {
|
|
2
|
+
/**
|
|
3
|
+
* @name pdf
|
|
4
|
+
* @description Provides generic methods for working with PDF files.
|
|
5
|
+
*/
|
|
6
|
+
interface ModulePdf {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @summary Asserts that text is present in a PDF file
|
|
10
|
+
* @function assert
|
|
11
|
+
* @param {String} pdfFilePath - Relative or absolute path to the PDF file.
|
|
12
|
+
* @param {String} text - Text to assert.
|
|
13
|
+
* @param {Number=} pageNum - Page number.
|
|
14
|
+
* @param {String=} message - Message to throw if assertion fails.
|
|
15
|
+
* @param {Boolean=} reverse - Check also reverse variant of string.
|
|
16
|
+
*/
|
|
17
|
+
assert(pdfFilePath: string, text: string, pageNum?: number, message?: string, reverse?: boolean): void;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @summary Asserts that text is not present in a PDF file
|
|
21
|
+
* @function assertNot
|
|
22
|
+
* @param {String} pdfFilePath - Relative or absolute path to the pdf file.
|
|
23
|
+
* @param {String} text - Text to assert.
|
|
24
|
+
* @param {Number=} pageNum - Page number.
|
|
25
|
+
* @param {String=} message - Message to throw if assertion fails.
|
|
26
|
+
* @param {Boolean=} reverse - Check also reverse variant of string.
|
|
27
|
+
*/
|
|
28
|
+
assertNot(pdfFilePath: string, text: string, pageNum?: number, message: string, reverse?: boolean): void;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @summary Count the number of times specified text is present in a PDF file.
|
|
32
|
+
* @function count
|
|
33
|
+
* @param {String} pdfFilePath - Relative or absolute path to the pdf file.
|
|
34
|
+
* @param {String} text - Text to count.
|
|
35
|
+
* @param {Number=} pageNum - Page number.
|
|
36
|
+
* @param {Boolean=} reverse - Check also reverse variant of string.
|
|
37
|
+
* @return {Number} Number of times the specified text was found.
|
|
38
|
+
*/
|
|
39
|
+
count(pdfFilePath: string, text: string, pageNum?: number, reverse?: boolean): void;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
declare namespace Oxygen {
|
|
2
|
+
/**
|
|
3
|
+
* @name proxy
|
|
4
|
+
* @description Provides methods for intercepting network traffic via mitmproxy.
|
|
5
|
+
*/
|
|
6
|
+
interface ModuleProxy {
|
|
7
|
+
/**
|
|
8
|
+
* @function init
|
|
9
|
+
* @summary Initializes proxy.
|
|
10
|
+
* @param {Number} proxyPort - Proxy port.
|
|
11
|
+
* @param {Number=} proxyCommPort - Port for internal proxy communication. If specified, then mitmproxy should be launched manually.
|
|
12
|
+
* Otherwise mitmpoxy will be launched automatically.
|
|
13
|
+
* @param {Boolean=} saveRequestBody - Save request bodies.
|
|
14
|
+
* @param {Boolean=} saveResponseBody - Save response bodies.
|
|
15
|
+
* @example <caption>[shell] Launching mitmproxy manually</caption>
|
|
16
|
+
* mitmdump --anticache -s mitmproxy-node\scripts\proxy.py --ssl-insecure --set httpCommPort=8765
|
|
17
|
+
*/
|
|
18
|
+
init(proxyPort: number, proxyCommPort?: number | undefined, saveRequestBody?: boolean | undefined, saveResponseBody?: boolean | undefined): boolean;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @function dispose
|
|
22
|
+
* @summary Disposes this module.
|
|
23
|
+
*/
|
|
24
|
+
dispose(status: any): void;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @summary Begin collecting network requests.
|
|
28
|
+
* @description Any previously collected requests will be discarded.
|
|
29
|
+
* @function start
|
|
30
|
+
* @example <caption>[javascript] Usage example</caption>
|
|
31
|
+
* proxy.init(8080);
|
|
32
|
+
* proxy.start();
|
|
33
|
+
* // print the collected request so far:
|
|
34
|
+
* let requests = proxy.getRequests();
|
|
35
|
+
* for (let req of requests) {
|
|
36
|
+
* log.info(req);
|
|
37
|
+
* }
|
|
38
|
+
* // wait for a request using a verbatim URL match:
|
|
39
|
+
* proxy.waitForUrl('https://www.yourwebsite.com/foo/bar');
|
|
40
|
+
* // wait for a request using a regular expression URL match:
|
|
41
|
+
* proxy.waitForUrl(/https:\/\/.*\/foo\/bar/);
|
|
42
|
+
* // wait for a request using a custom matcher:
|
|
43
|
+
* proxy.waitFor(function (request) {
|
|
44
|
+
* return request.status === '200' && request.url === 'https://www.yourwebsite.com/foo/bar';
|
|
45
|
+
* });
|
|
46
|
+
*/
|
|
47
|
+
start(): void;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @summary Stop collecting network requests.
|
|
51
|
+
* @function stop
|
|
52
|
+
*/
|
|
53
|
+
stop(): void;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @summary Return all the collected network requests so far.
|
|
57
|
+
* @function getRequests
|
|
58
|
+
* @return {Object[]} Array containing network requests.
|
|
59
|
+
*/
|
|
60
|
+
getRequests(): any[];
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @summary Wait for a network request matching the specified URL.
|
|
64
|
+
* @function waitForUrl
|
|
65
|
+
* @param {String|RegExp} pattern - An URL to match verbatim or a RegExp.
|
|
66
|
+
* @param {Number=} timeout - Timeout. Default is 60 seconds.
|
|
67
|
+
* @return {Object} Network request details if the network request was found.
|
|
68
|
+
*/
|
|
69
|
+
waitForUrl(pattern: string | RegExp, timeout?: number | undefined): any;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @summary Wait for a network request.
|
|
73
|
+
* @function waitFor
|
|
74
|
+
* @param {Function} matcher - Matching function. Should return true on match, or false otherwise.
|
|
75
|
+
* @param {Number=} timeout - Timeout. Default is 60 seconds.
|
|
76
|
+
* @return {Object} Network request details if the network request was found.
|
|
77
|
+
*/
|
|
78
|
+
waitFor(matcher: Function, timeout?: number | undefined): any;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @summary Assert if network request matching the specified URL.
|
|
82
|
+
* @function assertUrl
|
|
83
|
+
* @param {String|RegExp} url - A request URL to match verbatim or a RegExp.
|
|
84
|
+
* @param {Number=} timeout - Timeout. Default is 60 seconds.
|
|
85
|
+
* @return {Object} Network request details if the network request was found.
|
|
86
|
+
*/
|
|
87
|
+
assertUrl(url: string | RegExp, timeout?: number | undefined): any;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @summary Assert whether HTTP response status code matches the specified value.
|
|
91
|
+
* @function assertStatusCode
|
|
92
|
+
* @param {String|RegExp} url - A request URL to match verbatim or a RegExp.
|
|
93
|
+
* @param {Number} statusCode - A response status code to match verbatim or a RegExp.
|
|
94
|
+
* @param {String=} failureMessage - An optional failure message.
|
|
95
|
+
* @param {Number=} timeout - Timeout. Default is 60 seconds.
|
|
96
|
+
* @return {Object} Network request details if the network request was found.
|
|
97
|
+
*/
|
|
98
|
+
assertStatusCode(url: string | RegExp, statusCode: number, failureMessage?: string | undefined, timeout?: number | undefined): any;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare namespace Oxygen {
|
|
2
|
+
/**
|
|
3
|
+
* @name shell
|
|
4
|
+
* @description Provides methods for working with operating system shell.
|
|
5
|
+
*/
|
|
6
|
+
interface ModuleShell {
|
|
7
|
+
get name(): string;
|
|
8
|
+
/**
|
|
9
|
+
* @summary Execute command
|
|
10
|
+
* @description Spawn child process
|
|
11
|
+
* @function exec
|
|
12
|
+
* @param {String} command - Shell command to be executed, including arguments, if applicable.
|
|
13
|
+
* @return {String} null | Error | stdout result
|
|
14
|
+
*/
|
|
15
|
+
exec(command: string, options?: {}): string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @summary Assert whether the shell command output (stdout) is matching the specified pattern.
|
|
19
|
+
* @function assertOutput
|
|
20
|
+
* @param {String} pattern - Pattern to assert.
|
|
21
|
+
*/
|
|
22
|
+
assertOutput(pattern: string): boolean;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/// <reference types="@types/node" />
|
|
2
|
+
declare namespace Oxygen {
|
|
3
|
+
interface ModuleUtils {
|
|
4
|
+
/**
|
|
5
|
+
* @summary Pause test execution for the given amount of milliseconds.
|
|
6
|
+
* @function pause
|
|
7
|
+
* @param {Number} ms - Milliseconds to pause the execution for.
|
|
8
|
+
*/
|
|
9
|
+
pause(ms: number): void;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @summary Decrypt text
|
|
13
|
+
* @function decrypt
|
|
14
|
+
* @param {String} text - Text
|
|
15
|
+
* @return {Object} DecryptResult Object with getDecryptResult method
|
|
16
|
+
* @example <caption>[javascript] Usage example</caption>
|
|
17
|
+
* // to encrypt plaintext into ciphertext
|
|
18
|
+
* const encrypt = utils.encrypt('https://www.wikipedia.org');
|
|
19
|
+
* log.info(encrypt); // will print b757ba2c2fc50fbb511d596816ca06c4fa56f4e98ce222f30bc58d5251ed635e
|
|
20
|
+
*
|
|
21
|
+
* // to decrypt ciphertext and use it in script
|
|
22
|
+
* const decrypt = utils.decrypt(encrypt);
|
|
23
|
+
* log.info(decrypt); // will print ENCRYPTED
|
|
24
|
+
*
|
|
25
|
+
* web.init();
|
|
26
|
+
* web.open(decrypt); // will open https://www.wikipedia.org
|
|
27
|
+
*
|
|
28
|
+
* // to get original plaintext use getDecryptResult
|
|
29
|
+
* const value = decrypt.getDecryptResult();
|
|
30
|
+
* log.info(value); //will print https://www.wikipedia.org
|
|
31
|
+
*/
|
|
32
|
+
decrypt(text: string): any;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @summary Encrypt text
|
|
36
|
+
* @function encrypt
|
|
37
|
+
* @param {String} text - Text
|
|
38
|
+
* @return {String} Encrypted text
|
|
39
|
+
* @example <caption>[javascript] Usage example</caption>
|
|
40
|
+
* // to encrypt plaintext into ciphertext
|
|
41
|
+
* const encrypt = utils.encrypt('https://www.wikipedia.org');
|
|
42
|
+
* log.info(encrypt); // will print b757ba2c2fc50fbb511d596816ca06c4fa56f4e98ce222f30bc58d5251ed635e
|
|
43
|
+
*
|
|
44
|
+
* // to decrypt ciphertext and use it in script
|
|
45
|
+
* const decrypt = utils.decrypt(encrypt);
|
|
46
|
+
* log.info(decrypt); // will print ENCRYPTED
|
|
47
|
+
*
|
|
48
|
+
* web.init();
|
|
49
|
+
* web.open(decrypt); // will open https://www.wikipedia.org
|
|
50
|
+
*
|
|
51
|
+
* // to get original plaintext use getDecryptResult
|
|
52
|
+
* const value = decrypt.getDecryptResult();
|
|
53
|
+
* log.info(value); //will print https://www.wikipedia.org
|
|
54
|
+
*/
|
|
55
|
+
encrypt(text: string): string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @summary Reads data from csv file
|
|
59
|
+
* @function readCsv
|
|
60
|
+
* @param {String} filePath - Absolute path to file
|
|
61
|
+
* @param {Object=} options - [Options](https://csv.js.org/parse/options/)
|
|
62
|
+
*/
|
|
63
|
+
readCsv(filePath: string, options?: any | undefined): any;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @summary Writes data into csv file
|
|
67
|
+
* @function writeCsv
|
|
68
|
+
* @param {String} filePath - Absolute path to file
|
|
69
|
+
* @param {Array} data - CSV data in format [{column_name_1: 'foo', column_name_2: 'bar'}]
|
|
70
|
+
* @param {Object=} options - [Options](https://github.com/anton-bot/objects-to-csv#async-todiskfilename-options)
|
|
71
|
+
*/
|
|
72
|
+
writeCsv(filePath: string, data: any[], options?: any | undefined): void;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @summary Reads data from Xlsx file
|
|
76
|
+
* @function readXlsx
|
|
77
|
+
* @param {String} filePath - Absolute path to file
|
|
78
|
+
* @return {Array} - Array of xlsx data
|
|
79
|
+
*/
|
|
80
|
+
readXlsx(filePath: string): any[];
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @summary Uses the DNS protocol to resolve a host name
|
|
84
|
+
* @function dnsResolve
|
|
85
|
+
* @param {String} hostname - Host name to resolve.
|
|
86
|
+
* @param {String=} rrType - Resource record type. Default: 'A'.
|
|
87
|
+
* @return {String[] | Object} - Array or Object of resource records. The type and structure of individual results vary based on rrtype
|
|
88
|
+
*/
|
|
89
|
+
dnsResolve(hostname: string, rrType?: string | undefined): string[] | any;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @summary Parse XML data to JS object
|
|
93
|
+
* @function xmlToJson
|
|
94
|
+
* @param {string|Buffer} xmlDataStr - Like <root a="nice" b="very nice" ><a>wow</a></root>
|
|
95
|
+
* @param {boolean|Object} options - [Options](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/docs/v4/2.XMLparseOptions.md)
|
|
96
|
+
*/
|
|
97
|
+
xmlToJson(xmlDataStr: string | Buffer, options?: boolean | any): any;
|
|
98
|
+
}
|
|
99
|
+
}
|