1.3.3 • Published 8 years ago

mobile-json-wire-protocol v1.3.3

Weekly downloads
36
License
Apache-2.0
Repository
github
Last release
8 years ago

mobile-json-wire-protocol

NPM version Downloads Dependency Status devDependency Status

Build Status Coverage Status

An abstraction of the Mobile JSON Wire Protocol (spec) with Appium extensions (as specified here).

Endpoints in the protocol

The Mobile JSON Wire Protocol package gives access to a number of endpoints documented here.

MobileJsonWireProtocol

The basic class, subclassed by drivers that will use the protocol.

routeConfiguringFunction (driver)

This function gives drivers access to the protocol routes. It returns a function that itself will take an Express application.

isSessionCommand (command)

Checks if the command needs to have a session associated with it.

ALL_COMMANDS

An array of all the commands that will be dispatched to by the Mobile JSON Wire Proxy endpoints.

NO_SESSION_ID_COMMANDS

An array of commands that do not need a session associated with them.

Errors

This package exports a number of classes and methods related to Selenium error handling. There are error classes for each Selenium error type (see here, as well as the context errors in the mobile spec). The list of errors, and their meanings, can be found here.

There are, in addition, two helper methods for dealing with errors

isErrorType (err, type)

  • checks if the err object is a Mobile JSON Wire Protocol error of a particular type
  • arguments
    • err - the error object to test
    • type - the error class to test against
  • usage

    import { errors, isErrorType } from 'mobile-json-wire-protocol';
    
    try {
      // do some stuff...
    } catch (err) {
      if (isErrorType(err, errors.InvalidCookieDomainError)) {
        // process...
      }
    }

errorFromCode (code, message)

  • retrieve the appropriate error for an error code, with the supplied message.
  • arguments
    • code - the integer error code for a Mobile JSON Wire Protocol error
    • message - the message to be encapsulated in the error
  • usage

    import { errors, errorFromCode } from 'mobile-json-wire-protocol';
    
    let error = errorFromCode(6, 'an error has occurred');
    
    console.log(error instanceof errors.NoSuchDriverError);
    // => true
    
    console.log(error.message === 'an error has occurred');
    // => true
1.3.3

8 years ago

1.3.2

8 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.22.8

9 years ago

0.22.7

9 years ago

0.22.6

9 years ago

0.22.5

9 years ago

0.22.4

9 years ago

0.22.3

9 years ago

0.22.2

9 years ago

0.22.1

9 years ago

0.22.0

9 years ago

0.21.0

9 years ago

0.20.0

9 years ago

0.19.0

9 years ago

0.18.0

9 years ago

0.17.0

9 years ago

0.16.0

9 years ago

0.15.0

9 years ago

0.14.0

9 years ago

0.13.0

9 years ago

0.12.6

9 years ago

0.12.5

9 years ago

0.12.4

9 years ago

0.12.3

9 years ago

0.12.2

9 years ago

0.12.1

9 years ago

0.12.0

9 years ago

0.11.0

9 years ago

0.10.7

9 years ago

0.10.6

9 years ago

0.10.5

9 years ago

0.10.4

9 years ago

0.10.3

9 years ago

0.10.2

9 years ago

0.10.1

9 years ago

0.10.0

9 years ago

0.9.1

9 years ago

0.9.0

9 years ago

0.8.2

9 years ago

0.8.1

9 years ago

0.8.0

9 years ago

0.7.3

9 years ago

0.7.2

9 years ago

0.7.1

9 years ago

0.7.0

9 years ago

0.6.1

9 years ago

0.6.0

9 years ago

0.5.0

9 years ago

0.4.0

9 years ago

0.3.0

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago