Revision 24ee49b9
Added by Andreas Kohlbecker over 12 years ago
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/java/eu/etaxonomy/dataportal/pages/PortalPage.java | ||
---|---|---|
28 | 28 |
|
29 | 29 |
protected WebDriver driver; |
30 | 30 |
|
31 |
protected DataPortalContext context; |
|
32 |
|
|
31 | 33 |
protected final JUnitWebDriverWait wait; |
32 | 34 |
|
33 | 35 |
|
... | ... | |
56 | 58 |
@FindBy(className="node") |
57 | 59 |
protected WebElement node; |
58 | 60 |
|
59 |
|
|
60 | 61 |
@FindBys({@FindBy(id="tabs-wrapper"), @FindBy(className="primary")}) |
61 | 62 |
@CacheLookup |
62 | 63 |
protected WebElement primaryTabs; |
63 | 64 |
|
65 |
@FindBy(id="block-cdm_dataportal-2") |
|
66 |
@CacheLookup |
|
67 |
protected WebElement searchBlockElement; |
|
68 |
|
|
69 |
@FindBy(id="block-cdm_taxontree-cdm_tree") |
|
70 |
@CacheLookup |
|
71 |
protected WebElement classificationBrowserBlock; |
|
64 | 72 |
|
65 | 73 |
/** |
66 | 74 |
* Creates a new PortaPage. Implementations of this class will provide the base path of the page by |
... | ... | |
82 | 90 |
|
83 | 91 |
this.driver = driver; |
84 | 92 |
|
93 |
this.context = context; |
|
94 |
|
|
85 | 95 |
this.wait = new JUnitWebDriverWait(driver, 25); |
86 | 96 |
|
87 | 97 |
this.drupalPagePath = getDrupalPageBase() + (pagePathSuffix != null ? "/" + pagePathSuffix: ""); |
... | ... | |
108 | 118 |
* @throws Exception |
109 | 119 |
*/ |
110 | 120 |
public PortalPage(WebDriver driver, DataPortalContext context, URL url) throws Exception { |
121 |
|
|
111 | 122 |
this.driver = driver; |
112 | 123 |
|
124 |
this.context = context; |
|
125 |
|
|
113 | 126 |
this.wait = new JUnitWebDriverWait(driver, 25); |
114 | 127 |
|
115 |
this.pageUrl = new URL(context.getBaseUri().toString() + DRUPAL_PAGE_QUERY_BASE + getDrupalPageBase());
|
|
128 |
this.pageUrl = new URL(context.getBaseUri().toString()); |
|
116 | 129 |
|
117 | 130 |
// tell browser to navigate to the given URL |
118 | 131 |
driver.get(url.toString()); |
... | ... | |
139 | 152 |
* @throws Exception |
140 | 153 |
*/ |
141 | 154 |
public PortalPage(WebDriver driver, DataPortalContext context) throws Exception { |
155 |
|
|
142 | 156 |
this.driver = driver; |
143 | 157 |
|
158 |
this.context = context; |
|
159 |
|
|
144 | 160 |
this.wait = new JUnitWebDriverWait(driver, 25); |
145 | 161 |
|
146 | 162 |
// preliminary set the pageUrl to the base path of this page, this is used in the next setp to check if the |
147 | 163 |
// driver.getCurrentUrl() is a sub path of the base path |
148 |
this.pageUrl = new URL(context.getBaseUri().toString() + DRUPAL_PAGE_QUERY_BASE + getDrupalPageBase());
|
|
164 |
this.pageUrl = new URL(context.getBaseUri().toString()); |
|
149 | 165 |
|
150 | 166 |
if(!isOnPage()){ |
151 | 167 |
throw new Exception("Not on the expected portal page ( current: " + driver.getCurrentUrl() + ", expected: " + pageUrl + " )"); |
... | ... | |
187 | 203 |
return title.getText(); |
188 | 204 |
} |
189 | 205 |
|
206 |
/** |
|
207 |
* returns the warning messages from the Drupal message box |
|
208 |
* @return |
|
209 |
*/ |
|
210 |
public String getWarnings() { |
|
211 |
return null; //TODO unimplemented |
|
212 |
} |
|
213 |
|
|
214 |
/** |
|
215 |
* returns the error messages from the Drupal message box |
|
216 |
* @return |
|
217 |
*/ |
|
218 |
public String getErrors() { |
|
219 |
return null; //TODO unimplemented |
|
220 |
} |
|
221 |
|
|
190 | 222 |
public String getAuthorInformationText() { |
191 | 223 |
|
192 | 224 |
WebElement authorInformation = null; |
Also available in: Unified diff
switching to selenium 2.3.1 & SearchPage & OriginalSource tests