@atomic-testing/component-driver-html
Version:
HTML component driver for atomic-testing
40 lines • 1.72 kB
JavaScript
;
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.HTMLAnchorDriver = void 0;
const core_1 = require("@atomic-testing/core");
class HTMLAnchorDriver extends core_1.ComponentDriver {
click(option) {
return __awaiter(this, void 0, void 0, function* () {
yield this.interactor.click(this.locator, option);
});
}
hover(option) {
return __awaiter(this, void 0, void 0, function* () {
yield this.interactor.click(this.locator, option);
});
}
getHref() {
return __awaiter(this, void 0, void 0, function* () {
return this.interactor.getAttribute(this.locator, 'href');
});
}
getTarget() {
return __awaiter(this, void 0, void 0, function* () {
return this.interactor.getAttribute(this.locator, 'target');
});
}
get driverName() {
return 'HTMLButtonDriver';
}
}
exports.HTMLAnchorDriver = HTMLAnchorDriver;
//# sourceMappingURL=HTMLAnchorDriver.js.map