Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding electron.md for Electron beta documentation #2446

Merged
merged 14 commits into from
Dec 4, 2023
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions docs/web-apps/automated-testing/electron.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
id: electron
title: Electron Support on Sauce Labs [Beta]
sidebar_label: Electron
mfranzonello2 marked this conversation as resolved.
Show resolved Hide resolved
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import useBaseUrl from '@docusaurus/useBaseUrl';

[Electron](https://electronjs.org/) embeds Chromium and Node.js to enable web developers to create desktop applications. Sauce Labs is beta trialing support for automated testing with Electron-based apps on Windows 10 and 11, available to all users with VDC concurrency at US West or EU Central.
mfranzonello2 marked this conversation as resolved.
Show resolved Hide resolved

## Supported Testing Platforms

Sauce Labs currently supports the following test configurations for Electron.
### Platforms
Windows 10, Windows 11 (Linux and MacOS 13 support to come)
### Electron versions
versions 5 - 25
mfranzonello2 marked this conversation as resolved.
Show resolved Hide resolved

## How to Get Started

### App management

Upload a zip file containing your Electron app via [REST API](/mobile-apps/app-storage/#uploading-apps-via-rest-api). You can refer to uploaded apps by either the app_id or app_name. Note that as with mobile apps, Electron apps are accessible only to members of the same team, and retained for 60 days.
mfranzonello2 marked this conversation as resolved.
Show resolved Hide resolved
mfranzonello2 marked this conversation as resolved.
Show resolved Hide resolved

### Binary location

The binary location is the folderpath and filename of your Electron executable within your zip file structure.
mfranzonello2 marked this conversation as resolved.
Show resolved Hide resolved

For example, if your zip file is structured like this:
```
SauceLabsElectronAppv1.zip
-- [ Sauce Labs Test ]
mfranzonello2 marked this conversation as resolved.
Show resolved Hide resolved
-- SauceLabsElectronApp.exe
-- mobi.dll
-- [ resources ]
-- ffmpeg.dll
[ guide ]
-- config.yaml
-- readme.txt
```

then the `binary` value is `'Sauce Labs Test\SauceLabsElecronApp.exe'`.

### Configuring your tests

You need to specify Electron as the browser name along with the Electron version needed as the browser version. You will also need to include either the file_id or file_name of your uploaded zip file containing your Electron app, with the path to the binary inside that zip.
mfranzonello2 marked this conversation as resolved.
Show resolved Hide resolved
Example written in Python with an Electron app test running on Windows 11 with Chromedriver 19 at US West:

```
mfranzonello2 marked this conversation as resolved.
Show resolved Hide resolved
mfranzonello2 marked this conversation as resolved.
Show resolved Hide resolved
options = ChromeOptions()
options.set_capability('browserName', 'electron')
options.browser_version = '19'
options.platform_name = 'Windows 11'
options.binary_location='<app_folder_name>\<app_file_name.exe>'
sauce_options = {}
sauce_options['username'] = ‘<username>’
sauce_options['accessKey'] = ‘<accesskey>’
sauce_options['app'] = 'storage:<file_id>'
mfranzonello2 marked this conversation as resolved.
Show resolved Hide resolved
options.set_capability('sauce:options', sauce_options)
url = 'https://ondemand.us-west-1.saucelabs.com:443/wd/hub'
driver = webdriver.Remote(command_executor=url, options=options)
```

## Viewing results

Test results are visible on the UI under “Automated Tests > Test Results.’ You can filter directly for Electron test results by selecting “Electron” from the “Browser” drop-down.
mfranzonello2 marked this conversation as resolved.
Show resolved Hide resolved

## Limitations

Electron support is currently enabled only for automated testing on Windows 10 and 11. Electron apps uploaded via REST API are not currently visible within the App Management of the UI. Live testing and UI enhancements to come in a future release.
mfranzonello2 marked this conversation as resolved.
Show resolved Hide resolved
Loading