From d855f064462ef0472d732b8e135f2aa433e41afb Mon Sep 17 00:00:00 2001 From: xander Date: Wed, 2 Apr 2025 18:06:55 +0100 Subject: [PATCH] Updated test to pass - It was previously failing due to subscriber logins being brought straight to https://test.fusil.uk/wp-admin/profile.php. Now it is fixed by only ensuring that the URL begins with the link to wp-admin This is a good example of why having more varied tests is handy! --- src/test/TestLogin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/TestLogin.java b/src/test/TestLogin.java index 9541716..d11ec5b 100644 --- a/src/test/TestLogin.java +++ b/src/test/TestLogin.java @@ -6,7 +6,7 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.By; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; -import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class TestLogin { private static final String LOGIN_PAGE = "https://test.fusil.uk/wp-login.php"; @@ -33,7 +33,7 @@ public class TestLogin { password.sendKeys(passwordText); login.click(); - assertEquals(EXPECTED_URL, driver.getCurrentUrl()); + assertTrue(driver.getCurrentUrl().startsWith(EXPECTED_URL)); driver.quit(); } } \ No newline at end of file