e2ed
Version:
E2E testing framework over Playwright
18 lines (17 loc) • 556 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getInputByValue = void 0;
/**
* Get input from multiselector (usually from `<input type="radio">`) by input value.
*/
const getInputByValue = async (input, value) => {
const count = await input.count;
for (let index = 0; index < count; index += 1) {
const currentInput = input.nth(index);
if ((await currentInput.value) === value) {
return currentInput;
}
}
return null;
};
exports.getInputByValue = getInputByValue;