diff --git a/src/Legerity.Core/Android/AndroidAppManagerOptions.cs b/src/Legerity.Core/Android/AndroidAppManagerOptions.cs index 0137361b..af605315 100644 --- a/src/Legerity.Core/Android/AndroidAppManagerOptions.cs +++ b/src/Legerity.Core/Android/AndroidAppManagerOptions.cs @@ -1,6 +1,7 @@ namespace Legerity.Android { using System; + using System.Collections.Generic; using OpenQA.Selenium.Appium; using OpenQA.Selenium.Appium.Enums; @@ -270,7 +271,34 @@ public void Configure((string, object)[] additionalOptions) /// A string that represents the current object. public override string ToString() { - return $"{base.ToString()}, App ID [{this.AppId}]"; + return $"Platform [Android], {base.ToString()}, {this.GetOptionDetails()}"; + } + + private string GetOptionDetails() + { + var options = new List(); + + if (!string.IsNullOrWhiteSpace(this.AppId)) + { + options.Add($"App ID [{this.AppId}]"); + } + + if (!string.IsNullOrWhiteSpace(this.AppPath)) + { + options.Add($"App Path [{this.AppPath}]"); + } + + if (!string.IsNullOrWhiteSpace(this.DeviceId)) + { + options.Add($"Device ID [{this.DeviceId}]"); + } + + if (!string.IsNullOrWhiteSpace(this.DeviceName)) + { + options.Add($"Device Name [{this.DeviceName}]"); + } + + return string.Join(", ", options); } } } diff --git a/src/Legerity.Core/IOS/IOSAppManagerOptions.cs b/src/Legerity.Core/IOS/IOSAppManagerOptions.cs index 015003cc..bf732ce7 100644 --- a/src/Legerity.Core/IOS/IOSAppManagerOptions.cs +++ b/src/Legerity.Core/IOS/IOSAppManagerOptions.cs @@ -1,5 +1,6 @@ namespace Legerity.IOS { + using System.Collections.Generic; using OpenQA.Selenium.Appium; using OpenQA.Selenium.Appium.Enums; @@ -119,7 +120,29 @@ public void Configure((string, object)[] additionalOptions) /// A string that represents the current object. public override string ToString() { - return $"{base.ToString()}, App ID [{this.AppId}]"; + return $"Platform [IOS], {base.ToString()}, {this.GetOptionDetails()}"; + } + + private string GetOptionDetails() + { + var options = new List(); + + if (!string.IsNullOrWhiteSpace(this.AppId)) + { + options.Add($"App ID [{this.AppId}]"); + } + + if (!string.IsNullOrWhiteSpace(this.DeviceId)) + { + options.Add($"Device ID [{this.DeviceId}]"); + } + + if (!string.IsNullOrWhiteSpace(this.DeviceName)) + { + options.Add($"Device Name [{this.DeviceName}]"); + } + + return string.Join(", ", options); } } } diff --git a/src/Legerity.Core/Web/WebAppManagerOptions.cs b/src/Legerity.Core/Web/WebAppManagerOptions.cs index 120e0710..0c4fd66a 100644 --- a/src/Legerity.Core/Web/WebAppManagerOptions.cs +++ b/src/Legerity.Core/Web/WebAppManagerOptions.cs @@ -1,5 +1,6 @@ namespace Legerity.Web { + using System.Collections.Generic; using System.Drawing; /// @@ -48,7 +49,19 @@ public WebAppManagerOptions(WebAppDriverType driverType, string driverDirectoryP /// A string that represents the current object. public override string ToString() { - return $"{base.ToString()}, App URL [{this.Url}]"; + return $"Platform [{this.DriverType}], {base.ToString()}, {this.GetOptionDetails()}"; + } + + private string GetOptionDetails() + { + var options = new List(); + + if (!string.IsNullOrWhiteSpace(this.Url)) + { + options.Add($"URL [{this.Url}]"); + } + + return string.Join(", ", options); } } diff --git a/src/Legerity.Core/Windows/WindowsAppManagerOptions.cs b/src/Legerity.Core/Windows/WindowsAppManagerOptions.cs index 4f9d59f7..5b3c2f0b 100644 --- a/src/Legerity.Core/Windows/WindowsAppManagerOptions.cs +++ b/src/Legerity.Core/Windows/WindowsAppManagerOptions.cs @@ -1,5 +1,6 @@ namespace Legerity.Windows { + using System.Collections.Generic; using Helpers; using OpenQA.Selenium.Appium; @@ -86,7 +87,19 @@ public void Configure((string, object)[] additionalOptions) /// A string that represents the current object. public override string ToString() { - return $"{base.ToString()}, App ID [{this.AppId}]"; + return $"Platform [Windows], {base.ToString()}, {this.GetOptionDetails()}"; + } + + private string GetOptionDetails() + { + var options = new List(); + + if (!string.IsNullOrWhiteSpace(this.AppId)) + { + options.Add($"App ID [{this.AppId}]"); + } + + return string.Join(", ", options); } } } \ No newline at end of file