Project

General

Profile

Download (2.16 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

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

    
17
import eu.etaxonomy.dataportal.DataPortalContext;
18
import eu.etaxonomy.dataportal.selenium.AllTrue;
19
import eu.etaxonomy.dataportal.selenium.PageTitleValidated;
20
import eu.etaxonomy.dataportal.selenium.VisibilityOfElementLocated;
21

    
22
/**
23
 * @author andreas
24
 * @date Jul 5, 2011
25
 *
26
 */
27
public class GenericPortalPage extends PortalPage {
28

    
29

    
30
    /**
31
     * @param driver
32
     * @param context
33
     * @param pagePathSuffix
34
     * @throws MalformedURLException
35
     */
36
    public GenericPortalPage(WebDriver driver, DataPortalContext context, String pagePathSuffix) throws MalformedURLException {
37
        super(driver, context, pagePathSuffix);
38
    }
39

    
40
    /**
41
     * @param driver
42
     * @param context
43
     * @throws Exception
44
     */
45
    public GenericPortalPage(WebDriver driver, DataPortalContext context) throws Exception {
46
        super(driver, context);
47
    }
48

    
49
    protected static String drupalPagePathBase = "cdm_dataportal";
50

    
51
    /* (non-Javadoc)
52
     * @see eu.etaxonomy.dataportal.pages.PortalPage#getDrupalPageBase()
53
     */
54
    @Override
55
    protected String getDrupalPageBase() {
56
        return drupalPagePathBase;
57
    }
58

    
59
    public TaxonSearchResultPage submitQuery(String query) throws Exception{
60
        searchBlockElement.findElement(By.id("edit-query")).clear();
61
        searchBlockElement.findElement(By.id("edit-query")).sendKeys(query);
62
        searchBlockElement.findElement(By.id("edit-submit")).submit();//Search results
63

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

    
73
}
(1-1/6)