-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestEditor.java
48 lines (43 loc) · 2 KB
/
TestEditor.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import java.net.URL;
public class TestEditor {
private AppiumDriver<AndroidElement> driver;
@Before
public void setUp() throws Exception {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("fullreset", false);
capabilities.setCapability("platformName", "android");
capabilities.setCapability("uiautomator2ServerInstallTimeout", "100000");
capabilities.setCapability("platformVersion", "10");
capabilities.setCapability("deviceName", "Galaxy A11");
capabilities.setCapability("automationName", "UiAutomator2");
capabilities.setCapability("newCommandTimeout", "1000");
capabilities.setCapability("appActivity", "com.atlasv.android.mvmaker.mveditor.SplashActivity");
capabilities.setCapability("newCommandTimeout", "1000");
capabilities.setCapability("appPackage", "vidma.video.editor.videomaker");
capabilities.setCapability("autoGrantPermissions", false);
capabilities.setCapability("noReset", true);
driver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
}
@Test
public void openEditor() throws InterruptedException {
Thread.sleep(5000);
driver.findElementById("vidma.video.editor.videomaker:id/ivAdd").click();
Thread.sleep(3000);
driver.findElementsById("vidma.video.editor.videomaker:id/ivIcon").get(6).click();
Thread.sleep(3000);
driver.findElementById("vidma.video.editor.videomaker:id/tvNext").click();
Thread.sleep(3000);
driver.findElementById("vidma.video.editor.videomaker:id/ivBack").click();
}
@After
public void tearDown() throws Exception {
driver.quit();
}
}