Skip to content
This repository has been archived by the owner on Mar 30, 2024. It is now read-only.

Commit

Permalink
Go to article (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
berk76 authored Feb 22, 2023
1 parent d63e339 commit 7f08bc9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
14 changes: 10 additions & 4 deletions src/main/java/cz/svjis/svjis/selenium/UseCases.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 7f08bc9

Please sign in to comment.