diff --git a/src/main/java/cz/svjis/svjis/selenium/UseCases.java b/src/main/java/cz/svjis/svjis/selenium/UseCases.java index 721117e..0f5c0f2 100644 --- a/src/main/java/cz/svjis/svjis/selenium/UseCases.java +++ b/src/main/java/cz/svjis/svjis/selenium/UseCases.java @@ -75,21 +75,27 @@ public static void doRedactionTest(WebDriver driver) throws IOException, SvjisSe RedactionCommands.createArticle(driver, 1); SeleniumUtils.takeSnapShot(driver, "2-redaction-02-create-article.png"); AdminCommands.logoutUser(driver); + AdminCommands.loginUser(driver, c.getString("adm.user.login", 4), c.getString("adm.user.password", 4)); RedactionCommands.createArticle(driver, 2); + EndUserCommands.goToArticle(driver, c.getString("redaction.articles.header", 2)); + SeleniumUtils.takeSnapShot(driver, "2-redaction-03-create-article.png"); AdminCommands.logoutUser(driver); + AdminCommands.loginUser(driver, c.getString("adm.user.login", 5), c.getString("adm.user.password", 5)); RedactionCommands.createArticle(driver, 3); AdminCommands.logoutUser(driver); + AdminCommands.loginUser(driver, c.getString("adm.user.login", 1), c.getString("adm.user.password", 1)); - SeleniumUtils.takeSnapShot(driver, "2-redaction-03-login.png"); + SeleniumUtils.takeSnapShot(driver, "2-redaction-04-login.png"); RedactionCommands.createNews(driver, 1); RedactionCommands.createNews(driver, 2); - SeleniumUtils.takeSnapShot(driver, "2-redaction-04-news.png"); + SeleniumUtils.takeSnapShot(driver, "2-redaction-05-news.png"); RedactionCommands.createInquiry(driver, 1); - SeleniumUtils.takeSnapShot(driver, "2-redaction-05-inquiry.png"); + SeleniumUtils.takeSnapShot(driver, "2-redaction-06-inquiry.png"); AdminCommands.logoutUser(driver); - SeleniumUtils.takeSnapShot(driver, "2-redaction-06-logout.png"); + + SeleniumUtils.takeSnapShot(driver, "2-redaction-07-logout.png"); } public static void doEndUserTest(WebDriver driver) throws IOException, SvjisSeleniumException { diff --git a/src/main/java/cz/svjis/svjis/selenium/commands/EndUserCommands.java b/src/main/java/cz/svjis/svjis/selenium/commands/EndUserCommands.java index a27edbe..0e96967 100644 --- a/src/main/java/cz/svjis/svjis/selenium/commands/EndUserCommands.java +++ b/src/main/java/cz/svjis/svjis/selenium/commands/EndUserCommands.java @@ -33,10 +33,14 @@ public static void voteInquiry(WebDriver driver, String vote, int i) throws Svji driver.findElement(By.id("vote-submit")).click(); driver.findElement(By.id("vote-result")); } - - public static void createArticleComment(WebDriver driver, String article, String commentText) throws SvjisSeleniumException { + + public static void goToArticle(WebDriver driver, String article) throws SvjisSeleniumException { clickAndWaitForClickable(driver, By.linkText("Články"), By.linkText(article)); driver.findElement(By.linkText(article)).click(); + } + + public static void createArticleComment(WebDriver driver, String article, String commentText) throws SvjisSeleniumException { + goToArticle(driver, article); fillIn(driver.findElement(By.id("body")), commentText); driver.findElement(By.id("submit")).click(); }