@assert-equals/dappdriver
Version:
DappDriver is an e2e testing framework designed for testing decentralized applications (dApps) using MetaMask, Rainbow or Zerion
51 lines (50 loc) • 1.37 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImportSeed = void 0;
const __1 = require("../..");
const controls_1 = require("../../../controls");
const page_1 = require("../../../page");
/**
*
*
* @export
* @class ImportSeed
* @extends {PageObject}
*/
class ImportSeed extends page_1.PageObject {
secretInput = (position) => new controls_1.InputText(`[data-testid="secret-input-${position}"]`);
get importWalletsButton() {
return new controls_1.HTMLElement('[data-testid="import-wallets-button"]');
}
/**
* Creates an instance of ImportSeed.
* @memberof ImportSeed
*/
constructor() {
super('/popup.html#/import/seed?onboarding=true', 'Rainbow Wallet');
}
/**
*
*
* @param {string} srp
* @return {*} {Promise<void>}
* @memberof ImportSeed
*/
async enterSRP(srp) {
const words = srp.split(' ');
for (let index = 0; index < words.length; index++) {
const position = index + 1;
await this.secretInput(position).type(words[index]);
}
}
/**
*
*
* @return {*} {Promise<ImportSelect>}
* @memberof ImportSeed
*/
async importWalletGroup() {
return await this.importWalletsButton.click(__1.ImportSelect);
}
}
exports.ImportSeed = ImportSeed;