-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac7a62c
commit d63d944
Showing
2 changed files
with
153 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
...src/test/java/de/deadlocker8/budgetmaster/integration/selenium/RecurringOverviewTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package de.deadlocker8.budgetmaster.integration.selenium; | ||
|
||
import de.deadlocker8.budgetmaster.authentication.UserService; | ||
import de.deadlocker8.budgetmaster.integration.helpers.IntegrationTestHelper; | ||
import de.deadlocker8.budgetmaster.integration.helpers.SeleniumTestBase; | ||
import org.junit.jupiter.api.Test; | ||
import org.openqa.selenium.By; | ||
import org.openqa.selenium.support.ui.ExpectedConditions; | ||
import org.openqa.selenium.support.ui.WebDriverWait; | ||
|
||
import java.io.File; | ||
import java.time.Duration; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
class RecurringOverviewTest extends SeleniumTestBase | ||
{ | ||
private static IntegrationTestHelper helper; | ||
|
||
@Override | ||
protected void importDatabaseOnce() | ||
{ | ||
helper = new IntegrationTestHelper(driver, port); | ||
helper.start(); | ||
helper.login(UserService.DEFAULT_PASSWORD); | ||
helper.hideBackupReminder(); | ||
helper.hideWhatsNewDialog(); | ||
|
||
String path = getClass().getClassLoader().getResource("NeverEndingRepeatingTransaction.json").getFile().replace("/", File.separator); | ||
helper.uploadDatabase(path); | ||
} | ||
|
||
@Test | ||
void test_newTransaction_cancel() | ||
{ | ||
driver.get(helper.getUrl() + "/transactions/recurringOverview"); | ||
|
||
final WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(5)); | ||
wait.until(ExpectedConditions.textToBePresentInElementLocated(By.cssSelector(".headline"), "Active Recurring Transactions")); | ||
|
||
assertThat(driver.findElements(By.className("search-result"))).hasSizeGreaterThan(0); | ||
} | ||
} |
110 changes: 110 additions & 0 deletions
110
BudgetMasterServer/src/test/resources/NeverEndingRepeatingTransaction.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
{ | ||
"TYPE": "BUDGETMASTER_DATABASE", | ||
"VERSION": 9, | ||
"categories": [ | ||
{ | ||
"ID": 312, | ||
"name": "Keine Kategorie", | ||
"color": "#FFFFFF", | ||
"type": "NONE" | ||
}, | ||
{ | ||
"ID": 313, | ||
"name": "Übertrag", | ||
"color": "#FFFF00", | ||
"type": "REST" | ||
} | ||
], | ||
"accounts": [ | ||
{ | ||
"ID": 136, | ||
"name": "Placeholder", | ||
"accountState": "FULL_ACCESS", | ||
"type": "ALL", | ||
"iconReferenceID": 406 | ||
}, | ||
{ | ||
"ID": 137, | ||
"name": "Default Account First", | ||
"accountState": "FULL_ACCESS", | ||
"type": "CUSTOM", | ||
"iconReferenceID": 407 | ||
} | ||
], | ||
"transactions": [ | ||
{ | ||
"amount": -1000, | ||
"isExpenditure": true, | ||
"date": "2022-10-01", | ||
"accountID": 137, | ||
"categoryID": 312, | ||
"name": "Pizza", | ||
"description": "", | ||
"tags": [], | ||
"repeatingOption": { | ||
"startDate": "2023-01-01", | ||
"modifier": { | ||
"quantity": 1, | ||
"localizationKey": "repeating.modifier.years" | ||
}, | ||
"endOption": { | ||
"localizationKey": "repeating.end.key.never" | ||
} | ||
} | ||
} | ||
], | ||
"templateGroups": [ | ||
{ | ||
"ID": 1, | ||
"name": "Not grouped", | ||
"type": "DEFAULT" | ||
} | ||
], | ||
"templates": [], | ||
"charts": [], | ||
"images": [], | ||
"icons": [ | ||
{ | ||
"ID": 406, | ||
"builtinIdentifier": "fas fa-landmark" | ||
}, | ||
{ | ||
"ID": 407 | ||
} | ||
], | ||
"transactionNameKeywords": [ | ||
{ | ||
"value": "einnahme" | ||
}, | ||
{ | ||
"value": "rückzahlung" | ||
}, | ||
{ | ||
"value": "erstattung" | ||
}, | ||
{ | ||
"value": "zinsen" | ||
}, | ||
{ | ||
"value": "lohn" | ||
}, | ||
{ | ||
"value": "gehalt" | ||
}, | ||
{ | ||
"value": "gutschrift" | ||
}, | ||
{ | ||
"value": "income" | ||
}, | ||
{ | ||
"value": "refund" | ||
}, | ||
{ | ||
"value": "interest" | ||
}, | ||
{ | ||
"value": "salary" | ||
} | ||
] | ||
} |