Revision 05ea371c
Added by Andreas Kohlbecker almost 13 years ago
modules/cdm_dataportal/test/java/dataportal-selenium-tests/src/test/java/eu/etaxonomy/dataportal/selenium/CdmDataPortalTestBase.java | ||
---|---|---|
17 | 17 |
|
18 | 18 |
import eu.etaxonomy.dataportal.Browser; |
19 | 19 |
import eu.etaxonomy.dataportal.DataPortalContext; |
20 |
import eu.etaxonomy.dataportal.DataPortalContextSuite; |
|
21 | 20 |
import eu.etaxonomy.dataportal.SystemUtils; |
21 |
import eu.etaxonomy.dataportal.junit.DataPortalContextSuite; |
|
22 | 22 |
|
23 | 23 |
/** |
24 | 24 |
* @author a.kohlbecker |
... | ... | |
29 | 29 |
|
30 | 30 |
public static final Logger logger = Logger.getLogger(CdmDataPortalTestBase.class); |
31 | 31 |
|
32 |
private static final String SYSTEM_PROPERTY_NAME_BROWSER = "browser";
|
|
32 |
public static final String SYSTEM_PROPERTY_NAME_BROWSER = "browser";
|
|
33 | 33 |
|
34 | 34 |
private static final String FIREBUG_VERSION = "1.6.2"; |
35 | 35 |
|
36 | 36 |
protected static WebDriver driver; |
37 | 37 |
|
38 |
private DataPortalContext context; |
|
39 |
|
|
38 |
private final DataPortalContext context;
|
|
39 |
|
|
40 | 40 |
public DataPortalContext getContext() { |
41 | 41 |
return context; |
42 | 42 |
} |
... | ... | |
79 | 79 |
} |
80 | 80 |
|
81 | 81 |
public static WebDriver initChromeDriver() { |
82 |
// System.setProperty("webdriver.chrome.bin", |
|
83 |
// "C:\\Dokumente und Einstellungen\\a.kohlbecker.BGBM\\Lokale Einstellungen\\Anwendungsdaten\\Google\\Chrome\\Application\\chrome.exe"); |
|
84 | 82 |
return new ChromeDriver(); |
85 | 83 |
} |
86 | 84 |
|
... | ... | |
96 | 94 |
* @return |
97 | 95 |
*/ |
98 | 96 |
public static WebDriver initFirefoxDriver() { |
99 |
// System.setProperty("webdriver.firefox.bin", |
|
100 |
// "C:\\Programme\\Mozilla Firefox 3\\firefox.exe"); |
|
101 |
// System.out.println("##:" + |
|
102 |
// System.getProperty("webdriver.firefox.bin")); |
|
103 |
|
|
97 |
CdmDataPortalTestBase.logger.debug(("##:" + System.getProperty("webdriver.firefox.bin"))); |
|
98 |
|
|
104 | 99 |
FirefoxProfile firefoxProfile = new FirefoxProfile(); |
105 | 100 |
try { |
106 | 101 |
|
... | ... | |
108 | 103 |
firefoxProfile.setPreference("extensions.firebug.currentVersion", FIREBUG_VERSION); // avoid displaying firt run page |
109 | 104 |
|
110 | 105 |
// --- allow enabling incompatible addons |
111 |
// firefoxProfile.addExtension(this.getClass(), |
|
112 |
// "/org/mozilla/addons/add_on_compatibility_reporter-0.8.3-fx+tb+sm.xpi"); |
|
106 |
// firefoxProfile.addExtension(this.getClass(), "/org/mozilla/addons/add_on_compatibility_reporter-0.8.3-fx+tb+sm.xpi"); |
|
113 | 107 |
// firefoxProfile.setPreference("extensions.acr.firstrun", false); |
114 |
// firefoxProfile.setPreference("extensions.enabledAddons", |
|
115 |
// "fxdriver@googlecode.com,compatibility@addons.mozilla.org:0.8.3,fxdriver@googlecode.com:0.9.7376,{CAFEEFAC-0016-0000-0024-ABCDEFFEDCBA}:6.0.24,{20a82645-c095-46ed-80e3-08825760534b}:0.0.0,meetinglauncher@iconf.net:4.10.12.316,jqs@sun.com:1.0,{972ce4c6-7e08-4474-a285-3208198ce6fd}:4.0"); |
|
116 |
// firefoxProfile.setPreference("extensions.checkCompatibility", |
|
117 |
// false); |
|
118 |
// firefoxProfile.setPreference("extensions.checkCompatibility.4.0", |
|
119 |
// false); |
|
120 |
// firefoxProfile.setPreference("extensions.checkCompatibility.4.1", |
|
121 |
// false); |
|
108 |
// firefoxProfile.setPreference("extensions.enabledAddons", "fxdriver@googlecode.com,compatibility@addons.mozilla.org:0.8.3,fxdriver@googlecode.com:0.9.7376,{CAFEEFAC-0016-0000-0024-ABCDEFFEDCBA}:6.0.24,{20a82645-c095-46ed-80e3-08825760534b}:0.0.0,meetinglauncher@iconf.net:4.10.12.316,jqs@sun.com:1.0,{972ce4c6-7e08-4474-a285-3208198ce6fd}:4.0"); |
|
109 |
// firefoxProfile.setPreference("extensions.checkCompatibility", false); |
|
110 |
// firefoxProfile.setPreference("extensions.checkCompatibility.4.0", false); |
|
111 |
// firefoxProfile.setPreference("extensions.checkCompatibility.4.1", false); |
|
122 | 112 |
|
123 | 113 |
} catch (IOException e) { |
124 |
// TODO Auto-generated catch block |
|
125 |
e.printStackTrace(); |
|
114 |
CdmDataPortalTestBase.logger.error(e); |
|
126 | 115 |
System.exit(-1); |
127 | 116 |
} |
128 | 117 |
driver = new FirefoxDriver(firefoxProfile); |
Also available in: Unified diff
test configurable via properties files