automation_model 1.0.32 → 1.0.34
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/bin/stable_browser.js +8 -1
- package/package.json +1 -1
package/bin/stable_browser.js
CHANGED
|
@@ -125,6 +125,7 @@ class StableBrowser {
|
|
|
125
125
|
info.log.push("click failed, will try force click");
|
|
126
126
|
await element.click({ timeout: 10000, force: true });
|
|
127
127
|
}
|
|
128
|
+
await this.waitForPageLoad();
|
|
128
129
|
return info;
|
|
129
130
|
} catch (e) {
|
|
130
131
|
this.logger.error("click failed " + JSON.stringify(info));
|
|
@@ -152,6 +153,7 @@ class StableBrowser {
|
|
|
152
153
|
info.log.push("selectOption failed, will try force");
|
|
153
154
|
await element.selectOption(values, { timeout: 10000, force: true });
|
|
154
155
|
}
|
|
156
|
+
await this.waitForPageLoad();
|
|
155
157
|
return info;
|
|
156
158
|
} catch (e) {
|
|
157
159
|
this.logger.error("selectOption failed " + JSON.stringify(info));
|
|
@@ -174,6 +176,7 @@ class StableBrowser {
|
|
|
174
176
|
await this._screenShot(options);
|
|
175
177
|
await element.fill(value, { timeout: 10000 });
|
|
176
178
|
await element.dispatchEvent("change");
|
|
179
|
+
await this.waitForPageLoad();
|
|
177
180
|
return info;
|
|
178
181
|
} catch (e) {
|
|
179
182
|
this.logger.error("fill failed " + JSON.stringify(info));
|
|
@@ -191,7 +194,11 @@ class StableBrowser {
|
|
|
191
194
|
try {
|
|
192
195
|
let element = await this._locate(selector, info, _params);
|
|
193
196
|
await this._screenShot(options);
|
|
194
|
-
await element.
|
|
197
|
+
let foundText = await element.textContent();
|
|
198
|
+
if (!foundText.includes(text)) {
|
|
199
|
+
throw new Error("element doesn't contain text " + text);
|
|
200
|
+
}
|
|
201
|
+
//await expect(element).toContainText(text, { timeout: 10000 });
|
|
195
202
|
//fill(value, { timeout: 10000 });
|
|
196
203
|
//await element.dispatchEvent("change");
|
|
197
204
|
return info;
|