UNPKG

@assert-equals/dappdriver

Version:

DappDriver is an e2e testing framework designed for testing decentralized applications (dApps) using MetaMask, Rainbow or Zerion

42 lines (41 loc) 1.32 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WebDriverInputText = void 0; const selenium_webdriver_1 = require("selenium-webdriver"); const html_element_1 = require("./html-element"); class WebDriverInputText extends html_element_1.WebDriverHTMLElement { constructor(cssLocator) { super(cssLocator); } async clear() { await this.search(); return await this.webElement.clear(); } async focus() { await this.search(); return await this.webElement.sendKeys(''); } async getText() { await this.search(); return await this.getValue(); } async getValue() { await this.search(); return await this.webElement.getAttribute('value'); } async type(keys) { await this.search(); return await this.webElement.sendKeys(keys); } async typeAndEnter(keys) { await this.search(); await this.webElement.sendKeys(keys); return await this.webElement.sendKeys(selenium_webdriver_1.Key.ENTER); } async typeAndTab(keys) { await this.search(); await this.webElement.sendKeys(keys); return await this.webElement.sendKeys(selenium_webdriver_1.Key.TAB); } } exports.WebDriverInputText = WebDriverInputText;