PageRenderTime 22ms CodeModel.GetById 13ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/sitebricks-acceptance-tests/src/test/java/com/google/sitebricks/acceptance/page/DecoratorPage.java

http://github.com/dhanji/sitebricks
Java | 36 lines | 29 code | 7 blank | 0 comment | 0 complexity | 380b0eede9a0d0e6d2e43b78cc6be111 MD5 | raw file
 1package com.google.sitebricks.acceptance.page;
 2
 3import org.openqa.selenium.WebDriver;
 4import org.openqa.selenium.support.PageFactory;
 5
 6import com.google.sitebricks.acceptance.util.AcceptanceTest;
 7
 8public class DecoratorPage {
 9
10  private WebDriver driver;
11
12  public DecoratorPage(WebDriver driver) {
13    this.driver = driver;
14  }
15  public boolean hasBasePageText() {
16    return driver.getPageSource().contains("Text defined in");
17  }
18  public boolean hasBasePageVariable() {
19    return driver.getPageSource().contains("from the superclass");
20  }
21  public boolean hasSubclassVariableInTemplate() {
22	    return driver.getPageSource().contains("This comes from the subclass");
23  }
24  public boolean hasSubclassVariable() {
25	    return driver.getPageSource().contains("very cool");
26  }
27  
28  public boolean hasSubclassText() {
29	    return driver.getPageSource().contains("This is in the extension");
30	 }
31
32  public static DecoratorPage open(WebDriver driver) {
33    driver.get(AcceptanceTest.baseUrl() + "/template");
34    return PageFactory.initElements(driver, DecoratorPage.class);
35  }
36}