update
my build already success but not running my test case
code:
package appium;
//package ;
import io.appium.java_client.remote.AndroidMobileCapabilityType;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import io.appium.java_client.remote.MobileCapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.By;
import org.junit.*;
import java.net.URL;
import java.net.MalformedURLException;
import java.util.logging.Level;
public class appiumtest {
private String reportDirectory = "reports";
private String reportFormat = "xml";
private String testName = "login";
protected AndroidDriver<AndroidElement> driver = null;
DesiredCapabilities dc = new DesiredCapabilities();
@Before
public void setUp() throws MalformedURLException {
dc.setCapability("reportDirectory", reportDirectory);
dc.setCapability("reportFormat", reportFormat);
dc.setCapability("testName", testName);
dc.setCapability(MobileCapabilityType.UDID, "f5a19fd4");
dc.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, "com.pegipegi.android");
dc.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, ".main.activities.SplashActivity");
driver = new AndroidDriver<AndroidElement>(new URL("http://localhost:4723/wd/hub"), dc);
driver.setLogLevel(Level.INFO);
}
@Test
public void testlogin() {
driver.findElement(By.xpath("//*[@contentDescription='Open navigation drawer']")).click();
driver.findElement(By.xpath("//*[@text='Login / Register']")).click();
driver.findElement(By.xpath("//*[@id='edit_text_email']")).sendKeys("banditpepe1@gmail.com");
driver.findElement(By.xpath("//*[@id='edit_text_password']")).sendKeys("test12");
driver.findElement(By.xpath("//*[@text='LOGIN']")).click();
}
@After
public void tearDown() {
driver.quit();
}
}
pom.xml
4.0.0
appi
appium
0.0.1-SNAPSHOT
true
always
fail
Experitest.repo1
YourName
http://repo.experitest.com:8010/Maven2/
default
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>com.experitest</groupId>
<artifactId>seetest-client</artifactId>
<version>11.0</version>
</dependency>
org.seleniumhq.selenium
selenium-java
2.52.0
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>4.1.2</version>
</dependency>
maven-compiler-plugin
3.0
appiumtest.java
1.8
1.8
build log:
[INFO] Scanning for projects…
[INFO]
[INFO] ----------------------------< appi:appium >-----------------------------
[INFO] Building appium 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] — maven-resources-plugin:2.6:resources (default-resources) @ appium —
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] — maven-compiler-plugin:3.0:compile (default-compile) @ appium —
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] — maven-resources-plugin:2.6:testResources (default-testResources) @ appium —
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] — maven-compiler-plugin:3.0:testCompile (default-testCompile) @ appium —
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] — maven-surefire-plugin:2.12.4:test (default-test) @ appium —
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.993 s
[INFO] Finished at: 2018-09-26T10:43:20+07:00
[INFO] ------------------------------------------------------------------------