-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[C#] Add baselineOverride functionality (#104)
Co-authored-by: Logan Graham <[email protected]>
- Loading branch information
1 parent
5d21606
commit b13b355
Showing
8 changed files
with
97 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using SauceLabs.Visual.GraphQL; | ||
using SauceLabs.Visual.Models; | ||
|
||
namespace SauceLabs.Visual | ||
{ | ||
/// <summary> | ||
/// <c>BaselineOverride</c> One or more values from 'SnapshotIn' we should use as an override | ||
/// when finding a baseline. Enables cross browser / OS snapshot comparison by matching the | ||
/// values set on the device you'd like to compare against. | ||
/// </summary> | ||
public class BaselineOverride | ||
{ | ||
public Browser? Browser { get; set; } | ||
public string? BrowserVersion { get; set; } | ||
public string? Device { get; set; } | ||
public string? Name { get; set; } | ||
public OperatingSystem? OperatingSystem { get; set; } | ||
public string? OperatingSystemVersion { get; set; } | ||
public string? SuiteName { get; set; } | ||
public string? TestName { get; set; } | ||
|
||
internal BaselineOverrideIn ToBaselineOverrideIn() | ||
{ | ||
return new BaselineOverrideIn() | ||
{ | ||
Browser = Browser, | ||
BrowserVersion = BrowserVersion, | ||
Device = Device, | ||
Name = Name, | ||
OperatingSystem = OperatingSystem, | ||
OperatingSystemVersion = OperatingSystemVersion, | ||
SuiteName = SuiteName, | ||
TestName = TestName, | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
using OpenQA.Selenium; | ||
using SauceLabs.Visual.Models; | ||
|
||
namespace SauceLabs.Visual | ||
{ | ||
|
||
|
25 changes: 25 additions & 0 deletions
25
visual-dotnet/SauceLabs.Visual/GraphQL/BaselineOverrideIn.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using Newtonsoft.Json; | ||
using SauceLabs.Visual.Models; | ||
|
||
namespace SauceLabs.Visual.GraphQL | ||
{ | ||
internal class BaselineOverrideIn | ||
{ | ||
[JsonProperty("browser", NullValueHandling = NullValueHandling.Ignore)] | ||
public Browser? Browser { get; set; } | ||
[JsonProperty("browserVersion", NullValueHandling = NullValueHandling.Ignore)] | ||
public string? BrowserVersion { get; set; } | ||
[JsonProperty("device", NullValueHandling = NullValueHandling.Ignore)] | ||
public string? Device { get; set; } | ||
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)] | ||
public string? Name { get; set; } | ||
[JsonProperty("operatingSystem", NullValueHandling = NullValueHandling.Ignore)] | ||
public OperatingSystem? OperatingSystem { get; set; } | ||
[JsonProperty("operatingSystemVersion", NullValueHandling = NullValueHandling.Ignore)] | ||
public string? OperatingSystemVersion { get; set; } | ||
[JsonProperty("suiteName", NullValueHandling = NullValueHandling.Ignore)] | ||
public string? SuiteName { get; set; } | ||
[JsonProperty("testName", NullValueHandling = NullValueHandling.Ignore)] | ||
public string? TestName { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace SauceLabs.Visual.Models | ||
{ | ||
public enum Browser | ||
{ | ||
Chrome, | ||
Edge, | ||
Firefox, | ||
PlaywrightWebkit, | ||
Safari, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace SauceLabs.Visual.Models | ||
{ | ||
public enum OperatingSystem | ||
{ | ||
Android, | ||
Ios, | ||
Linux, | ||
Macos, | ||
Windows, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters