UNPKG

@vibe/testkit

Version:
52 lines 2.12 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Checkbox = void 0; const BaseElement_1 = require("./BaseElement"); /** * Class representing a Checkbox element. * Extends the BaseElement class. */ class Checkbox extends BaseElement_1.BaseElement { /** * Create a Checkbox. * @param {Page} page - The Playwright page object. * @param {Locator} locator - The locator for the Checkbox element. * @param {string} elementReportName - The name for reporting purposes. */ constructor(page, locator, elementReportName) { super(page, locator, elementReportName); this.page = page; this.locator = locator; this.elementReportName = elementReportName; } /** * Set the checked state of the checkbox. * @param {boolean} isToCheck - True to check the checkbox, false to uncheck. * @returns {Promise<void>} */ setChecked(isToCheck) { return __awaiter(this, void 0, void 0, function* () { yield this.locator.setChecked(isToCheck); }); } /** * Check if the checkbox is checked. * @returns {Promise<boolean>} True if the checkbox is checked, false otherwise. */ isChecked() { return __awaiter(this, void 0, void 0, function* () { return this.locator.isChecked(); }); } } exports.Checkbox = Checkbox; //# sourceMappingURL=Checkbox.js.map