Skip to content

Commit

Permalink
Updates test to verify absence of banner on new announcement.
Browse files Browse the repository at this point in the history
  • Loading branch information
hemanik committed Oct 26, 2017
1 parent 630a3d6 commit 32369cb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/test/java/org/arquillian/tests/pagetests/BlogPageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,18 @@ public void should_be_able_to_go_to_jacoco_blog_from_cloud_tag() {

@Test
public void should_redirect_to_new_announcement_if_banner_is_present() throws Exception {

mainPage.menu()
.navigate().to("Blog");

blogPage.blogContent()
.verify()
.hasAnnouncementBanner(true);

blogPage.newAnnouncementBanner()
.navigate().to("Check our latest announcement");

fetchedBlogPage.verify().hasContent();

blogPage.blogContent()
.verify()
.hasAnnouncementBanner(false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ public BlogVerifier hasReleaseNotes() {
return this;
}

public BlogVerifier hasAnnouncementBanner(boolean status) {
try {
WebElement announcementBanner = contentRoot.findElement(By.partialLinkText("Check our latest announcement"));
assertThat(announcementBanner.isDisplayed()).isEqualTo(status);
} catch (NoSuchElementException e) {
if(status) {
throw new NoSuchElementException("Missing announcement banner for the blog post.", e);
}
}
return this;
}

private WebElement getBlogTitle(WebElement blog) {
return blog.findElement(By.cssSelector("[class='title'] a"));
}
Expand Down

0 comments on commit 32369cb

Please sign in to comment.