Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding support for label #239

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -77,7 +77,7 @@
this.debugUrl = debugUrl;
}

public virtual JObject Screenshot(String name, ScreenshotOptions options, String platformVersion = null)

Check warning on line 80 in Percy/providers/GenericProvider.cs

View workflow job for this annotation

GitHub Actions / Test

Cannot convert null literal to non-nullable reference type.

Check warning on line 80 in Percy/providers/GenericProvider.cs

View workflow job for this annotation

GitHub Actions / Test

Cannot convert null literal to non-nullable reference type.
{
this.metadata = MetadataHelper.Resolve(
percyAppiumDriver,
Expand Down Expand Up @@ -109,7 +109,7 @@
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
Loading