FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fixed article integration tests · devhttps/frontend@c04fcd4 · GitHub

Commit c04fcd4

Browse files
Patrick Hamann
committed
Fixed article integration tests
1 parent 48ebcad commit c04fcd4

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎core-navigation/test/RelatedFeatureTest.scala‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ class RelatedFeatureTest extends FeatureSpec with GivenWhenThen with ShouldMatch
5353
val article = findFirst("li")
5454
article.findFirst("a").getAttribute("href").length should be > 0
5555
article.findFirst("h3").getText.length should be > 0
56-
article.findFirst(".trail-text").getText.length should be > 0
56+
article.findFirst(".trail__text").getText.length should be > 0
5757
article.findFirst("time").getAttribute("data-timestamp") should be("1344426007000")
5858

59-
find("li .trail-text") should have length 5
59+
find("li .trail__text") should have length 5
6060

6161
And("I should see the pictures for the first three trails, where they exist")
6262
// FIXME - need consistent data, as image can go missing

‎front/test/FrontFeatureTest.scala‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class FrontFeatureTest extends FeatureSpec with GivenWhenThen with ShouldMatcher
4242

4343
Then("I should see the news trailblock")
4444
val news = $(".zone-news")
45-
news.find(".trail-headline") should have length (4)
45+
news.find(".trail__headline") should have length (4)
4646
}
4747
}
4848

@@ -86,7 +86,7 @@ class FrontFeatureTest extends FeatureSpec with GivenWhenThen with ShouldMatcher
8686
import browser._
8787

8888
Then("I should see the copyright")
89-
findFirst(".footer p").getText should startWith("© Guardian News and Media Limited")
89+
findFirst(".footer__copyright").getText should startWith("© Guardian News and Media Limited")
9090

9191
}
9292
}

‎integration-tests/src/test/java/com/gu/test/ArticleSteps.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public void is_not_displayed(String arg1) throws Throwable {
119119

120120
@Then("^\"([^\"]*)\" section tab show read \"([^\"]*)\"$")
121121
public void section_tab_show_read(String arg1, String arg2) throws Throwable {
122-
assertTrue(webDriver.isTextPresentByElement(By.className("tabs-selected"), arg2));
122+
assertTrue(webDriver.isTextPresentByElement(By.className("tabs__tab--selected"), arg2));
123123
}
124124

125125
@When("^I click \"([^\"]*)\" tab at the top of the page$")
@@ -166,7 +166,7 @@ public void I_select_the_sections_navigation_button( ) throws Throwable {
166166

167167
@Then("^it should show me a list of sections$")
168168
public void it_should_show_a_list_of_sections() throws Throwable {
169-
assertEquals("block", webDriver.getElementCssValue(By.className("nav-popup-sections"), "display"));
169+
assertEquals("block", webDriver.getElementCssValue(By.className("nav-popup--sections"), "display"));
170170
}
171171

172172
@Then("^another click on the \"([^\"]*)\" \"([^\"]*)\" tab closes the list$")
@@ -194,9 +194,9 @@ public void I_can_expand_and_collapse_expanders(String sectionState) throws Thro
194194
WebElement expander = webDriver.waitForElement(By.className("cta"));
195195
expander.click();
196196

197-
String expectedTrailblockHeight = (sectionState.equals("expand")) ? "none" : "0";
197+
String expectedTrailblockHeight = (sectionState.equals("expand")) ? "block" : "none";
198198
// sections are hidden with css max-height
199-
assertTrue(webDriver.waitForCss(By.cssSelector(".related-trails .panel"), "max-height", expectedTrailblockHeight));
199+
assertTrue(webDriver.waitForCss(By.cssSelector(".related-trails .panel"), "display", expectedTrailblockHeight));
200200
}
201201

202202
@When("^Back to top is selected$")

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL