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

Update GraphQL schema #170

Merged
merged 5 commits into from
Dec 9, 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
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ internal class CreateSnapshotFromWebDriverIn
public bool? CaptureDom { get; set; }
[JsonProperty("baselineOverride")]
public BaselineOverrideIn? BaselineOverride { get; set; }
[JsonProperty("clipSelector")]
public string? ClipSelector { get; set; }
[JsonProperty("clipElement")]
public string? ClipElement { get; set; }
[JsonProperty("fullPageConfig")]
Expand All @@ -47,7 +45,6 @@ public CreateSnapshotFromWebDriverIn(
DiffingMethod diffingMethod,
RegionIn[] regions,
bool captureDom,
string? clipSelector,
string? clipElement,
string? suiteName,
string? testName,
Expand All @@ -66,7 +63,6 @@ public CreateSnapshotFromWebDriverIn(
SessionMetadata = sessionMetadata;
SessionId = sessionId;
CaptureDom = captureDom;
ClipSelector = clipSelector;
ClipElement = clipElement;
SuiteName = suiteName;
TestName = testName;
Expand Down
1 change: 0 additions & 1 deletion visual-dotnet/SauceLabs.Visual/VisualCheckOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public class VisualCheckOptions
public bool? CaptureDom { get; set; }
public bool? FullPage { get; set; }
public FullPageConfig? FullPageConfig { get; set; }
public string? ClipSelector { get; set; }
public IWebElement? ClipElement { get; set; }

/// <summary>
Expand Down
1 change: 0 additions & 1 deletion visual-dotnet/SauceLabs.Visual/VisualClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/// <param name="wd">the instance of the WebDriver session</param>
public static async Task<VisualClient> Create(WebDriver wd)
{
return await Create(wd, Region.FromEnvironment(), EnvVars.Username, EnvVars.AccessKey, new CreateBuildOptions());

Check warning on line 38 in visual-dotnet/SauceLabs.Visual/VisualClient.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'username' in 'Task<VisualClient> VisualClient.Create(WebDriver wd, Region region, string username, string accessKey, CreateBuildOptions buildOptions)'.

Check warning on line 38 in visual-dotnet/SauceLabs.Visual/VisualClient.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'accessKey' in 'Task<VisualClient> VisualClient.Create(WebDriver wd, Region region, string username, string accessKey, CreateBuildOptions buildOptions)'.
}

/// <summary>
Expand All @@ -45,7 +45,7 @@
/// <param name="buildOptions">the options of the build creation</param>
public static async Task<VisualClient> Create(WebDriver wd, CreateBuildOptions buildOptions)
{
return await Create(wd, Region.FromEnvironment(), EnvVars.Username, EnvVars.AccessKey, buildOptions);

Check warning on line 48 in visual-dotnet/SauceLabs.Visual/VisualClient.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'username' in 'Task<VisualClient> VisualClient.Create(WebDriver wd, Region region, string username, string accessKey, CreateBuildOptions buildOptions)'.

Check warning on line 48 in visual-dotnet/SauceLabs.Visual/VisualClient.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'accessKey' in 'Task<VisualClient> VisualClient.Create(WebDriver wd, Region region, string username, string accessKey, CreateBuildOptions buildOptions)'.
}

/// <summary>
Expand All @@ -55,7 +55,7 @@
/// <param name="region">the Sauce Labs region to connect to</param>
public static async Task<VisualClient> Create(WebDriver wd, Region region)
{
return await Create(wd, region, EnvVars.Username, EnvVars.AccessKey, new CreateBuildOptions());

Check warning on line 58 in visual-dotnet/SauceLabs.Visual/VisualClient.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'username' in 'Task<VisualClient> VisualClient.Create(WebDriver wd, Region region, string username, string accessKey, CreateBuildOptions buildOptions)'.

Check warning on line 58 in visual-dotnet/SauceLabs.Visual/VisualClient.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'accessKey' in 'Task<VisualClient> VisualClient.Create(WebDriver wd, Region region, string username, string accessKey, CreateBuildOptions buildOptions)'.
}

/// <summary>
Expand All @@ -66,7 +66,7 @@
/// <param name="buildOptions">the options of the build creation</param>
public static async Task<VisualClient> Create(WebDriver wd, Region region, CreateBuildOptions buildOptions)
{
return await Create(wd, region, EnvVars.Username, EnvVars.AccessKey, buildOptions);

Check warning on line 69 in visual-dotnet/SauceLabs.Visual/VisualClient.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'username' in 'Task<VisualClient> VisualClient.Create(WebDriver wd, Region region, string username, string accessKey, CreateBuildOptions buildOptions)'.

Check warning on line 69 in visual-dotnet/SauceLabs.Visual/VisualClient.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'accessKey' in 'Task<VisualClient> VisualClient.Create(WebDriver wd, Region region, string username, string accessKey, CreateBuildOptions buildOptions)'.
}

/// <summary>
Expand Down Expand Up @@ -112,7 +112,7 @@
/// <param name="region">the Sauce Labs region to connect to</param>
/// <param name="username">the Sauce Labs username</param>
/// <param name="accessKey">the Sauce Labs access key</param>
private VisualClient(WebDriver wd, Region region, string username, string accessKey)

Check warning on line 115 in visual-dotnet/SauceLabs.Visual/VisualClient.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Build' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
{
if (StringUtils.IsNullOrEmpty(username) || StringUtils.IsNullOrEmpty(accessKey))
{
Expand Down Expand Up @@ -179,7 +179,6 @@
sessionId: _sessionId,
sessionMetadata: _sessionMetadataBlob ?? "",
captureDom: options.CaptureDom ?? CaptureDom,
clipSelector: options.ClipSelector,
clipElement: options.ClipElement?.GetElementId(),
suiteName: options.SuiteName,
testName: options.TestName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ mutation createSnapshotUpload($input: SnapshotUploadIn!) {
result: createSnapshotUpload(input: $input) {
id
buildId
uploadUrl
imageUploadUrl
}
}
158 changes: 131 additions & 27 deletions visual-java/src/main/graphql/visual/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ type ApplicationSummary {
}

input ApproveBuildIn {
"""@deprecated Use `uuid`. This field will be removed in a future update."""
id: ID
id: UUID
onlyNew: Boolean

"""@deprecated Use `id`. This field will be removed in a future update."""
uuid: UUID
}

Expand Down Expand Up @@ -223,6 +224,40 @@ enum BaselinesOrderBy {
}

type Branch implements Node {
baselines(
"""Read all values in the set after (below) this cursor."""
after: Cursor

"""Read all values in the set before (above) this cursor."""
before: Cursor

"""
A condition to be used in determining which values should be returned by the collection.
"""
condition: BaselineCondition

"""
A filter to be used in determining which values should be returned by the collection.
"""
filter: BaselineFilter
filters: SnapshotFiltersIn

"""Only read the first `n` values of the set."""
first: Int

"""Only read the last `n` values of the set."""
last: Int

"""
Skip the first `n` values from our `after` cursor, an alternative to cursor
based pagination. May not be used with `last`.
"""
offset: Int

"""The method to use when ordering `Baseline`."""
orderBy: [BaselinesOrderBy!] = [PRIMARY_KEY_ASC]
): BaselinesConnection!

"""Returns the differents values availables for attributes."""
distinctAttributeValues: DistinctAttributeValues!
id: String!
Expand Down Expand Up @@ -276,6 +311,7 @@ enum Browser {
CHROME
EDGE
FIREFOX
NONE
PLAYWRIGHT_WEBKIT
SAFARI
}
Expand Down Expand Up @@ -347,6 +383,39 @@ type Build implements Node {
"""The method to use when ordering `Diff`."""
orderBy: [DiffsOrderBy!] = [PRIMARY_KEY_ASC]
): DiffsConnection!
diffsPaginated(
"""Read all values in the set after (below) this cursor."""
after: Cursor

"""Read all values in the set before (above) this cursor."""
before: Cursor

"""
A condition to be used in determining which values should be returned by the collection.
"""
condition: DiffCondition

"""
A filter to be used in determining which values should be returned by the collection.
"""
filter: DiffFilter
filters: DiffFiltersIn

"""Only read the first `n` values of the set."""
first: Int

"""Only read the last `n` values of the set."""
last: Int

"""
Skip the first `n` values from our `after` cursor, an alternative to cursor
based pagination. May not be used with `last`.
"""
offset: Int

"""The method to use when ordering `Diff`."""
orderBy: [DiffsOrderBy!] = [PRIMARY_KEY_ASC]
): DiffsConnection!

"""Returns the differents values availables for attributes."""
distinctAttributeValues: DistinctAttributeValues!
Expand Down Expand Up @@ -619,6 +688,7 @@ type Comment implements Node {
A globally unique identifier. Can be used in various places throughout the system to identify this single value.
"""
nodeId: ID!
updatedAt: Datetime
}

enum CommentAction {
Expand Down Expand Up @@ -707,21 +777,16 @@ input CreateSnapshotFromWebDriverIn {
visual testing.
"""
baselineOverride: BaselineOverrideIn
buildId: UUID

"""
@deprecated Use `buildUuid`. This field will be removed in a future update.
@deprecated Use `buildId`. This field will be removed in a future update.
"""
buildId: ID
buildUuid: UUID
captureDom: Boolean

"""The selenium ID of an element we should clip the screen to."""
clipElement: WebdriverElementID

"""
A querySelector compatible selector of an element that we should crop the screenshot to.
"""
clipSelector: String
diffingMethod: DiffingMethod
diffingOptions: DiffingOptionsIn

Expand Down Expand Up @@ -922,6 +987,18 @@ input DiffFilter {
status: DiffStatusFilter
}

"""
Extension of SnapshotFiltersIn. Should contain the same values here in addition to status filters.
"""
input DiffFiltersIn {
browser: [Browser!]
device: [String!]
groupBy: [GroupByOption!]
operatingSystem: [OperatingSystemFilterIn!]
search: String
status: [DiffStatus!]
}

input DiffPreviewIn {
ignoreRegions: [RegionIn!]!
}
Expand Down Expand Up @@ -1051,7 +1128,7 @@ enum DiffsOrderBy {
}

type DistinctAttributeValues {
browser: [String]!
browser: [Browser]!
device: [String]!
operatingSystem: [OperatingSystemAttribute!]!
storybookDepth1: [String]!
Expand Down Expand Up @@ -1089,13 +1166,11 @@ input FinishBuildIn {
}

input ForceFinishBuildIn {
customId: String!
customId: String
uuid: UUID
}

input FullPageConfigIn {
"""@deprecated this field will be removed soon."""
addressBarShadowPadding: Float

"""
Delay in ms after scrolling and before taking screenshots.
A slight delay can be helpful if the page is using lazy loading when scrolling
Expand Down Expand Up @@ -1131,9 +1206,6 @@ input FullPageConfigIn {
Default and max value is 10
"""
scrollLimit: Int

"""@deprecated this field will be removed soon."""
toolBarShadowPadding: Int
}

scalar FullText
Expand All @@ -1146,6 +1218,14 @@ input FullTextFilter {
matches: String
}

enum GroupByOption {
Browser
Device
OperatingSystem_OperatingSystemVersion
SuiteName
TestName
}

input IgnoreSelectorIn {
diffingOptions: DiffingOptionsIn
name: String
Expand Down Expand Up @@ -1260,6 +1340,12 @@ type Mutation {
"""
input: MergeBaselinesInput!
): MergeBaselinesPayload!
updateComment(
"""
The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields.
"""
input: UpdateCommentIn!
): Comment!
updateDiff(
"""
The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields.
Expand Down Expand Up @@ -1289,6 +1375,11 @@ type OperatingSystemAttribute {
version: String
}

input OperatingSystemFilterIn {
name: OperatingSystem!
version: String!
}

type Org {
id: UUID

Expand Down Expand Up @@ -2004,7 +2095,6 @@ type Snapshot implements Node {
"""The method to use when ordering `Diff`."""
orderBy: [DiffsOrderBy!] = [PRIMARY_KEY_ASC]
): DiffsConnection!
domDiffUrl: String
domFormat: DomFormat!

"""
Expand Down Expand Up @@ -2096,6 +2186,14 @@ input SnapshotFilter {
uploadId: StringFilter
}

input SnapshotFiltersIn {
browser: [Browser!]
device: [String!]
groupBy: [GroupByOption!]
operatingSystem: [OperatingSystemFilterIn!]
search: String
}

input SnapshotIn {
appId: String
appName: String
Expand All @@ -2108,11 +2206,11 @@ input SnapshotIn {
baselineOverride: BaselineOverrideIn
browser: Browser
browserVersion: String
buildId: UUID

"""
@deprecated Use `buildUuid`. This field will be removed in a future update.
@deprecated Use `buildId`. This field will be removed in a future update.
"""
buildId: ID
buildUuid: UUID
device: String
devicePixelRatio: Float
Expand All @@ -2126,11 +2224,11 @@ input SnapshotIn {
operatingSystemVersion: String
suiteName: String
testName: String
uploadId: UUID

"""
@deprecated Use `uploadUuid`. This field will be removed in a future update.
@deprecated Use `uploadId`. This field will be removed in a future update.
"""
uploadId: ID
uploadUuid: UUID
}

Expand All @@ -2139,14 +2237,14 @@ type SnapshotUpload {
domUploadUrl: String
id: UUID!
imageUploadUrl: String
uploadUrl: String! @deprecated(reason: "Use imageUploadUrl.")
}

input SnapshotUploadIn {
buildId: UUID

"""
@deprecated Use `buildUuid`. This field will be removed in a future update.
@deprecated Use `buildId`. This field will be removed in a future update.
"""
buildId: ID
buildUuid: UUID
}

Expand Down Expand Up @@ -2246,10 +2344,16 @@ input UUIDFilter {
lessThanOrEqualTo: UUID
}

input UpdateCommentIn {
comment: String!
id: UUID!
}

input UpdateDiffIn {
"""@deprecated Use `uuid`. This field will be removed in a future update."""
id: ID
id: UUID
status: UpdateDiffStatus!

"""@deprecated Use `id`. This field will be removed in a future update."""
uuid: UUID
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ public static class CreateSnapshotFromWebDriverIn {

public Optional<Boolean> captureDom = Optional.empty();

public Optional<String> clipSelector = Optional.empty();

public Optional<String> clipElement = Optional.empty();

public Optional<FullPageScreenshotConfig> fullPageConfig = Optional.empty();
Expand Down Expand Up @@ -109,10 +107,6 @@ public void setCaptureDom(Boolean captureDom) {
this.captureDom = Optional.of(captureDom);
}

public void setClipSelector(String clipSelector) {
this.clipSelector = Optional.of(clipSelector);
}

public void setClipElement(WebElement clipElement) {
this.clipElement = Optional.of(((RemoteWebElement) clipElement).getId());
}
Expand Down
10 changes: 10 additions & 0 deletions visual-js/.changeset/nine-berries-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@saucelabs/visual": minor
"@saucelabs/cypress-visual-plugin": minor
"@saucelabs/nightwatch-sauce-visual-service": minor
"@saucelabs/visual-playwright": minor
"@saucelabs/visual-storybook": minor
"@saucelabs/wdio-sauce-visual-service": minor
---

Removed deprecated functionality.
Loading
Loading