Project

General

Profile

Download (2.03 KB) Statistics
| Branch: | Tag: | Revision:
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.sql.PreparedStatement;
14

    
15
import org.openqa.selenium.By;
16
import org.openqa.selenium.WebDriver;
17

    
18
import com.google.common.base.Function;
19

    
20
import eu.etaxonomy.dataportal.DataPortalContext;
21
import eu.etaxonomy.dataportal.selenium.AllTrue;
22
import eu.etaxonomy.dataportal.selenium.PageTitleValidated;
23
import eu.etaxonomy.dataportal.selenium.UrlLoaded;
24
import eu.etaxonomy.dataportal.selenium.VisibilityOfElementLocated;
25

    
26
/**
27
 * @author andreas
28
 * @date Jul 5, 2011
29
 *
30
 */
31
public class GenericPortalPage extends PortalPage {
32

    
33

    
34
	/**
35
	 * @param driver
36
	 * @param context
37
	 * @param pagePathSuffix
38
	 * @throws MalformedURLException
39
	 */
40
	public GenericPortalPage(WebDriver driver, DataPortalContext context, String pagePathSuffix) throws MalformedURLException {
41
		super(driver, context, pagePathSuffix);
42
	}
43

    
44
	/**
45
	 * @param driver
46
	 * @param context
47
	 * @throws Exception
48
	 */
49
	public GenericPortalPage(WebDriver driver, DataPortalContext context) throws Exception {
50
		super(driver, context);
51
	}
52

    
53
	protected static String drupalPagePathBase = "cdm_dataportal";
54

    
55
	/* (non-Javadoc)
56
	 * @see eu.etaxonomy.dataportal.pages.PortalPage#getDrupalPageBase()
57
	 */
58
	@Override
59
	protected String getDrupalPageBase() {
60
		return drupalPagePathBase;
61
	}
62

    
63
	public TaxonSearchResultPage submitQuery(String query) throws Exception{
64
		searchBlockElement.findElement(By.id("edit-query")).clear();
65
		searchBlockElement.findElement(By.id("edit-query")).sendKeys(query);
66
		searchBlockElement.findElement(By.id("edit-submit")).submit();//Search results
67

    
68
		wait.until(new AllTrue(new PageTitleValidated(context.prepareTitle("Search results")), new VisibilityOfElementLocated(By.id("container"))));
69
		return new TaxonSearchResultPage(driver, context);
70
	}
71

    
72
}
(1-1/6)