1
|
/**
|
2
|
* Copyright (C) 2011 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.dataportal.elements;
|
10
|
|
11
|
import org.openqa.selenium.By;
|
12
|
import org.openqa.selenium.WebElement;
|
13
|
|
14
|
/**
|
15
|
* @author andreas
|
16
|
* @since Aug 29, 2011
|
17
|
*
|
18
|
*/
|
19
|
public class GalleryImage extends ImgElement {
|
20
|
|
21
|
|
22
|
private WebElement captionCell;
|
23
|
private WebElement mediaCell;
|
24
|
|
25
|
public GalleryImage(WebElement mediaCell, WebElement captionCell) {
|
26
|
super(mediaCell.findElement(By.tagName("img")));
|
27
|
this.captionCell = captionCell;
|
28
|
this.mediaCell = mediaCell;
|
29
|
}
|
30
|
|
31
|
public String getCaptionText() {
|
32
|
if(captionCell == null){
|
33
|
return null;
|
34
|
}
|
35
|
return captionCell.findElement(By.tagName("dl")).getText();
|
36
|
}
|
37
|
|
38
|
public LinkElement getCaptionLink() {
|
39
|
if(captionCell == null){
|
40
|
return null;
|
41
|
}
|
42
|
return new LinkElement(captionCell.findElement(By.xpath("./div[contains(@class,'media-caption-link')]/a")));
|
43
|
}
|
44
|
|
45
|
public LinkElement getImageLink() {
|
46
|
if(mediaCell == null){
|
47
|
return null;
|
48
|
}
|
49
|
return new LinkElement(mediaCell.findElement(By.tagName("a")));
|
50
|
}
|
51
|
|
52
|
}
|