Skip to content

Commit

Permalink
added method getAmountHelperText
Browse files Browse the repository at this point in the history
  • Loading branch information
Nebyt committed Jul 15, 2024
1 parent c6ba1d6 commit 82fae99
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions packages/e2e-tests/pages/wallet/walletTab/sendSubTab.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ class SendSubTab extends WalletTab {
locator: '//input[starts-with(@id, "amount--")]', // unfortunately, I didn't find a way to make a proper ID
method: 'xpath',
};
amountToSendHelperTextLocator = {
locator: 'wallet:send:addAssetsStep-amountError-text',
method: 'id',
};
addTokenButtonLocator = {
locator: 'wallet:send:addAssetsStep-addTokens-button',
method: 'id',
Expand Down Expand Up @@ -69,7 +73,7 @@ class SendSubTab extends WalletTab {
receiverHandleInfoTextLocator = {
locator: 'wallet:send:confrimTransactionStep-receiverHandleInfo-text',
method: 'id',
}
};
receiverAddressTextLocator = {
locator: 'wallet:send:confrimTransactionStep-receiverAddress-text',
method: 'id',
Expand Down Expand Up @@ -137,7 +141,7 @@ class SendSubTab extends WalletTab {
}
async getReceiverHandlerAddress() {
this.logger.info(`SendSubTab::getReceiverHandlerAddress is called.`);
return await this.getText(this.domainResolverAddressTextLocator)
return await this.getText(this.domainResolverAddressTextLocator);
}
async enterMemo(memo) {
this.logger.info(`SendSubTab::enterMemo is called. Memo: ${memo}`);
Expand Down Expand Up @@ -183,6 +187,19 @@ class SendSubTab extends WalletTab {
}
}
}
async getAmountHelperText() {
this.logger.info(`SendSubTab::getAmountHelperText is called.`);
const fieldIsNotEmpty = await this.customWaiter(async () => {
const fieldElem = await this.findElement(this.amountToSendHelperTextLocator);
const fieldText = await fieldElem.getText();
return fieldText !== '' && fieldText !== null && fieldText !== undefined;
});
if (fieldIsNotEmpty) {
return await this.getText(this.amountToSendHelperTextLocator);
} else {
throw new Error('There is no an error message');
}
}
async getInfoFromConfirmTxPage() {
this.logger.info(`SendSubTab::getInfoFromConfirmTxPage is called.`);
throw new Error('The function is in development');
Expand Down

0 comments on commit 82fae99

Please sign in to comment.