@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.65 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfirmRecoveryPhrase = void 0;
const controls_1 = require("../../../controls");
const page_1 = require("../../../page");
const completion_1 = require("./completion");
/**
*
*
* @export
* @class ConfirmRecoveryPhrase
* @extends {PageObject}
*/
class ConfirmRecoveryPhrase extends page_1.PageObject {
chipInput = (index) => new controls_1.InputText(`[data-testid="recovery-phrase-input-${index}"]`);
confirmButton = () => new controls_1.HTMLElement('[data-testid="recovery-phrase-confirm"]');
/**
* Creates an instance of ConfirmRecoveryPhrase.
* @memberof ConfirmRecoveryPhrase
*/
constructor() {
super('/home.html#onboarding/confirm-recovery-phrase', 'MetaMask');
}
/**
*
*
* @param {number} index
* @param {Array<string>} words
* @return {*} {Promise<void>}
* @memberof ConfirmRecoveryPhrase
*/
async enterWord(index, words) {
return await this.chipInput(index).type(words[index]);
}
/**
*
*
* @param {Array<string>} words
* @return {*} {Promise<void>}
* @memberof ConfirmRecoveryPhrase
*/
async enterRequiredWords(words) {
await this.enterWord(2, words);
await this.enterWord(3, words);
await this.enterWord(7, words);
}
/**
*
*
* @return {*} {Promise<Completion>}
* @memberof ConfirmRecoveryPhrase
*/
async confirm() {
return await this.confirmButton().click(completion_1.Completion);
}
}
exports.ConfirmRecoveryPhrase = ConfirmRecoveryPhrase;