Skip to content

Commit

Permalink
Test: Fix Session tests (#780)
Browse files Browse the repository at this point in the history
* Test: Fix SessionTest

* Test: Move and rename SessionTests
  • Loading branch information
Dor-bl authored Apr 28, 2024
1 parent 7469ae0 commit ea404e1
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Android;

namespace Appium.Net.Integration.Tests.Android
namespace Appium.Net.Integration.Tests.Android.Session
{
class SessionTest
class SessionTests
{
private AppiumDriver _driver;

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

[Test]
public void GetDeviceUdidTest()
public void GetSessionDetailTest()
{
var deviceUiid = _driver.SessionDetails["deviceUDID"].ToString();
Assert.That(deviceUiid, Is.Not.Null);
object deviceName = _driver.GetSessionDetail("deviceName");
Assert.That(deviceName, Is.Not.Null);
}

[Test]
public void GetDeviceDictionaryData()
{
var dictionary = (Dictionary<string, object>) _driver.SessionDetails["desired"];
Assert.That(dictionary.Count, Is.Not.EqualTo(0));
var dictionary = (Dictionary<string, object>)_driver.SessionDetails["desired"];
Assert.That(dictionary, Is.Not.Empty);
}
}
}

0 comments on commit ea404e1

Please sign in to comment.