0.3.30 • Published 20 days ago

@appium/plugin-test-support v0.3.30

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
20 days ago

@appium/plugin-test-support

Testing utilities for Appium plugins

This package is for plugin authors to help test their plugins.

Mocha is the supported test framework (but can theoretically be used with others).

Usage

For E2E Tests

The pluginE2EHarness method configures a server and driver for testing via "before all" and "after all"-style hooks.

This example uses WebdriverIO to communicate with a test Appium server.

import {pluginE2EHarness} from '@appium/plugin-test-support';
import {remote} from 'webdriverio';

describe('MyPlugin', function() {
  pluginE2EHarness({
    before: global.before, // from mocha
    after: global.after, // from mocha
    serverArgs: SOME_EXTRA_SERVER_ARGS,
    port: 31337,
    host: '127.0.0.1',
    appiumHome: process.env.APPIUM_HOME, // best practice: use a temp dir instead
    driverName: 'fake', // driver to test with
    driverSource: 'local', // use "local" unless you want appium to install from npm every time
    driverSpec: FAKE_DRIVER_DIR, // path to local driver working copy or installation
    pluginName: 'MyPlugin', // your plugin 
    pluginSource: 'local', // use "local" for this
    pluginSpec: THIS_PLUGIN_DIR, // dir of this plugin's `package.json`
  });

  it('should use my plugin', async function() {
    // at this point, the Appium server will be running with the plugin/driver combination of your
    // choosing

    // port/host should match what you provided to `pluginE2EHarness`
    const browser = await remote({port: 31337, hostname: '127.0.0.1'});
  })
});

License

Apache-2.0

0.3.30

20 days ago

0.3.29

1 month ago

0.3.28

3 months ago

0.3.27

4 months ago

0.3.26

5 months ago

0.3.25

5 months ago

0.3.24

6 months ago

0.3.17

11 months ago

0.3.20

9 months ago

0.3.23

7 months ago

0.3.22

7 months ago

0.3.21

9 months ago

0.3.19

10 months ago

0.3.18

10 months ago

0.3.16

11 months ago

0.3.15

11 months ago

0.3.14

12 months ago

0.3.13

1 year ago

0.3.12

1 year ago

0.3.9

1 year ago

0.3.11

1 year ago

0.3.10

1 year ago

0.3.8

1 year ago

0.3.7

1 year ago

0.3.6

1 year ago

0.3.5

1 year ago

0.3.0

1 year ago

0.2.1

2 years ago

0.3.1

1 year ago

0.2.0

2 years ago