diff --git a/visual-dotnet/SauceLabs.Visual/VisualCheckOptions.cs b/visual-dotnet/SauceLabs.Visual/VisualCheckOptions.cs index e237bd4f..9ccad605 100644 --- a/visual-dotnet/SauceLabs.Visual/VisualCheckOptions.cs +++ b/visual-dotnet/SauceLabs.Visual/VisualCheckOptions.cs @@ -14,7 +14,7 @@ public class VisualCheckOptions public IWebElement[]? IgnoreElements { get; set; } public bool? CaptureDom { get; set; } - public string? ClassName { get; set; } + public string? SuiteName { get; set; } public string? TestName { get; set; } } } \ No newline at end of file diff --git a/visual-dotnet/SauceLabs.Visual/VisualClient.cs b/visual-dotnet/SauceLabs.Visual/VisualClient.cs index 905b56a7..828fae5d 100644 --- a/visual-dotnet/SauceLabs.Visual/VisualClient.cs +++ b/visual-dotnet/SauceLabs.Visual/VisualClient.cs @@ -29,7 +29,7 @@ public class VisualClient : IDisposable public bool CaptureDom { get; set; } = false; private readonly ResiliencePipeline _retryPipeline; - private string? _previousTestClass = null; + private string? _previousSuiteName = null; /// /// Creates a new instance of VisualClient @@ -231,13 +231,13 @@ public Task VisualCheck(string name, VisualCheckOptions? options = null, [CallerMemberName] string callerMemberName = "") { options ??= new VisualCheckOptions(); - if (!string.IsNullOrEmpty(callerMemberName) && (string.IsNullOrEmpty(options.ClassName) || string.IsNullOrEmpty(options.TestName))) + if (!string.IsNullOrEmpty(callerMemberName) && (string.IsNullOrEmpty(options.SuiteName) || string.IsNullOrEmpty(options.TestName))) { var stack = new StackTrace(); var frame = stack.GetFrames()?.FirstOrDefault(f => f.GetMethod().Name == callerMemberName); - options.ClassName ??= frame?.GetMethod().DeclaringType?.FullName ?? _previousTestClass; + options.SuiteName ??= frame?.GetMethod().DeclaringType?.FullName ?? _previousSuiteName; options.TestName ??= callerMemberName; - _previousTestClass = options.ClassName; + _previousSuiteName = options.SuiteName; } return VisualCheckAsync(name, options); } @@ -257,7 +257,7 @@ private async Task VisualCheckAsync(string name, VisualCheckOptions opti sessionId: _sessionId, sessionMetadata: _sessionMetadataBlob ?? "", captureDom: options.CaptureDom ?? CaptureDom, - suiteName: options.ClassName, + suiteName: options.SuiteName, testName: options.TestName ))).EnsureValidResponse(); result.Result.Diffs.Nodes.ToList().ForEach(d => _screenshotIds.Add(d.Id));