@assert-equals/dappdriver
Version:
DappDriver is an e2e testing framework designed for testing decentralized applications (dApps) using MetaMask, Rainbow or Zerion
48 lines (47 loc) • 1.31 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RecoveryPhrase = void 0;
const controls_1 = require("../../../controls");
const page_1 = require("../../../page");
const select_wallets_1 = require("./select-wallets");
/**
*
*
* @export
* @class RecoveryPhrase
* @extends {PageObject}
*/
class RecoveryPhrase extends page_1.PageObject {
srpInput = (index) => new controls_1.InputText(`#word-${index}`);
importWalletButton = () => new controls_1.HTMLElement('form button:nth-of-type(2)');
/**
* Creates an instance of RecoveryPhrase.
* @memberof RecoveryPhrase
*/
constructor() {
super('onboarding#/onboarding/import/mnemonic', 'Zerion');
}
/**
*
*
* @param {string} srp
* @return {*} {Promise<void>}
* @memberof RecoveryPhrase
*/
async enterSRP(srp) {
const words = srp.split(' ');
for (const word of words) {
await this.srpInput(words.indexOf(word)).type(word);
}
}
/**
*
*
* @return {*} {Promise<SelectWallets>}
* @memberof RecoveryPhrase
*/
async confirmSecretRecoveryPhrase() {
return await this.importWalletButton().click(select_wallets_1.SelectWallets);
}
}
exports.RecoveryPhrase = RecoveryPhrase;