diff --git a/visual-js/.changeset/silent-jeans-reflect.md b/visual-js/.changeset/silent-jeans-reflect.md new file mode 100644 index 00000000..0665695a --- /dev/null +++ b/visual-js/.changeset/silent-jeans-reflect.md @@ -0,0 +1,7 @@ +--- +"@saucelabs/visual": minor +"@saucelabs/nightwatch-sauce-visual-service": minor +"@saucelabs/wdio-sauce-visual-service": minor +--- + +Added control over scrolling to the top before and after capturing a native full-page screenshot. \ No newline at end of file diff --git a/visual-js/visual/src/graphql/__generated__/graphql.ts b/visual-js/visual/src/graphql/__generated__/graphql.ts index d4b39fc7..93165d55 100644 --- a/visual-js/visual/src/graphql/__generated__/graphql.ts +++ b/visual-js/visual/src/graphql/__generated__/graphql.ts @@ -60,7 +60,7 @@ export type Baseline = Node & { appName: Maybe; appVersion: Maybe; branch: Maybe; - browser: Maybe; + browser: Browser; browserVersion: Maybe; createdAt: Scalars['Datetime']; createdByOrgId: Scalars['UUID']; @@ -82,10 +82,12 @@ export type Baseline = Node & { name: Scalars['String']; /** A globally unique identifier. Can be used in various places throughout the system to identify this single value. */ nodeId: Scalars['ID']; - operatingSystem: Maybe; + operatingSystem: OperatingSystem; operatingSystemVersion: Maybe; parentId: Maybe; project: Maybe; + smartSuiteName: Scalars['String']; + smartTestName: Scalars['String']; /** Reads a single `Snapshot` that is related to this `Baseline`. */ snapshot: Maybe; snapshotId: Maybe; @@ -645,6 +647,8 @@ export type CreateSnapshotFromWebDriverIn = { captureDom?: InputMaybe; /** The selenium ID of an element we should clip the screen to. */ clipElement?: InputMaybe; + /** @deprecated(reason: "clipElement should be used instead.") */ + clipSelector?: InputMaybe; diffingMethod?: InputMaybe; diffingOptions?: InputMaybe; /** @@ -708,6 +712,7 @@ export type Diff = Node & { diffingMethod: DiffingMethod; /** snapshot { uploadId } should be requested at the same moment */ domDiffUrl: Maybe; + feedback: DiffFeedback; hasDom: Scalars['Boolean']; id: Scalars['UUID']; /** A globally unique identifier. Can be used in various places throughout the system to identify this single value. */ @@ -779,6 +784,39 @@ export type DiffCountIn = { withBaseline?: InputMaybe; }; +export type DiffFeedback = { + __typename?: 'DiffFeedback'; + hasIrrelevantChanges: Scalars['Boolean']; + isBroken: Scalars['Boolean']; +}; + +/** A connection to a list of `DiffFeedback` values. */ +export type DiffFeedbacksConnection = { + __typename?: 'DiffFeedbacksConnection'; + /** A list of edges which contains the `DiffFeedback` and cursor to aid in pagination. */ + edges: Array; + /** A list of `DiffFeedback` objects. */ + nodes: Array; + /** Information to aid in pagination. */ + pageInfo: PageInfo; + /** The count of *all* `DiffFeedback` you could get from the connection. */ + totalCount: Scalars['Int']; +}; + +/** A `DiffFeedback` edge in the connection. */ +export type DiffFeedbacksEdge = { + __typename?: 'DiffFeedbacksEdge'; + /** A cursor for use in pagination. */ + cursor: Maybe; + /** The `DiffFeedback` at the end of the edge. */ + node: DiffFeedback; +}; + +/** Methods to use when ordering `DiffFeedback`. */ +export enum DiffFeedbacksOrderBy { + Natural = 'NATURAL' +} + /** A filter to be used against `Diff` object types. All fields are combined with a logical ‘and.’ */ export type DiffFilter = { /** Filter by the object’s `baselineId` field. */ @@ -983,6 +1021,8 @@ export type FullPageConfigIn = { * Default and max value is 10 */ scrollLimit?: InputMaybe; + /** Change scroll behaviour before and after taking full page screenshot. Available only on native apps. */ + scrollOption?: InputMaybe; }; /** A filter to be used against FullText fields. All fields are combined with a logical ‘and.’ */ @@ -995,6 +1035,8 @@ export enum GroupByOption { Browser = 'Browser', Device = 'Device', OperatingSystemOperatingSystemVersion = 'OperatingSystem_OperatingSystemVersion', + SmartSuiteName = 'SmartSuiteName', + SmartTestName = 'SmartTestName', SuiteName = 'SuiteName', TestName = 'TestName' } @@ -1034,6 +1076,7 @@ export type MergeBaselinesPayload = { export type Mutation = { __typename?: 'Mutation'; addComment: Comment; + /** @deprecated Use setDiffStatus */ approveBuild: Build; createBuild: Build; /** @@ -1048,7 +1091,10 @@ export type Mutation = { finishBuild: Build; forceFinishBuild: Maybe; mergeBaselines: MergeBaselinesPayload; + setDiffFeedback: Diff; + setDiffStatus: Array; updateComment: Comment; + /** @deprecated Use setDiffStatus */ updateDiff: Diff; }; @@ -1119,6 +1165,18 @@ export type MutationMergeBaselinesArgs = { }; +/** The root mutation type which contains root level fields which mutate data. */ +export type MutationSetDiffFeedbackArgs = { + input: SetDiffFeedbackIn; +}; + + +/** The root mutation type which contains root level fields which mutate data. */ +export type MutationSetDiffStatusArgs = { + input: SetDiffStatusIn; +}; + + /** The root mutation type which contains root level fields which mutate data. */ export type MutationUpdateCommentArgs = { input: UpdateCommentIn; @@ -1141,6 +1199,7 @@ export enum OperatingSystem { Ios = 'IOS', Linux = 'LINUX', Macos = 'MACOS', + Unknown = 'UNKNOWN', Windows = 'WINDOWS' } @@ -1368,6 +1427,8 @@ export type Query = Node & { diff: Maybe; /** Reads a single `Diff` using its globally unique `ID`. */ diffByNodeId: Maybe; + /** Reads and enables pagination through a set of `DiffFeedback`. */ + diffFeedbacks: Maybe; /** Reads and enables pagination through a set of `Diff`. */ diffs: Maybe; /** @@ -1548,6 +1609,17 @@ export type QueryDiffByNodeIdArgs = { }; +/** The root query type which gives access points into the data universe. */ +export type QueryDiffFeedbacksArgs = { + after: InputMaybe; + before: InputMaybe; + first: InputMaybe; + last: InputMaybe; + offset: InputMaybe; + orderBy?: InputMaybe>; +}; + + /** The root query type which gives access points into the data universe. */ export type QueryDiffsArgs = { after: InputMaybe; @@ -1685,6 +1757,15 @@ export type RegionIn = { y: Scalars['Int']; }; +/** + * START_FROM_TOP - scroll before and after to top of the scrollElement + * START_FROM_CURRENT_LOCATION - no scroll before and after + */ +export enum ScrollOption { + StartFromCurrentLocation = 'START_FROM_CURRENT_LOCATION', + StartFromTop = 'START_FROM_TOP' +} + export type SelectorIn = { type: SelectorType; value: Scalars['String']; @@ -1694,6 +1775,17 @@ export enum SelectorType { Xpath = 'XPATH' } +export type SetDiffFeedbackIn = { + diffId: Scalars['UUID']; + hasIrrelevantChanges: Scalars['Boolean']; + isBroken: Scalars['Boolean']; +}; + +export type SetDiffStatusIn = { + diffIds: Array; + status: UpdateDiffStatus; +}; + export type Snapshot = Node & { __typename?: 'Snapshot'; appId: Maybe; @@ -1702,7 +1794,7 @@ export type Snapshot = Node & { /** Reads and enables pagination through a set of `Baseline`. */ baselines: BaselinesConnection; branch: Maybe; - browser: Maybe; + browser: Browser; browserVersion: Maybe; /** Reads a single `Build` that is related to this `Snapshot`. */ build: Maybe; @@ -1742,8 +1834,10 @@ export type Snapshot = Node & { name: Scalars['String']; /** A globally unique identifier. Can be used in various places throughout the system to identify this single value. */ nodeId: Scalars['ID']; - operatingSystem: Maybe; + operatingSystem: OperatingSystem; operatingSystemVersion: Maybe; + smartSuiteName: Scalars['String']; + smartTestName: Scalars['String']; suiteName: Maybe; testName: Maybe; thumbnailUrl: Scalars['String']; diff --git a/visual-js/visual/src/types.ts b/visual-js/visual/src/types.ts index 7c3ef785..84572b13 100644 --- a/visual-js/visual/src/types.ts +++ b/visual-js/visual/src/types.ts @@ -1,4 +1,8 @@ -import { RegionIn, SelectorIn } from './graphql/__generated__/graphql'; +import { + RegionIn, + ScrollOption, + SelectorIn, +} from './graphql/__generated__/graphql'; import { SelectiveRegionOptions } from './common/selective-region'; import { SauceRegion } from './common/regions'; @@ -34,6 +38,10 @@ export type FullPageScreenshotOptions = * Selector of an element that we should crop the screenshot to. Available only on native apps. */ nativeClipSelector?: SelectorIn; + /** + * Change scroll behaviour before and after taking full page screenshot. Available only on native apps. + */ + scrollOption?: ScrollOption; }; export type Ignorable = T | T[] | Promise | Promise | RegionIn;