Revision 7d706e69
Added by Andreas Kohlbecker almost 13 years ago
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/java/eu/etaxonomy/dataportal/pages/PortalPage.java | ||
---|---|---|
10 | 10 |
import org.openqa.selenium.support.FindBy; |
11 | 11 |
import org.openqa.selenium.support.PageFactory; |
12 | 12 |
|
13 |
import eu.etaxonomy.dataportal.TestConfiguration; |
|
13 | 14 |
import eu.etaxonomy.dataportal.selenium.JUnitWebDriverWait; |
14 | 15 |
|
15 | 16 |
public class PortalPage { |
... | ... | |
32 | 33 |
this.driver = driver; |
33 | 34 |
this.initialUrl = new URL(driver.getCurrentUrl()); |
34 | 35 |
this.wait = new JUnitWebDriverWait(driver, 25); |
35 |
logger.info("new " + this.getClass().getSimpleName() + " for " + initialUrl); |
|
36 |
|
|
37 |
logger.info("loading " + initialUrl); |
|
36 | 38 |
} |
37 | 39 |
|
38 | 40 |
public void goToInitialPage() { |
... | ... | |
40 | 42 |
PageFactory.initElements(driver, this); |
41 | 43 |
} |
42 | 44 |
|
45 |
/** |
|
46 |
* returns the string from the <code>title</code> tag. |
|
47 |
* @return |
|
48 |
*/ |
|
43 | 49 |
public String getTitle() { |
44 | 50 |
return title.getText(); |
45 | 51 |
} |
46 | 52 |
|
53 |
|
|
54 |
/** |
|
55 |
* Returns the current URL string from the {@link WebDriver} |
|
56 |
* @return |
|
57 |
*/ |
|
47 | 58 |
public String getURL() { |
48 | 59 |
return driver.getCurrentUrl(); |
49 | 60 |
} |
... | ... | |
59 | 70 |
public boolean equals(Object obj) { |
60 | 71 |
if (PortalPage.class.isAssignableFrom(obj.getClass())) { |
61 | 72 |
PortalPage page = (PortalPage) obj; |
62 |
return this.getTitle().equals(page.getTitle()) |
|
63 |
&& this.getURL().equals(page.getURL()); |
|
73 |
return this.getURL().equals(page.getURL()); |
|
64 | 74 |
|
65 | 75 |
} else { |
66 | 76 |
return false; |
Also available in: Unified diff
using PageFactory (Selenium 2 Page Objects pattern) done for PoltomouskeyPage