Skip to content

Commit ea404e1

Browse files
authored
Test: Fix Session tests (#780)
* Test: Fix SessionTest * Test: Move and rename SessionTests
1 parent 7469ae0 commit ea404e1

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

test/integration/Android/SessionTest.cs test/integration/Android/Session/SessionTests.cs

+8-7
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
using OpenQA.Selenium.Appium;
55
using OpenQA.Selenium.Appium.Android;
66

7-
namespace Appium.Net.Integration.Tests.Android
7+
namespace Appium.Net.Integration.Tests.Android.Session
88
{
9-
class SessionTest
9+
class SessionTests
1010
{
1111
private AppiumDriver _driver;
1212

@@ -16,6 +16,7 @@ public void BeforeAll()
1616
var capabilities = Env.ServerIsRemote()
1717
? Caps.GetAndroidUIAutomatorCaps(Apps.Get("androidApiDemos"))
1818
: Caps.GetAndroidUIAutomatorCaps(Apps.Get("androidApiDemos"));
19+
capabilities.AddAdditionalAppiumOption("desired", capabilities.ToCapabilities());
1920
var serverUri = Env.ServerIsRemote() ? AppiumServers.RemoteServerUri : AppiumServers.LocalServiceUri;
2021
_driver = new AndroidDriver(serverUri, capabilities, Env.InitTimeoutSec);
2122
_driver.Manage().Timeouts().ImplicitWait = Env.ImplicitTimeoutSec;
@@ -32,17 +33,17 @@ public void AfterAll()
3233
}
3334

3435
[Test]
35-
public void GetDeviceUdidTest()
36+
public void GetSessionDetailTest()
3637
{
37-
var deviceUiid = _driver.SessionDetails["deviceUDID"].ToString();
38-
Assert.That(deviceUiid, Is.Not.Null);
38+
object deviceName = _driver.GetSessionDetail("deviceName");
39+
Assert.That(deviceName, Is.Not.Null);
3940
}
4041

4142
[Test]
4243
public void GetDeviceDictionaryData()
4344
{
44-
var dictionary = (Dictionary<string, object>) _driver.SessionDetails["desired"];
45-
Assert.That(dictionary.Count, Is.Not.EqualTo(0));
45+
var dictionary = (Dictionary<string, object>)_driver.SessionDetails["desired"];
46+
Assert.That(dictionary, Is.Not.Empty);
4647
}
4748
}
4849
}

0 commit comments

Comments
 (0)