UNPKG

@assert-equals/dappdriver

Version:

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

54 lines (53 loc) 1.68 kB
"use strict"; 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 { get srpTextarea() { return new html_element_1.HTMLElement('[data-testid="srp-input-import__srp-note"]'); } srpInput = (index) => new html_element_1.HTMLElement(`[data-testid="import-srp__srp-word-${index}"]`); get confirmButton() { return 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(' '); await this.srpTextarea.type(words[0] + ' '); for (let i = 1; i < words.length; i++) { await this.srpInput(i).type(words[i] + ' '); } } /** * * * @return {*} {Promise<CreatePassword>} * @memberof ImportWithRecoveryPhrase */ async confirmSecretRecoveryPhrase() { return await this.confirmButton.click(create_password_1.CreatePassword); } } exports.ImportWithRecoveryPhrase = ImportWithRecoveryPhrase;