-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathCaptainTest.cs
46 lines (40 loc) · 1.18 KB
/
CaptainTest.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
using System.Drawing;
using Instabug.Captain;
namespace E2E.Utils;
public class CaptainTest : IDisposable
{
private static readonly CaptainConfig _config = new()
{
AndroidApp = Path.GetFullPath("../../../../example/build/app/outputs/flutter-apk/app-debug.apk"),
AndroidAppId = "com.instabug.flutter.example",
AndroidVersion = "11",
IosApp = Path.GetFullPath("../../../../example/build/ios/iphonesimulator/Runner.app"),
IosAppId = "com.instabug.InstabugSample",
IosVersion = "15.5",
IosDevice = "iPhone 13 Pro Max"
};
protected static readonly Captain captain = new(_config);
public CaptainTest()
{
// Wait till the app is ready
captain.FindByText("Hello Instabug");
}
public void Dispose()
{
captain.RestartApp();
}
protected void ScrollDown()
{
captain.Swipe(
start: new Point(captain.Window.Size.Width / 2, captain.Window.Size.Height - 200),
end: new Point(captain.Window.Size.Width / 2, 250)
);
}
protected void ScrollUp()
{
captain.Swipe(
start: new Point(captain.Window.Size.Width / 2, 250),
end: new Point(captain.Window.Size.Width / 2, captain.Window.Size.Height - 200)
);
}
}