UNPKG

@assert-equals/dappdriver

Version:

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

76 lines (75 loc) 2.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CreatePassword = void 0; const html_element_1 = require("../../../controls/html-element"); const page_1 = require("../../../page"); const index_1 = require("../../index"); /** * * * @export * @class CreatePassword * @extends {PageObject} */ class CreatePassword extends page_1.PageObject { newPasswordInput = () => new html_element_1.HTMLElement('[data-testid="create-password-new"]'); confirmPasswordInput = () => new html_element_1.HTMLElement('[data-testid="create-password-confirm"]'); passwordTermsCheckbox = () => new html_element_1.HTMLElement('[data-testid="create-password-terms"]'); importButton = () => new html_element_1.HTMLElement('[data-testid="create-password-import"]'); createButton = () => new html_element_1.HTMLElement('[data-testid="create-password-wallet"]'); /** * Creates an instance of CreatePassword. * @memberof CreatePassword */ constructor() { super('/home.html#onboarding/create-password', 'MetaMask'); } /** * * * @param {string} [password='P@ssword01!'] * @return {*} {Promise<void>} * @memberof CreatePassword */ async confirmPassword(password = 'P@ssword01!') { return await this.confirmPasswordInput().type(password); } /** * * * @param {string} [password='P@ssword01!'] * @return {*} {Promise<void>} * @memberof CreatePassword */ async enterPassword(password = 'P@ssword01!') { return await this.newPasswordInput().type(password); } /** * * * @return {*} {Promise<void>} * @memberof CreatePassword */ async agreePasswordTerms() { return await this.passwordTermsCheckbox().click(); } /** * * * @return {*} {Promise<Completion>} * @memberof CreatePassword */ async importWallet() { return await this.importButton().click(index_1.Completion); } /** * * * @return {*} {Promise<SecureYourWallet>} * @memberof CreatePassword */ async createWallet() { return await this.createButton().click(index_1.SecureYourWallet); } } exports.CreatePassword = CreatePassword;