-
Notifications
You must be signed in to change notification settings - Fork 0
/
UnitTestApp.cs
51 lines (47 loc) · 1.93 KB
/
UnitTestApp.cs
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
49
50
51
using System;
using NUnit.Framework;
using OpenQA.Selenium.Remote;
using System.Threading;
namespace AppTest
{
public class Tests
{
public DesiredCapabilities capabilities;
public RemoteWebDriver driver;
[SetUp]
public void Setup()
{
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 RemoteWebDriver(new Uri("http://127.0.0.1:4723/wd/hub"), capabilities);
}
[Test]
public void TestEditor()
{
Thread.Sleep(5000);
driver.FindElementById("vidma.video.editor.videomaker:id/ivAdd").Click();
Thread.Sleep(3000);
driver.FindElementsById("vidma.video.editor.videomaker:id/ivIcon")[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");
}
[TearDown]
public void TearDown()
{
driver.Quit();
}
}
}