automation_model 1.0.31 → 1.0.32

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.
@@ -182,6 +182,26 @@ class StableBrowser {
182
182
  throw e;
183
183
  }
184
184
  }
185
+ async containsText(selector, text, _params = null, options = {}) {
186
+ const info = {};
187
+ info.log = [];
188
+ info.operation = "containsText";
189
+ info.selector = selector;
190
+ info.value = text;
191
+ try {
192
+ let element = await this._locate(selector, info, _params);
193
+ await this._screenShot(options);
194
+ await element.toContainText(text, { timeout: 10000 });
195
+ //fill(value, { timeout: 10000 });
196
+ //await element.dispatchEvent("change");
197
+ return info;
198
+ } catch (e) {
199
+ this.logger.error("verify element contains text failed " + JSON.stringify(info));
200
+ Object.assign(e, { info: info });
201
+ await this._screenShot(options);
202
+ throw e;
203
+ }
204
+ }
185
205
  async _screenShot(options = {}) {
186
206
  if (options.screenshot) {
187
207
  await this.page.screenshot({ path: options.screenshotPath });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "automation_model",
3
- "version": "1.0.31",
3
+ "version": "1.0.32",
4
4
  "description": "An automation infrastructure module to be use for generative AI automation projects.",
5
5
  "main": "bin/index.js",
6
6
  "type": "module",