Skip to content

Commit af4a6b2

Browse files
committed
Merge pull request #1 from TikhomirovSergey/master
Sample fix
2 parents fe05b4d + f3aa7bc commit af4a6b2

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

pom.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,18 @@
2727
<version>1.4.0</version>
2828
</dependency>
2929
</dependencies>
30+
<build>
31+
<plugins>
32+
<plugin>
33+
<groupId>org.apache.maven.plugins</groupId>
34+
<artifactId>maven-surefire-plugin</artifactId>
35+
<version>2.12</version>
36+
<configuration>
37+
<suiteXmlFiles>
38+
<suiteXmlFile>testng.xml</suiteXmlFile>
39+
</suiteXmlFiles>
40+
</configuration>
41+
</plugin>
42+
</plugins>
43+
</build>
3044
</project>

src/test/java/com/test/classes/AppiumServer.java

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,33 @@ public void startDefaultAppium() throws Exception {
4242
public void appiumServer(String deviceID) throws Exception {
4343
System.out.println("Starting Appium Server");
4444
System.out.println(deviceID);
45+
System.out.println("Attempt to get port..");
4546
int port = ap.getPort();
47+
System.out.println("Port " + port);
48+
System.out.println("Attempt to get chrome port..");
4649
int chromePort = ap.getPort();
50+
System.out.println("Chrome port " + chromePort);
51+
System.out.println("Attempt to get bootstrap port..");
4752
int bootstrapPort = ap.getPort();
53+
System.out.println("Bootstrap port" + bootstrapPort);
4854
Thread.currentThread().sleep(5000);
55+
56+
System.out.println("Attempt to start server");
4957
builder = new AppiumServiceBuilder()
50-
.withAppiumJS(new File("/usr/local/lib/node_modules/appium/bin/appium.js"))
51-
.withArgument(GeneralServerFlag.APP,
52-
"/Users/saikrisv/Documents/workspace/workspace1/AppiumTest/build/AndroidCalculator.apk")
58+
//.withAppiumJS(new File("/usr/local/lib/node_modules/appium/bin/appium.js"))
59+
//.withArgument(GeneralServerFlag.APP,
60+
// "/Users/saikrisv/Documents/workspace/workspace1/AppiumTest/build/AndroidCalculator.apk")
5361
.withArgument(GeneralServerFlag.LOG_LEVEL, "info")
5462
.withArgument(GeneralServerFlag.UIID, deviceID)
5563
.withArgument(GeneralServerFlag.CHROME_DRIVER_PORT, Integer.toString(chromePort))
5664
.withArgument(AndroidServerFlag.BOOTSTRAP_PORT_NUMBER, Integer.toString(bootstrapPort))
57-
.withArgument(GeneralServerFlag.SESSION_OVERRIDE).usingPort(port);
65+
.withArgument(GeneralServerFlag.SESSION_OVERRIDE).usingPort(port).withLogFile(new File("Log" + Thread.currentThread().getName() +
66+
Thread.currentThread().getId()));
5867
/* and so on */;
5968

6069
appiumDriverLocalService = builder.build();
6170
appiumDriverLocalService.start();
71+
System.out.println("Server has been started");
6272
//appiumDriverLocalService.getStdOut();
6373

6474
System.out.println(appiumDriverLocalService.isRunning());

testng.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
3-
<suite thread-count="3" name="Suite" parallel=methods verbose="1">
3+
<suite thread-count="2" name="Suite" parallel="methods" verbose="1">
44
<test name="Test">
55
<classes>
66
<class name="com.test.classes.TestNGMethodSelector">

0 commit comments

Comments
 (0)