UNPKG

@atomic-testing/component-driver-html

Version:
33 lines 1.63 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.HTMLOptionDriver = void 0; const core_1 = require("@atomic-testing/core"); class HTMLOptionDriver extends core_1.ComponentDriver { label() { return __awaiter(this, void 0, void 0, function* () { const label = yield this.getText(); return (label === null || label === void 0 ? void 0 : label.trim()) || null; }); } value() { return __awaiter(this, void 0, void 0, function* () { var _a; const val = (_a = (yield this.interactor.getAttribute(this.locator, 'value'))) !== null && _a !== void 0 ? _a : (yield this.label()); return (val === null || val === void 0 ? void 0 : val.trim()) || null; }); } get driverName() { return 'HTMLOptionDriver'; } } exports.HTMLOptionDriver = HTMLOptionDriver; //# sourceMappingURL=HTMLOptionDriver.js.map