mirror of
https://dev.azure.com/Foster-X/CMP329%20CW2/_git/CMP329%20CW2
synced 2025-07-27 11:03:32 +00:00
Updated url comparison to use equals instead of startswith (oh the joys of copy pasting code!)
This commit is contained in:
parent
7ba185d387
commit
0b79e17915
1 changed files with 3 additions and 4 deletions
|
@ -59,7 +59,7 @@ public class TestPoster {
|
||||||
postAccessible = false;
|
postAccessible = false;
|
||||||
}
|
}
|
||||||
if (canPost) { //if there's permission to post, carry on
|
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 title = driver.findElement(By.id(POST_TITLE_ID));
|
||||||
WebElement content = driver.findElement(By.id(POST_CONTENT_ID));
|
WebElement content = driver.findElement(By.id(POST_CONTENT_ID));
|
||||||
WebElement textSwitch = driver.findElement(By.id(POST_EDITOR_SWITCH_ID));
|
WebElement textSwitch = driver.findElement(By.id(POST_EDITOR_SWITCH_ID));
|
||||||
|
@ -69,10 +69,9 @@ public class TestPoster {
|
||||||
title.sendKeys(POST_TITLE_TEXT);
|
title.sendKeys(POST_TITLE_TEXT);
|
||||||
content.sendKeys(POST_CONTENT_TEXT);
|
content.sendKeys(POST_CONTENT_TEXT);
|
||||||
publishButton.click();
|
publishButton.click();
|
||||||
|
|
||||||
} else { //if there's no permission to post
|
} else { //if there's no permission to post
|
||||||
assertTrue(postAccessible == false);
|
assertTrue(postAccessible == false);
|
||||||
assertFalse(driver.getCurrentUrl().startsWith(NEW_POST_URL));
|
assertFalse(driver.getCurrentUrl().equals(NEW_POST_URL));
|
||||||
}
|
}
|
||||||
//driver.quit();
|
//driver.quit();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue