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

Remove deprecated API mutations #67

Merged
merged 4 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
5 changes: 5 additions & 0 deletions visual-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@
<javaType>java.lang.String</javaType>
<graphQLScalarTypeStaticField>graphql.scalars.ExtendedScalars.Object</graphQLScalarTypeStaticField>
</customScalar>
<customScalar>
<graphQLTypeName>WebdriverElementID</graphQLTypeName>
<javaType>java.lang.String</javaType>
<graphQLScalarTypeStaticField>graphql.scalars.ExtendedScalars.Object</graphQLScalarTypeStaticField>
</customScalar>
</customScalars>
</configuration>
</execution>
Expand Down
4 changes: 4 additions & 0 deletions visual-java/src/main/graphql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
- the schema `./visual/schema.grapqhls` is copied from `backend/src/generated/schema.sql` and appended with the
following:

```sh
cp ../../iris/backend/src/generated/schema.graphql src/main/graphql/visual/schema.graphqls
```

```graphql
schema {
mutation: Mutation
query: Query
Expand Down
31 changes: 27 additions & 4 deletions visual-java/src/main/graphql/visual/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ type Baseline implements Node {
id: UUID!
imageUrl: String!
isLatest: Boolean!
metadata: JSON
name: String!

"""
Expand Down Expand Up @@ -497,6 +498,9 @@ input CreateSnapshotFromWebDriverIn {
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.
"""
Expand All @@ -509,6 +513,7 @@ input CreateSnapshotFromWebDriverIn {
Limitation: Currently, this feature is supported only on desktop browsers.
"""
fullPageConfig: FullPageConfigIn
ignoreElements: [ElementIn!]
ignoreRegions: [RegionIn!]

"""This will be mandatory in the future."""
Expand Down Expand Up @@ -779,14 +784,22 @@ enum DiffsOrderBy {
STATUS_IS_EQUAL_DESC
}

input ElementIn {
diffingOptions: DiffingOptionsIn

"""The server-assigned ID of an element from webdriver."""
id: WebdriverElementID!
name: String
}

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

input FullPageConfigIn {
"""Adjust address bar padding on iOS and Android for viewport cutout."""
"""@deprecated this field will be removed soon."""
addressBarShadowPadding: Float

"""
Expand All @@ -801,6 +814,11 @@ input FullPageConfigIn {
"""Hide elements on the page after first scroll by css selectors."""
hideAfterFirstScroll: [String]

"""
Hide elements on the page after first scroll using their server-assigned ID from webdriver.
"""
hideElementsAfterFirstScroll: [WebdriverElementID!]

"""Hide all scrollbars in the app."""
hideScrollBars: Boolean

Expand All @@ -810,7 +828,7 @@ input FullPageConfigIn {
"""
scrollLimit: Int

"""Adjust toolbar padding on iOS and Android for viewport cutout."""
"""@deprecated this field will be removed soon."""
toolBarShadowPadding: Int
}

Expand Down Expand Up @@ -1278,8 +1296,6 @@ type Query implements Node {
"""The method to use when ordering `Snapshot`."""
orderBy: [SnapshotsOrderBy!] = [PRIMARY_KEY_ASC]
): SnapshotsConnection
webdriverSession(sessionId: ID!): WebdriverSession @deprecated(reason: "Use webdriverSessionInfo. This will be removed by 2024-02-11.")
webdriverSessionFromArchive(jobId: ID!, sessionId: ID!): WebdriverSession @deprecated(reason: "Use webdriverSessionInfo. This will be removed by 2024-02-11.")
webdriverSessionInfo(input: WebdriverSessionInfoIn!): WebdriverSession
}

Expand Down Expand Up @@ -1395,6 +1411,9 @@ type Snapshot implements Node {

By convention, the following errors exist:
- `{"code": "TRUNCATED"}`: The image file is corrupt and was probably truncated.
- `{"domCode": "DOM_TOO_LARGE"}`: [WARNING] The uploaded DOM is too large.
- `{"domCode": "DOM_MISSING"}`: [WARNING] A DOM snapshot was requested, but could not be captured.
- `{"domCode": "DOM_INVALID"}`: [WARNING] The DOM snapshot has an invalid structure.

Other error types may exist and the frontend should display a generic error message
together with the JSON contents of `error`.
Expand All @@ -1414,6 +1433,7 @@ type Snapshot implements Node {
URL that is used by the frontend to link to the job, task or process that has generated this snapshot. For exemple, a link to a Sauce Session.
"""
jobUrl: String
metadata: JSON
name: String!

"""
Expand Down Expand Up @@ -1480,6 +1500,7 @@ input SnapshotIn {
diffingOptions: DiffingOptionsIn
ignoreRegions: [RegionIn!]
jobUrl: String
metadata: JSON
name: String!
operatingSystem: OperatingSystem
operatingSystemVersion: String
Expand Down Expand Up @@ -1622,6 +1643,8 @@ type User {
username: String
}

scalar WebdriverElementID

type WebdriverSession {
applicationSummary: ApplicationSummary

Expand Down
9 changes: 0 additions & 9 deletions visual-java/src/main/graphql/visual/webdriverSession.graphql

This file was deleted.

9 changes: 9 additions & 0 deletions visual-js/.changeset/tiny-plums-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@saucelabs/visual": minor
"@saucelabs/cypress-visual-plugin": patch
"@saucelabs/nightwatch-sauce-visual-service": patch
"@saucelabs/visual-storybook": patch
"@saucelabs/wdio-sauce-visual-service": patch
---

Remove deprecated API calls
ebekebe marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 0 additions & 2 deletions visual-js/visual/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {
DiffsForTestResultDocument,
FinishBuildDocumentDocument,
UpdateDiffDocument,
WebdriverSessionDocument,
WebdriverSessionInfoDocument,
BuildWithDiffsByCustomIdDocument,
BuildByCustomIdDocument,
Expand Down Expand Up @@ -111,7 +110,6 @@ export const getApi = (
apollo,
CreateSnapshotFromWebDriverDocument,
),
webdriverSession: makeQuery(apollo, WebdriverSessionDocument),
webdriverSessionInfo: makeQuery(apollo, WebdriverSessionInfoDocument),
build: makeQuery(apollo, BuildDocument),
buildByCustomId: makeQuery(apollo, BuildByCustomIdDocument),
Expand Down
9 changes: 0 additions & 9 deletions visual-js/visual/src/documents/webdriverSession.graphql

This file was deleted.

5 changes: 0 additions & 5 deletions visual-js/visual/src/graphql/__generated__/gql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions visual-js/visual/src/graphql/__generated__/graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.