diff options
author | mrfoxygmfr <mrfoxygmfr@sch9.ru> | 2025-05-01 10:24:37 +0300 |
---|---|---|
committer | mrfoxygmfr <mrfoxygmfr@sch9.ru> | 2025-05-01 10:24:37 +0300 |
commit | 16bf1448e478a207584faf8fd979741b65094030 (patch) | |
tree | fcdd659ec46cfac902dfb0820c25f7e9420160b2 | |
parent | 32abde013d2f103ddefae167c2b459b1b024f395 (diff) |
feat(test): add selenium for http tests
-rw-r--r-- | build.gradle.kts | 1 | ||||
-rw-r--r-- | src/main/resources/templates/common.html | 2 | ||||
-rw-r--r-- | src/test/java/ru/mrfoxygmfr/warehouse_accounting/http/PartnersControllerTest.java | 21 | ||||
-rw-r--r-- | third_party/selenium/selenium-server-4.31.0.jar | bin | 0 -> 42755143 bytes |
4 files changed, 23 insertions, 1 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index 4db3c43..2e64d63 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -30,6 +30,7 @@ dependencies { implementation("org.springframework.boot:spring-boot-starter-data-jpa") implementation("org.springframework.boot:spring-boot-starter-actuator") implementation("io.hypersistence:hypersistence-utils-hibernate-63:3.9.5") + implementation("org.seleniumhq.selenium:selenium-java") implementation("org.thymeleaf:thymeleaf") implementation("org.thymeleaf:thymeleaf-spring6") diff --git a/src/main/resources/templates/common.html b/src/main/resources/templates/common.html index 24af612..6dfd5ba 100644 --- a/src/main/resources/templates/common.html +++ b/src/main/resources/templates/common.html @@ -11,7 +11,7 @@ margin-top: 20px; } </style> - <title></title> + <title>Система складского учета</title> </head> <body> diff --git a/src/test/java/ru/mrfoxygmfr/warehouse_accounting/http/PartnersControllerTest.java b/src/test/java/ru/mrfoxygmfr/warehouse_accounting/http/PartnersControllerTest.java new file mode 100644 index 0000000..0cb64bb --- /dev/null +++ b/src/test/java/ru/mrfoxygmfr/warehouse_accounting/http/PartnersControllerTest.java @@ -0,0 +1,21 @@ +package ru.mrfoxygmfr.warehouse_accounting.http; + +import org.junit.jupiter.api.Test; +import org.openqa.selenium.*; +import org.openqa.selenium.chrome.ChromeDriver; + +import static org.junit.jupiter.api.Assertions.*; + +public class PartnersControllerTest { + private final String srcURL = "http://localhost:8080/"; + private final String title = "Система складского учета"; + + @Test + void PartnersPageTest() { + ChromeDriver driver = new ChromeDriver(); + driver.get(srcURL); + assertEquals(title, driver.getTitle()); + driver.quit(); + } +} + diff --git a/third_party/selenium/selenium-server-4.31.0.jar b/third_party/selenium/selenium-server-4.31.0.jar Binary files differnew file mode 100644 index 0000000..d9e5cb5 --- /dev/null +++ b/third_party/selenium/selenium-server-4.31.0.jar |