@assert-equals/dappdriver
Version:
DappDriver is an e2e testing framework designed for testing decentralized applications (dApps) using MetaMask, Rainbow or Zerion
26 lines (25 loc) • 716 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.WebDriverCheckBox = void 0;
const html_element_1 = require("./html-element");
class WebDriverCheckBox extends html_element_1.WebDriverHTMLElement {
constructor(cssLocator) {
super(cssLocator);
}
async isSelected() {
await this.search();
return this.webElement.isSelected();
}
async setValue(value) {
const isSelected = await this.isSelected();
if (isSelected) {
if (!value) {
await this.click();
}
}
else if (value) {
await this.click();
}
}
}
exports.WebDriverCheckBox = WebDriverCheckBox;