Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

A testcafe browser provider for controlling Android devices locally

License

Notifications You must be signed in to change notification settings

bsmithb2/testcafe-browser-provider-android

Repository files navigation

testcafe-browser-provider-android

Build Status

This is the android browser provider plugin for TestCafe.

Supported Browsers

Chrome

NOTE: This plugin resets Chrome to a freshly installed state on each test.

HELP NEEDED: Maybe someone finds a way to start Chrome in private/incognito mode instead. (See Issue #4)

Firefox

Firefox is started in private mode.

Dependencies: Android Debug Bridge (adb)

In order to communicate with the device, the Android Debug Bridge is required. If you dont want to install Android Studio, the standalone package can be downloaded on https://developer.android.com/studio/releases/platform-tools.html.

Note that the adb command needs to be available on the commandline. (You may need to put it in your PATH enviornment variable.)

Googles guide "Get Started with Remote Debugging Android Devices" guides through the basics of hardware setup, and how to use Chromes Developer Tools on remote devices. (Handy once you found problems that only occur in mobile devices. See also: "Debugging Firefox for Android over USB").

Build

Build has dependencies

npm install -g gulp 
npm install -g testcafe
npm install
gulp build
npm link

Once that is done - you run it by running a test in testcafe, or commands in testcafe.

This command lists all android devices locally

testcafe -b android

This command runs a sample test on an attached android device.

testcafe android exampletests/test.js

Install

npm install testcafe-browser-provider-android

Usage

You can determine the available browser aliases by running

testcafe -b android

When you run tests from the command line, use the alias when specifying browsers:

testcafe android:browser1 'path/to/test/file.js'

When you use API, pass the alias to the browsers() method:

testCafe
    .createRunner()
    .src('path/to/test/file.js')
    .browsers('android:browser1')
    .run();

Author

Bradley Smith (https://bradleysmith.dev)

About

A testcafe browser provider for controlling Android devices locally

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •