Skip to content

Commit

Permalink
Merge branch 'main' into rdx-482-appium-capabilities-constant-rename
Browse files Browse the repository at this point in the history
  • Loading branch information
shahrukhamd authored Dec 11, 2024
2 parents e59c56e + 5b27082 commit 91ce0ed
Show file tree
Hide file tree
Showing 8 changed files with 336 additions and 47 deletions.
34 changes: 9 additions & 25 deletions docs/dev/data-center-maint.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,15 @@ Saucelabs.com and the Sauce Labs testing service in the US and EU will be down f

| Region | Date | Time |
| ---------- | ------------------ | ------------------------------ |
| US | January 6, 2024 | 10am - 12pm PST |
| EU | January 20, 2024 | 7pm - 9pm CET |
| US and EU | February 10, 2024 | 10am - 12pm PDT, 7pm - 9pm CEST|
| EU | February 24, 2024 | 7pm - 9pm CET |
| US | March 9, 2024 | 10am - 12pm PDT |
| US and EU | March 20, 2024 | 6:30am - 08:30am UTC |
| US | March 21, 2024 | 6:30am - 08:30am UTC |
| EU | March 23, 2024 | 7pm - 9pm CET |
| US and EU | April 20, 2024 | 10am - 12pm PDT, 7pm - 9pm CEST|
| US | May 18, 2024 | 10am - 12pm PDT |
| EU | May 25, 2024 | 7pm-9pm CEST |
| US | June 8, 2024 | 10am - 12pm PDT |
| EU | June 22, 2024 | 7pm-9pm CEST |
| US | July 9, 2024 | 9pm-1am PDT |
| EU | July 18, 2024 | 9pm-11pm CEST |
| US | August 10, 2024 | 10am - 12pm PDT |
| EU | August 24, 2024 | 7pm - 9pm CEST |
| US | September 14, 2024 | 10am - 12pm PDT |
| EU | September 21, 2024 | 7pm - 9pm CEST |
| US West | October 5, 2024 | 10am - 12pm PDT (1700-1900 UTC)|
| US East | October 12, 2024 | 1pm - 3pm EDT (1700-1900 UTC) |
| EU Central | October 19, 2024 | 7pm - 9pm CEST (1700-1900 UTC) |
| US West | November 2, 2024 | 10am - 12pm PDT (1700-1900 UTC)|
| US East and EU Central | November 9, 2024 | 1pm - 3pm EST (1800-2000 UTC) |
| US West and EU Central | December 14, 2024 | 10am - 12pm PDT (1800-2000 UTC)|
| US West and EU Central | December 14, 2024 | 10 AM - 12 PM PDT (1800-2000 UTC)|
| EU Central | January 11, 2025 | 7 PM - 9 PM CET (1800-2000 UTC) |
| US West | January 25, 2025 | 10 AM - 12 PM PST (1800-2000 UTC) |
| US East | February 1, 2025 | 10 AM - 12 PM PST (1800-2000 UTC) |
| US West | February 8, 2025 | 10 AM - 12 PM PST (1800-2000 UTC) |
| EU Central | February 15, 2025 | 7 PM - 9 PM CET (1800-2000 UTC) |
| US East | March 8, 2025 | 10 AM - 12 PM PST (1800-2000 UTC) |
| EU Central | March 15, 2025 | 7 PM - 9 PM CET (1800-2000 UTC) |
| US West | March 22, 2025 | 10 AM - 12 PM PST (1800-2000 UTC) |

### 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

Expand Down
33 changes: 14 additions & 19 deletions docs/error-reporting/platform-integrations/unreal/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,7 @@ To configure the crash reporter for a packaged build:

Integrate the [backtrace-android](https://github.com/backtrace-labs/backtrace-android) error reporting library with your Unreal Engine game for Android written in Java or Kotlin.

1. Download [BacktraceAndroid_UPL.xml](https://gist.github.com/ianrice07/36d8731f0d1af10af4803288c7c86c10).
1. In the `BacktraceAndroid_UPL.xml` file, provide the name of your [subdomain and a submission token](/error-reporting/platform-integrations/unreal/setup/#what-youll-need) for `BacktraceCredentials`.
- Java:
```java
BacktraceCredentials credentials = new BacktraceCredentials("https://submit.backtrace.io/{subdomain}/{submission-token}/json");
```
- Kotlin:
```java
val backtraceCredentials = BacktraceCredentials("https://submit.backtrace.io/{subdomain}/{submission-token}/json")
```
1. Download [BacktraceWrapper](https://github.com/backtrace-labs/backtrace-unreal-android/releases) package.
1. In the directory for your Unreal Engine project, locate your app or game's `Build.cs` file.
1. Place the `BacktraceAndroid_UPL.xml` file in the same directory with the `Build.cs` file.
1. In the `Build.cs` file, add the following lines at the end of the `ModuleRules` class constructor:
Expand All @@ -160,23 +151,27 @@ Integrate the [backtrace-android](https://github.com/backtrace-labs/backtrace-an
}
```

1. Download the [BacktraceWrapper.h](https://gist.github.com/lysannep/6c09a572baffede96cd250dbdf01279a#file-backtracewrapper-h) header file and add it to your GameInstance.
1. To initialize the Backtrace client, use `BacktraceIO::FInitializeBacktraceClient`.
:::note
It's recommended to initialize the client from the `GameInstance::OnStart()` method. However, if the method is not available, you can initialize the client with any method you use to start your app or game process.
:::
:::note
Optionally, you can specify custom attributes and file attachment paths to submit with your error reports. If you choose to specify file attachment paths, they must be specified as Android paths. For example, to specify a file attachment path for your `ProjectSavedDir()`, use:
1. Place the `BacktraceWrapper.h` and `BacktraceWrapper.cpp` files in the same directory and add BacktraceWrapper to your GameInstance.
1. To initialize the Backtrace client, use `BacktraceIO::FInitializeBacktraceClient` with the name of your [subdomain and a submission token](/error-reporting/platform-integrations/unreal/setup/#what-youll-need) as a SubmissionUrl.
```cpp
FString SubmissionUrl = TEXT("https://submit.backtrace.io/{subdomain}/{submission-token}/json");
BacktraceIO::FInitializeBacktraceClient(SubmissionUrl, Attributes, Attachments);
```

>**Note:**
>It's recommended to initialize the client from the `GameInstance::OnStart()` method. However, if the method is not available, you can initialize the client with any method you use to start your app or game process.
>
>Optionally, you can specify custom attributes and file attachment paths to submit with your error reports. If you choose to specify file attachment paths, they must be specified as Android paths. For example, to specify a file attachment path for your `ProjectSavedDir()`, use:
```
if (Target.Platform == UnrealTargetPlatform.Android)
#include "Misc/App.h"
#if PLATFORM_ANDROID
extern FString GFilePathBase;
FString FileAttachmentPath = GFilePathBase + FString("/UE4Game/") + FApp::GetName() + TEXT("/") + FApp::GetName() + TEXT("/Saved") + TEXT("MyFileName.txt");
FString FileName = TEXT("MyFileName.txt");
FilePath = GFilePathBase + FString("/UE5Game/") + FApp::GetName() + TEXT("/") + FApp::GetName() + TEXT("/Saved/") + FileName;
#endif
```
For more details on how to convert your Unreal Engine paths to Android paths, see the conversion functions for `FAndroidPlatformFile::PathToAndroidPaths` in the `AndroidPlatformFile.cpp` file.
:::

To change the default configuration settings for the Backtrace client, you can change the settings in the `BacktraceAndroid_UPL.xml` file. For more information, see [Configuring Backtrace for Android](/error-reporting/platform-integrations/android/configuration/) for the backtrace-android library.

Expand Down
271 changes: 271 additions & 0 deletions docs/visual-testing/integrations/espresso.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,271 @@
---
sidebar_label: Espresso
---

import ClippingDescription from '../_partials/_clipping-description.md';

# Espresso Integration

You can use the Sauce Visual Espresso plugin to set up an integration with the Sauce Labs platform and start comparing the visual snapshots generated during your tests.

## Introduction

This guide requires an existing Android JUnit setup.

You can alternatively take a look to our [example repository](#examples).

Sauce Visual Espresso plugin provides a library exposing a `VisualClient` object that provides the method
`sauceVisualCheck()` to take a screenshot and send it to Sauce Visual for comparison.

## Quickstart

### Step 1: Add Sauce Visual dependency

Add [Sauce Visual](https://central.sonatype.com/artifact/com.saucelabs.visual/visual-espresso) dependency to your build.gradle

```groovy
androidTestImplementation 'com.saucelabs.visual:visual-espresso:0.0.1'
```

_Note: You can find the latest versions available [here](https://central.sonatype.com/artifact/com.saucelabs.visual/visual-espresso)._

### Step 2: Configure Visual Testing integration

Declare a VisualClient instance as class variable

```java
import com.saucelabs.visual.VisualClient;

static VisualClient visual = VisualClient.builder(sauceUsername, sauceAccessKey)
.buildName("Sauce Demo Test")
.build();
```

To enhance efficiency in managing tests, it's important to provide a specific test name and suite name for each test. This practice allows Sauce Visual to effectively organize snapshots into coherent groups. As a result, it simplifies the review process, saving time and effort in navigating through test results and understanding the context of each snapshot.

Moreover, our Espresso binding offers an automated solution to this process. By integrating the following code snippet into your tests, Sauce Visual can automatically assign appropriate test names and suite names, streamlining your testing workflow.

```java
import com.saucelabs.visual.junit.TestMetaInfoRule;

import org.junit.Rule;

public class MyJunitTestClass {

@Rule
public TestMetaInfoRule testMetaInfoRule = new TestMetaInfoRule();
}
```

Don't forget to finish the build

```java
import org.junit.AfterClass;

@AfterClass
public static void tearDown() {
if (visual != null) {
visual.finish();
}
}
```

### Step 3: Add visual tests in your tests

Add a check to one of your tests:


```java
import org.junit.Test;

@Test
void checkLogin() {

visual.sauceVisualCheck("Before Login");
}
```

### Step 4: Configure your Sauce Labs credentials

Sauce Visual Espresso expects Sauce Labs username and access key to be passed when initiating the client.
It's recommended to define and pass your Sauce Labs credentials to `VisualClient` as custom `BuildConfig` fields.

```groovy
android {
buildConfigField "String", "SAUCE_USERNAME", "YOUR_SAUCE_USERNAME"
buildConfigField "String", "SAUCE_ACCESS_KEY", "YOUR_SAUCE_ACCESS_KEY"
}
```

```java
import com.saucelabs.visual.VisualClient;

static VisualClient visualClient = VisualClient.builder(
BuildConfig.SAUCE_USERNAME,
BuildConfig.SAUCE_ACCESS_KEY)
.buildName("Espresso Basic Sample")
.build();
```

Username and Access Key can be retrieved from https://app.saucelabs.com/user-settings.

### Step 5: Run the test

Upon executing your tests for the first time under this step, a visual baseline is automatically created in our system. This baseline serves as the standard for all subsequent tests. As new tests are run, they are compared to this original baseline, with any deviations highlighted to signal visual changes. These comparisons are integral for detecting any unintended visual modifications early in your development cycle. All test builds, including the initial baseline and subsequent runs, can be monitored and managed through the Sauce Labs platform at [Sauce Visual Builds](https://app.saucelabs.com/visual/builds).

Remember, the baseline is established during the initial run, and any subsequent visual differences detected will be marked for review.

## Advanced usage

### Customizing Your Build Lifecycle

Following builder methods are available for `VisualClient` if you'd like to manage your build lifecyle externally.

- `buildId(String buildId)`: For advanced users, a user-supplied Sauce Labs Visual build ID. Can be used to create builds in advance using the GraphQL API or CLI tool. This can be used to parallelize tests with multiple browsers, shard, or more. By default, this is not set and we create / finish a build during setup / teardown.
- `customId(String customId)`: 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.

### Build attributes

When creating the service in `VisualClient`, extra fields can be set to define the context, thus acting on which baselines new snapshots will be compared to. ([More info on baseline matching](../../visual-testing.md#baseline-matching))

It needs to be defined through the `VisualApi.Builder` object.

Methods available:

- `buildName(String buildName)`: Sets the name of the build
- `projectName(String project)`: Sets the name of the project
- `branchName(String branch)`: Sets the name of the branch
- `defaultBranchName(String defaultBranch)`: Sets the name of the default branch

Example:

```java
import com.saucelabs.visual.VisualClient;

visual = VisualClient.builder(username, accessKey)
.buildName("Sauce Demo Test")
.branchName("main")
.projectName("Java examples")
.build();
```

### Ignored regions

#### Component-based ignored region

Sauce Visual provides a way to ignore a list of components.

An ignored component can be a specific element from the page.

Those ignored components are specified when requesting a new snapshot.

Example:

```java
import com.saucelabs.visual.VisualCheckOptions;;

visualClient.sauceVisualCheck("Inventory Page",
VisualCheckOptions.builder()
.ignore(withId(R.id.changeTextBt))
.build());
```

#### User-specified ignored region

Alternatively, ignored regions can be user-specified areas. A region is defined by four elements.

- `x`, `y`: The location of the top-left corner of the ignored region
- `width`: The width of the region to ignore
- `height`: The height of the region to ignore

_Note: all values are pixels_

You can also give a name to a region that will be visible in Sauce Visual UI using `name`

Example:

```java

import com.saucelabs.visual.VisualCheckOptions;
import com.saucelabs.visual.model.Region;

visualClient.sauceVisualCheck("Inventory Page",
VisualCheckOptions.builder()
.ignore(Region.builder()
.name("Demo region")
.x(100)
.y(100)
.width(200)
.height(200)
.build())
.build());
```

### Capturing the DOM snapshot

Sauce Visual does not capture DOM snapshots by default. This setting can be changed globally via the build options.

Example:
```java
import com.saucelabs.visual.VisualCheckOptions;

static VisualClient visualClient = VisualClient.builder(
sauceUsername,
sauceAccessKey)
.buildName("Espresso Basic Sample")
.captureDom(true)
.build();
```

You can alternatively enable DOM capturing when initating a visual check.

```java
import com.saucelabs.visual.VisualCheckOptions;

visualClient.sauceVisualCheck("Inventory Page",
VisualCheckOptions.builder()
.captureDom(true)
.build());
```

### Clip to an Element

<ClippingDescription />

Example:

```java
import com.saucelabs.visual.VisualCheckOptions;

visualClient.sauceVisualCheck("Visible Sale Banner",
VisualCheckOptions.builder()
.clipElement(withId(R.id.changeTextBt))
.build());
```
### Full page screenshots

Sauce Visual Espresso allows you to capture the entire scrollable area of your application, ensuring thorough visual testing that includes content beyond the visible viewport.

**Key Behaviors:**
- Capture of Scrollable Areas: The tool focuses exclusively on scrollable content within the defined area, providing an accurate representation of your app's primary interface.
- Exclusions: Static elements outside the scrollable area, such as headers, footers, or overlaying menus, are not included in the full-page screenshot.
- Comparison to Web Page Screenshots: Unlike full-page screenshots for web pages—where the page is scrolled and stitched together from multiple screenshots—Sauce Visual Espresso captures only the designated scrollable area in one seamless snapshot.

This tailored approach ensures precise testing and highlights the elements critical to your application’s user experience.

**Note**: Full-page screenshots for Espresso are in beta and may exhibit unexpected behavior, and DOM capture is not available for these screenshots.

Example:

```java
import com.saucelabs.visual.VisualCheckOptions;

visualClient.sauceVisualCheck("Long content page",
VisualCheckOptions.builder()
.fullPageScreenshot(withId(R.id.scrollView))
.build());
```

## Examples

Click [here](https://github.com/saucelabs/visual-examples/tree/main/espresso) to see the example project.
16 changes: 14 additions & 2 deletions docs/web-apps/automated-testing/_partials/_advanced-nodejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,23 @@ Sauce Labs supports the following Node.js versions:
<th>Removal Date</th>
</tr>
<tbody>
<tr>
<td>22.11.0</td>
<td>jod, lts</td>
<td>April 30, 2027</td>
<td>July 30, 2027</td>
</tr>
<tr>
<td>20.18.1</td>
<td>iron, maintenance</td>
<td>April 30, 2026</td>
<td>July 30, 2026</td>
</tr>
<tr>
<td>20.14.0</td>
<td>iron, lts</td>
<td>October 22, 2024</td>
<td />
<td>April 30, 2026</td>
<td>July 30, 2026</td>
</tr>
</tbody>
</table>
Loading

0 comments on commit 91ce0ed

Please sign in to comment.