1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2011 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
7
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9
|
*/
|
10
|
package eu.etaxonomy.dataportal.elements;
|
11
|
|
12
|
import org.openqa.selenium.By;
|
13
|
import org.openqa.selenium.NoSuchElementException;
|
14
|
import org.openqa.selenium.RenderedWebElement;
|
15
|
import org.openqa.selenium.WebElement;
|
16
|
|
17
|
|
18
|
/**
|
19
|
* @author andreas
|
20
|
* @date Jul 4, 2011
|
21
|
*
|
22
|
*/
|
23
|
public class DrupalBlock extends BaseElement {
|
24
|
|
25
|
private String header;
|
26
|
|
27
|
protected RenderedWebElement content;
|
28
|
|
29
|
/**
|
30
|
* @param element
|
31
|
*/
|
32
|
public DrupalBlock(RenderedWebElement element) {
|
33
|
|
34
|
super(element);
|
35
|
|
36
|
content = (RenderedWebElement) element.findElement(By.className("content"));
|
37
|
|
38
|
try {
|
39
|
WebElement headerElement = element.findElement(By.tagName("h2"));
|
40
|
header = headerElement.getText();
|
41
|
} catch (NoSuchElementException e){
|
42
|
// IGNORE //
|
43
|
}
|
44
|
}
|
45
|
|
46
|
public String getHeader() {
|
47
|
return header;
|
48
|
}
|
49
|
|
50
|
public RenderedWebElement getContent() {
|
51
|
return content;
|
52
|
}
|
53
|
|
54
|
}
|