Skip to content

Commit 9241a9c

Browse files
authored
Merge branch 'main' into alexh-sc-3874-add-us-east-tunnel-endpoint
2 parents fc681bc + bc9f054 commit 9241a9c

File tree

7 files changed

+222
-28
lines changed

7 files changed

+222
-28
lines changed

docs/dev/data-center-maint.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ Saucelabs.com and the Sauce Labs testing service in the US and EU will be down f
2727
| EU | June 22, 2024 | 7pm-9pm CEST |
2828
| US | July 9, 2024 | 9pm-1am PDT |
2929
| EU | July 18, 2024 | 9pm-11pm CEST |
30-
| US | August 8, 2024 | 9pm-11pm PDT |
31-
| EU | August 22, 2024 | 9pm-11pm CEST |
32-
| US | September 12, 2024 | 9pm-11pm PDT |
33-
| EU | September 19, 2024 | 9pm-11pm CEST |
30+
| US | August 10, 2024 | 10am - 12pm PDT |
31+
| EU | August 24, 2024 | 7pm - 9pm CEST |
32+
| US | September 14, 2024 | 10am - 12pm PDT |
33+
| EU | September 21, 2024 | 7pm - 9pm CEST |
3434

3535
### Backtrace - error reporting service updates are pushed Wednesdays 11am - 1pm ET across all data centers. Individual application servers may experience a short period of downtime within this window
3636

docs/visual-testing/_partials/_environment-variables.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
| `SAUCE_VISUAL_BUILD_NAME` | | The name you would like to appear in the Sauce Visual dashboard. |
77
| `SAUCE_VISUAL_BRANCH` | | The branch name you would like to associate this build with. We recommend using your current VCS branch in CI. |
88
| `SAUCE_VISUAL_DEFAULT_BRANCH` | | The main branch name you would like to associate this build with. Usually `main` or `master` or alternatively the branch name your current branch was derived from. [Follow me to learn more](../workflows/ci.md) |
9-
| `SAUCE_VISUAL_PROJECT` | | The label / project you would like to associated this build with. |
9+
| `SAUCE_VISUAL_PROJECT` | | The label / project you would like to associate this build with. |
1010
| `SAUCE_VISUAL_BUILD_ID` | | For advanced users, a user-supplied SauceLabs Visual build ID. Can be used to create builds in advance using the GraphQL API. This can be used to parallelize tests with multiple browsers, shard, or more. <br/> By default, this is not set and we create / finish a build during setup / teardown. |
1111
| `SAUCE_VISUAL_CUSTOM_ID` | | For advanced users, a user-supplied custom ID to identify this build. Can be used in CI to identify / check / re-check the status of a single build. Usage suggestions: CI pipeline ID. |

docs/visual-testing/integrations/java.md

+1-20
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ visual.sauceVisualCheck("Before Login", options);
329329

330330
#### Screenshot-wide configuration
331331

332-
<SelectiveDiffingGlobal />=
332+
<SelectiveDiffingGlobal />
333333

334334
Example:
335335

@@ -451,25 +451,6 @@ options.setClipSelector(".your-css-selector");
451451
visual.sauceVisualCheck("Visible Sale Banner", options);
452452
```
453453

454-
#### Selective Diffing (BETA)
455-
456-
[Selective regions](../selective-diffing.md) are an even more powerful way to control diffing.
457-
458-
```java
459-
EnumSet<DiffingFlag> visualChanges = EnumSet.of(DiffingFlag.Visual);
460-
461-
visual.sauceVisualCheck(
462-
"Before Login",
463-
new CheckOptions.Builder()
464-
.withDiffingMethod(DiffingMethod.BALANCED)
465-
.disable(EnumSet.of(DiffingFlag.Position, DiffingFlag.Dimensions))
466-
.enable(visualChanges, loginPage.getInputUsername())
467-
.disable(visualChanges, loginPage.getInputUsername())
468-
.build());
469-
```
470-
471-
You can find the full example in our [examples repo](#examples).
472-
473454
## Examples
474455

475456
Two examples are available:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
---
2+
id: api-lifecycle
3+
title: API Lifecycle
4+
sidebar_label: API Lifecycle
5+
---
6+
7+
# API Lifecycle
8+
9+
This documentation provides a step-by-step guide on how to interact with Sauce Visual API. By following these steps, you'll be able to create builds, upload images, create snapshots, and finish builds. This guide is intended for users who wish to connect directly to the API or implement a binding on their own, including a link to our GraphQL API documentation for further reference.
10+
11+
## What You'll Need
12+
13+
- A Sauce Labs account ([Log in](https://accounts.saucelabs.com/am/XUI/#login/) or sign up for a [free trial license](https://saucelabs.com/sign-up))
14+
- Familiarity with GraphQL queries and mutations
15+
- Tools like Postman or cURL for testing API calls
16+
17+
## Lifecycle Steps
18+
19+
### 1. Create a Build
20+
21+
To start, you need to create a build. This initializes the process and prepares the environment for subsequent steps.
22+
23+
**GraphQL Mutation:**
24+
25+
```graphql
26+
mutation {
27+
createBuild(input: { name: "Your Build Name", branch: "Branch name", project: "Project name" }) {
28+
id
29+
name
30+
status
31+
url
32+
}
33+
}
34+
```
35+
36+
- `branch`: Branch name to associate the build with.
37+
- `project`: Label/project to associate the build with.
38+
39+
**Expected Response:**
40+
41+
```json
42+
{
43+
"data": {
44+
"createBuild": {
45+
"id": "build-id-here",
46+
"name": "Your Build Name",
47+
"status": "RUNNING",
48+
"url": "https://app.saucelabs.com/visual/builds/build-id-here"
49+
}
50+
}
51+
}
52+
```
53+
54+
- `status`: As a newly created build without any snapshots, this will be `RUNNING`.
55+
- `url`: The URL that can be used any time to check the build on Sauce Labs.
56+
57+
### 2. Upload Image
58+
59+
Next, upload an image to the build. This is a two step process.
60+
61+
First, obtain a signed URL for uploading your image by using the `createSnapshotUpload` mutation.
62+
63+
**GraphQL Mutation:**
64+
65+
```graphql
66+
mutation {
67+
createSnapshotUpload(input: {buildId: "build-id-here"}) {
68+
id
69+
uploadUrl
70+
domUploadUrl
71+
}
72+
}
73+
```
74+
75+
- `buildId`: The ID of the build created in the previous step.
76+
77+
**Expected Response:**
78+
79+
```json
80+
{
81+
"data": {
82+
"createSnapshotUpload": {
83+
"id": "upload-id-here",
84+
"uploadUrl": "image-upload-url-here",
85+
"domUploadUrl": "dom-upload-url-here"
86+
}
87+
}
88+
}
89+
```
90+
91+
- `id`: Upload ID to use in the subsequent steps.
92+
- `uploadUrl`: The URL to upload the image in the next step.
93+
- `domUploadUrl`: The URL to upload the DOM to (if desired and available). Explained in the optional step below.
94+
95+
Next, send a `PUT` request to `uploadUrl` with image file in the body of the request. Only **PNG** files are supported.
96+
97+
**cURL Request:**
98+
99+
```sh
100+
curl --request PUT \
101+
--url 'upload-url-here' \
102+
--header 'Content-MD5: base64-encoded-md5-hash' \
103+
--header 'Content-Type: image/png' \
104+
--data '@my-screenshot.png'
105+
```
106+
107+
- `Content-MD5` header: Base64 encoded MD5 hash of the file (`my-screenshot.png`).
108+
- `Content-Type` header: Must be set to `image/png`. Not other extensions are supported.
109+
110+
Optional: Upload DOM
111+
112+
If desired (and available), DOM can be also uploaded to `domUploadUrl` obtained from `createSnapshotUpload` mutation.
113+
114+
**cURL Request:**
115+
116+
```sh
117+
curl --request PUT \
118+
--url 'dom-upload-url-here' \
119+
--header 'Content-MD5: base64-encoded-md5-hash' \
120+
--header 'Content-Type: text/html' \
121+
--data '@my-dom.html'
122+
```
123+
124+
- `Content-MD5` header: Base64 encoded MD5 hash of the file (`my-dom.html`).
125+
- `Content-Type` header: Must be set to `text/html`. Not other extensions are supported.
126+
127+
### 3. Create Snapshot
128+
129+
After uploading your image, add your snapshot along with its metadata to your build.
130+
131+
**GraphQL Mutation:**
132+
133+
```graphql
134+
mutation {
135+
createSnapshot(
136+
input: {
137+
buildUuid: "build-id-here",
138+
uploadId: "upload-id-here",
139+
name: "Your snapshot name",
140+
operatingSystem: OS,
141+
operatingSystemVersion: "os-version",
142+
browser: BROWSER,
143+
browserVersion: "browser-version"
144+
}
145+
) {
146+
id
147+
uploadId
148+
}
149+
}
150+
```
151+
- `buildUuid`: Build ID that was used in previous steps.
152+
- `uploadId`: Upload ID acquired with `createSnapshotUpload` in the previous step.
153+
- `operatingSystem`: The operating system used to take the snapshot. Strongly advised to be filled in. Available options: `ANDROID`, `IOS`, `LINUX`, `MACOS`, `WINDOWS`.
154+
- `operatingSystemVersion`: The operating system version. e.g. "14.5" for `MACOS` or "11" for `WINDOWS`.
155+
- `browser`: The browser used to take the snapshot. Strongly advised to be filled in (if available). Available options: `CHROME`, `EDGE`, `FIREFOX`, `PLAYWRIGHT_WEBKIT`, `SAFARI`.
156+
- `browserVersion`: The browser version. e.g. "120.0.6099.318", "128.0.2".
157+
158+
**Expected Response:**
159+
160+
```json
161+
{
162+
"data": {
163+
"createSnapshot": {
164+
"id": "snapshot-id-here",
165+
"uploadId": "upload-id-here"
166+
}
167+
}
168+
}
169+
```
170+
171+
- `id`: The ID of the snapshot that has been created.
172+
173+
### 4. Finish Build
174+
175+
Finally, finish the build to mark it as complete. Keep in mind that this is a necessary step and the build cannot be reused after it's finished.
176+
177+
It's also worth noting that unfinished builds will be automatically closed and set to `ERRORED` state after a certain period of time (default: 3 hours).
178+
179+
**GraphQL Mutation:**
180+
181+
```graphql
182+
mutation {
183+
finishBuild(input: {uuid: "build-id-here"}) {
184+
id
185+
status
186+
url
187+
}
188+
}
189+
```
190+
191+
**Expected Response:**
192+
193+
```json
194+
{
195+
"data": {
196+
"finishBuild": {
197+
"id": "build-id-here",
198+
"status": "UNAPPROVED",
199+
"url": "https://app.saucelabs.com/visual/builds/build-id-here"
200+
}
201+
}
202+
}
203+
```
204+
205+
## Additional Information
206+
207+
For more detailed information about the available queries and mutations, refer to our [GraphQL API documentation](https://api.us-west-1.saucelabs.com/v1/visual/graphql).

docs/visual-testing/workflows/ci.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import TabItem from '@theme/TabItem';
88

99
# Continuous Integration
1010

11-
To integrate Sauce Visual into your continuous integration workflow we recommend a two-step approach using the sauce visual cli. Sauce visual cli will work with all major CI systems (GitHub, Gitlab, Jenkins, CircleCI).
11+
To integrate Sauce Visual into your continuous integration workflow we recommend a two-step approach using the [Sauce Visual CLI](../cli.md). Sauce Visual CLI will work with all major CI systems (GitHub, Gitlab, Jenkins, CircleCI).
1212

1313
<img src={useBaseUrl('img/sauce-visual/workflow-ci.png')} alt="Branch Review Pipeline" />
1414

1515
To implement a merge/pull request flow which blocks the given request from merging when visual diffs are detected and not approved do the following:
1616

17-
1. trigger test execution in your ci the way you do it locally. Make sure to pass a custom build id and do not fail your test when visual differences where detected.
18-
2. in a dedicated build step use the sauce visual cli to fetch the current state of the sauce visual build using the custom build id from step one. It will fail in case visual changes have been detected.
17+
1. trigger test execution in your CI the way you do it locally. Make sure to pass a custom build ID and do not fail your test when visual differences where detected.
18+
2. in a dedicated build step use the Sauce Visual CLI to fetch the current state of the Sauce Visual build using the custom build ID from step one. It will fail in case visual changes have been detected.
1919

2020
```
2121
# make sure nodejs and npx is available

sidebars.js

+1
Original file line numberDiff line numberDiff line change
@@ -1694,6 +1694,7 @@ module.exports = {
16941694
'visual-testing/workflows/test-execution',
16951695
'visual-testing/workflows/review',
16961696
'visual-testing/workflows/ci',
1697+
'visual-testing/workflows/api-lifecycle'
16971698
],
16981699
},
16991700
{

src/plugins/beamer/index.js

+5
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ module.exports = function (context) {
3434
product_id : 'WyhkZHOU27797',
3535
${selector},
3636
${display},
37+
callback: function() {
38+
setTimeout(function() {
39+
window.Beamer.enableFaviconNotification = false;
40+
}, 0);
41+
},
3742
};`,
3843
},
3944
{

0 commit comments

Comments
 (0)