Skip to content

Commit

Permalink
adding support for label
Browse files Browse the repository at this point in the history
  • Loading branch information
prklm10 committed Oct 25, 2024
1 parent eebeca8 commit ccecb72
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions Percy.Tests/lib/ScreenshotOptionsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public void TestGetAndSet()
Assert.Equal(screenshotOptions.CustomConsiderRegions.Count, 0);
Assert.Equal(screenshotOptions.Sync, null);
Assert.Equal(screenshotOptions.TestCase, null);
Assert.Equal(screenshotOptions.Labels, null);
Assert.Equal(screenshotOptions.ThTestCaseExecutionId, null);
}
}
Expand Down
3 changes: 2 additions & 1 deletion Percy/lib/CliWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private static dynamic Request(string endpoint, JObject? payload = null)
}
};

internal static JObject PostScreenshot(string name, JObject tag, List<Tile> tiles, String externalDebugUrl, JObject ignoredElementsData, JObject consideredElementsData, Boolean? sync, String? testCase, String? thTestCaseExecutionId)
internal static JObject PostScreenshot(string name, JObject tag, List<Tile> tiles, String externalDebugUrl, JObject ignoredElementsData, JObject consideredElementsData, Boolean? sync, String? testCase, String? labels, String? thTestCaseExecutionId)
{
try
{
Expand All @@ -104,6 +104,7 @@ internal static JObject PostScreenshot(string name, JObject tag, List<Tile> tile
consideredElementsData = consideredElementsData,
sync = sync,
testCase = testCase,
labels = labels,
thTestCaseExecutionId = thTestCaseExecutionId
};
dynamic res = Request("/percy/comparison", JObject.FromObject(screenshotOptions));
Expand Down
1 change: 1 addition & 0 deletions Percy/lib/ScreenshotOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class ScreenshotOptions
public int? ScreenLengths { get; set; }
public Boolean? Sync { get; set; }
public String? TestCase { get; set; }
public String? Labels { get; set; }
public String? ThTestCaseExecutionId { get; set; }
public List<String> IgnoreRegionXpaths { get; set; } = new List<string>();
public List<String> IgnoreRegionAccessibilityIds { get; set; } = new List<string>();
Expand Down
2 changes: 1 addition & 1 deletion Percy/providers/GenericProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public virtual JObject Screenshot(String name, ScreenshotOptions options, String
considerElementsData = consideredRegions
});
var tiles = CaptureTiles(options);
return CliWrapper.PostScreenshot(name, tag, tiles, debugUrl, ignoredElementsData, consideredElementsData, options.Sync, options.TestCase, options.ThTestCaseExecutionId);
return CliWrapper.PostScreenshot(name, tag, tiles, debugUrl, ignoredElementsData, consideredElementsData, options.Sync, options.TestCase, options.Labels, options.ThTestCaseExecutionId);
}

public JArray FindRegions(List<String> Xpaths, List<String> AccessibilityIds, List<Object> Elements, List<Region> Locations)
Expand Down

0 comments on commit ccecb72

Please sign in to comment.