diff --git a/src/test/TestPoster.java b/src/test/TestPoster.java index f9b9bff..107a705 100644 --- a/src/test/TestPoster.java +++ b/src/test/TestPoster.java @@ -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(); }