-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
53 changed files
with
4,946 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Java (build) | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'visual-java/**' | ||
pull_request: | ||
paths: | ||
- 'visual-java/**' | ||
|
||
defaults: | ||
run: | ||
working-directory: visual-java | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Java (Release) | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
releaseType: | ||
description: 'Release type - major, minor or patch' | ||
required: true | ||
default: 'minor' | ||
options: | ||
- 'major' | ||
- 'minor' | ||
- 'patch' | ||
|
||
defaults: | ||
run: | ||
working-directory: visual-java | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
target/ | ||
.idea/ | ||
.DS_Store |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip | ||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Sauce Labs Visual for Java | ||
|
||
Sauce Labs Visual for Java expose Sauce Labs Visual Testing for your Java project with Selenium. | ||
|
||
## Installation | ||
|
||
Add [sauce visual](https://central.sonatype.com/artifact/com.saucelabs.visual/java-client) dependency to your project | ||
|
||
*Latest available version can be found [here](https://central.sonatype.com/artifact/com.saucelabs.visual/java-client)* | ||
|
||
- Maven | ||
|
||
```xml | ||
|
||
<dependency> | ||
<groupId>com.saucelabs.visual</groupId> | ||
<artifactId>java-client</artifactId> | ||
<version>LATEST VERSION</version> | ||
<scope>test</scope> | ||
</dependency> | ||
``` | ||
|
||
- Gradle | ||
|
||
``` | ||
testImplementation group: 'com.saucelabs.visual', name: 'java-client', version: 'LATEST VERSION' | ||
``` | ||
|
||
- Gradle (short) | ||
|
||
``` | ||
testImplementation 'com.saucelabs.visual:java-client:LATEST VERSION' | ||
``` | ||
|
||
## How to use | ||
|
||
- Instantiate `VisualClient` object | ||
```java | ||
import com.saucelabs.visual.DataCenter; | ||
//... | ||
DataCenter dataCenter = DataCenter.US_WEST_1; | ||
var visualClient = await VisualClient.Create(Driver, datacenter); | ||
``` | ||
|
||
- Invoke Visual Testing | ||
```java | ||
var checkOptions = new VisualCheckOptions() { CaptureDom = true }; | ||
await visualClient.VisualCheck("Home Page", checkOptions); | ||
``` | ||
|
||
- Get results of Visual Tests and run assertions on it | ||
```java | ||
var results = await visualClient.VisualResults(visualBuild.Id); | ||
// verify that no differences have been detected | ||
Assert.AreEqual(0, results[DiffStatus.Approved]); | ||
``` |
Oops, something went wrong.