UNPKG

@assert-equals/dappdriver

Version:

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

58 lines (57 loc) 1.43 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Verify = void 0; const html_element_1 = require("../../../controls/html-element"); const page_1 = require("../../../page"); const success_1 = require("./success"); /** * * * @export * @class Verify * @extends {PageObject} */ class Verify extends page_1.PageObject { wordInput = (index) => new html_element_1.HTMLElement(`#word-${index}`); verifyButton = () => new html_element_1.HTMLElement('xpath=//button[contains(., "Verify")]'); /** * Creates an instance of Verify. * @memberof Verify */ constructor() { super('onboarding#/onboarding/create/verify', 'Zerion'); } /** * * * @param {number} index * @param {string} word * @return {*} {Promise<void>} * @memberof Verify */ async enterWord(index, word) { return await this.wordInput(index).type(word); } /** * * * @param {Array<string>} words * @return {*} {Promise<void>} * @memberof Verify */ async enterSeed(words) { for (const word of words) { await this.enterWord(words.indexOf(word), word); } } /** * * * @return {*} {Promise<Success>} * @memberof Verify */ async verify() { return await this.verifyButton().click(success_1.Success); } } exports.Verify = Verify;