UNPKG

@assert-equals/dappdriver

Version:

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

83 lines (82 loc) 2.26 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CreatePassword = void 0; const __1 = require("../.."); const html_element_1 = require("../../../controls/html-element"); const page_1 = require("../../../page"); /** * * * @export * @class CreatePassword * @extends {PageObject} */ class CreatePassword extends page_1.PageObject { get newPasswordInput() { return new html_element_1.HTMLElement('[data-testid="create-password-new-input"]'); } get confirmPasswordInput() { return new html_element_1.HTMLElement('[data-testid="create-password-confirm-input"]'); } get passwordTermsCheckbox() { return new html_element_1.HTMLElement('[data-testid="create-password-terms"]'); } get submitButton() { return new html_element_1.HTMLElement('[data-testid="create-password-submit"]'); } /** * 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<Metametrics>} * @memberof CreatePassword */ async importWallet() { return await this.submitButton.click(__1.Metametrics); } /** * * * @return {*} {Promise<ReviewRecoveryPhrase>} * @memberof CreatePassword */ async createWallet() { return await this.submitButton.click(__1.ReviewRecoveryPhrase); } } exports.CreatePassword = CreatePassword;