Optimize Visual Check for Transaction Review Page

Add FeeChange to transaction flows
Add stabilisation for FeeSelection and copyAddress function
This commit is contained in:
Christine Pinto
2024-08-07 16:09:53 +02:00
parent 5321c80bdc
commit 36594b4a97
18 changed files with 144 additions and 146 deletions

View File

@@ -114,7 +114,7 @@ function ReceiveCardComponent({
};
return (
<ReceiveCard className={className}>
<ReceiveCard data-testid="address-div" className={className}>
<ColumnContainer>
{children}
<TitleText>{title}</TitleText>

View File

@@ -147,7 +147,7 @@ function SelectFeeRate({
<RowContainer>
<EditRow>
{feeRateSpeed && (
<Label $size="m" $variant="dark">
<Label data-testid="fee-priority" $size="m" $variant="dark">
{feeRateSpeed}{' '}
</Label>
)}

View File

@@ -87,7 +87,6 @@ export default class Onboarding {
this.secondParagraphBackupStep = page.getByRole('heading', { name: 'Confirm you' });
this.textSeedWords = page.locator('p[translate="no"]');
this.buttonSeedWords = page.locator('button[value]:not([value=""])');
// TODO: find more stable selector
this.header = page.locator('#app h3');
this.inputPassword = page.locator('input[type="password"]');
this.errorMessage = page.getByRole('heading', { name: 'Your password should be at' });

View File

@@ -354,6 +354,10 @@ export default class Wallet {
readonly containerQRCode: Locator;
readonly labelFeePriority: Locator;
readonly divAddress: Locator;
constructor(readonly page: Page) {
this.page = page;
this.navigationDashboard = page.getByTestId('nav-dashboard');
@@ -376,6 +380,7 @@ export default class Wallet {
this.feeAmount = page.getByTestId('fee-amount');
this.buttonSelectFee = page.getByTestId('fee-select-button');
this.labelTotalFee = page.getByTestId('total-fee');
this.labelFeePriority = page.getByTestId('fee-priority');
// Account
this.labelAccountName = page.getByLabel('Account Name');
@@ -484,6 +489,7 @@ export default class Wallet {
// Receive
this.buttonQRAddress = page.getByTestId('qr-button');
this.labelAddress = page.getByTestId('address-label');
this.divAddress = page.getByTestId('address-div');
this.containerQRCode = page.getByTestId('qr-container');
// Swap
@@ -546,7 +552,6 @@ export default class Wallet {
this.sendSTXValue = page.getByTestId('send-value');
this.inputField = page.locator('input[type="text"]');
this.sendRuneAmount = page.getByTestId('send-rune-amount');
//
// List
this.buttonList = page.getByTestId('action-button').filter({ hasText: 'List' });
@@ -629,29 +634,6 @@ export default class Wallet {
await expect(this.buttonBack).toBeVisible();
}
async checkVisualsSendInscriptionsPage2(ordinalAddress, ordinalNumber, collection) {
await expect(this.buttonExpand).toBeVisible();
await expect(this.buttonCancel).toBeEnabled();
await expect(this.buttonConfirm).toBeEnabled();
await expect(this.buttonEditFee).toBeVisible();
await expect(this.feeAmount).toBeVisible();
await expect(this.imageToken).toBeVisible();
await this.buttonExpand.click();
await expect(this.sendAddress.first()).toBeVisible();
await expect(this.receiveAddress.first()).toBeVisible();
await expect(this.confirmAmount.first()).toBeVisible();
await expect(this.confirmBalance.first()).toBeVisible();
await expect(await this.receiveAddress.first().innerText()).toContain(ordinalAddress.slice(-4));
// Collection Inscriptions don't have the ordinal number displayed in the Review
// Check if the right ordinal number is shown
if (!collection) {
const reviewNumberOrdinal = await this.numberInscription.first().innerText();
await expect(ordinalNumber).toMatch(reviewNumberOrdinal);
}
}
/**
* Checks the visibility and state of UI elements state on first page in Send Flow
*
@@ -703,7 +685,17 @@ export default class Wallet {
// await expect(this.buttonBack).toBeVisible();
}
// SendAddress or receiveAddress can be null as not all TR screens have them e.g. swap
/**
* Checks the visuals and elements on the send transaction review page.
*
* @param {string} url - The expected partial URL of the review page.
* @param {boolean} editableFees - Optional. Indicates whether the fees can be edited on the Review page
* @param {string} sendAddress - Optional. The expected last 4 characters of the sender's address
* @param {string} receiverAddress - Optional. The expected last 4 characters of the receiver's address
* @param {boolean} totalAmountShown - Optional. Indicates whether the total amount is shown. Default is true.
* @param {boolean} tokenImageShown - Optional. Indicates whether the token image is shown. Default is true.
* @param {string} ordinalNumber - Optional. The expected ordinal number to be displayed for single Inscriptions
*/
async checkVisualsSendTransactionReview(
url: string,
editableFees?: boolean,
@@ -711,6 +703,7 @@ export default class Wallet {
receiverAddress?: string,
totalAmountShown: boolean = true,
tokenImageShown: boolean = true,
ordinalNumber?: string,
) {
await expect(this.page.url()).toContain(url);
await expect(this.buttonExpand).toBeVisible();
@@ -749,6 +742,12 @@ export default class Wallet {
receiverAddress.slice(-4),
);
}
// Collection Inscriptions don't have the ordinal number displayed in the Review
// Check if the right ordinal number is shown
if (ordinalNumber) {
const reviewNumberOrdinal = await this.numberInscription.first().innerText();
await expect(ordinalNumber).toMatch(reviewNumberOrdinal);
}
}
// Check Visuals of Rune Dashboard (without List button), return balance amount
@@ -857,6 +856,40 @@ export default class Wallet {
await expect(this.buttonNext).toBeDisabled();
}
// 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() {
// 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();
// Click on edit Fee button
await this.buttonEditFee.click();
await expect(this.buttonSelectFee.first()).toBeVisible();
await expect(this.labelTotalFee.first()).toBeVisible();
// Compare fee to previous saved fee
const fee = await this.buttonSelectFee
.filter({ hasText: feePriority })
.locator(this.labelTotalFee)
.innerText();
const numericFee = parseFloat(fee.replace(/[^0-9.]/g, ''));
await expect(numericFee).toBe(numericOriginalFee);
// Save high fee rate for comparison
const highFee = await this.labelTotalFee.first().innerText();
const numericHighFee = parseFloat(highFee.replace(/[^0-9.]/g, ''));
// Switch to high fee
await this.buttonSelectFee.first().click();
const newFee = await this.feeAmount.innerText();
const numericNewFee = parseFloat(newFee.replace(/[^0-9.]/g, ''));
await expect(numericNewFee).toBe(numericHighFee);
}
async navigateToCollectibles() {
await this.navigationNFT.click();
await expect(this.page.url()).toContain('nft-dashboard');
@@ -921,9 +954,11 @@ export default class Wallet {
// click on 'Receive' button
await this.allUpperButtons.nth(1).click();
// Locate the QR button to the address
const button = this.divAddress.filter({ hasText: whichAddress }).locator(this.buttonQRAddress);
// Need to click on the QR Code button to get the full Address
// TODO change it to name of the Address instead of index
await this.buttonQRAddress.nth(whichAddress).click();
await button.click();
await expect(this.containerQRCode).toBeVisible();
const address = await this.labelAddress.innerText();
@@ -1138,8 +1173,8 @@ export default class Wallet {
}
// The function toggleAllTokens takes a boolean parameter enable.
// true indicates enabling token (using inactive tokens).
// false indicates disabling token (using active tokens).
// true indicates enabling token (using inactive tokens).
// false indicates disabling token (using active tokens).
async toggleAllTokens(enable: boolean) {
// Determine which tokens to interact with based on the 'enable' parameter
const tokenSelector = enable ? this.checkboxTokenInactive : this.checkboxTokenActive;

View File

@@ -76,9 +76,9 @@ test.describe('Create and Restore Wallet Flow', () => {
await expect(newWallet.balance).toHaveText('$0.00');
// Get the addresses and save it in variables
const addressBitcoin = await newWallet.getAddress(0);
const addressOrdinals = await newWallet.getAddress(1);
const addressStack = await newWallet.getAddress(2);
const addressBitcoin = await newWallet.getAddress('Bitcoin');
const addressOrdinals = await newWallet.getAddress('Ordinals');
const addressStack = await newWallet.getAddress('Stacks');
// Save the Address in a file so that other tests can access them
const dataAddress = JSON.stringify({
@@ -140,9 +140,9 @@ test.describe('Create and Restore Wallet Flow', () => {
await await expect(balanceText).toHaveText('$0.00');
// Get the Addresses
const addressBitcoinCheck = await newWallet.getAddress(0);
const addressOrdinalsCheck = await newWallet.getAddress(1);
const addressStackCheck = await newWallet.getAddress(2);
const addressBitcoinCheck = await newWallet.getAddress('Bitcoin');
const addressOrdinalsCheck = await newWallet.getAddress('Ordinals');
const addressStackCheck = await newWallet.getAddress('Stacks');
// Read and parse the file
const rawData = fs.readFileSync(filePathAddresses, 'utf8');

View File

@@ -13,8 +13,8 @@ test.describe('List runes', () => {
await wallet.setupTest(extensionId, 'SEED_WORDS1', false);
// get own BTC & Ordinals Address for address check on review page
const selfBTC = await wallet.getAddress(0);
const selfOrdinals = await wallet.getAddress(1);
const selfBTC = await wallet.getAddress('Bitcoin');
const selfOrdinals = await wallet.getAddress('Ordinals');
// Check if Rune is enabled and if not enable the rune and click on it
await wallet.checkAndClickOnSpecificRune(runeName);
@@ -146,8 +146,8 @@ test.describe('List runes', () => {
await wallet.setupTest(extensionId, 'SEED_WORDS1', false);
// get own BTC & Ordinals Address for address check on review page
const selfBTC = await wallet.getAddress(0);
const selfOrdinals = await wallet.getAddress(1);
const selfBTC = await wallet.getAddress('Bitcoin');
const selfOrdinals = await wallet.getAddress('Ordinals');
// Check if Rune is enabled and if not enable the rune and click on it
await wallet.checkAndClickOnSpecificRune(runeName);

View File

@@ -10,7 +10,7 @@ test.describe('Cancel runes listing', () => {
await wallet.setupTest(extensionId, 'SEED_WORDS1', false);
// get own BTC & Ordinals Address for address check on review page
const selfOrdinals = await wallet.getAddress(1);
const selfOrdinals = await wallet.getAddress('Ordinals');
// Check if Rune is enabled and if not enable the rune and click on it
await wallet.checkAndClickOnSpecificRune(runeName);
@@ -72,7 +72,7 @@ test.describe('Cancel runes listing', () => {
await wallet.setupTest(extensionId, 'SEED_WORDS1', false);
// get own BTC & Ordinals Address for address check on review page
const selfOrdinals = await wallet.getAddress(1);
const selfOrdinals = await wallet.getAddress('Ordinals');
// Check if Rune is enabled and if not enable the rune and click on it
await wallet.checkAndClickOnSpecificRune(runeName);

View File

@@ -12,7 +12,7 @@ test.describe('Send runes', () => {
await wallet.setupTest(extensionId, 'SEED_WORDS1', false);
// get own Ordinals Address for address check on review page
const addressOrdinals = await wallet.getAddress(1);
const addressOrdinals = await wallet.getAddress('Ordinals');
// Check if Rune is enabled and if not enable the rune and click on it
await wallet.checkAndClickOnSpecificRune('SKIBIDI•OHIO•RIZZ');
@@ -46,8 +46,8 @@ test.describe('Send runes', () => {
await wallet.setupTest(extensionId, 'SEED_WORDS1', true);
// get own BTC & Ordinals Address for address check on review page
const selfBTC = await wallet.getAddress(0);
const addressOrdinals = await wallet.getAddress(1);
const selfBTC = await wallet.getAddress('Bitcoin');
const addressOrdinals = await wallet.getAddress('Ordinals');
// Check if Rune is enabled and if not enable the rune and click on it
await wallet.checkAndClickOnSpecificRune(runeName);

View File

@@ -12,8 +12,8 @@ test.describe('Send runes', () => {
await wallet.setupTest(extensionId, 'SEED_WORDS1', true);
// get own BTC & Ordinals Address for address check on review page
const selfBTC = await wallet.getAddress(0);
const addressOrdinals = await wallet.getAddress(1);
const selfBTC = await wallet.getAddress('Bitcoin');
const addressOrdinals = await wallet.getAddress('Ordinals');
// Check if Rune is enabled and if not enable the rune and click on it
await wallet.checkAndClickOnSpecificRune(runeName);
@@ -53,6 +53,9 @@ test.describe('Send runes', () => {
const sendAmountNumerical = parseFloat(sendRuneAmount.replace(/[^0-9.]/g, ''));
await expect(price1).toEqual(sendAmountNumerical);
// TODO: this function doesn't work for the rune fee change on the review transaction page as the changed fee is too slow for the E2E
// await wallet.switchToHighFees();
// Cancel the transaction
await expect(wallet.buttonCancel).toBeEnabled();
await wallet.buttonCancel.click();

View File

@@ -19,7 +19,7 @@ test.describe('Swap Flow Exchange', () => {
await wallet.setupTest(extensionId, 'SEED_WORDS1', true);
// get own BTC Address
const selfBTC = await wallet.getAddress(0);
const selfBTC = await wallet.getAddress('Bitcoin');
await wallet.checkVisualsStartpage();

View File

@@ -16,7 +16,7 @@ test.describe('Swap Flow Exchange', () => {
await wallet.setupTest(extensionId, 'SEED_WORDS1', false);
// get own BTC Address
const selfBTC = await wallet.getAddress(0);
const selfBTC = await wallet.getAddress('Bitcoin');
await wallet.checkVisualsStartpage();
@@ -73,31 +73,7 @@ test.describe('Swap Flow Exchange', () => {
// We can only continue if the FeeRate is above 0
await wallet.waitForTextAboveZero(wallet.feeAmount, 30000);
// Save the current fee amount for comparison
const originalFee = await wallet.feeAmount.innerText();
const numericOriginalFee = parseFloat(originalFee.replace(/[^0-9.]/g, ''));
await expect(numericOriginalFee).toBeGreaterThan(0);
// Click on edit Fee button
await wallet.buttonEditFee.click();
await expect(wallet.buttonSelectFee.first()).toBeVisible();
await expect(wallet.labelTotalFee.first()).toBeVisible();
// Compare medium fee to previous saved fee
const mediumFee = await wallet.labelTotalFee.last().innerText();
const numericMediumFee = parseFloat(mediumFee.replace(/[^0-9.]/g, ''));
await expect(numericMediumFee).toBe(numericOriginalFee);
// Save high fee rate for comparison
const highFee = await wallet.labelTotalFee.first().innerText();
const numericHighFee = parseFloat(highFee.replace(/[^0-9.]/g, ''));
// Switch to high fee
await wallet.buttonSelectFee.first().click();
const newFee = await wallet.feeAmount.innerText();
const numericNewFee = parseFloat(newFee.replace(/[^0-9.]/g, ''));
await expect(numericNewFee).toBe(numericHighFee);
await wallet.switchToHighFees();
await wallet.buttonSwap.click();
await wallet.checkVisualsSendTransactionReview('swap', false, selfBTC);

View File

@@ -20,7 +20,7 @@ test.describe('Swap Flow ME', () => {
await wallet.setupTest(extensionId, 'SEED_WORDS1', false);
// get own BTC Address
const selfBTC = await wallet.getAddress(0);
const selfBTC = await wallet.getAddress('Bitcoin');
await wallet.checkVisualsStartpage();

View File

@@ -17,7 +17,7 @@ test.describe('Swap Flow ME', () => {
await wallet.setupTest(extensionId, 'SEED_WORDS1', false);
// get own BTC Address
const selfBTC = await wallet.getAddress(0);
const selfBTC = await wallet.getAddress('Bitcoin');
await wallet.checkVisualsStartpage();
@@ -91,31 +91,7 @@ test.describe('Swap Flow ME', () => {
// We can only continue if the FeeRate is above 0
await wallet.waitForTextAboveZero(wallet.feeAmount, 30000);
// Save the current fee amount for comparison
const originalFee = await wallet.feeAmount.innerText();
const numericOriginalFee = parseFloat(originalFee.replace(/[^0-9.]/g, ''));
await expect(numericOriginalFee).toBeGreaterThan(0);
// Click on edit Fee button
await wallet.buttonEditFee.click();
await expect(wallet.buttonSelectFee.first()).toBeVisible();
await expect(wallet.labelTotalFee.first()).toBeVisible();
// Compare medium fee to previous saved fee
const mediumFee = await wallet.labelTotalFee.last().innerText();
const numericMediumFee = parseFloat(mediumFee.replace(/[^0-9.]/g, ''));
await expect(numericMediumFee).toBe(numericOriginalFee);
// Save high fee rate for comparison
const highFee = await wallet.labelTotalFee.first().innerText();
const numericHighFee = parseFloat(highFee.replace(/[^0-9.]/g, ''));
// Switch to high fee
await wallet.buttonSelectFee.first().click();
const newFee = await wallet.feeAmount.innerText();
const numericNewFee = parseFloat(newFee.replace(/[^0-9.]/g, ''));
await expect(numericNewFee).toBe(numericHighFee);
await wallet.switchToHighFees();
await wallet.buttonSwap.click();
await wallet.checkVisualsSendTransactionReview('swap', false, selfBTC);

View File

@@ -17,7 +17,7 @@ test.describe('Swap Flow Unisat', () => {
await wallet.setupTest(extensionId, 'SEED_WORDS1', false);
// get own BTC Address
const selfBTC = await wallet.getAddress(0);
const selfBTC = await wallet.getAddress('Bitcoin');
await wallet.checkVisualsStartpage();
@@ -94,31 +94,7 @@ test.describe('Swap Flow Unisat', () => {
// We can only continue if the FeeRate is above 0
await wallet.waitForTextAboveZero(wallet.feeAmount, 30000);
// Save the current fee amount for comparison
const originalFee = await wallet.feeAmount.innerText();
const numericOriginalFee = parseFloat(originalFee.replace(/[^0-9.]/g, ''));
await expect(numericOriginalFee).toBeGreaterThan(0);
// Click on edit Fee button
await wallet.buttonEditFee.click();
await expect(wallet.buttonSelectFee.first()).toBeVisible();
await expect(wallet.labelTotalFee.first()).toBeVisible();
// Compare medium fee to previous saved fee
const mediumFee = await wallet.labelTotalFee.last().innerText();
const numericMediumFee = parseFloat(mediumFee.replace(/[^0-9.]/g, ''));
await expect(numericMediumFee).toBe(numericOriginalFee);
// Save high fee rate for comparison
const highFee = await wallet.labelTotalFee.first().innerText();
const numericHighFee = parseFloat(highFee.replace(/[^0-9.]/g, ''));
// Switch to high fee
await wallet.buttonSelectFee.first().click();
const newFee = await wallet.feeAmount.innerText();
const numericNewFee = parseFloat(newFee.replace(/[^0-9.]/g, ''));
await expect(numericNewFee).toBe(numericHighFee);
await wallet.switchToHighFees();
await wallet.buttonSwap.click();
await wallet.checkVisualsSendTransactionReview('swap', false, selfBTC);

View File

@@ -9,7 +9,7 @@ test.describe('Collectibles Tab - Inscriptions', () => {
await wallet.setupTest(extensionId, 'SEED_WORDS1', true);
// get own Ordinals Address for address check on review page
const addressOrdinals = await wallet.getAddress(1);
const addressOrdinals = await wallet.getAddress('Ordinals');
// Navigate to Collectibles tab
await wallet.navigateToCollectibles();
@@ -62,7 +62,15 @@ test.describe('Collectibles Tab - Inscriptions', () => {
await wallet.buttonNext.click();
// Transaction Review Page
await wallet.checkVisualsSendInscriptionsPage2(TEST_ORDINALS_ADDRESS, orgNumberOrdinal, true);
await wallet.checkVisualsSendTransactionReview(
'send-ordinal',
true,
'',
TEST_ORDINALS_ADDRESS,
false,
);
await wallet.switchToHighFees();
// Cancel the transaction
await wallet.buttonCancel.click();
@@ -142,7 +150,13 @@ test.describe('Collectibles Tab - Inscriptions', () => {
await wallet.buttonNext.click();
// Transaction Review Page
await wallet.checkVisualsSendInscriptionsPage2(TEST_ORDINALS_ADDRESS, orgNumberOrdinal, true);
await wallet.checkVisualsSendTransactionReview(
'send-ordinal',
true,
'',
TEST_ORDINALS_ADDRESS,
false,
);
await wallet.confirmSendTransaction();
@@ -162,7 +176,7 @@ test.describe('Collectibles Tab - Inscriptions', () => {
await wallet.setupTest(extensionId, 'SEED_WORDS1', true);
// get own Ordinals Address for address check on review page
const addressOrdinals = await wallet.getAddress(1);
const addressOrdinals = await wallet.getAddress('Ordinals');
// Navigate to Collectibles tab
await wallet.navigateToCollectibles();
@@ -210,7 +224,17 @@ test.describe('Collectibles Tab - Inscriptions', () => {
await wallet.buttonNext.click();
// Transaction Review Page
await wallet.checkVisualsSendInscriptionsPage2(TEST_ORDINALS_ADDRESS, orgNumberOrdinal, false);
await wallet.checkVisualsSendTransactionReview(
'send-ordinal',
true,
'',
TEST_ORDINALS_ADDRESS,
false,
true,
orgNumberOrdinal,
);
await wallet.switchToHighFees();
// Cancel the transaction
await wallet.buttonCancel.click();
@@ -274,7 +298,15 @@ test.describe('Collectibles Tab - Inscriptions', () => {
await wallet.buttonNext.click();
// Transaction Review Page
await wallet.checkVisualsSendInscriptionsPage2(TEST_ORDINALS_ADDRESS, orgNumberOrdinal, false);
await wallet.checkVisualsSendTransactionReview(
'send-ordinal',
true,
'',
TEST_ORDINALS_ADDRESS,
false,
true,
orgNumberOrdinal,
);
await wallet.confirmSendTransaction();

View File

@@ -31,7 +31,7 @@ test.describe('Collectibles Tab - Rare sats', () => {
await wallet.setupTest(extensionId, 'SEED_WORDS1', true);
// get own Ordinals Address for address check on review page
const addressOrdinals = await wallet.getAddress(1);
const addressOrdinals = await wallet.getAddress('Ordinals');
// Navigate to Collectibles tab
await wallet.navigateToCollectibles();
@@ -67,6 +67,8 @@ test.describe('Collectibles Tab - Rare sats', () => {
false,
);
await wallet.switchToHighFees();
// Cancel the transaction
await wallet.buttonCancel.click();
@@ -82,7 +84,7 @@ test.describe('Collectibles Tab - Rare sats', () => {
await wallet.setupTest(extensionId, 'SEED_WORDS1', true);
// get own Ordinals Address for address check on review page
const addressOrdinals = await wallet.getAddress(1);
const addressOrdinals = await wallet.getAddress('Ordinals');
// Navigate to Collectibles tab
await wallet.navigateToCollectibles();

View File

@@ -13,7 +13,7 @@ test.describe('Transaction BTC', () => {
await wallet.setupTest(extensionId, 'SEED_WORDS2', false);
// get own BTC & Ordinals Address for address check on review page
const selfBTC = await wallet.getAddress(0);
const selfBTC = await wallet.getAddress('Bitcoin');
// Save initial Balance for later Balance checks
const initialBTCBalance = await wallet.getTokenBalance('Bitcoin');
@@ -59,7 +59,7 @@ test.describe('Transaction BTC', () => {
await wallet.setupTest(extensionId, 'SEED_WORDS1', true);
// get own BTC Address
const selfBTCTest = await wallet.getAddress(0);
const selfBTCTest = await wallet.getAddress('Bitcoin');
// Save initial Balance for later Balance checks
const initialBTCBalance = await wallet.getTokenBalance('Bitcoin');
@@ -102,6 +102,8 @@ test.describe('Transaction BTC', () => {
// Check correct amounts
await wallet.checkAmountsSendingBTC(selfBTCTest, BTCTest, amountBTCSend);
await wallet.switchToHighFees();
// Cancel the transaction
await expect(wallet.buttonCancel).toBeEnabled();
await wallet.buttonCancel.click();
@@ -120,7 +122,7 @@ test.describe('Transaction BTC', () => {
await wallet.setupTest(extensionId, 'SEED_WORDS1', true);
// get own BTC Address
const selfBTCTest = await wallet.getAddress(0);
const selfBTCTest = await wallet.getAddress('Bitcoin');
// Save initial Balance for later Balance checks
const initialBTCBalance = await wallet.getTokenBalance('Bitcoin');
@@ -166,6 +168,4 @@ test.describe('Transaction BTC', () => {
const balanceAfterCancel = await wallet.getTokenBalance('Bitcoin');
await expect(initialBTCBalance).toEqual(balanceAfterCancel);
});
// TODO: add test where we change the fees for a BTC transaction
});

View File

@@ -11,7 +11,7 @@ test.describe('Transaction STX', () => {
await wallet.setupTest(extensionId, 'SEED_WORDS1', false);
// get own STX Address
const selfSTXMain = await wallet.getAddress(2);
const selfSTXMain = await wallet.getAddress('Stacks');
await wallet.checkVisualsStartpage();
@@ -91,6 +91,8 @@ test.describe('Transaction STX', () => {
// Check correct amounts
await wallet.checkAmountsSendingSTX(amountSTXSend, STXTest, sendFee);
await wallet.switchToHighFees();
// Cancel the transaction
await expect(wallet.buttonCancel).toBeEnabled();
await wallet.buttonCancel.click();
@@ -103,7 +105,6 @@ test.describe('Transaction STX', () => {
await expect(initialSTXBalance).toEqual(balanceAfterCancel);
});
// TODO: need to add Stack funds to the wallet, testnet is currently not avaiable
test('Send STX - confirm transaction testnet #localexecution', async ({ page, extensionId }) => {
// Restore wallet and setup Testnet network
const wallet = new Wallet(page);
@@ -156,6 +157,4 @@ test.describe('Transaction STX', () => {
// Can't check amounts or transaction as E2E test is faster than the UI or API to how that transaction --> has to be checked manually
});
// TODO: add test where we change the fees for a STX transaction
});