mirror of
https://dev.azure.com/Foster-X/CMP329%20CW2/_git/CMP329%20CW2
synced 2025-07-27 05:53: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
|
@ -25,7 +25,7 @@ public class TestPoster {
|
|||
private static final String LOGGGEDIN_URL = "https://"+domain+"/wp-admin/";
|
||||
private static final String NEW_POST_URL = "https://"+domain+"/wp-admin/post-new.php";
|
||||
private static final String POST_CONTENT_TEXT = "Lorem ipsum dolor amet";
|
||||
private static final String POST_TITLE_TEXT = "Lipsum 4 u";
|
||||
private static final String POST_TITLE_TEXT = "Lipsum4u";
|
||||
@ParameterizedTest
|
||||
@CsvFileSource(resources = "/csv/built/credentials_permissions.csv", numLinesToSkip = 0)
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue