@assert-equals/dappdriver
Version:
DappDriver is an e2e testing framework designed for testing decentralized applications (dApps) using MetaMask, Rainbow or Zerion
61 lines (60 loc) • 1.69 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BackUpRecoveryPhrase = void 0;
const html_element_1 = require("../../../controls/html-element");
const page_1 = require("../../../page");
const verify_1 = require("./verify");
/**
*
*
* @export
* @class BackUpRecoveryPhrase
* @extends {PageObject}
*/
class BackUpRecoveryPhrase extends page_1.PageObject {
get revealButton() {
return new html_element_1.HTMLElement('button[type="button"]');
}
get seedLabel() {
return new html_element_1.HTMLElement('xpath=//div[contains(@class, "CaYX_a_zstack")]//div[contains(@class, "_uitext_tij8c_1")]');
}
get verifyBackUpButton() {
return new html_element_1.HTMLElement('xpath=//button[contains(., "Verify Backup")]');
}
/**
* Creates an instance of BackUpRecoveryPhrase.
* @memberof BackUpRecoveryPhrase
*/
constructor() {
super('onboarding#/onboarding/backup/recovery-phrase', 'Zerion');
}
/**
*
*
* @return {*} {Promise<void>}
* @memberof BackUpRecoveryPhrase
*/
async reveal() {
return await this.revealButton.clickAndWait();
}
/**
*
*
* @return {*} {Promise<Array<string>>}
* @memberof BackUpRecoveryPhrase
*/
async getSeed() {
const seedPhrase = await this.seedLabel.getText();
return seedPhrase.split(' ');
}
/**
*
*
* @return {*} {Promise<Verify>}
* @memberof BackUpRecoveryPhrase
*/
async verify() {
return await this.verifyBackUpButton.click(verify_1.Verify);
}
}
exports.BackUpRecoveryPhrase = BackUpRecoveryPhrase;