Skip to content

Commit

Permalink
Point to Sauce Docs for java and dotnet (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
kb-kerem authored Jul 17, 2024
1 parent 29455cc commit 5f094a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 87 deletions.
28 changes: 2 additions & 26 deletions visual-dotnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,6 @@

Sauce Labs Visual for C# expose Sauce Labs Visual Testing for your C# project with Selenium.

# Installation
## Installation & Usage

Add SauceLabs.Visual to your current project
```sh
dotnet add package SauceLabs.Visual
```

# How to use

- Instantiate `VisualClient` object
```csharp
var dataCenter = DataCenter.UsWest1;
var visualClient = await VisualClient.Create(Driver, datacenter);
```

- Invoke Visual Testing
```csharp
var checkOptions = new VisualCheckOptions() { CaptureDom = true };
await visualClient.VisualCheck("Home Page", checkOptions);
```

- Get results of Visual Tests and run assertions on it
```csharp
var results = await visualClient.VisualResults(visualBuild.Id);
// verify that no differences have been detected
Assert.AreEqual(0, results[DiffStatus.Approved]);
```
View installation and usage instructions on the [Sauce Docs website](https://docs.saucelabs.com/visual-testing/integrations/csharp/).
63 changes: 2 additions & 61 deletions visual-java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,65 +2,6 @@

Sauce Labs Visual for Java exposes Sauce Labs Visual Testing for your Java project with Selenium.

## Installation
## Installation & Usage

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 `VisualApi` object
```java

import com.saucelabs.visual.DataCenter;
import com.saucelabs.visual.VisualApi;
import org.openqa.selenium.remote.RemoteWebDriver;
//...
RemoteWebDriver driver = new RemoteWebDriver(webDriverUrl, capabilities);
VisualApi visual = new VisualApi.Builder(driver, sauceUsername, sauceAccessKey, DataCenter.US_WEST_1).build();
```

- Invoke Visual Testing
```java

import com.saucelabs.visual.CheckOptions;
//...
CheckOptions checkOptions = new CheckOptions.Builder().withCaptureDom(true).build();
visual.sauceVisualCheck("Home Page", checkOptions);
```

- Get results of Visual Tests and run assertions on it
```java

import com.saucelabs.visual.graphql.type.DiffStatus;
import org.junit.jupiter.api.Assertions;
//...
Map<DiffStatus, Integer> results = visual.sauceVisualResults();
// verify that no differences have been detected
Assertions.assertEquals(0, results.get(DiffStatus.APPROVED));
```
View installation and usage instructions on the [Sauce Docs website](https://docs.saucelabs.com/visual-testing/integrations/java/).

0 comments on commit 5f094a9

Please sign in to comment.