Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default defineConfig({
- `platform`: The platform you want to test on, such as 'android' or 'ios'.

- `provider`: The device provider where you want to run your tests.
You can choose between `browserstack`, `lambdatest`, `emulator`, or `local-device`.
You can choose between `browserstack`, `lambdatest`, `kobiton`, `emulator`, or `local-device`.

- `buildPath`: The path to your build file. For Android, it should be an APK file.
For iOS, if you are running tests on real device, it should be an `.ipa` file. For running tests on an emulator, it should be a `.app` file.
Expand Down Expand Up @@ -135,6 +135,35 @@ the provider in your config.
},
```

#### Run tests on Kobiton

Appwright supports Kobiton out of the box. To run tests on Kobiton, configure
the provider in your config.


```ts
{
name: "android",
use: {
platform: Platform.ANDROID,
device: {
provider: "kobiton",
// Specify device to run the tests on
// Find devices in the Kobiton portal under Devices
name: "Galaxy S24",
osVersion: "14",
},
buildPath: "app-release.apk",
appBundleId: "com.example.app",
},
},
```
Set the following environment variables before running:

- `KOBITON_USERNAME` — your Kobiton username
- `KOBITON_API_KEY` — your Kobiton API key (from Settings → API Keys)


## Run the sample project

To run the sample project:
Expand Down
15 changes: 15 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ providers are supported:
- `emulator`
- `browserstack`
- `lambdatest`
- `kobiton`

### BrowserStack

Expand All @@ -37,6 +38,20 @@ These environment variables are required for the LambdaTest

LambdaTest also requires `name` and `osVersion` of the device to be set in the projects in appwright config file.

### Kobiton

Kobiton [Real Device Cloud](https://kobiton.com/) can be used to provide
remote devices to Appwright.

These environment variables are required for Kobiton:

- KOBITON_USERNAME
- KOBITON_API_KEY

You can find your API key in the Kobiton portal under **Settings > API Keys**.

Kobiton requires `name` of the device to be set in the projects in appwright config file. `osVersion` is optional but recommended.

### Android Emulator

To run tests on the Android emulator, ensure the following installations are available. If not, follow these steps:
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ import { LocalDeviceProvider } from "./local";
import { EmulatorProvider } from "./emulator";
import { FullProject } from "@playwright/test";
import { LambdaTestDeviceProvider } from "./lambdatest";
import { KobitonDeviceProvider } from "./kobiton";

export function getProviderClass(provider: string): any {
switch (provider) {
case "browserstack":
return BrowserStackDeviceProvider;
case "lambdatest":
return LambdaTestDeviceProvider;
case "kobiton":
return KobitonDeviceProvider;
case "emulator":
return EmulatorProvider;
case "local-device":
Expand Down
Loading