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!
This commit is contained in:
Xander 2025-04-02 18:06:55 +01:00
parent df611ef206
commit d855f06446

View file

@ -6,7 +6,7 @@ import org.openqa.selenium.WebElement;
import org.openqa.selenium.By; import org.openqa.selenium.By;
import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource; 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 { public class TestLogin {
private static final String LOGIN_PAGE = "https://test.fusil.uk/wp-login.php"; private static final String LOGIN_PAGE = "https://test.fusil.uk/wp-login.php";
@ -33,7 +33,7 @@ public class TestLogin {
password.sendKeys(passwordText); password.sendKeys(passwordText);
login.click(); login.click();
assertEquals(EXPECTED_URL, driver.getCurrentUrl()); assertTrue(driver.getCurrentUrl().startsWith(EXPECTED_URL));
driver.quit(); driver.quit();
} }
} }