Project

General

Profile

« Previous | Next » 

Revision d124d729

Added by Andreas Kohlbecker over 12 years ago

fixing broken test

View differences:

modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cyprus/CyprusSearchTest.java
9 9
 */
10 10
package eu.etaxonomy.dataportal.selenium.tests.cyprus;
11 11

  
12
import static org.junit.Assert.assertNull;
13

  
12 14
import org.junit.Assert;
15
import org.junit.Before;
13 16
import org.junit.Ignore;
14 17
import org.junit.Test;
15 18
import org.openqa.selenium.By;
16 19
import org.openqa.selenium.WebElement;
17 20

  
18 21
import eu.etaxonomy.dataportal.DataPortalContext;
22
import eu.etaxonomy.dataportal.elements.TaxonListElement;
19 23
import eu.etaxonomy.dataportal.junit.CdmDataPortalTestBase;
20 24
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts;
25
import eu.etaxonomy.dataportal.pages.GenericPortalPage;
26
import eu.etaxonomy.dataportal.pages.TaxonSearchResultPage;
21 27

  
22 28
/**
23 29
 * @author a.kohlbecker
......
27 33
@DataPortalContexts( { DataPortalContext.cyprus })
28 34
public class CyprusSearchTest extends CdmDataPortalTestBase{
29 35

  
36
	private GenericPortalPage homePage;
37

  
38
	@Before
39
	public void setUp() throws Exception {
40

  
41
		driver.get(getContext().getBaseUri().toString());
42
		homePage = new GenericPortalPage(driver, getContext());
43

  
44
	}
45

  
30 46
	/**
31 47
	 * see http://dev.e-taxonomy.eu/trac/ticket/2350
48
	 * @throws Exception
32 49
	 */
33 50
	@Test
34
	@Ignore
35
	public void searchResultsWithoutAnnotationFootnotes(){
36
		driver.get(getBaseUrl() + "?query=Genis*&search[tree]=0c2b5d25-7b15-4401-8b51-dd4be0ee5cab&q=cdm_dataportal%2Fsearch%2Ftaxon&search[pageSize]=25&search[pageNumber]=0&search[doTaxa]=1&search[doSynonyms]=1&search[doTaxaByCommonNames]=0");
51
	public void searchResultsWithoutAnnotationFootnotes() throws Exception{
52

  
53
		TaxonSearchResultPage searchResultPage = homePage.submitQuery("Genis*");
37 54

  
38
		// --- This variant is slower in FF that using the full xpath
39
		//		WebElement container = driver.findElement(By.id("squeeze"));
40
		//		RenderedWebElement element = (RenderedWebElement)container.findElement(By.xpath("div/div/ul/li/span[contains(@class, 'footnote-key')]"));
55
		for (TaxonListElement item : searchResultPage.getResultItems()){
56
			 assertNull("result set entries must not have footnote keys", item.getElement().findElements(By.className("footnote-key")));
57
		}
41 58

  
42
		// --- using the full xpath
43
		WebElement element = driver.findElement(By.xpath("/html/body/div/div/div[2]/div[2]/div/div/div/ul/li/span[contains(@class, 'footnote-key')]"));
44
		Assert.assertNull("result set entries must not have footnote keys", element);
45 59
	}
46 60

  
47 61
}

Also available in: Unified diff