diff --git a/BudgetMasterServer/src/main/resources/templates/transactions/transactions.ftl b/BudgetMasterServer/src/main/resources/templates/transactions/transactions.ftl index e6ce8d4dba9794556fd3426f96ba94ae07654c45..b2f61698cef6a6314882e7e85e80e951fb081298 100644 --- a/BudgetMasterServer/src/main/resources/templates/transactions/transactions.ftl +++ b/BudgetMasterServer/src/main/resources/templates/transactions/transactions.ftl @@ -57,10 +57,14 @@ <#assign transactionDate=dateService.getDateStringWithoutYear(transaction.date)/> <#if transactionDate != lastDate> - <div class="col s12 left-align bold transaction-text transaction-date"> - ${transactionDate} - </div> - <#assign lastDate=transactionDate/> + <#if !transaction?is_first> + </div> <#-- close "transaction-date-group" div from previous loop iteration --> + </#if> + <div class="transaction-date-group"> + <div class="col s12 left-align bold transaction-text transaction-date"> + ${transactionDate} + </div> + <#assign lastDate=transactionDate/> </#if> <div class="hide-on-large-only transaction-row-top card transaction-card background-light <#if transaction.isFuture()>transaction-row-transparent</#if> <#if shouldHighlight>background-blue-light transaction-row-transparent-override" id="highlighted-small"<#else>"</#if>> diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/helpers/TransactionTestHelper.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/helpers/TransactionTestHelper.java index 9e489fe653682ad804c30aae0a78345c3383f98e..b211351fed41ef81ae8d31c3794188b02e1496cd 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/helpers/TransactionTestHelper.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/helpers/TransactionTestHelper.java @@ -16,19 +16,16 @@ import static org.assertj.core.api.Assertions.assertThat; public class TransactionTestHelper { - public static void assertTransactionColumns(List<WebElement> columns, String shortDate, String categoryName, String categoryColor, boolean repeatIconVisible, boolean transferIconIsVisible, String name, String description, String amount) + public static void assertTransactionColumns(List<WebElement> columns, String categoryName, String categoryColor, boolean repeatIconVisible, boolean transferIconIsVisible, String name, String description, String amount) { - // date - assertThat(columns.get(0)).hasFieldOrPropertyWithValue("text", shortDate); - // category - final WebElement categoryCircle = columns.get(1).findElement(By.className("category-circle")); + final WebElement categoryCircle = columns.get(0).findElement(By.className("category-circle")); assertThat(categoryCircle.getCssValue("background-color")).isEqualTo(categoryColor); categoryName = categoryName.substring(0, 1).toUpperCase(); assertThat(categoryCircle.findElement(By.tagName("span"))).hasFieldOrPropertyWithValue("text", categoryName); // icon - final List<WebElement> icons = columns.get(2).findElements(By.tagName("i")); + final List<WebElement> icons = columns.get(1).findElements(By.tagName("i")); assertThat(icons).hasSize(determineNumberOfTransactionTypeIcons(repeatIconVisible, transferIconIsVisible)); assertThat(icons.get(0).isDisplayed()).isEqualTo(repeatIconVisible || transferIconIsVisible); if(repeatIconVisible) @@ -41,19 +38,19 @@ public class TransactionTestHelper } // name - assertThat(columns.get(3).findElement(By.className("transaction-text")).getText()) + assertThat(columns.get(2).findElement(By.className("transaction-text")).getText()) .isEqualTo(name); //description if(description != null) { - assertThat(columns.get(3).findElement(By.className("italic")).getText()) + assertThat(columns.get(2).findElement(By.className("italic")).getText()) .isEqualTo(description); } // amount - assertThat(columns.get(4).getText()).contains(amount); + assertThat(columns.get(3).getText()).contains(amount); } private static int determineNumberOfTransactionTypeIcons(boolean repeatIconVisible, boolean transferIconIsVisible) diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/AccountTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/AccountTest.java index 9fc242ecb476f33d518570551a616220cd617896..1066cf323bf14196949eae74f26656f281abc7a0 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/AccountTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/AccountTest.java @@ -349,7 +349,7 @@ class AccountTest extends SeleniumTestBase final List<WebElement> columns = row.findElements(By.className("col")); // check columns - final List<WebElement> icons = columns.get(5).findElements(By.tagName("i")); + final List<WebElement> icons = columns.get(4).findElements(By.tagName("i")); assertThat(icons).hasSize(1); assertThat(icons.get(0).getText()).isEqualTo("content_copy"); } diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/DeleteDatabaseTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/DeleteDatabaseTest.java index 73e44514e077b57ff1d396433cad94645c8ba9d0..b06bfcce16ac5a8da09231f31b9bf1ca738f8333 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/DeleteDatabaseTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/DeleteDatabaseTest.java @@ -65,10 +65,17 @@ class DeleteDatabaseTest extends SeleniumTestBase // assert only transaction "rest" is showing TransactionTestHelper.selectGlobalAccountByName(driver, "Default Account"); TransactionTestHelper.gotoSpecificYearAndMonth(driver, 2022, "March"); - final List<WebElement> transactionsRows = driver.findElements(By.cssSelector(".transaction-container .hide-on-med-and-down.transaction-row-top")); - assertThat(transactionsRows).hasSize(1); - final WebElement row = transactionsRows.get(0); - final List<WebElement> columns = row.findElements(By.className("col")); - TransactionTestHelper.assertTransactionColumns(columns, "01.03.", "Rest", "rgb(255, 255, 0)", false, false, "Rest", null, "0.00"); + + final List<WebElement> transactionDateGroups = driver.findElements(By.className("transaction-date-group")); + assertThat(transactionDateGroups).hasSize(1); + + final WebElement dateGroup = transactionDateGroups.get(0); + assertThat(dateGroup.findElement(By.className("transaction-date"))).hasFieldOrPropertyWithValue("text", "01.03."); + final List<WebElement> transactionsInGroup = driver.findElements(By.cssSelector(".transaction-container .hide-on-med-and-down.transaction-row-top")); + assertThat(transactionsInGroup).hasSize(1); + + final WebElement transactionRow = transactionsInGroup.get(0); + final List<WebElement> columns = transactionRow.findElements(By.className("col")); + TransactionTestHelper.assertTransactionColumns(columns, "Rest", "rgb(255, 255, 0)", false, false, "Rest", null, "0.00"); } } \ No newline at end of file diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/NewTransactionFromExistingOneTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/NewTransactionFromExistingOneTest.java index bd9c0ed8d020692696ef55262abb40abe97da06c..137e404848dab24f5c046e4356fa21aacddcc680 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/NewTransactionFromExistingOneTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/NewTransactionFromExistingOneTest.java @@ -49,7 +49,7 @@ class NewTransactionFromExistingOneTest extends SeleniumTestBase List<WebElement> transactionsRows = driver.findElements(By.cssSelector(".transaction-container .hide-on-med-and-down.transaction-row-top")); List<WebElement> columns = transactionsRows.get(0).findElements(By.className("col")); - columns.get(5).findElement(By.className("button-new-from-existing")).click(); + columns.get(4).findElement(By.className("button-new-from-existing")).click(); WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(5)); wait.until(ExpectedConditions.textToBePresentInElementLocated(By.cssSelector(".headline"), "New Transaction")); @@ -87,7 +87,7 @@ class NewTransactionFromExistingOneTest extends SeleniumTestBase List<WebElement> transactionsRows = driver.findElements(By.cssSelector(".transaction-container .hide-on-med-and-down.transaction-row-top")); List<WebElement> columns = transactionsRows.get(0).findElements(By.className("col")); - columns.get(5).findElement(By.className("button-new-from-existing")).click(); + columns.get(4).findElement(By.className("button-new-from-existing")).click(); WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(5)); wait.until(ExpectedConditions.textToBePresentInElementLocated(By.cssSelector(".headline"), "New Transfer")); @@ -125,7 +125,7 @@ class NewTransactionFromExistingOneTest extends SeleniumTestBase List<WebElement> transactionsRows = driver.findElements(By.cssSelector(".transaction-container .hide-on-med-and-down.transaction-row-top")); List<WebElement> columns = transactionsRows.get(0).findElements(By.className("col")); - columns.get(5).findElement(By.className("button-new-from-existing")).click(); + columns.get(4).findElement(By.className("button-new-from-existing")).click(); WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(5)); wait.until(ExpectedConditions.textToBePresentInElementLocated(By.cssSelector(".headline"), "New Transaction")); @@ -159,7 +159,7 @@ class NewTransactionFromExistingOneTest extends SeleniumTestBase List<WebElement> transactionsRows = driver.findElements(By.cssSelector(".transaction-container .hide-on-med-and-down.transaction-row-top")); List<WebElement> columns = transactionsRows.get(0).findElements(By.className("col")); - columns.get(5).findElement(By.className("button-new-from-existing")).click(); + columns.get(4).findElement(By.className("button-new-from-existing")).click(); WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(5)); wait.until(ExpectedConditions.textToBePresentInElementLocated(By.cssSelector(".headline"), "New Transaction")); diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/NewTransactionNormalTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/NewTransactionNormalTest.java index 166a67895195f02c0c7dbd17aa465033c6229b13..6c5ecb9868060bca27f4798cf2d410532401681b 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/NewTransactionNormalTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/NewTransactionNormalTest.java @@ -114,12 +114,18 @@ class NewTransactionNormalTest extends SeleniumTestBase transactionsRows = driver.findElements(By.cssSelector(".transaction-container .hide-on-med-and-down.transaction-row-top")); assertThat(transactionsRows).hasSize(numberOfTransactionsBefore + 1); - final WebElement row = transactionsRows.get(0); - final List<WebElement> columns = row.findElements(By.className("col")); - assertThat(columns).hasSize(6); + final List<WebElement> transactionDateGroups = driver.findElements(By.className("transaction-date-group")); + + final WebElement dateGroup = transactionDateGroups.get(0); + assertThat(dateGroup.findElement(By.className("transaction-date"))).hasFieldOrPropertyWithValue("text", TransactionTestHelper.getDateString(day)); + final List<WebElement> transactionsInGroup = driver.findElements(By.cssSelector(".transaction-container .hide-on-med-and-down.transaction-row-top")); + + final WebElement transactionRow = transactionsInGroup.get(0); + final List<WebElement> columns = transactionRow.findElements(By.className("col")); + assertThat(columns).hasSize(5); // check columns - TransactionTestHelper.assertTransactionColumns(columns, TransactionTestHelper.getDateString(day), categoryName, "rgb(46, 124, 43)", false, false, name, description, amount); + TransactionTestHelper.assertTransactionColumns(columns, categoryName, "rgb(46, 124, 43)", false, false, name, description, amount); } @Test @@ -156,12 +162,19 @@ class NewTransactionNormalTest extends SeleniumTestBase transactionsRows = driver.findElements(By.cssSelector(".transaction-container .hide-on-med-and-down.transaction-row-top")); assertThat(transactionsRows).hasSize(numberOfTransactionsBefore + 1); - final WebElement row = transactionsRows.get(0); - final List<WebElement> columns = row.findElements(By.className("col")); - assertThat(columns).hasSize(6); + + final List<WebElement> transactionDateGroups = driver.findElements(By.className("transaction-date-group")); + + final WebElement dateGroup = transactionDateGroups.get(0); + assertThat(dateGroup.findElement(By.className("transaction-date"))).hasFieldOrPropertyWithValue("text", TransactionTestHelper.getDateString(day)); + final List<WebElement> transactionsInGroup = driver.findElements(By.cssSelector(".transaction-container .hide-on-med-and-down.transaction-row-top")); + + final WebElement transactionRow = transactionsInGroup.get(0); + final List<WebElement> columns = transactionRow.findElements(By.className("col")); + assertThat(columns).hasSize(5); // check columns - TransactionTestHelper.assertTransactionColumns(columns, TransactionTestHelper.getDateString(day), categoryName, "rgb(46, 124, 43)", false, false, name, description, "-" + amount); + TransactionTestHelper.assertTransactionColumns(columns, categoryName, "rgb(46, 124, 43)", false, false, name, description, "-" + amount); } @Test @@ -282,12 +295,18 @@ class NewTransactionNormalTest extends SeleniumTestBase transactionsRows = driver.findElements(By.cssSelector(".transaction-container .hide-on-med-and-down.transaction-row-top")); assertThat(transactionsRows).hasSize(numberOfTransactionsBefore + 1); - final WebElement row = transactionsRows.get(0); - final List<WebElement> columns = row.findElements(By.className("col")); - assertThat(columns).hasSize(6); + final List<WebElement> transactionDateGroups = driver.findElements(By.className("transaction-date-group")); + + final WebElement dateGroup = transactionDateGroups.get(0); + assertThat(dateGroup.findElement(By.className("transaction-date"))).hasFieldOrPropertyWithValue("text", TransactionTestHelper.getDateString(day)); + final List<WebElement> transactionsInGroup = driver.findElements(By.cssSelector(".transaction-container .hide-on-med-and-down.transaction-row-top")); + + final WebElement transactionRow = transactionsInGroup.get(0); + final List<WebElement> columns = transactionRow.findElements(By.className("col")); + assertThat(columns).hasSize(5); // check columns - TransactionTestHelper.assertTransactionColumns(columns, TransactionTestHelper.getDateString(day), categoryName, "rgb(46, 124, 43)", false, false, name, null, "-" + amount); + TransactionTestHelper.assertTransactionColumns(columns, categoryName, "rgb(46, 124, 43)", false, false, name, null, "-" + amount); } @Test @@ -358,11 +377,17 @@ class NewTransactionNormalTest extends SeleniumTestBase transactionsRows = driver.findElements(By.cssSelector(".transaction-container .hide-on-med-and-down.transaction-row-top")); assertThat(transactionsRows).hasSize(numberOfTransactionsBefore + 1); - final WebElement row = transactionsRows.get(0); - final List<WebElement> columns = row.findElements(By.className("col")); - assertThat(columns).hasSize(6); + final List<WebElement> transactionDateGroups = driver.findElements(By.className("transaction-date-group")); + + final WebElement dateGroup = transactionDateGroups.get(0); + assertThat(dateGroup.findElement(By.className("transaction-date"))).hasFieldOrPropertyWithValue("text", TransactionTestHelper.getDateString(day)); + final List<WebElement> transactionsInGroup = driver.findElements(By.cssSelector(".transaction-container .hide-on-med-and-down.transaction-row-top")); + + final WebElement transactionRow = transactionsInGroup.get(0); + final List<WebElement> columns = transactionRow.findElements(By.className("col")); + assertThat(columns).hasSize(5); // check columns - TransactionTestHelper.assertTransactionColumns(columns, TransactionTestHelper.getDateString(day), categoryName, "rgb(46, 124, 43)", false, false, name, null, amount); + TransactionTestHelper.assertTransactionColumns(columns, categoryName, "rgb(46, 124, 43)", false, false, name, null, amount); } } \ No newline at end of file diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/NewTransactionRecurringTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/NewTransactionRecurringTest.java index f8c293d0ece5326891520160a109137de8097d3b..1d450648e657abbdcbc0b17190d5ca98568d2e8a 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/NewTransactionRecurringTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/NewTransactionRecurringTest.java @@ -73,10 +73,10 @@ class NewTransactionRecurringTest extends SeleniumTestBase for(WebElement row : transactionsRows) { final List<WebElement> columns = row.findElements(By.className("col")); - final String name = columns.get(3).findElement(By.className("transaction-text")).getText(); + final String name = columns.get(2).findElement(By.className("transaction-text")).getText(); if(name.equals(TRANSACTION_NAME)) { - columns.get(5).findElements(By.tagName("a")).get(1).click(); + columns.get(4).findElements(By.tagName("a")).get(1).click(); WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(5)); wait.until(ExpectedConditions.textToBePresentInElementLocated(By.cssSelector("#modalConfirmDelete .modal-content h4"), "Delete Entry")); @@ -134,12 +134,18 @@ class NewTransactionRecurringTest extends SeleniumTestBase List<WebElement> transactionsRows = driver.findElements(By.cssSelector(".transaction-container .hide-on-med-and-down.transaction-row-top")); assertThat(transactionsRows).hasSizeGreaterThan(2); - final WebElement row = transactionsRows.get(transactionsRows.size() - 2); - final List<WebElement> columns = row.findElements(By.className("col")); - assertThat(columns).hasSize(6); + final List<WebElement> transactionDateGroups = driver.findElements(By.className("transaction-date-group")); + + final WebElement dateGroup = transactionDateGroups.get(transactionDateGroups.size() - 2); + assertThat(dateGroup.findElement(By.className("transaction-date"))).hasFieldOrPropertyWithValue("text", TransactionTestHelper.getDateString(day)); + final List<WebElement> transactionsInGroup = driver.findElements(By.cssSelector(".transaction-container .hide-on-med-and-down.transaction-row-top")); + + final WebElement transactionRow = transactionsInGroup.get(0); + final List<WebElement> columns = transactionRow.findElements(By.className("col")); + assertThat(columns).hasSize(5); // check columns - TransactionTestHelper.assertTransactionColumns(columns, TransactionTestHelper.getDateString(day), categoryName, "rgb(46, 124, 43)", true, false, TRANSACTION_NAME, description, amount); + TransactionTestHelper.assertTransactionColumns(columns, categoryName, "rgb(46, 124, 43)", true, false, TRANSACTION_NAME, description, amount); } @Test @@ -190,12 +196,18 @@ class NewTransactionRecurringTest extends SeleniumTestBase List<WebElement> transactionsRows = driver.findElements(By.cssSelector(".transaction-container .hide-on-med-and-down.transaction-row-top")); assertThat(transactionsRows).hasSizeGreaterThan(2); - final WebElement row = transactionsRows.get(transactionsRows.size() - 2); - final List<WebElement> columns = row.findElements(By.className("col")); - assertThat(columns).hasSize(6); + final List<WebElement> transactionDateGroups = driver.findElements(By.className("transaction-date-group")); + + final WebElement dateGroup = transactionDateGroups.get(transactionDateGroups.size() - 2); + assertThat(dateGroup.findElement(By.className("transaction-date"))).hasFieldOrPropertyWithValue("text", TransactionTestHelper.getDateString(day)); + final List<WebElement> transactionsInGroup = driver.findElements(By.cssSelector(".transaction-container .hide-on-med-and-down.transaction-row-top")); + + final WebElement transactionRow = transactionsInGroup.get(0); + final List<WebElement> columns = transactionRow.findElements(By.className("col")); + assertThat(columns).hasSize(5); // check columns - TransactionTestHelper.assertTransactionColumns(columns, TransactionTestHelper.getDateString(day), categoryName, "rgb(46, 124, 43)", true, false, TRANSACTION_NAME, description, "-" + amount); + TransactionTestHelper.assertTransactionColumns(columns, categoryName, "rgb(46, 124, 43)", true, false, TRANSACTION_NAME, description, "-" + amount); } @Test @@ -246,15 +258,21 @@ class NewTransactionRecurringTest extends SeleniumTestBase List<WebElement> transactionsRows = driver.findElements(By.cssSelector(".transaction-container .hide-on-med-and-down.transaction-row-top")); assertThat(transactionsRows).hasSizeGreaterThan(2); - final WebElement row = transactionsRows.get(transactionsRows.size() - 2); - final List<WebElement> columns = row.findElements(By.className("col")); - assertThat(columns).hasSize(6); + final List<WebElement> transactionDateGroups = driver.findElements(By.className("transaction-date-group")); + + final WebElement dateGroup = transactionDateGroups.get(transactionDateGroups.size() - 2); + assertThat(dateGroup.findElement(By.className("transaction-date"))).hasFieldOrPropertyWithValue("text", TransactionTestHelper.getDateString(day)); + final List<WebElement> transactionsInGroup = driver.findElements(By.cssSelector(".transaction-container .hide-on-med-and-down.transaction-row-top")); + + final WebElement transactionRow = transactionsInGroup.get(0); + final List<WebElement> columns = transactionRow.findElements(By.className("col")); + assertThat(columns).hasSize(5); // check columns - TransactionTestHelper.assertTransactionColumns(columns, TransactionTestHelper.getDateString(day), categoryName, "rgb(46, 124, 43)", true, true, TRANSACTION_NAME, description, amount); + TransactionTestHelper.assertTransactionColumns(columns, categoryName, "rgb(46, 124, 43)", true, true, TRANSACTION_NAME, description, amount); // open transaction in edit view again - columns.get(5).findElement(By.cssSelector("a")).click(); + columns.get(4).findElement(By.cssSelector("a")).click(); wait.until(ExpectedConditions.textToBePresentInElementLocated(By.cssSelector(".headline"), "Edit " + type)); assertThat(driver.findElement(By.cssSelector(".account-select-wrapper .custom-select-selected-item .category-circle")).getAttribute("data-value")).isEqualTo("2"); diff --git a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/NewTransactionTransferTest.java b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/NewTransactionTransferTest.java index 9fcddb36a154ffb7e9d3788f8419141d175ec5d5..a4f45e162003987b06e4adcca78c8b5cdfdc53c9 100644 --- a/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/NewTransactionTransferTest.java +++ b/BudgetMasterServer/src/test/java/de/deadlocker8/budgetmaster/integration/selenium/NewTransactionTransferTest.java @@ -13,9 +13,7 @@ import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import java.io.File; -import java.text.SimpleDateFormat; import java.time.Duration; -import java.util.Date; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; @@ -112,15 +110,18 @@ class NewTransactionTransferTest extends SeleniumTestBase // assert assertThat(driver.getCurrentUrl()).endsWith("/transactions"); - List<WebElement> transactionsRows = driver.findElements(By.cssSelector(".transaction-container .hide-on-med-and-down.transaction-row-top")); - assertThat(transactionsRows).hasSize(2); + final List<WebElement> transactionDateGroups = driver.findElements(By.className("transaction-date-group")); + + final WebElement dateGroup = transactionDateGroups.get(0); + assertThat(dateGroup.findElement(By.className("transaction-date"))).hasFieldOrPropertyWithValue("text", TransactionTestHelper.getDateString(day)); + final List<WebElement> transactionsInGroup = driver.findElements(By.cssSelector(".transaction-container .hide-on-med-and-down.transaction-row-top")); - final WebElement row = transactionsRows.get(0); - final List<WebElement> columns = row.findElements(By.className("col")); - assertThat(columns).hasSize(6); + final WebElement transactionRow = transactionsInGroup.get(0); + final List<WebElement> columns = transactionRow.findElements(By.className("col")); + assertThat(columns).hasSize(5); // check columns - TransactionTestHelper.assertTransactionColumns(columns, TransactionTestHelper.getDateString(day), categoryName, "rgb(46, 124, 43)", false, true, name, description, amount); + TransactionTestHelper.assertTransactionColumns(columns, categoryName, "rgb(46, 124, 43)", false, true, name, description, amount); } @Test