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.pages;
|
11
|
|
12
|
import java.net.MalformedURLException;
|
13
|
import java.util.ArrayList;
|
14
|
import java.util.List;
|
15
|
|
16
|
import org.openqa.selenium.By;
|
17
|
import org.openqa.selenium.WebDriver;
|
18
|
import org.openqa.selenium.WebElement;
|
19
|
|
20
|
import eu.etaxonomy.dataportal.DataPortalContext;
|
21
|
import eu.etaxonomy.dataportal.elements.GalleryImage;
|
22
|
import eu.etaxonomy.dataportal.selenium.AllTrue;
|
23
|
import eu.etaxonomy.dataportal.selenium.ChildElementVisible;
|
24
|
import eu.etaxonomy.dataportal.selenium.PageTitleValidated;
|
25
|
import eu.etaxonomy.dataportal.selenium.VisibilityOfElementLocated;
|
26
|
|
27
|
/**
|
28
|
* @author andreas
|
29
|
* @date Jul 5, 2011
|
30
|
*
|
31
|
*/
|
32
|
public class GenericPortalPage extends PortalPage {
|
33
|
|
34
|
|
35
|
/**
|
36
|
* @param driver
|
37
|
* @param context
|
38
|
* @param pagePathSuffix
|
39
|
* @throws MalformedURLException
|
40
|
*/
|
41
|
public GenericPortalPage(WebDriver driver, DataPortalContext context, String pagePathSuffix) throws MalformedURLException {
|
42
|
super(driver, context, pagePathSuffix);
|
43
|
}
|
44
|
|
45
|
/**
|
46
|
* @param driver
|
47
|
* @param context
|
48
|
* @throws Exception
|
49
|
*/
|
50
|
public GenericPortalPage(WebDriver driver, DataPortalContext context) throws Exception {
|
51
|
super(driver, context);
|
52
|
}
|
53
|
|
54
|
protected static String drupalPagePathBase = "cdm_dataportal";
|
55
|
|
56
|
/* (non-Javadoc)
|
57
|
* @see eu.etaxonomy.dataportal.pages.PortalPage#getDrupalPageBase()
|
58
|
*/
|
59
|
@Override
|
60
|
protected String getDrupalPageBase() {
|
61
|
return drupalPagePathBase;
|
62
|
}
|
63
|
|
64
|
public TaxonSearchResultPage submitQuery(String query) throws Exception{
|
65
|
searchBlockElement.findElement(By.id("edit-query")).clear();
|
66
|
searchBlockElement.findElement(By.id("edit-query")).sendKeys(query);
|
67
|
searchBlockElement.findElement(By.id("edit-submit")).submit();//Search results
|
68
|
|
69
|
wait.until(
|
70
|
new AllTrue(
|
71
|
new PageTitleValidated(context.prepareTitle("Search results")),
|
72
|
new VisibilityOfElementLocated(By.id("container"))
|
73
|
)
|
74
|
);
|
75
|
return new TaxonSearchResultPage(driver, context);
|
76
|
}
|
77
|
|
78
|
}
|