Project

General

Profile

Download (1.96 KB) Statistics
| Branch: | Tag: | Revision:
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.pages;
10

    
11
import java.net.MalformedURLException;
12

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

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

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

    
28

    
29

    
30
    public GenericPortalPage(WebDriver driver, DataPortalContext context, String pagePathSuffix) throws MalformedURLException {
31
        super(driver, context, pagePathSuffix);
32
    }
33

    
34

    
35
    public GenericPortalPage(WebDriver driver, DataPortalContext context) throws Exception {
36
        super(driver, context);
37
    }
38

    
39
    protected static String drupalPagePathBase = "cdm_dataportal";
40

    
41
    /* (non-Javadoc)
42
     * @see eu.etaxonomy.dataportal.pages.PortalPage#getDrupalPageBase()
43
     */
44
    @Override
45
    protected String getDrupalPageBase() {
46
        return drupalPagePathBase;
47
    }
48

    
49
    public TaxonSearchResultPage submitQuery(String query) throws Exception{
50
        searchBlockElement.findElement(By.id("edit-query")).clear();
51
        searchBlockElement.findElement(By.id("edit-query")).sendKeys(query);
52
        searchBlockElement.findElement(By.id("edit-submit")).submit();//Search results
53

    
54
        wait.until(
55
                    new AllTrue(
56
                                new PageTitleValidated(context.prepareTitle("Search results")),
57
                                new VisibilityOfElementLocated(By.id("search_results"))
58
                                )
59
                    );
60
        return new TaxonSearchResultPage(driver, context);
61
    }
62

    
63
}
(1-1/9)