@assert-equals/dappdriver
Version:
DappDriver is an e2e testing framework designed for testing decentralized applications (dApps) using MetaMask, Rainbow or Zerion
25 lines (24 loc) • 992 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PlaywrightHTMLElementCollection = void 0;
const html_element_1 = require("../controls/html-element");
const dapp_driver_1 = require("../session/dapp-driver");
class PlaywrightHTMLElementCollection {
cssLocator;
timeout;
page;
frame;
webElements;
htmlElements = new Array();
constructor(cssLocator, timeout = 20000) {
this.page = dapp_driver_1.DappDriver.Instance.Page;
this.frame = dapp_driver_1.DappDriver.Instance.Frame;
this.timeout = timeout;
this.webElements = !this.frame ? this.page.locator(cssLocator) : this.frame.locator(cssLocator);
}
async elements() {
(await this.webElements.all()).forEach((element) => this.htmlElements.push(new html_element_1.HTMLElement(this.cssLocator, this.timeout, element)));
return this.htmlElements;
}
}
exports.PlaywrightHTMLElementCollection = PlaywrightHTMLElementCollection;