Revision 53c35833
Added by Andreas Kohlbecker about 12 years ago
.gitattributes | ||
---|---|---|
259 | 259 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/CdmDataPortalSeleniumRCTestBase.java -text |
260 | 260 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/CdmDataPortalTestBase.java -text |
261 | 261 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/ExampleTest.java -text |
262 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/CichorieaeSearchTest.java -text |
|
263 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/CyprusSearchTest.java -text |
|
262 | 264 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/resources/org/mozilla/addons/add_on_compatibility_reporter-0.8.3-fx+tb+sm.xpi -text |
263 | 265 |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/resources/org/mozilla/addons/firebug-1.6.2.xpi -text |
264 | 266 |
modules/cdm_dataportal/test/phpUnit/TestUtils.php -text |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/main/java/eu/etaxonomy/dataportal/DataPortalContext.java | ||
---|---|---|
13 | 13 |
import java.net.URISyntaxException; |
14 | 14 |
import java.util.UUID; |
15 | 15 |
|
16 |
import org.apache.log4j.Logger; |
|
17 |
|
|
18 | 16 |
public enum DataPortalContext { |
19 | 17 |
|
20 |
cichorieae("http://160.45.63.201/dataportal/preview/cichorieae/", |
|
21 |
"http://127.0.0.1:8080", "534e190f-3339-49ba-95d9-fa27d5493e3e"), palmae( |
|
22 |
"http://160.45.63.201/dataportal/preview/palmae/", |
|
23 |
"http://127.0.0.1:8080", "534e190f-3339-49ba-95d9-fa27d5493e3e"); |
|
24 |
// floraMalesiana; |
|
25 |
|
|
18 |
cichorieae("http://160.45.63.201/dataportal/preview/cichorieae/", "http://127.0.0.1:8080", "534e190f-3339-49ba-95d9-fa27d5493e3e"), |
|
19 |
palmae("http://160.45.63.201/dataportal/preview/cyprus/", "http://127.0.0.1:8080", "534e190f-3339-49ba-95d9-fa27d5493e3e"), |
|
20 |
cyprus("http://160.45.63.201/dataportal/preview/cyprus/", "http://127.0.0.1:8080", "0c2b5d25-7b15-4401-8b51-dd4be0ee5cab"); |
|
26 | 21 |
|
27 | 22 |
URI baseUri; |
28 | 23 |
URI cdmServerUri; |
29 | 24 |
UUID classificationUUID; |
30 | 25 |
String themeName; |
31 | 26 |
|
32 |
private DataPortalContext(String baseUri, String cdmServerUri, |
|
33 |
String classificationUUID) { |
|
27 |
private DataPortalContext(String baseUri, String cdmServerUri, String classificationUUID) { |
|
34 | 28 |
try { |
35 | 29 |
this.baseUri = new URI(baseUri); |
36 | 30 |
this.cdmServerUri = new URI(cdmServerUri); |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/CdmDataPortalSeleniumRCTestBase.java | ||
---|---|---|
20 | 20 |
* http://seleniumhq.org/docs/03_webdriver.html#emulating-selenium-rc |
21 | 21 |
* |
22 | 22 |
* @author a.kohlbecker |
23 |
* |
|
23 |
* @deprecated SeleniumRCTests should only be used if you are really desperatly |
|
24 |
* shor in time and you need to use the Selenium 1 IDE in order to |
|
25 |
* quickly create tests. |
|
24 | 26 |
*/ |
27 |
@Deprecated |
|
25 | 28 |
public abstract class CdmDataPortalSeleniumRCTestBase extends CdmDataPortalTestBase { |
26 | 29 |
|
27 | 30 |
protected static Selenium selenium; |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/CdmDataPortalTestBase.java | ||
---|---|---|
99 | 99 |
// "C:\\Programme\\Mozilla Firefox 3\\firefox.exe"); |
100 | 100 |
// System.out.println("##:" + |
101 | 101 |
// System.getProperty("webdriver.firefox.bin")); |
102 |
|
|
102 | 103 |
FirefoxProfile firefoxProfile = new FirefoxProfile(); |
103 | 104 |
try { |
104 | 105 |
|
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/ExampleTest.java | ||
---|---|---|
22 | 22 |
@DataPortalContexts( { DataPortalContext.cichorieae }) |
23 | 23 |
public class ExampleTest extends CdmDataPortalSeleniumRCTestBase { |
24 | 24 |
|
25 |
static String baseUrl = "http://wp6-cichorieae.e-taxonomy.eu/portal/"; |
|
26 |
|
|
27 | 25 |
@Test |
28 | 26 |
public void testSearchLCommunis() throws Exception { |
29 | 27 |
driver |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/CichorieaeSearchTest.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.tests; |
|
11 |
|
|
12 |
import junit.framework.Assert; |
|
13 |
|
|
14 |
import org.junit.Test; |
|
15 |
import org.openqa.selenium.By; |
|
16 |
import org.openqa.selenium.RenderedWebElement; |
|
17 |
import org.openqa.selenium.WebElement; |
|
18 |
|
|
19 |
import eu.etaxonomy.dataportal.DataPortalContext; |
|
20 |
import eu.etaxonomy.dataportal.DataPortalContextAwareRunner.DataPortalContexts; |
|
21 |
import eu.etaxonomy.dataportal.selenium.CdmDataPortalTestBase; |
|
22 |
|
|
23 |
@DataPortalContexts( { DataPortalContext.cichorieae }) |
|
24 |
public class CichorieaeSearchTest extends CdmDataPortalTestBase { |
|
25 |
|
|
26 |
@Test |
|
27 |
public void testSearchLCommunis() throws Exception { |
|
28 |
driver.get(getBaseUrl() |
|
29 |
+ "?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"); |
|
30 |
WebElement taxonElement = driver.findElement(By |
|
31 |
.xpath("/html/body/div/div/div[2]/div[2]/div/div/div/ul/li/span[@ref='/name/f280f79f-5903-47b0-8352-53e4204c6cf1']")); |
|
32 |
|
|
33 |
WebElement nameElement = taxonElement.findElement(By.className("BotanicalName")); |
|
34 |
|
|
35 |
RenderedWebElement namePart1 = (RenderedWebElement) nameElement.findElement(By.xpath("span[1]")); |
|
36 |
Assert.assertEquals("Lapsana", namePart1.getText()); |
|
37 |
Assert.assertEquals("italic", namePart1.getValueOfCssProperty("font-style")); |
|
38 |
|
|
39 |
RenderedWebElement namePart2 = (RenderedWebElement) nameElement.findElement(By.xpath("span[2]")); |
|
40 |
Assert.assertEquals("communis", namePart2.getText()); |
|
41 |
Assert.assertEquals("italic", namePart2.getValueOfCssProperty("font-style")); |
|
42 |
|
|
43 |
RenderedWebElement authorPart = (RenderedWebElement) nameElement.findElement(By.xpath("span[3]")); |
|
44 |
Assert.assertEquals("L.", authorPart.getText()); |
|
45 |
Assert.assertEquals("normal", authorPart.getValueOfCssProperty("font-style")); |
|
46 |
|
|
47 |
RenderedWebElement referenceElement = (RenderedWebElement) taxonElement.findElement(By.className("reference")); |
|
48 |
Assert.assertEquals("Sp. Pl.: 811. 1753", referenceElement.findElement((By.className("reference"))).getText()); |
|
49 |
} |
|
50 |
|
|
51 |
} |
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/tests/CyprusSearchTest.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.tests; |
|
11 |
|
|
12 |
import org.junit.Assert; |
|
13 |
import org.junit.Test; |
|
14 |
import org.openqa.selenium.By; |
|
15 |
import org.openqa.selenium.RenderedWebElement; |
|
16 |
import org.openqa.selenium.WebElement; |
|
17 |
|
|
18 |
import eu.etaxonomy.dataportal.DataPortalContext; |
|
19 |
import eu.etaxonomy.dataportal.DataPortalContextAwareRunner.DataPortalContexts; |
|
20 |
import eu.etaxonomy.dataportal.selenium.CdmDataPortalTestBase; |
|
21 |
|
|
22 |
/** |
|
23 |
* @author a.kohlbecker |
|
24 |
* |
|
25 |
*/ |
|
26 |
|
|
27 |
@DataPortalContexts( { DataPortalContext.cyprus }) |
|
28 |
public class CyprusSearchTest extends CdmDataPortalTestBase{ |
|
29 |
|
|
30 |
/** |
|
31 |
* see http://dev.e-taxonomy.eu/trac/ticket/2350 |
|
32 |
*/ |
|
33 |
@Test |
|
34 |
public void searchResultsWithoutAnnotationFootnotes(){ |
|
35 |
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"); |
|
36 |
RenderedWebElement element = (RenderedWebElement)driver.findElement(By.xpath("/html/body/div/div/div[2]/div[2]/div/div/div/ul/li/span[@class='footnote-key footnote-key-1 member-of-footnotes--annotations']")); |
|
37 |
Assert.assertNull("result set entries must not have footnote keys", element); |
|
38 |
} |
|
39 |
|
|
40 |
} |
Also available in: Unified diff
test for cyprus portal