From 622c47007791afd2e565ce103bf05e3164e7b29b Mon Sep 17 00:00:00 2001 From: Leandro Menezes Date: Tue, 3 Sep 2024 23:07:25 -0300 Subject: [PATCH] testing e2e fixes --- packages/desktop-client/e2e/accounts.test.js | 6 +++--- packages/desktop-client/e2e/rules.test.js | 8 ++++---- packages/desktop-client/e2e/schedules.test.js | 2 +- packages/desktop-client/e2e/transactions.test.js | 16 ++++++++-------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/desktop-client/e2e/accounts.test.js b/packages/desktop-client/e2e/accounts.test.js index c7e0d02219f..b11bffaa9a6 100644 --- a/packages/desktop-client/e2e/accounts.test.js +++ b/packages/desktop-client/e2e/accounts.test.js @@ -29,7 +29,7 @@ test.describe('Accounts', () => { balance: 100, }); - const transaction = accountPage.getNthTransaction(0); + const transaction = accountPage.getNthTransaction(1); //jump header line await expect(transaction.payee).toHaveText('Starting Balance'); await expect(transaction.notes).toHaveText(''); await expect(transaction.category).toHaveText('Starting Balances'); @@ -86,13 +86,13 @@ test.describe('Accounts', () => { await accountPage.selectNthTransaction(1); await accountPage.clickSelectAction('Make transfer'); - let transaction = accountPage.getNthTransaction(0); + let transaction = accountPage.getNthTransaction(1); //jump header line await expect(transaction.payee).toHaveText('Ally Savings'); await expect(transaction.category).toHaveText('Transfer'); await expect(transaction.credit).toHaveText('34.56'); await expect(transaction.account).toHaveText('HSBC'); - transaction = accountPage.getNthTransaction(1); + transaction = accountPage.getNthTransaction(2); await expect(transaction.payee).toHaveText('HSBC'); await expect(transaction.category).toHaveText('Transfer'); await expect(transaction.debit).toHaveText('34.56'); diff --git a/packages/desktop-client/e2e/rules.test.js b/packages/desktop-client/e2e/rules.test.js index 74db81652c2..29684a87714 100644 --- a/packages/desktop-client/e2e/rules.test.js +++ b/packages/desktop-client/e2e/rules.test.js @@ -61,7 +61,7 @@ test.describe('Rules', () => { debit: '12.34', }); - const transaction = accountPage.getNthTransaction(0); + const transaction = accountPage.getNthTransaction(1); //jump header line await expect(transaction.payee).toHaveText('Fast Internet'); await expect(transaction.category).toHaveText('General'); await expect(transaction.debit).toHaveText('12.34'); @@ -118,19 +118,19 @@ test.describe('Rules', () => { payee: 'Ikea', }); - const transaction = accountPage.getNthTransaction(0); + const transaction = accountPage.getNthTransaction(1); //jump header line await expect(transaction.payee).toHaveText('Ikea'); await expect(transaction.notes).toHaveText('food / entertainment'); await expect(transaction.category).toHaveText('Split'); await expect(transaction.debit).toHaveText('100.00'); await expect(page).toMatchThemeScreenshots(); - const firstSplitTransaction = accountPage.getNthTransaction(1); + const firstSplitTransaction = accountPage.getNthTransaction(2); await expect(firstSplitTransaction.payee).toHaveText('Ikea'); await expect(firstSplitTransaction.debit).toHaveText('90.00'); await expect(firstSplitTransaction.category).toHaveText('Entertainment'); - const secondSplitTransaction = accountPage.getNthTransaction(2); + const secondSplitTransaction = accountPage.getNthTransaction(3); await expect(secondSplitTransaction.payee).toHaveText('Ikea'); await expect(secondSplitTransaction.debit).toHaveText('10.00'); await expect(secondSplitTransaction.category).toHaveText('Food'); diff --git a/packages/desktop-client/e2e/schedules.test.js b/packages/desktop-client/e2e/schedules.test.js index cc8e374365c..620002bf914 100644 --- a/packages/desktop-client/e2e/schedules.test.js +++ b/packages/desktop-client/e2e/schedules.test.js @@ -52,7 +52,7 @@ test.describe('Schedules', () => { // Go to transactions page const accountPage = await navigation.goToAccountPage('HSBC'); - const transaction = accountPage.getNthTransaction(0); + const transaction = accountPage.getNthTransaction(1); //jump header line await expect(transaction.payee).toHaveText('Home Depot'); await expect(transaction.category).toHaveText('Categorize'); await expect(transaction.debit).toHaveText('25.00'); diff --git a/packages/desktop-client/e2e/transactions.test.js b/packages/desktop-client/e2e/transactions.test.js index dfb80ceacd9..9400fb0f30e 100644 --- a/packages/desktop-client/e2e/transactions.test.js +++ b/packages/desktop-client/e2e/transactions.test.js @@ -67,9 +67,6 @@ test.describe('Transactions', () => { await filterTooltip.applyButton.click(); // Assert that there are only clothing transactions - await expect(accountPage.getNthTransaction(0).category).toHaveText( - 'Clothing', - ); await expect(accountPage.getNthTransaction(1).category).toHaveText( 'Clothing', ); @@ -82,6 +79,9 @@ test.describe('Transactions', () => { await expect(accountPage.getNthTransaction(4).category).toHaveText( 'Clothing', ); + await expect(accountPage.getNthTransaction(5).category).toHaveText( + 'Clothing', + ); await expect(page).toMatchThemeScreenshots(); }); }); @@ -94,7 +94,7 @@ test.describe('Transactions', () => { debit: '12.34', }); - const transaction = accountPage.getNthTransaction(0); + const transaction = accountPage.getNthTransaction(1); //jump header line await expect(transaction.payee).toHaveText('Home Depot'); await expect(transaction.notes).toHaveText('Notes field'); await expect(transaction.category).toHaveText('Food'); @@ -119,21 +119,21 @@ test.describe('Transactions', () => { }, ]); - const firstTransaction = accountPage.getNthTransaction(0); + const firstTransaction = accountPage.getNthTransaction(1); //jump header line await expect(firstTransaction.payee).toHaveText('Krogger'); await expect(firstTransaction.notes).toHaveText('Notes'); await expect(firstTransaction.category).toHaveText('Split'); await expect(firstTransaction.debit).toHaveText('333.33'); await expect(firstTransaction.credit).toHaveText(''); - const secondTransaction = accountPage.getNthTransaction(1); + const secondTransaction = accountPage.getNthTransaction(2); await expect(secondTransaction.payee).toHaveText('Krogger'); await expect(secondTransaction.notes).toHaveText(''); await expect(secondTransaction.category).toHaveText('General'); await expect(secondTransaction.debit).toHaveText('222.22'); await expect(secondTransaction.credit).toHaveText(''); - const thirdTransaction = accountPage.getNthTransaction(2); + const thirdTransaction = accountPage.getNthTransaction(3); await expect(thirdTransaction.payee).toHaveText('Krogger'); await expect(thirdTransaction.notes).toHaveText(''); await expect(thirdTransaction.category).toHaveText('Categorize'); @@ -155,7 +155,7 @@ test.describe('Transactions', () => { await accountPage.addEnteredTransaction(); - transaction = accountPage.getNthTransaction(0); + transaction = accountPage.getNthTransaction(1); //jump header line await expect(transaction.payee).toHaveText('Bank of America'); await expect(transaction.notes).toHaveText('Notes field'); await expect(transaction.category).toHaveText('Transfer');