Updated url comparison to use equals instead of startswith (oh the joys of copy pasting code!)

This commit is contained in:
Xander 2025-04-05 02:52:35 +01:00
parent 7ba185d387
commit 0b79e17915

View file

@ -59,7 +59,7 @@ public class TestPoster {
postAccessible = false;
}
if (canPost) { //if there's permission to post, carry on
assertTrue(driver.getCurrentUrl().startsWith(NEW_POST_URL));
assertTrue(driver.getCurrentUrl().equals(NEW_POST_URL));
WebElement title = driver.findElement(By.id(POST_TITLE_ID));
WebElement content = driver.findElement(By.id(POST_CONTENT_ID));
WebElement textSwitch = driver.findElement(By.id(POST_EDITOR_SWITCH_ID));
@ -69,10 +69,9 @@ public class TestPoster {
title.sendKeys(POST_TITLE_TEXT);
content.sendKeys(POST_CONTENT_TEXT);
publishButton.click();
} else { //if there's no permission to post
assertTrue(postAccessible == false);
assertFalse(driver.getCurrentUrl().startsWith(NEW_POST_URL));
assertFalse(driver.getCurrentUrl().equals(NEW_POST_URL));
}
//driver.quit();
}