Skip to content

Commit

Permalink
Merge branch 'main' into default-balanced
Browse files Browse the repository at this point in the history
  • Loading branch information
kb-kerem committed Aug 21, 2024
2 parents 26b3cf7 + a59d094 commit 7b2528f
Show file tree
Hide file tree
Showing 17 changed files with 196 additions and 62 deletions.
6 changes: 3 additions & 3 deletions tests/package-lock.json

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

5 changes: 0 additions & 5 deletions visual-js/.changeset/bright-pumas-thank.md

This file was deleted.

6 changes: 6 additions & 0 deletions visual-js/visual-wdio/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @saucelabs/wdio-sauce-visual-service

## 0.5.5

### Patch Changes

- 6a62a83: Add baseline override support

## 0.5.4

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions visual-js/visual-wdio/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@saucelabs/wdio-sauce-visual-service",
"description": "WebdriverIO service that add visual checks capabilities using Sauce Labs Visual",
"version": "0.5.4",
"version": "0.5.5",
"main": "build/index.js",
"types": "build/index.d.ts",
"license": "MIT",
Expand All @@ -26,7 +26,7 @@
"./package.json": "./package.json"
},
"dependencies": {
"@saucelabs/visual": "^0.6.3",
"@saucelabs/visual": "^0.6.5",
"@wdio/globals": "8.10.5",
"@wdio/logger": "8.6.6",
"@wdio/types": "8.10.4",
Expand Down
8 changes: 7 additions & 1 deletion visual-js/visual-wdio/src/SauceVisualService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
RegionType,
SauceRegion,
selectiveRegionOptionsToDiffingOptions,
BaselineOverrideIn,
VisualApi,
WebdriverSession,
} from '@saucelabs/visual';
Expand Down Expand Up @@ -83,7 +84,7 @@ declare global {
}
}

type SauceVisualServiceOptions = {
export type SauceVisualServiceOptions = {
buildName?: string;
buildId?: string;
project?: string;
Expand All @@ -95,6 +96,7 @@ type SauceVisualServiceOptions = {
clipElement?: WdioElement;
region?: SauceRegion;
fullPage?: FullPageScreenshotOptions;
baselineOverride?: BaselineOverrideIn;
};

// This type is derived from what provides Cucumber as framework
Expand Down Expand Up @@ -130,6 +132,7 @@ export type CheckOptions = {
diffingMethod?: DiffingMethod;
disable?: (keyof DiffingOptionsIn)[];
fullPage?: FullPageScreenshotOptions;
baselineOverride?: BaselineOverrideIn;
};

export let uploadedDiffIds: string[] = [];
Expand Down Expand Up @@ -164,6 +167,7 @@ export default class SauceVisualService implements Services.ServiceInstance {
clipElement: WdioElement | undefined;
fullPage?: FullPageScreenshotOptions;
apiClient: VisualApi;
baselineOverride?: BaselineOverrideIn;

constructor(
public options: SauceVisualServiceOptions,
Expand All @@ -175,6 +179,7 @@ export default class SauceVisualService implements Services.ServiceInstance {
this.clipSelector = options.clipSelector;
this.clipElement = options.clipElement;
this.fullPage = options.fullPage;
this.baselineOverride = options.baselineOverride;
this.apiClient = getApi(
{
...this.config,
Expand Down Expand Up @@ -438,6 +443,7 @@ export default class SauceVisualService implements Services.ServiceInstance {
suiteName: this.test?.parent,
testName: this.test?.title,
fullPageConfig: getFullPageConfig(this.fullPage, options.fullPage),
baselineOverride: options.baselineOverride || this.baselineOverride,
});
uploadedDiffIds.push(...result.diffs.nodes.flatMap((diff) => diff.id));
log.info('Check result', result);
Expand Down
6 changes: 4 additions & 2 deletions visual-js/visual-wdio/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import SauceVisualService from './SauceVisualService.js';
import SauceVisualService, {
SauceVisualServiceOptions,
} from './SauceVisualService.js';
import { DiffingMethod } from '@saucelabs/visual';

export { SauceVisualService, DiffingMethod };
export { SauceVisualService, SauceVisualServiceOptions, DiffingMethod };

// exposing default exports as documented here: https://webdriver.io/docs/customservices/
export default SauceVisualService;
Expand Down
6 changes: 6 additions & 0 deletions visual-js/visual/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @saucelabs/visual

## 0.6.5

### Patch Changes

- a1f4373: Update types

## 0.6.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion visual-js/visual/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@saucelabs/visual",
"description": "JS client bindings for Sauce Labs Visual",
"version": "0.6.4",
"version": "0.6.5",
"main": "build/index.cjs",
"module": "build/index.js",
"types": "build/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions visual-js/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2920,7 +2920,7 @@ __metadata:
languageName: unknown
linkType: soft

"@saucelabs/visual@^0.6.0, @saucelabs/visual@^0.6.2, @saucelabs/visual@^0.6.3, @saucelabs/visual@workspace:visual":
"@saucelabs/visual@^0.6.0, @saucelabs/visual@^0.6.2, @saucelabs/visual@^0.6.3, @saucelabs/visual@^0.6.5, @saucelabs/visual@workspace:visual":
version: 0.0.0-use.local
resolution: "@saucelabs/visual@workspace:visual"
dependencies:
Expand Down Expand Up @@ -2966,7 +2966,7 @@ __metadata:
resolution: "@saucelabs/wdio-sauce-visual-service@workspace:visual-wdio"
dependencies:
"@jest/globals": ^29.7.0
"@saucelabs/visual": ^0.6.3
"@saucelabs/visual": ^0.6.5
"@tsconfig/node18": ^2.0.0
"@types/jest": ^29.5.6
"@typescript-eslint/eslint-plugin": ^5.59.1
Expand Down
2 changes: 1 addition & 1 deletion visual-python/.bumpversion.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.bumpversion]
current_version = "0.0.14"
current_version = "0.1.0"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
Expand Down
4 changes: 2 additions & 2 deletions visual-python/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM python:3.12-slim-bookworm
FROM python:3.11-slim-bookworm

COPY . .

RUN pip install -r requirements/dev.txt

RUN pip install .

ENTRYPOINT ["robot", "--variable", "NO_BUILD_NAME:True", "--test", "Login", "integration-tests/robot"]
ENTRYPOINT ["robot", "--variable", "NO_BUILD_NAME:True", "--test", "Login", "integration-tests/robot"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
*** Settings ***
Resource resource.robot
Test Timeout 5 minutes

*** Test Cases ***
Baseline

Visual Set Global DiffingMethod BALANCED
Visual Set Global CaptureDom True
${override} = Visual BaselineOverride device=Desktop (1920x900) browser=CHROME browser_version=127.0
Visual Set Global BaselineOverride ${override}
${full_page_config} = Visual FullPageConfig
Visual Set Global FullPageConfig ${full_page_config}
Visual Snapshot Inventory Page

${override} = Visual BaselineOverride device=Desktop (1920x900) browser=CHROME browser_version=127.0
${fpc} = Visual FullPageConfig scroll_limit=1
Visual Snapshot Inventory Page (Override) baseline_override=${override} full_page_config=${fpc} diffing_method=SIMPLE capture_dom=False


Visual Set Global DiffingMethod None
Visual Set Global CaptureDom None
Visual Set Global BaselineOverride None
Visual Set Global FullPageConfig None
2 changes: 1 addition & 1 deletion visual-python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "saucelabs_visual"
version = "0.0.14"
version = "0.1.0"
description = "Python bindings for Sauce Labs Visual"
dependencies=[
"requests",
Expand Down
4 changes: 2 additions & 2 deletions visual-python/requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Development & local build requirements
-r user.txt
-r build.txt
robotframework==7.0.0
robotframework-seleniumlibrary==6.2.0
robotframework==7.0.1
robotframework-seleniumlibrary==6.5.0
pytest==8.1.1
coverage==7.4.4
Loading

0 comments on commit 7b2528f

Please sign in to comment.