UNPKG

playwright-pom-materials

Version:

Playwright POM materials

20 lines (19 loc) 669 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RadioButtons = void 0; const Selectable_1 = require("./Selectable"); class RadioButtons { constructor(locator, selectors) { this.locator = locator; this.selectorFunc = typeof selectors === 'function' ? selectors : (key) => selectors[key]; } button(name) { const obj = this.selectorFunc(name); const [selector, options] = Array.isArray(obj) ? obj : [obj, undefined]; return new Selectable_1.Selectable(this.locator.locator(selector), options); } } exports.RadioButtons = RadioButtons;