-
Notifications
You must be signed in to change notification settings - Fork 4
Bugfix/jstl jakarta #597
Bugfix/jstl jakarta #597
Changes from all commits
35c17a1
7aabc1b
b1b9829
f5ec60d
11b64fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| /* | ||
| * Copyright 2025 OpenDCS Consortium and its Contributors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License") | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.opendcs.odcsapi.gui.login; | ||
|
|
||
| import java.time.Duration; | ||
|
|
||
| import io.github.bonigarcia.wdm.WebDriverManager; | ||
| import io.restassured.RestAssured; | ||
| import org.junit.jupiter.api.AfterEach; | ||
| import org.junit.jupiter.api.BeforeEach; | ||
| import org.junit.jupiter.api.Tag; | ||
| import org.junit.jupiter.api.TestTemplate; | ||
| import org.junit.jupiter.api.extension.ExtendWith; | ||
| import org.opendcs.odcsapi.fixtures.DatabaseContextProvider; | ||
| import org.openqa.selenium.WebDriver; | ||
| import org.openqa.selenium.chrome.ChromeDriver; | ||
| import org.openqa.selenium.chrome.ChromeOptions; | ||
| import org.openqa.selenium.support.ui.WebDriverWait; | ||
|
|
||
| import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
|
||
| @Tag("integration") | ||
| @ExtendWith(DatabaseContextProvider.class) | ||
| final class LoginPageTest | ||
| { | ||
|
|
||
| private WebDriver driver; | ||
| private WebDriverWait wait; | ||
|
Check warning on line 41 in opendcs-integration-test/src/test/java/org/opendcs/odcsapi/gui/login/LoginPageTest.java
|
||
|
|
||
| @BeforeEach | ||
| public void setUp() | ||
|
Check warning on line 44 in opendcs-integration-test/src/test/java/org/opendcs/odcsapi/gui/login/LoginPageTest.java
|
||
| { | ||
| WebDriverManager.chromedriver().setup(); | ||
| ChromeOptions options = new ChromeOptions(); | ||
| options.addArguments("--headless=new"); | ||
| options.addArguments("--disable-gpu"); | ||
| options.addArguments("--no-sandbox"); | ||
| options.addArguments("--disable-dev-shm-usage"); | ||
| options.addArguments("--window-size=1920,1080"); | ||
| driver = new ChromeDriver(options); | ||
| wait = new WebDriverWait(driver, Duration.ofSeconds(10)); | ||
| } | ||
|
|
||
| @AfterEach | ||
| public void tearDown() | ||
|
Check warning on line 58 in opendcs-integration-test/src/test/java/org/opendcs/odcsapi/gui/login/LoginPageTest.java
|
||
| { | ||
| if(driver != null) | ||
| { | ||
| driver.quit(); | ||
| } | ||
| } | ||
|
|
||
| @TestTemplate | ||
| public void testInvalidLoginShowsError() | ||
|
Check warning on line 67 in opendcs-integration-test/src/test/java/org/opendcs/odcsapi/gui/login/LoginPageTest.java
|
||
| { | ||
| driver.get(RestAssured.baseURI + ":" + RestAssured.port + "/" + "login"); | ||
| String pageSource = driver.getPageSource(); | ||
| assertTrue(pageSource.contains("Login"), "The valid login page content was not found"); | ||
| assertTrue(pageSource.contains("Don't have an account?"), "The valid login page content was not found"); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.