@o3r/testing
Version:
The module provides testing (e2e, unit test) utilities to help you build your own E2E pipeline integrating visual testing.
31 lines • 971 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.O3rRadioElement = void 0;
const element_1 = require("../element");
/**
* Implementation dedicated to Playwright.
*/
class O3rRadioElement extends element_1.O3rElement {
constructor(sourceElement) {
super(sourceElement);
}
/** @inheritDoc */
async check(value = true) {
if ((await this.isChecked()) === value) {
// eslint-disable-next-line no-console -- no other logger available
console.warn(`O3rRadioELement is already ${value ? 'checked' : 'unchecked'}`);
return;
}
return this.sourceElement.element.setChecked(value);
}
/** @inheritDoc */
async uncheck() {
return this.check(false);
}
/** @inheritDoc */
isChecked() {
return this.sourceElement.element.isChecked();
}
}
exports.O3rRadioElement = O3rRadioElement;
//# sourceMappingURL=radio-element.js.map