playwright-ts-automationframework 1.1.49 → 1.1.50

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.
@@ -96,6 +96,7 @@ export declare class Actions extends BasePage {
96
96
  * selectDropDownByText(cityDrpdwn, "Sydney");
97
97
  */
98
98
  selectDropDownByText(control: WebControl, optionTobeSelcted: string): Promise<void>;
99
+ selectDropDownByPartialText(control: WebControl, partialText: string): Promise<void>;
99
100
  /**
100
101
  * Select dropdown element by index.
101
102
  *
@@ -289,6 +289,33 @@ var Actions = /** @class */ (function (_super) {
289
289
  });
290
290
  });
291
291
  };
292
+ Actions.prototype.selectDropDownByPartialText = function (control, partialText) {
293
+ return __awaiter(this, void 0, void 0, function () {
294
+ var options, matchingOption;
295
+ return __generator(this, function (_a) {
296
+ switch (_a.label) {
297
+ case 0: return [4 /*yield*/, control.controlLocator.first().locator('option').allInnerTexts()];
298
+ case 1:
299
+ options = _a.sent();
300
+ matchingOption = options.find(function (option) { return option.includes(partialText); });
301
+ if (!matchingOption) {
302
+ (0, logs_core_1.logError)("No option found containing '".concat(partialText, "' in '").concat(control.controlDescription, "'"));
303
+ throw new Error("No matching option found for '".concat(partialText, "'"));
304
+ }
305
+ return [4 /*yield*/, control.controlLocator.first().selectOption({ label: matchingOption }).then(function () {
306
+ (0, logs_core_1.logAction)("Selected '".concat(matchingOption, "' from '").concat(control.controlDescription, "'"));
307
+ }, function (error) {
308
+ (0, logs_core_1.logError)("Unable to select '".concat(matchingOption, "' from '").concat(control.controlDescription, "'"));
309
+ (0, logs_core_1.logConsole)("Error: '".concat(error, "'"));
310
+ throw error;
311
+ })];
312
+ case 2:
313
+ _a.sent();
314
+ return [2 /*return*/];
315
+ }
316
+ });
317
+ });
318
+ };
292
319
  /**
293
320
  * Select dropdown element by index.
294
321
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playwright-ts-automationframework",
3
- "version": "1.1.49",
3
+ "version": "1.1.50",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -19,11 +19,11 @@
19
19
  "ignore-case": "^0.1.0"
20
20
  },
21
21
  "dependencies": {
22
- "@playwright/test": "^1.51.0",
23
- "@types/node": "^22.13.9",
22
+ "@playwright/test": "^1.51.1",
23
+ "@types/node": "^22.13.13",
24
24
  "log4js": "^6.9.1",
25
25
  "nodemailer": "^6.10.0",
26
- "npm": "^10.9.1",
26
+ "npm": "^11.2.0",
27
27
  "path": "^0.12.7",
28
28
  "typescript": "^5.8.2"
29
29
  },