Skip to content

Commit 4fd4647

Browse files
author
Manish Goyal
committed
updating local project
1 parent af09382 commit 4fd4647

File tree

5 files changed

+53
-10
lines changed

5 files changed

+53
-10
lines changed

config_default.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
# To localy override values, create config.yml file next to this one.
33
# You can also override these values by specyfing a system property
44

5-
browser: FF # acceptable values: FF, CHROME, GHOST, ANDROID, CHROMEMOBILEMERCURY, HTMLUNIT
5+
browser: CHROME # acceptable values: FF, CHROME, GHOST, ANDROID, CHROMEMOBILEMERCURY, HTMLUNIT
66
wikiName: mediawiki119 # default testing wiki
77
env: prod # acceptable values: prod, preview, sandbox-number dev-name
8-
credentialsPath: /selenium-config/config.xml # Path to your config.xml file
9-
captchaPath: /selenium-config/captcha.txt # Path to your captcha.txt file
8+
credentialsPath: config.xml # Path to your config.xml file
9+
captchaPath: captcha.txt # Path to your captcha.txt file
1010
qs: null
1111
disableFlash: true
1212
jsErrorsEnabled: false

pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@
139139
<artifactId>htmlunit</artifactId>
140140
<version>2.18</version>
141141
</dependency>
142+
<dependency>
143+
<groupId>org.littleshoot</groupId>
144+
<artifactId>littleproxy</artifactId>
145+
<version>1.1.0-beta1</version>
146+
</dependency>
142147
</dependencies>
143148
<build>
144149
<plugins>
@@ -160,7 +165,7 @@
160165
<suiteXmlFiles>
161166
<suiteXmlFile>${testSuite}</suiteXmlFile>
162167
</suiteXmlFiles>
163-
<argLine>-Xms800m -Xmx800m -XX:MaxPermSize=1024m</argLine>
168+
<argLine>-Xms800m -Xmx800m -XX:MaxPermSize=1024m -Djava.awt.headless=true</argLine>
164169
</configuration>
165170
</plugin>
166171
<plugin>

src/test/java/com/wikia/webdriver/common/core/XMLReader.java

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@
55

66
import org.apache.commons.configuration.ConfigurationException;
77
import org.apache.commons.configuration.XMLConfiguration;
8+
import org.apache.commons.lang3.StringUtils;
89

910
import java.io.File;
11+
import java.io.FileInputStream;
12+
import java.io.IOException;
13+
import java.io.InputStream;
14+
import java.util.Properties;
1015

1116
public class XMLReader {
1217

@@ -21,14 +26,45 @@ private XMLReader() {
2126
*/
2227
public static String getValue(File file, String key) {
2328

24-
try {
29+
/*try {
2530
XMLConfiguration xml = new XMLConfiguration(file);
2631
return xml.getString(key);
2732
} catch (ConfigurationException e) {
2833
PageObjectLogging.log("Error while reading XML config", e, false);
2934
3035
return e.getMessage();
36+
}*/
37+
38+
Properties prop = new Properties();
39+
InputStream input = null;
40+
41+
try {
42+
43+
input = new FileInputStream(file);
44+
45+
// load a properties file
46+
prop.load(input);
47+
48+
// get the property value and print it out
49+
System.out.println("value for " + key + " = " + prop.getProperty(key));
50+
if(StringUtils.isEmpty(prop.getProperty(key)) ) {
51+
System.out.println("Can not find value for " + key);
52+
}
53+
return prop.getProperty(key);
54+
55+
} catch (IOException ex) {
56+
ex.printStackTrace();
57+
} finally {
58+
if (input != null) {
59+
try {
60+
input.close();
61+
} catch (IOException e) {
62+
e.printStackTrace();
63+
}
64+
}
3165
}
66+
System.out.println("Can not find value for " + key);
67+
return "";
3268
}
3369

3470
public static String getValue(String key) {

src/test/java/com/wikia/webdriver/testcases/interactivemapstests/PinMapTests.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ public void PinMapTests_003_VerifyPinCreationErrors() {
8282
@RelatedIssue(issueID = " ",
8383
comment = "This maps test should not fail")
8484
@DontRun(env = {"dev", "sandbox", "preview"})
85-
@Test(groups = {"PinMapTests_004", "PinMapTests", "InteractiveMaps"},
86-
dependsOnMethods = "PinMapTests_006_VerifyChangePinData")
85+
@Test(groups = {"PinMapTests_004", "PinMapTests", "InteractiveMaps"}
86+
//,dependsOnMethods = "PinMapTests_006_VerifyChangePinData")
87+
)
8788
@Execute(asUser = User.USER)
8889
public void PinMapTests_004_VerifyPopUpAfterClickPin() {
8990
WikiBasePageObject base = new WikiBasePageObject(driver);
@@ -97,8 +98,9 @@ public void PinMapTests_004_VerifyPopUpAfterClickPin() {
9798
}
9899

99100
@DontRun(env = {"dev", "sandbox", "preview"})
100-
@Test(enabled = false, groups = {"PinMapTests_005", "PinMapTests", "InteractiveMaps"},
101-
dependsOnMethods = "PinMapTests_006_VerifyChangePinData")
101+
@Test(enabled = false, groups = {"PinMapTests_005", "PinMapTests", "InteractiveMaps"}
102+
//,dependsOnMethods = "PinMapTests_006_VerifyChangePinData")
103+
)
102104
@Execute(asUser = User.USER)
103105
public void PinMapTests_005_VerifyDeletePin() {
104106
WikiBasePageObject base = new WikiBasePageObject(driver);

src/test/java/com/wikia/webdriver/testsuites/testSuite.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
2-
<suite name="Wikia test suite" configfailurepolicy="continue">
2+
<suite name="Wikia test suite" configfailurepolicy="continue" allow-return-values="true">
33
<listeners>
44
<listener class-name="com.wikia.webdriver.common.testnglisteners.InvokeMethodAdapter"/>
55
</listeners>

0 commit comments

Comments
 (0)