Skip to content

Commit

Permalink
fix: device system time null exception (#448)
Browse files Browse the repository at this point in the history
closes #440
  • Loading branch information
laolubenson authored Jan 14, 2021
1 parent e75c1eb commit a048964
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
5 changes: 1 addition & 4 deletions src/Appium.Net/Appium.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<RootNamespace>OpenQA.Selenium</RootNamespace>
<AssemblyVersion>4.2.0</AssemblyVersion>
<Version>4.2.0</Version>
<Company>Appium Commiters</Company>
<Product>Appium-Dotnet-Driver</Product>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<Copyright>Copyright © 2020</Copyright>
<PackageProjectUrl>https://github.com/appium/appium-dotnet-driver</PackageProjectUrl>
<RepositoryUrl>https://github.com/appium/appium-dotnet-driver</RepositoryUrl>
Expand All @@ -26,7 +24,6 @@

<PropertyGroup>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<FileVersion>4.2.0</FileVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard2.0|AnyCPU'">
Expand Down
2 changes: 1 addition & 1 deletion src/Appium.Net/Appium/AppiumDriverCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public class AppiumDriverCommand
/// <summary>
/// Get the time on the device
/// </summary>
public const string SystemTime = "system_time";
public const string SystemTime = "getDeviceTime";

/// <summary>
/// Get Display Density
Expand Down
10 changes: 8 additions & 2 deletions test/integration/Android/EmulatorDeviceTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using NUnit.Framework;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Android;
using static System.String;

namespace Appium.Net.Integration.Tests.Android
{
Expand Down Expand Up @@ -35,8 +36,13 @@ public void AfterEach()
public void DeviceTimeTest()
{
var time = _driver.DeviceTime;
Console.WriteLine(time);
Assert.AreEqual(true, time.Length == 28);
Assert.Multiple(() =>
{
Assert.NotNull(time);
Assert.AreNotEqual(Empty, time);
Console.WriteLine(time);
Assert.NotNull(DateTime.Parse(time));
});
}
}
}

0 comments on commit a048964

Please sign in to comment.