@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.48 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImportWithRecoveryPhrase = void 0;
const html_element_1 = require("../../../controls/html-element");
const page_1 = require("../../../page");
const create_password_1 = require("./create-password");
/**
*
*
* @export
* @class ImportWithRecoveryPhrase
* @extends {PageObject}
*/
class ImportWithRecoveryPhrase extends page_1.PageObject {
srpInput = (index) => new html_element_1.HTMLElement(`[data-testid="import-srp__srp-word-${index}"]`);
confirmButton = () => new html_element_1.HTMLElement('[data-testid="import-srp-confirm"]');
/**
* Creates an instance of ImportWithRecoveryPhrase.
* @memberof ImportWithRecoveryPhrase
*/
constructor() {
super('/home.html#onboarding/import-with-recovery-phrase', 'MetaMask');
}
/**
*
*
* @param {string} srp
* @return {*} {Promise<void>}
* @memberof ImportWithRecoveryPhrase
*/
async enterSRP(srp) {
const words = srp.split(' ');
for (const word of words) {
await this.srpInput(words.indexOf(word)).type(word);
}
}
/**
*
*
* @return {*} {Promise<CreatePassword>}
* @memberof ImportWithRecoveryPhrase
*/
async confirmSecretRecoveryPhrase() {
return await this.confirmButton().click(create_password_1.CreatePassword);
}
}
exports.ImportWithRecoveryPhrase = ImportWithRecoveryPhrase;