1
|
/**
|
2
|
*
|
3
|
*/
|
4
|
package eu.etaxonomy.dataportal.selenium;
|
5
|
|
6
|
import org.openqa.selenium.By;
|
7
|
import org.openqa.selenium.WebDriver;
|
8
|
|
9
|
import com.google.common.base.Function;
|
10
|
|
11
|
/**
|
12
|
* @author andreas
|
13
|
*
|
14
|
*/
|
15
|
public class PageTitleValidated implements Function<WebDriver, Boolean> {
|
16
|
|
17
|
private String title;
|
18
|
|
19
|
public PageTitleValidated(String title) {
|
20
|
this.title = title;
|
21
|
}
|
22
|
|
23
|
/* (non-Javadoc)
|
24
|
* @see com.google.common.base.Function#apply(java.lang.Object)
|
25
|
*/
|
26
|
public Boolean apply(WebDriver driver) {
|
27
|
boolean validated = driver.findElement(By.tagName("title")).getText().equals(title);
|
28
|
return Boolean.valueOf(validated);
|
29
|
}
|
30
|
|
31
|
}
|