@assert-equals/dappdriver
Version:
DappDriver is an e2e testing framework designed for testing decentralized applications (dApps) using MetaMask, Rainbow or Zerion
60 lines (59 loc) • 1.45 kB
JavaScript
;
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}`);
get verifyButton() {
return new html_element_1.HTMLElement('xpath=//button[contains(., "Verify")]');
}
/**
* Creates an instance of Verify.
* @memberof Verify
*/
constructor() {
super('onboarding#/onboarding/backup/verify-backup', '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;