mirror of
https://github.com/appium/appium.git
synced 2026-10-26 10:47:45 +08:00
Bring Sample Code into master (#10880)
* Sample code stub (#9887) * WD tests * WD sample code (#9918) * WebdriverIO sample code (#10166) * Ruby sample code (#10331) * PHP Sample Code (#10209) * Basic Android java test * Java sample code (#10427) * Sample code (#10834) * Sample code stub (#9887) * WD tests * WD sample code (#9918) * WebdriverIO sample code (#10166) * Ruby sample code (#10331) * PHP Sample Code (#10209) * Basic Android java test * Java sample code (#10427) * fixed WDIO test * Update .npmignore
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import org.openqa.selenium.WebElement;
|
||||
import org.openqa.selenium.remote.DesiredCapabilities;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.*;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
public class AndroidCreateWebSessionTest extends BaseTest {
|
||||
private AndroidDriver<WebElement> driver;
|
||||
|
||||
@BeforeClass
|
||||
public void setUp() {
|
||||
DesiredCapabilities capabilities = new DesiredCapabilities();
|
||||
capabilities.setCapability("deviceName", "Android Emulator");
|
||||
capabilities.setCapability("browserName", "Chrome");
|
||||
driver = new AndroidDriver<WebElement>(getServiceUrl(), capabilities);
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public void tearDown() {
|
||||
driver.quit();
|
||||
}
|
||||
|
||||
@Test()
|
||||
public void testCreateWebSession() throws URISyntaxException {
|
||||
driver.get(new URI("http://www.google.com").toString());
|
||||
String title = driver.getTitle();
|
||||
Assert.assertEquals(title, "Google");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user