@auto-wiz/core 1.1.4 → 1.2.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/dist/steps/stepValidation.js +10 -10
- package/dist/types.d.ts +7 -13
- package/package.json +1 -1
|
@@ -30,8 +30,8 @@ function validateClickStep(step) {
|
|
|
30
30
|
if (step.type !== "click") {
|
|
31
31
|
return { valid: false, error: "Invalid step type for click validation" };
|
|
32
32
|
}
|
|
33
|
-
if (!step.
|
|
34
|
-
return { valid: false, error: "Click step requires
|
|
33
|
+
if (!step.locator) {
|
|
34
|
+
return { valid: false, error: "Click step requires locator" };
|
|
35
35
|
}
|
|
36
36
|
return { valid: true };
|
|
37
37
|
}
|
|
@@ -39,8 +39,8 @@ function validateTypeStep(step) {
|
|
|
39
39
|
if (step.type !== "type") {
|
|
40
40
|
return { valid: false, error: "Invalid step type for type validation" };
|
|
41
41
|
}
|
|
42
|
-
if (!step.
|
|
43
|
-
return { valid: false, error: "Type step requires
|
|
42
|
+
if (!step.locator) {
|
|
43
|
+
return { valid: false, error: "Type step requires locator" };
|
|
44
44
|
}
|
|
45
45
|
if (step.text === undefined && step.originalText === undefined) {
|
|
46
46
|
return { valid: false, error: "Type step requires text or originalText" };
|
|
@@ -51,8 +51,8 @@ function validateSelectStep(step) {
|
|
|
51
51
|
if (step.type !== "select") {
|
|
52
52
|
return { valid: false, error: "Invalid step type for select validation" };
|
|
53
53
|
}
|
|
54
|
-
if (!step.
|
|
55
|
-
return { valid: false, error: "Select step requires
|
|
54
|
+
if (!step.locator) {
|
|
55
|
+
return { valid: false, error: "Select step requires locator" };
|
|
56
56
|
}
|
|
57
57
|
if (step.value === undefined) {
|
|
58
58
|
return { valid: false, error: "Select step requires value" };
|
|
@@ -63,8 +63,8 @@ function validateExtractStep(step) {
|
|
|
63
63
|
if (step.type !== "extract") {
|
|
64
64
|
return { valid: false, error: "Invalid step type for extract validation" };
|
|
65
65
|
}
|
|
66
|
-
if (!step.
|
|
67
|
-
return { valid: false, error: "Extract step requires
|
|
66
|
+
if (!step.locator) {
|
|
67
|
+
return { valid: false, error: "Extract step requires locator" };
|
|
68
68
|
}
|
|
69
69
|
return { valid: true };
|
|
70
70
|
}
|
|
@@ -88,10 +88,10 @@ function validateWaitForStep(step) {
|
|
|
88
88
|
if (step.type !== "waitFor") {
|
|
89
89
|
return { valid: false, error: "Invalid step type for waitFor validation" };
|
|
90
90
|
}
|
|
91
|
-
if (!step.
|
|
91
|
+
if (!step.locator && step.timeoutMs === undefined) {
|
|
92
92
|
return {
|
|
93
93
|
valid: false,
|
|
94
|
-
error: "WaitFor step requires
|
|
94
|
+
error: "WaitFor step requires locator or timeoutMs",
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
if (step.timeoutMs !== undefined) {
|
package/dist/types.d.ts
CHANGED
|
@@ -20,15 +20,13 @@ export interface ElementLocator {
|
|
|
20
20
|
}
|
|
21
21
|
type CoreStep = {
|
|
22
22
|
type: "click";
|
|
23
|
-
|
|
24
|
-
locator?: ElementLocator;
|
|
23
|
+
locator: ElementLocator;
|
|
25
24
|
url?: string;
|
|
26
25
|
screenshot?: string;
|
|
27
26
|
timeoutMs?: number;
|
|
28
27
|
} | {
|
|
29
28
|
type: "type";
|
|
30
|
-
|
|
31
|
-
locator?: ElementLocator;
|
|
29
|
+
locator: ElementLocator;
|
|
32
30
|
text: string;
|
|
33
31
|
originalText?: string;
|
|
34
32
|
submit?: boolean;
|
|
@@ -37,31 +35,27 @@ type CoreStep = {
|
|
|
37
35
|
timeoutMs?: number;
|
|
38
36
|
} | {
|
|
39
37
|
type: "select";
|
|
40
|
-
|
|
41
|
-
locator?: ElementLocator;
|
|
38
|
+
locator: ElementLocator;
|
|
42
39
|
value: string;
|
|
43
40
|
url?: string;
|
|
44
41
|
screenshot?: string;
|
|
45
42
|
timeoutMs?: number;
|
|
46
43
|
} | {
|
|
47
44
|
type: "extract";
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
prop?: "innerText" | "value" | "outerHTML" | "structure";
|
|
45
|
+
locator: ElementLocator;
|
|
46
|
+
prop?: "innerText" | "value" | "outerHTML" | "structure" | "simplified";
|
|
51
47
|
url?: string;
|
|
52
48
|
screenshot?: string;
|
|
53
49
|
timeoutMs?: number;
|
|
54
50
|
} | {
|
|
55
51
|
type: "waitFor";
|
|
56
|
-
selector?: string;
|
|
57
52
|
locator?: ElementLocator;
|
|
58
53
|
timeoutMs?: number;
|
|
59
54
|
url?: string;
|
|
60
55
|
screenshot?: string;
|
|
61
56
|
} | {
|
|
62
57
|
type: "screenshot";
|
|
63
|
-
|
|
64
|
-
locator?: ElementLocator;
|
|
58
|
+
locator: ElementLocator;
|
|
65
59
|
url?: string;
|
|
66
60
|
screenshot: string;
|
|
67
61
|
timeoutMs?: number;
|
|
@@ -132,7 +126,7 @@ export type ElementScreenshotMessage = {
|
|
|
132
126
|
screenshot: string;
|
|
133
127
|
elementInfo: {
|
|
134
128
|
tagName: string;
|
|
135
|
-
|
|
129
|
+
locator: string;
|
|
136
130
|
text?: string;
|
|
137
131
|
};
|
|
138
132
|
};
|