File tree Expand file tree Collapse file tree 3 files changed +58
-1
lines changed Expand file tree Collapse file tree 3 files changed +58
-1
lines changed Original file line number Diff line number Diff line change 43
43
<PrivateAssets >all</PrivateAssets >
44
44
<IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
45
45
</PackageReference >
46
- <PackageReference Include =" Selenium.WebDriver" Version =" 4.32 .0" />
46
+ <PackageReference Include =" Selenium.WebDriver" Version =" 4.35 .0" />
47
47
<PackageReference Include =" System.Drawing.Common" Version =" 8.0.10" />
48
48
</ItemGroup >
49
49
</Project >
Original file line number Diff line number Diff line change
1
+ using Appium . Net . Integration . Tests . helpers ;
2
+ using NUnit . Framework ;
3
+ using OpenQA . Selenium . Appium . Android ;
4
+ using OpenQA . Selenium . BiDi ;
5
+ using System . Threading . Tasks ;
6
+
7
+ namespace Appium . Net . Integration . Tests . Android
8
+ {
9
+ public class BiDiTests
10
+ {
11
+ private AndroidDriver _driver ;
12
+
13
+ private BiDi _bidi ;
14
+
15
+ [ OneTimeSetUp ]
16
+ public void BeforeAll ( )
17
+ {
18
+ var capabilities = Caps . GetAndroidUIAutomatorCaps ( ) ;
19
+ capabilities . UseWebSocketUrl = true ;
20
+ var serverUri = Env . ServerIsRemote ( ) ? AppiumServers . RemoteServerUri : AppiumServers . LocalServiceUri ;
21
+ _driver = new AndroidDriver ( serverUri , capabilities , Env . InitTimeoutSec ) ;
22
+ }
23
+
24
+ [ Test ]
25
+ public async Task RunBiDiScript ( )
26
+ {
27
+ _bidi = await _driver . AsBiDiAsync ( ) ;
28
+ await _bidi . StatusAsync ( ) ;
29
+ }
30
+
31
+ [ OneTimeTearDown ]
32
+ public async Task AfterAll ( )
33
+ {
34
+ if ( _bidi != null )
35
+ {
36
+ try
37
+ {
38
+ await _bidi . DisposeAsync ( ) ;
39
+ }
40
+ catch { } ;
41
+ }
42
+ _driver ? . Quit ( ) ;
43
+ if ( ! Env . ServerIsRemote ( ) )
44
+ {
45
+ AppiumServers . StopLocalService ( ) ;
46
+ }
47
+ }
48
+ }
49
+ }
Original file line number Diff line number Diff line change @@ -26,6 +26,14 @@ public static AppiumOptions GetAndroidUIAutomatorCaps(string app)
26
26
return capabilities ;
27
27
}
28
28
29
+ public static AppiumOptions GetAndroidUIAutomatorCaps ( )
30
+ {
31
+ var capabilities = new AppiumOptions ( ) ;
32
+ capabilities . AutomationName = AutomationName . AndroidUIAutomator2 ;
33
+ capabilities . DeviceName = "Android Emulator" ;
34
+ return capabilities ;
35
+ }
36
+
29
37
public static AppiumOptions GetAndroidEspressoCaps ( string app )
30
38
{
31
39
var capabilities = new AppiumOptions ( ) ;
You can’t perform that action at this time.
0 commit comments