automation_model 1.0.597-dev → 1.0.599-dev
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/lib/command_common.d.ts +1 -1
- package/lib/command_common.js +21 -25
- package/lib/command_common.js.map +1 -1
- package/lib/stable_browser.d.ts +4 -5
- package/lib/stable_browser.js +184 -176
- package/lib/stable_browser.js.map +1 -1
- package/package.json +1 -1
package/lib/command_common.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function _preCommand(state: any, stable: any
|
|
1
|
+
export declare function _preCommand(state: any, stable: any): Promise<void>;
|
|
2
2
|
export declare function _commandError(state: any, error: any, stable: any): Promise<void>;
|
|
3
3
|
export declare function _screenshot(state: any, stable: any, specificElement?: any): Promise<void>;
|
|
4
4
|
export declare function _commandFinally(state: any, stable: any): void;
|
package/lib/command_common.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getHumanReadableErrorMessage } from "./error-messages.js";
|
|
2
2
|
import { LocatorLog } from "./locator_log.js";
|
|
3
3
|
import { _fixUsingParams, maskValue } from "./utils.js";
|
|
4
|
-
export async function _preCommand(state, stable
|
|
4
|
+
export async function _preCommand(state, stable) {
|
|
5
5
|
if (!state) {
|
|
6
6
|
return;
|
|
7
7
|
}
|
|
@@ -66,21 +66,11 @@ export async function _preCommand(state, stable, world) {
|
|
|
66
66
|
await _screenshot(state, stable);
|
|
67
67
|
}
|
|
68
68
|
if (state.highlight === true) {
|
|
69
|
-
|
|
70
|
-
stable._highlightElements(state.element)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
// console.log(`Unhighlighted in _preCommand`);
|
|
75
|
-
}).catch((e) => {
|
|
76
|
-
// console.log(`Unhighlighting failed in _preCommand: ${e}`);
|
|
77
|
-
});
|
|
78
|
-
}).catch((e) => {
|
|
79
|
-
// console.log(`Error inbetween highlighting and unhighlighting: ${e}`);
|
|
80
|
-
});
|
|
81
|
-
}).catch((e) => {
|
|
82
|
-
// console.log(`Error in highlighting: ${e}`);
|
|
83
|
-
});
|
|
69
|
+
try {
|
|
70
|
+
await stable._highlightElements(state.element);
|
|
71
|
+
}
|
|
72
|
+
catch (e) {
|
|
73
|
+
// ignore
|
|
84
74
|
}
|
|
85
75
|
}
|
|
86
76
|
state.info.failCause.operationFailed = true;
|
|
@@ -119,14 +109,20 @@ export async function _commandError(state, error, stable) {
|
|
|
119
109
|
}
|
|
120
110
|
}
|
|
121
111
|
export async function _screenshot(state, stable, specificElement) {
|
|
122
|
-
let focusedElement = null;
|
|
123
|
-
if (specificElement !== undefined) {
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
|
|
112
|
+
// let focusedElement = null;
|
|
113
|
+
// if (specificElement !== undefined) {
|
|
114
|
+
// focusedElement = specificElement;
|
|
115
|
+
// } else {
|
|
116
|
+
// focusedElement = state.element;
|
|
117
|
+
// }
|
|
118
|
+
// const { screenshotId, screenshotPath } = await stable._screenShot(
|
|
119
|
+
// state.options,
|
|
120
|
+
// state.world,
|
|
121
|
+
// state.info,
|
|
122
|
+
// focusedElement
|
|
123
|
+
// );
|
|
124
|
+
// ;
|
|
125
|
+
const { screenshotId, screenshotPath } = await stable._screenShot(state.options, state.world, state.info);
|
|
130
126
|
state.screenshotId = screenshotId;
|
|
131
127
|
state.screenshotPath = screenshotPath;
|
|
132
128
|
}
|
|
@@ -146,7 +142,7 @@ export function _commandFinally(state, stable) {
|
|
|
146
142
|
status: "FAILED",
|
|
147
143
|
startTime: state.startTime,
|
|
148
144
|
endTime: state.endTime,
|
|
149
|
-
message: state.error?.message,
|
|
145
|
+
message: state?.info?.errorMessage ?? state.error?.message,
|
|
150
146
|
}
|
|
151
147
|
: {
|
|
152
148
|
status: "PASSED",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command_common.js","sourceRoot":"","sources":["../../src/command_common.ts"],"names":[],"m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,MAAM,KAAK,CAAC,EAAE;QACnC,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;KACtE;AACH,CAAC;AACD,MAAM,UAAU,cAAc,CAAC,KAAU,EAAE,UAAe;IACxD,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;QAC3B,OAAO;KACR;IACD,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC,CAAC;AAC9E,CAAC"}
|
package/lib/stable_browser.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ declare class StableBrowser {
|
|
|
58
58
|
elementCount: number;
|
|
59
59
|
randomToken: string;
|
|
60
60
|
}>;
|
|
61
|
-
_collectLocatorInformation(selectorHierarchy: any, index: number | undefined, scope: any, foundLocators: any, _params: Params, info: any, visibleOnly?: boolean, allowDisabled?: boolean | undefined): Promise<void>;
|
|
61
|
+
_collectLocatorInformation(selectorHierarchy: any, index: number | undefined, scope: any, foundLocators: any, _params: Params, info: any, visibleOnly?: boolean, allowDisabled?: boolean | undefined, element_name?: null): Promise<void>;
|
|
62
62
|
closeUnexpectedPopups(info: any, _params: any): Promise<{
|
|
63
63
|
rerun: boolean;
|
|
64
64
|
}>;
|
|
@@ -66,7 +66,7 @@ declare class StableBrowser {
|
|
|
66
66
|
_findFrameScope(selectors: any, timeout: number | undefined, info: any): Promise<any>;
|
|
67
67
|
_getDocumentBody(selectors: any, timeout: number | undefined, info: any): Promise<any>;
|
|
68
68
|
_locate_internal(selectors: any, info: any, _params?: Params, timeout?: number, allowDisabled?: boolean | undefined): Promise<any>;
|
|
69
|
-
_scanLocatorsGroup(locatorsGroup: any, scope: any, _params: any, info: any, visibleOnly: any, allowDisabled?: boolean | undefined): Promise<{
|
|
69
|
+
_scanLocatorsGroup(locatorsGroup: any, scope: any, _params: any, info: any, visibleOnly: any, allowDisabled?: boolean | undefined, element_name: any): Promise<{
|
|
70
70
|
foundElements: any[];
|
|
71
71
|
}>;
|
|
72
72
|
simpleClick(elementDescription: any, _params?: Params, options?: {}, world?: null): Promise<void>;
|
|
@@ -120,8 +120,8 @@ declare class StableBrowser {
|
|
|
120
120
|
};
|
|
121
121
|
loadTestDataAsync(type: string, dataSelector: string, world?: null): Promise<any>;
|
|
122
122
|
getTestData(world?: null): {};
|
|
123
|
-
_screenShot(options?: {}, world?: null, info?: null
|
|
124
|
-
takeScreenshot(screenshotPath: any
|
|
123
|
+
_screenShot(options?: {}, world?: null, info?: null): Promise<{}>;
|
|
124
|
+
takeScreenshot(screenshotPath: any): Promise<any>;
|
|
125
125
|
verifyElementExistInPage(selectors: any, _params?: null, options?: {}, world?: null): Promise<any>;
|
|
126
126
|
extractAttribute(selectors: any, attribute: any, variable: any, _params?: null, options?: {}, world?: null): Promise<any>;
|
|
127
127
|
verifyAttribute(selectors: any, attribute: any, value: any, _params?: null, options?: {}, world?: null): Promise<any>;
|
|
@@ -130,7 +130,6 @@ declare class StableBrowser {
|
|
|
130
130
|
emailCode: any;
|
|
131
131
|
}>;
|
|
132
132
|
_highlightElements(scope: any, css: any): Promise<void>;
|
|
133
|
-
_unhighlightElements(scope: any, css: any): Promise<void>;
|
|
134
133
|
verifyPagePath(pathPart: any, options?: {}, world?: null): Promise<{} | undefined>;
|
|
135
134
|
findTextInAllFrames(dateAlternatives: any, numberAlternatives: any, text: any, state: any): Promise<{
|
|
136
135
|
elementCount: number;
|