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
|
* @date Aug 29, 2011
|
17
|
*
|
18
|
*/
|
19
|
public class GalleryImage extends ImgElement {
|
20
|
|
21
|
|
22
|
private WebElement captionCell;
|
23
|
private WebElement mediaCell;
|
24
|
|
25
|
/**
|
26
|
* @param img
|
27
|
*/
|
28
|
public GalleryImage(WebElement mediaCell, WebElement captionCell) {
|
29
|
super(mediaCell.findElement(By.tagName("img")));
|
30
|
this.captionCell = captionCell;
|
31
|
this.mediaCell = mediaCell;
|
32
|
}
|
33
|
|
34
|
public String getCaptionText() {
|
35
|
if(captionCell == null){
|
36
|
return null;
|
37
|
}
|
38
|
return captionCell.findElement(By.tagName("dl")).getText();
|
39
|
}
|
40
|
|
41
|
public LinkElement getCaptionLink() {
|
42
|
if(captionCell == null){
|
43
|
return null;
|
44
|
}
|
45
|
return new LinkElement(captionCell.findElement(By.xpath("./div[contains(@class,'media-caption-link')]/a")));
|
46
|
}
|
47
|
|
48
|
public LinkElement getImageLink() {
|
49
|
if(mediaCell == null){
|
50
|
return null;
|
51
|
}
|
52
|
return new LinkElement(mediaCell.findElement(By.tagName("a")));
|
53
|
}
|
54
|
|
55
|
}
|