@assert-equals/dappdriver
Version:
DappDriver is an e2e testing framework designed for testing decentralized applications (dApps) using MetaMask, Rainbow or Zerion
47 lines (46 loc) • 1.36 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SignInRequest = void 0;
const html_element_1 = require("../../controls/html-element");
const confirm_transaction_1 = require("./confirm-transaction");
/**
*
*
* @export
* @class SignInRequest
* @extends {ConfirmTransaction}
* @implements {IConfirmation}
*/
class SignInRequest extends confirm_transaction_1.ConfirmTransaction {
get nextButton() {
return new html_element_1.HTMLElement('[data-testid="confirm-footer-button"]');
}
get cancelButton() {
return new html_element_1.HTMLElement('[data-testid="confirm-footer-cancel-button"]');
}
get scrollButton() {
return new html_element_1.HTMLElement('[aria-label="Scroll down"]', 8000);
}
/**
* Creates an instance of SignInRequest.
* @memberof SignInRequest
*/
constructor() {
super('#/confirm-transaction', 'MetaMask');
}
/**
*
*
* @template TPage
* @param {new () => TPage} page
* @return {*} {Promise<TPage>}
* @memberof SignInRequest
*/
async accept(page) {
if (await this.scrollButton.isDisplayed()) {
await this.scrollButton.clickAndWait();
}
return await this.nextButton.clickAndSwitchToWindow(page);
}
}
exports.SignInRequest = SignInRequest;