Skip to content

Commit

Permalink
update java
Browse files Browse the repository at this point in the history
  • Loading branch information
ebekebe committed May 28, 2024
1 parent 7cbf086 commit 20e5441
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 13 deletions.
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.

0 comments on commit 20e5441

Please sign in to comment.