Project

General

Profile

Download (2.3 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
import java.util.List;
15

    
16
import org.junit.Assert;
17
import org.openqa.selenium.By;
18
import org.openqa.selenium.WebDriver;
19
import org.openqa.selenium.WebElement;
20

    
21
import com.google.common.base.Function;
22

    
23
import eu.etaxonomy.dataportal.DataPortalContext;
24
import eu.etaxonomy.dataportal.elements.ClassificationTreeBlock;
25
import eu.etaxonomy.dataportal.selenium.AllTrue;
26
import eu.etaxonomy.dataportal.selenium.PageTitleValidated;
27
import eu.etaxonomy.dataportal.selenium.UrlLoaded;
28
import eu.etaxonomy.dataportal.selenium.VisibilityOfElementLocated;
29

    
30
/**
31
 * @author andreas
32
 * @date Jul 5, 2011
33
 *
34
 */
35
public class GenericPortalPage extends PortalPage {
36

    
37

    
38
    /**
39
     * @param driver
40
     * @param context
41
     * @param pagePathSuffix
42
     * @throws MalformedURLException
43
     */
44
    public GenericPortalPage(WebDriver driver, DataPortalContext context, String pagePathSuffix) throws MalformedURLException {
45
        super(driver, context, pagePathSuffix);
46
    }
47

    
48
    /**
49
     * @param driver
50
     * @param context
51
     * @throws Exception
52
     */
53
    public GenericPortalPage(WebDriver driver, DataPortalContext context) throws Exception {
54
        super(driver, context);
55
    }
56

    
57
    protected static String drupalPagePathBase = "cdm_dataportal";
58

    
59
    /* (non-Javadoc)
60
     * @see eu.etaxonomy.dataportal.pages.PortalPage#getDrupalPageBase()
61
     */
62
    @Override
63
    protected String getDrupalPageBase() {
64
        return drupalPagePathBase;
65
    }
66

    
67
    public TaxonSearchResultPage submitQuery(String query) throws Exception{
68
        searchBlockElement.findElement(By.id("edit-query")).clear();
69
        searchBlockElement.findElement(By.id("edit-query")).sendKeys(query);
70
        searchBlockElement.findElement(By.id("edit-submit")).submit();//Search results
71

    
72
        wait.until(new AllTrue(new PageTitleValidated(context.prepareTitle("Search results")), new VisibilityOfElementLocated(By.id("container"))));
73
        return new TaxonSearchResultPage(driver, context);
74
    }
75

    
76
}
(1-1/6)