@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) • 947 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PlaywrightDropDown = void 0;
const html_element_1 = require("./html-element");
class PlaywrightDropDown extends html_element_1.PlaywrightHTMLElement {
constructor(cssLocator) {
super(cssLocator);
}
async getSelectedOption() {
return await this.webElement.locator('option:checked').textContent({ timeout: this.timeout });
}
async getText() {
return await this.getSelectedOption();
}
async selectByIndex(index) {
await this.webElement.selectOption({ index: index }, { timeout: this.timeout });
}
async selectByText(text) {
await this.webElement.selectOption({ label: text }, { timeout: this.timeout });
}
async selectByValue(value) {
await this.webElement.selectOption({ value: value }, { timeout: this.timeout });
}
}
exports.PlaywrightDropDown = PlaywrightDropDown;