UNPKG

@o3r/testing

Version:

The module provides testing (e2e, unit test) utilities to help you build your own E2E pipeline integrating visual testing.

47 lines 1.91 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.O3rRadioElement = void 0; var tslib_1 = require("tslib"); var element_1 = require("../element"); /** * Implementation dedicated to Playwright. */ var O3rRadioElement = /** @class */ (function (_super) { tslib_1.__extends(O3rRadioElement, _super); function O3rRadioElement(sourceElement) { return _super.call(this, sourceElement) || this; } /** @inheritDoc */ O3rRadioElement.prototype.check = function () { return tslib_1.__awaiter(this, arguments, void 0, function (value) { if (value === void 0) { value = true; } return tslib_1.__generator(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, this.isChecked()]; case 1: if ((_a.sent()) === value) { // eslint-disable-next-line no-console -- no other logger available console.warn("O3rRadioELement is already ".concat(value ? 'checked' : 'unchecked')); return [2 /*return*/]; } return [2 /*return*/, this.sourceElement.element.setChecked(value)]; } }); }); }; /** @inheritDoc */ O3rRadioElement.prototype.uncheck = function () { return tslib_1.__awaiter(this, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) { return [2 /*return*/, this.check(false)]; }); }); }; /** @inheritDoc */ O3rRadioElement.prototype.isChecked = function () { return this.sourceElement.element.isChecked(); }; return O3rRadioElement; }(element_1.O3rElement)); exports.O3rRadioElement = O3rRadioElement; //# sourceMappingURL=radio-element.js.map