Revision f339c2fc
Added by Andreas Kohlbecker over 12 years ago
.gitattributes | ||
---|---|---|
294 | 294 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/resources/org/mozilla/addons/firebug-1.8.3.xpi -text |
295 | 295 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/resources/org/mozilla/addons/firepath-0.9.7-fx.xpi -text |
296 | 296 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/resources/org/mozilla/addons/firexpath-0.9.6.1-fx.xpi -text |
297 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/ExampleTest.java -text
|
|
297 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/TestExample.java -text
|
|
298 | 298 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/CichorieaeSearchTest.java -text |
299 | 299 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Cichorieae_HybridTest.java -text |
300 | 300 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/cichorieae/Cichorieae_TechnicalAnnnotationsTest.java -text |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/ExampleTest.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2009 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.selenium; |
|
11 |
|
|
12 |
import junit.framework.Assert; |
|
13 |
|
|
14 |
import org.junit.Ignore; |
|
15 |
import org.junit.Test; |
|
16 |
import org.openqa.selenium.By; |
|
17 |
import org.openqa.selenium.WebElement; |
|
18 |
|
|
19 |
import eu.etaxonomy.dataportal.DataPortalContext; |
|
20 |
import eu.etaxonomy.dataportal.junit.CdmDataPortalSeleniumRCTestBase; |
|
21 |
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts; |
|
22 |
|
|
23 |
@SuppressWarnings("deprecation") |
|
24 |
@DataPortalContexts( { DataPortalContext.cichorieae }) |
|
25 |
public class ExampleTest extends CdmDataPortalSeleniumRCTestBase { |
|
26 |
|
|
27 |
@Test |
|
28 |
@Ignore |
|
29 |
public void testSearchLCommunis() throws Exception { |
|
30 |
driver.get(getBaseUrl() |
|
31 |
+ "?query=Lapsana+com*&search[tree]=534e190f-3339-49ba-95d9-fa27d5493e3e&q=cdm_dataportal%2Fsearch%2Ftaxon&search[pageSize]=25&search[pageNumber]=0&search[doTaxa]=1&search[doSynonyms]=1&search[doTaxaByCommonNames]=0"); |
|
32 |
WebElement taxonElement = driver.findElement(By |
|
33 |
.xpath("/html/body/div/div/div[2]/div[2]/div/div/div/ul/li/span[@ref='/name/f280f79f-5903-47b0-8352-53e4204c6cf1']")); |
|
34 |
|
|
35 |
WebElement nameElement = taxonElement.findElement(By.className("BotanicalName")); |
|
36 |
|
|
37 |
WebElement namePart1 = nameElement.findElement(By.xpath("span[1]")); |
|
38 |
Assert.assertEquals("Lapsana", namePart1.getText()); |
|
39 |
Assert.assertEquals("italic", namePart1.getCssValue("font-style")); |
|
40 |
|
|
41 |
WebElement namePart2 = nameElement.findElement(By.xpath("span[2]")); |
|
42 |
Assert.assertEquals("communis", namePart2.getText()); |
|
43 |
Assert.assertEquals("italic", namePart2.getCssValue("font-style")); |
|
44 |
|
|
45 |
WebElement authorPart = nameElement.findElement(By.xpath("span[3]")); |
|
46 |
Assert.assertEquals("L.", authorPart.getText()); |
|
47 |
Assert.assertEquals("normal", authorPart.getCssValue("font-style")); |
|
48 |
|
|
49 |
WebElement referenceElement = taxonElement.findElement(By.className("reference")); |
|
50 |
Assert.assertEquals("Sp. Pl.: 811. 1753", referenceElement.findElement((By.className("reference"))).getText()); |
|
51 |
} |
|
52 |
|
|
53 |
/** |
|
54 |
* This test emulates the Selenium RC API |
|
55 |
* |
|
56 |
* @throws Exception |
|
57 |
*/ |
|
58 |
@Test |
|
59 |
@Ignore |
|
60 |
public void testSearchLCommunisUsingSeleniumRC() throws Exception { |
|
61 |
selenium.open("?query=Lapsana+com*&search[tree]=534e190f-3339-49ba-95d9-fa27d5493e3e&q=cdm_dataportal%2Fsearch%2Ftaxon&search[pageSize]=25&search[pageNumber]=0&search[doTaxa]=1&search[doSynonyms]=1&search[doTaxaByCommonNames]=0"); |
|
62 |
selenium.isTextPresent("Lapsana"); |
|
63 |
selenium.isTextPresent("communis"); |
|
64 |
selenium.isTextPresent("L."); |
|
65 |
selenium.isTextPresent("Sp. Pl.: 811. 1753"); |
|
66 |
} |
|
67 |
|
|
68 |
} |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/TestExample.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2009 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.selenium; |
|
11 |
|
|
12 |
import junit.framework.Assert; |
|
13 |
|
|
14 |
import org.junit.Ignore; |
|
15 |
import org.junit.Test; |
|
16 |
import org.openqa.selenium.By; |
|
17 |
import org.openqa.selenium.WebElement; |
|
18 |
|
|
19 |
import eu.etaxonomy.dataportal.DataPortalContext; |
|
20 |
import eu.etaxonomy.dataportal.junit.CdmDataPortalSeleniumRCTestBase; |
|
21 |
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite.DataPortalContexts; |
|
22 |
|
|
23 |
@SuppressWarnings("deprecation") |
|
24 |
@DataPortalContexts( { DataPortalContext.cichorieae }) |
|
25 |
public class TestExample extends CdmDataPortalSeleniumRCTestBase { |
|
26 |
|
|
27 |
// @Test |
|
28 |
public void testSearchLCommunis() throws Exception { |
|
29 |
driver.get(getBaseUrl() |
|
30 |
+ "?query=Lapsana+com*&search[tree]=534e190f-3339-49ba-95d9-fa27d5493e3e&q=cdm_dataportal%2Fsearch%2Ftaxon&search[pageSize]=25&search[pageNumber]=0&search[doTaxa]=1&search[doSynonyms]=1&search[doTaxaByCommonNames]=0"); |
|
31 |
WebElement taxonElement = driver.findElement(By |
|
32 |
.xpath("/html/body/div/div/div[2]/div[2]/div/div/div/ul/li/span[@ref='/name/f280f79f-5903-47b0-8352-53e4204c6cf1']")); |
|
33 |
|
|
34 |
WebElement nameElement = taxonElement.findElement(By.className("BotanicalName")); |
|
35 |
|
|
36 |
WebElement namePart1 = nameElement.findElement(By.xpath("span[1]")); |
|
37 |
Assert.assertEquals("Lapsana", namePart1.getText()); |
|
38 |
Assert.assertEquals("italic", namePart1.getCssValue("font-style")); |
|
39 |
|
|
40 |
WebElement namePart2 = nameElement.findElement(By.xpath("span[2]")); |
|
41 |
Assert.assertEquals("communis", namePart2.getText()); |
|
42 |
Assert.assertEquals("italic", namePart2.getCssValue("font-style")); |
|
43 |
|
|
44 |
WebElement authorPart = nameElement.findElement(By.xpath("span[3]")); |
|
45 |
Assert.assertEquals("L.", authorPart.getText()); |
|
46 |
Assert.assertEquals("normal", authorPart.getCssValue("font-style")); |
|
47 |
|
|
48 |
WebElement referenceElement = taxonElement.findElement(By.className("reference")); |
|
49 |
Assert.assertEquals("Sp. Pl.: 811. 1753", referenceElement.findElement((By.className("reference"))).getText()); |
|
50 |
} |
|
51 |
|
|
52 |
/** |
|
53 |
* This test emulates the Selenium RC API |
|
54 |
* |
|
55 |
* @throws Exception |
|
56 |
*/ |
|
57 |
// @Test |
|
58 |
public void testSearchLCommunisUsingSeleniumRC() throws Exception { |
|
59 |
selenium.open("?query=Lapsana+com*&search[tree]=534e190f-3339-49ba-95d9-fa27d5493e3e&q=cdm_dataportal%2Fsearch%2Ftaxon&search[pageSize]=25&search[pageNumber]=0&search[doTaxa]=1&search[doSynonyms]=1&search[doTaxaByCommonNames]=0"); |
|
60 |
selenium.isTextPresent("Lapsana"); |
|
61 |
selenium.isTextPresent("communis"); |
|
62 |
selenium.isTextPresent("L."); |
|
63 |
selenium.isTextPresent("Sp. Pl.: 811. 1753"); |
|
64 |
} |
|
65 |
|
|
66 |
} |
Also available in: Unified diff
excluding example from test set