mirror of
https://github.com/zhigang1992/xverse-web-extension.git
synced 2026-04-30 05:35:53 +08:00
Adjust feePriority for swap flow
This commit is contained in:
@@ -858,12 +858,15 @@ export default class Wallet {
|
||||
|
||||
// had to disable this rule as my first assertion was always changed to a wrong assertion
|
||||
/* eslint-disable playwright/prefer-web-first-assertions */
|
||||
async switchToHighFees() {
|
||||
async switchToHighFees(feePriorityShown: boolean = true) {
|
||||
// Save the current fee amount for comparison
|
||||
const originalFee = await this.feeAmount.innerText();
|
||||
const numericOriginalFee = parseFloat(originalFee.replace(/[^0-9.]/g, ''));
|
||||
await expect(numericOriginalFee).toBeGreaterThan(0);
|
||||
const feePriority = await this.labelFeePriority.innerText();
|
||||
let feePriority = 'Medium';
|
||||
if (feePriorityShown) {
|
||||
feePriority = await this.labelFeePriority.innerText();
|
||||
}
|
||||
|
||||
// Click on edit Fee button
|
||||
await this.buttonEditFee.click();
|
||||
|
||||
@@ -73,7 +73,7 @@ test.describe('Swap Flow Exchange', () => {
|
||||
// We can only continue if the FeeRate is above 0
|
||||
await wallet.waitForTextAboveZero(wallet.feeAmount, 30000);
|
||||
|
||||
await wallet.switchToHighFees();
|
||||
await wallet.switchToHighFees(false);
|
||||
|
||||
await wallet.buttonSwap.click();
|
||||
await wallet.checkVisualsSendTransactionReview('swap', false, selfBTC);
|
||||
|
||||
@@ -91,7 +91,7 @@ test.describe('Swap Flow ME', () => {
|
||||
// We can only continue if the FeeRate is above 0
|
||||
await wallet.waitForTextAboveZero(wallet.feeAmount, 30000);
|
||||
|
||||
await wallet.switchToHighFees();
|
||||
await wallet.switchToHighFees(false);
|
||||
|
||||
await wallet.buttonSwap.click();
|
||||
await wallet.checkVisualsSendTransactionReview('swap', false, selfBTC);
|
||||
|
||||
@@ -94,7 +94,7 @@ test.describe('Swap Flow Unisat', () => {
|
||||
// We can only continue if the FeeRate is above 0
|
||||
await wallet.waitForTextAboveZero(wallet.feeAmount, 30000);
|
||||
|
||||
await wallet.switchToHighFees();
|
||||
await wallet.switchToHighFees(false);
|
||||
|
||||
await wallet.buttonSwap.click();
|
||||
await wallet.checkVisualsSendTransactionReview('swap', false, selfBTC);
|
||||
|
||||
Reference in New Issue
Block a user