Socket
Socket
Sign inDemoInstall

@wdio/types

Package Overview
Dependencies
Maintainers
2
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wdio/types - npm Package Compare versions

Comparing version 7.0.0-beta.0 to 7.0.0-beta.1

199

build/Capabilities.d.ts

@@ -28,11 +28,41 @@ import { WebdriverIO as WebDriverIOOptions, Testrunner as TestrunnerOptions, Connection as ConnectionOptions } from './Options';

export interface Capabilities extends VendorExtensions, ConnectionOptions {
/**
* Identifies the user agent.
*/
browserName?: string;
/**
* Identifies the version of the user agent.
*/
browserVersion?: string;
/**
* Identifies the operating system of the endpoint node.
*/
platformName?: string;
/**
* Indicates whether untrusted and self-signed TLS certificates are implicitly trusted on navigation for the duration of the session.
*/
acceptInsecureCerts?: boolean;
/**
* Defines the current session’s page load strategy.
*/
pageLoadStrategy?: PageLoadingStrategy;
/**
* Defines the current session’s proxy configuration.
*/
proxy?: ProxyObject;
/**
* Indicates whether the remote end supports all of the resizing and repositioning commands.
*/
setWindowRect?: boolean;
/**
* Describes the timeouts imposed on certain session operations.
*/
timeouts?: Timeouts;
/**
* Defines the current session’s strict file interactability.
*/
strictFileInteractability?: boolean;
/**
* Describes the current session’s user prompt handler. Defaults to the dismiss and notify state.
*/
unhandledPromptBehavior?: string;

@@ -97,18 +127,64 @@ }

};
/**
* @deprecated
*/
testobject_api_key?: string;
}
export interface ChromeOptions {
/**
* List of command-line arguments to use when starting Chrome. Arguments with an
* associated value should be separated by a '=' sign (e.g., `['start-maximized', 'user-data-dir=/tmp/temp_profile']`).
* See here for a list of Chrome arguments.
*/
args?: string[];
/**
* Path to the Chrome executable to use (on Mac OS X, this should be the actual binary,
* not just the app. e.g., '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome')
*/
binary?: string;
/**
* A list of Chrome extensions to install on startup. Each item in the list should
* be a base-64 encoded packed Chrome extension (.crx)
*/
extensions?: string[];
/**
* A dictionary with each entry consisting of the name of the preference and its value.
* These preferences are applied to the Local State file in the user data folder.
*/
localState?: {
[name: string]: any;
};
/**
* If false, Chrome will be quit when ChromeDriver is killed, regardless of whether
* the session is quit. If true, Chrome will only be quit if the session is quit
* (or closed). Note, if true, and the session is not quit, ChromeDriver cannot clean
* up the temporary user data directory that the running Chrome instance is using.
*/
detach?: boolean;
/**
* An address of a Chrome debugger server to connect to, in the form of `<hostname/ip:port>`,
* e.g. '127.0.0.1:38947'
*/
debuggerAddress?: string;
/**
* List of Chrome command line switches to exclude that ChromeDriver by default passes
* when starting Chrome. Do not prefix switches with --.
*/
excludeSwitches?: string[];
/**
* Directory to store Chrome minidumps . (Supported only on Linux.)
*/
minidumpPath?: string;
/**
* A dictionary with either a value for “deviceName,” or values for “deviceMetrics” and
* “userAgent.” Refer to Mobile Emulation for more information.
*/
mobileEmulation?: {
[name: string]: any;
};
/**
* An optional dictionary that specifies performance logging preferences. See
* [Chromedriver docs](http://chromedriver.chromium.org/capabilities) for
* more information.
*/
perfLoggingPrefs?: {

@@ -121,7 +197,19 @@ enableNetwork?: boolean;

};
/**
* A dictionary with each entry consisting of the name of the preference and its value.
* These preferences are only applied to the user profile in use. See the 'Preferences'
* file in Chrome's user data directory for examples.
*/
prefs?: {
[name: string]: string | number | boolean;
};
/**
* A list of window types that will appear in the list of window handles. For access
* to <webview> elements, include "webview" in this list.
*/
windowTypes?: string[];
}
/**
* Chromium Edge
*/
interface MicrosoftEdgeOptions extends ChromeOptions {

@@ -186,3 +274,2 @@ }

export interface ChromeCapabilities {
chrome?: string;
chromeOptions?: ChromeOptions;

@@ -348,2 +435,5 @@ mobileEmulationEnabled?: boolean;

}
/**
* see also https://wiki.saucelabs.com/display/DOCS/Test+Configuration+Options
*/
export interface SauceLabsCapabilities {

@@ -404,9 +494,80 @@ name?: string;

accessKey?: string;
localIdentifier?: string;
consoleLogs?: 'disable' | 'errors' | 'warnings' | 'info' | 'verbose';
appiumLogs?: boolean;
video?: boolean;
seleniumLogs?: boolean;
geoLocation?: string;
timezone?: string;
resolution?: string;
'browserstack.maskCommands'?: string[];
idleTimeout?: number;
maskBasicAuth?: boolean;
autoWait?: number;
hosts?: string;
bfcache?: 0 | 1;
wsLocalSupport?: boolean;
deviceName?: string;
realMobile?: boolean;
appiumVersion?: string;
deviceOrientation?: 'portrait' | 'landscape';
customNetwork?: string;
networkProfile?: string;
chrome?: {
driver?: string;
};
edge?: {
enablePopups?: boolean;
};
'browserstack.sendKeys'?: boolean;
safari?: {
enablePopups?: boolean;
allowAllCookies?: boolean;
driver?: string;
};
firefox?: {
driver?: string;
};
browserName?: string;
browserVersion?: string;
acceptSslCerts?: boolean;
}
export interface SauceLabsVisualCapabilities {
/**
* Project name
*/
projectName?: string;
/**
* API Key for user's Screener account.
*/
apiKey?: string;
/**
* A <width>x<height> representation of desired viewport size.
* @default "1024x768"
*/
viewportSize?: string;
/**
* Branch or environment name.
* @example "main"
*/
branch?: string;
/**
* Branch name of project's base branch. Used for baseline branching and merging.
* @example "main"
*/
baseBranch?: string;
/**
* Visual diff options to control validations.
* @default
* ```js
* {
* structure: true,
* layout: true,
* style: true,
* content: true,
* minLayoutPosition: 4,
* minLayoutDimension: 10
* }
* ```
*/
diffOptions?: {

@@ -420,9 +581,45 @@ structure?: boolean;

};
/**
* A comma-delimited list of css selectors to ignore when performing visual diffs.
* @example "#some-id, .some-selector"
*/
ignore?: string;
/**
* Option to set build to failure when new states are found, and to disable
* using new states as a baseline.
*
* This option defaults to true, and can be set to false if user wants new
* states to automatically be the visual baseline without needing to review
* and accept them.
* @default true
*/
failOnNewStates?: boolean;
/**
* Option to automatically accept new and changed states in base branch.
* Assumes base branch should always be correct.
* @default false
*/
alwaysAcceptBaseBranch?: boolean;
/**
* Option to disable independent baseline for each feature branch, and
* only use base branch as baseline. Must be used with "baseBranch" option.
* @default false
*/
disableBranchBaseline?: boolean;
/**
* Option to capture a full-page screenshot using a scrolling and stitching
* strategy instead of using native browser full-page screenshot capabilities.
* @default false
*/
scrollAndStitchScreenshots?: boolean;
/**
* Option to disable adding CORS headers. By default, CORS headers are set
* for all cross-origin requests.
* @default false
*/
disableCORS?: boolean;
}
/**
* https://testingbot.com/support/other/test-options#platform
*/
export interface TestingbotCapabilities {

@@ -429,0 +626,0 @@ name?: string;

@@ -19,2 +19,5 @@ export interface Suite {

ctx: any;
/**
* Mocha flags
*/
description?: string;

@@ -21,0 +24,0 @@ _retriedTest?: any;

@@ -10,7 +10,34 @@ /// <reference types="node" />

export declare type SupportedProtocols = 'webdriver' | 'devtools' | './protocol-stub';
/**
* WebdriverIO allows to connect to different WebDriver endpoints by capability
* so these connection options need to be part of capabilities
*/
export interface Connection {
/**
* Protocol to use when communicating with the Selenium standalone server (or driver).
*
* @default 'http'
*/
protocol?: string;
/**
* Host of your WebDriver server.
*
* @default 'localhost'
*/
hostname?: string;
/**
* Port your WebDriver server is on.
*
* @default 4444
*/
port?: number;
/**
* Path to WebDriver endpoint or grid server.
*
* @default '/'
*/
path?: string;
/**
* Query paramaters that are propagated to the driver server.
*/
queryParams?: {

@@ -21,12 +48,95 @@ [name: string]: string;

export interface WebDriver extends Connection {
/**
* Your cloud service username (only works for [Sauce Labs](https://saucelabs.com),
* [Browserstack](https://www.browserstack.com), [TestingBot](https://testingbot.com),
* [CrossBrowserTesting](https://crossbrowsertesting.com) or
* [LambdaTest](https://www.lambdatest.com) accounts). If set, WebdriverIO will
* automatically set connection options for you. If you don't use a cloud provider this
* can be used to authenticate any other WebDriver backend.
*/
user?: string;
/**
* Your cloud service access key or secret key (only works for
* [Sauce Labs](https://saucelabs.com), [Browserstack](https://www.browserstack.com),
* [TestingBot](https://testingbot.com), [CrossBrowserTesting](https://crossbrowsertesting.com)
* or [LambdaTest](https://www.lambdatest.com) accounts). If set, WebdriverIO will
* automatically set connection options for you. If you don't use a cloud provider this
* can be used to authenticate any other WebDriver backend.
*/
key?: string;
/**
* Defines the capabilities you want to run in your WebDriver session. Check out the
* [WebDriver Protocol](https://w3c.github.io/webdriver/#capabilities) for more details.
* If you want to run multiremote session you need to define an object that has the
* browser instance names as string and their capabilities as values.
*
* @example
* ```js
* // WebDriver/DevTools session
* const browser = remote({
* capabilities: {
* browserName: 'chrome',
* browserVersion: 86
* platformName: 'Windows 10'
* }
* })
*
* // multiremote session
* const browser = remote({
* capabilities: {
* browserA: {
* browserName: 'chrome',
* browserVersion: 86
* platformName: 'Windows 10'
* },
* browserB: {
* browserName: 'firefox',
* browserVersion: 74
* platformName: 'Mac OS X'
* }
* }
* })
* ```
*/
capabilities: W3CCapabilities | DesiredCapabilities;
/**
* Level of logging verbosity.
*
* @default 'info'
*/
logLevel?: WebDriverLogTypes;
/**
* Set specific log levels per logger
* use 'silent' level to disable logger
*/
logLevels?: Record<string, WebDriverLogTypes>;
/**
* Timeout for any WebDriver request to a driver or grid.
*
* @default 120000
*/
connectionRetryTimeout?: number;
/**
* Count of request retries to the Selenium server.
*
* @default 3
*/
connectionRetryCount?: number;
/**
* Specify custom headers to pass into every request.
*/
headers?: {
[name: string]: string;
};
/**
* Allows you to use a custom http/https/http2 [agent](https://www.npmjs.com/package/got#agent) to make requests.
*
* @default
* ```js
* {
* http: new http.Agent({ keepAlive: true }),
* https: new https.Agent({ keepAlive: true })
* }
* ```
*/
agent?: {

@@ -36,4 +146,13 @@ http: http.Agent;

};
/**
* Function intercepting [HTTP request options](https://github.com/sindresorhus/got#options) before a WebDriver request is made.
*/
transformRequest?: (requestOptions: got.Options) => got.Options;
/**
* Function intercepting HTTP response objects after a WebDriver response has arrived.
*/
transformResponse?: (response: got.Response, requestOptions: got.Options) => got.Response;
/**
* Appium direct connect options (see: https://appiumpro.com/editions/86-connecting-directly-to-appium-hosts-in-distributed-environments)
*/
directConnectProtocol?: string;

@@ -43,3 +162,18 @@ directConnectHost?: string;

directConnectPath?: string;
/**
* Whether it requires SSL certificates to be valid in HTTP/s requests
* for an environment which cannot get process environment well.
*
* @default true
*/
strictSSL?: boolean;
/**
* Directory to store all testrunner log files (including reporter logs and `wdio` logs).
* If not set, all logs are streamed to `stdout`. Since most reporters are made to log to
* `stdout`, it is recommended to only use this option for specific reporters where it
* makes more sense to push report into a file (like the `junit` reporter, for example).
*
* When running in standalone mode, the only log generated by WebdriverIO will be
* the `wdio` log.
*/
outputDir?: string;

@@ -52,32 +186,214 @@ }

export interface WebdriverIO extends Omit<WebDriver, 'capabilities'> {
/**
* Defines the capabilities you want to run in your WebDriver session. Check out the
* [WebDriver Protocol](https://w3c.github.io/webdriver/#capabilities) for more details.
* If you want to run a multiremote session you need to define instead of an array of
* capabilities an object that has an arbitrary browser instance name as string and its
* capabilities as values.
*
* @example
* ```js
* // wdio.conf.js
* export.config = {
* // ...
* capabilities: {
* browserName: 'safari',
* platformName: 'MacOS 10.13',
* ...
* }
* }
* ```
*
* @example
* ```
* // wdio.conf.js
* export.config = {
* // ...
* capabilities: {
* browserA: {
* browserName: 'chrome',
* browserVersion: 86
* platformName: 'Windows 10'
* },
* browserB: {
* browserName: 'firefox',
* browserVersion: 74
* platformName: 'Mac OS X'
* }
* }
* })
* ```
*/
capabilities: RemoteCapability;
/**
* Define the protocol you want to use for your browser automation.
* Currently only [`webdriver`](https://www.npmjs.com/package/webdriver) and
* [`devtools`](https://www.npmjs.com/package/devtools) are supported,
* as these are the main browser automation technologies available.
*/
automationProtocol?: SupportedProtocols;
/**
* If running on Sauce Labs, you can choose to run tests between different datacenters:
* US or EU. To change your region to EU, add region: 'eu' to your config.
*/
region?: string;
/**
* Sauce Labs provides a headless offering that allows you to run Chrome and Firefox tests headless.
*/
headless?: boolean;
/**
* Shorten url command calls by setting a base URL.
*/
baseUrl?: string;
/**
* Default timeout for all `waitFor*` commands. (Note the lowercase f in the option name.)
* This timeout only affects commands starting with `waitFor*` and their default wait time.
*/
waitforTimeout?: number;
/**
* Default interval for all `waitFor*` commands to check if an expected state (e.g.,
* visibility) has been changed.
*/
waitforInterval?: number;
}
export interface Testrunner extends Hooks, Omit<WebdriverIO, 'capabilities'>, WebdriverIO.HookFunctionExtension {
/**
* Defines a set of capabilities you want to run in your testrunner session. Check out the
* [WebDriver Protocol](https://w3c.github.io/webdriver/#capabilities) for more details.
* If you want to run a multiremote session you need to define instead of an array of
* capabilities an object that has an arbitrary browser instance name as string and its
* capabilities as values.
*
* @example
* ```js
* // wdio.conf.js
* export.config = {
* // ...
* capabilities: [{
* browserName: 'safari',
* platformName: 'MacOS 10.13',
* ...
* }, {
* browserName: 'microsoftedge',
* platformName: 'Windows 10',
* ...
* }]
* }
* ```
*
* @example
* ```
* // wdio.conf.js
* export.config = {
* // ...
* capabilities: {
* browserA: {
* browserName: 'chrome',
* browserVersion: 86
* platformName: 'Windows 10'
* },
* browserB: {
* browserName: 'firefox',
* browserVersion: 74
* platformName: 'Mac OS X'
* }
* }
* })
* ```
*/
capabilities: RemoteCapabilities;
/**
* Type of runner (currently only "local" is supported)
*/
runner?: 'local';
/**
* Define specs for test execution.
*/
specs?: string[];
/**
* Exclude specs from test execution.
*/
exclude?: string[];
/**
* An object describing various of suites, which you can then specify
* with the --suite option on the wdio CLI.
*/
suites?: Record<string, string[]>;
/**
* Maximum number of total parallel running workers.
*/
maxInstances?: number;
/**
* Maximum number of total parallel running workers per capability.
*/
maxInstancesPerCapability?: number;
/**
* If you want your test run to stop after a specific number of test failures, use bail.
* (It defaults to 0, which runs all tests no matter what.) Note: Please be aware that
* when using a third party test runner (such as Mocha), additional configuration might
* be required.
*/
bail?: number;
/**
* The number of retry attempts for an entire specfile when it fails as a whole.
*/
specFileRetries?: number;
/**
* Delay in seconds between the spec file retry attempts
*/
specFileRetriesDelay?: number;
/**
* Whether or not retried specfiles should be retried immediately or deferred to the end of the queue
*/
specFileRetriesDeferred?: boolean;
/**
* Services take over a specific job you don't want to take care of. They enhance
* your test setup with almost no effort.
*/
services?: ServiceEntry[];
/**
* Defines the test framework to be used by the WDIO testrunner.
*/
framework?: string;
/**
* List of reporters to use. A reporter can be either a string, or an array of
* `['reporterName', { <reporter options> }]` where the first element is a string
* with the reporter name and the second element an object with reporter options.
*/
reporters?: ReporterEntry[];
/**
* Determines in which interval the reporter should check if they are synchronised
* if they report their logs asynchronously (e.g. if logs are streamed to a 3rd
* party vendor).
*/
reporterSyncInterval?: number;
/**
* Determines the maximum time reporters have to finish uploading all their logs
* until an error is being thrown by the testrunner.
*/
reporterSyncTimeout?: number;
/**
* Node arguments to specify when launching child processes.
*/
execArgv?: string[];
/**
* A set of environment variables to be injected into the worker process.
*/
runnerEnv?: Record<string, any>;
/**
* Files to watch when running `wdio` with the `--watch` flag.
*/
filesToWatch?: string[];
/**
* List of cucumber features with line numbers (when using [cucumber framework](https://webdriver.io/docs/frameworks.html#using-cucumber)).
* @default []
*/
cucumberFeaturesWithLineNumbers?: string[];
/**
* flags
*/
watch?: boolean;
/**
* framework options
*/
mochaOpts?: WebdriverIO.MochaOpts;

@@ -84,0 +400,0 @@ jasmineOpts?: WebdriverIO.JasmineOpts;

@@ -12,2 +12,5 @@ /// <reference types="node" />

logFile?: string;
/**
* allow random typings from 3rd party reporters
*/
[key: string]: any;

@@ -21,6 +24,30 @@ }

}
export declare type ReporterEntry = (string | ReporterClass | [
export declare type ReporterEntry = (
/**
* e.g. `services: ['@wdio/allure-reporter']`
*/
string |
/**
* e.g. `services: [CustomReporter]`
*/
ReporterClass |
/**
* e.g. `services: [['@wdio/sauce-service', { ... }]]`
*
* Note: we use `WebdriverIO.ServiceOptions` rather than referencing the
* interface directly to allow other services to extend the service option
* with theirs
*/
[
string,
WebdriverIO.ReporterOption
] | [
] |
/**
* e.g. `services: [[CustomClass, { ... }]]`
*
* Note: we use `WebdriverIO.ServiceOptions` rather than referencing the
* interface directly to allow other services to extend the service option
* with theirs
*/
[
ReporterClass,

@@ -27,0 +54,0 @@ WebdriverIO.ReporterOption

@@ -34,6 +34,34 @@ /// <reference types="node" />

}
export declare type ServiceEntry = (string | HookFunctions | ServiceClass | [
export declare type ServiceEntry = (
/**
* e.g. `services: ['@wdio/sauce-service']`
*/
string |
/**
* e.g. `services: [{ onPrepare: () => { ... } }]`
*/
HookFunctions |
/**
* e.g. `services: [CustomClass]`
*/
ServiceClass |
/**
* e.g. `services: [['@wdio/sauce-service', { ... }]]`
*
* Note: we use `WebdriverIO.ServiceOptions` rather than referencing the
* interface directly to allow other services to extend the service option
* with theirs
*/
[
string,
WebdriverIO.ServiceOption
] | [
] |
/**
* e.g. `services: [[CustomClass, { ... }]]`
*
* Note: we use `WebdriverIO.ServiceOptions` rather than referencing the
* interface directly to allow other services to extend the service option
* with theirs
*/
[
ServiceClass,

@@ -46,19 +74,121 @@ WebdriverIO.ServiceOption

export interface HookFunctions {
/**
* Gets executed once before all workers get launched.
* @param config wdio configuration object
* @param capabilities list of capabilities details
*/
onPrepare?(config: TestrunnerOptions, capabilities: RemoteCapabilities): void;
/**
* Gets executed before a worker process is spawned and can be used to initialise specific service
* for that worker as well as modify runtime environments in an async fashion.
* @param cid capability id (e.g 0-0)
* @param caps object containing capabilities for session that will be spawn in the worker
* @param specs specs to be run in the worker process
* @param args object that will be merged with the main configuration once worker is initialised
* @param execArgv list of string arguments passed to the worker process
*/
onWorkerStart?(cid: string, caps: DesiredCapabilities, specs: string[], args: TestrunnerOptions, execArgv: string[]): void;
/**
* Gets executed after all workers got shut down and the process is about to exit. An error
* thrown in the onComplete hook will result in the test run failing.
* @param exitCode runner exit code
* @param config wdio configuration object
* @param capabilities list of capabilities details
* @param results test results
*/
onComplete?(exitCode: number, config: Omit<TestrunnerOptions, 'capabilities'>, capabilities: DesiredCapabilities, results: any): void;
/**
* Gets executed when a refresh happens.
* @param oldSessionId session id of old session
* @param newSessionId session id of new session
*/
onReload?(oldSessionId: string, newSessionId: string): void;
/**
* Gets executed before test execution begins. At this point you can access to all global
* variables like `browser`. It is the perfect place to define custom commands.
* @param capabilities list of capabilities details
* @param specs specs to be run in the worker process
* @param browser instance of created browser/device session
*/
before?(capabilities: RemoteCapability, specs: string[], browser: any): void;
/**
* Runs before a WebdriverIO command gets executed.
* @param commandName command name
* @param args arguments that command would receive
*/
beforeCommand?(commandName: string, args: any[]): void;
/**
* Hook that gets executed _before_ a hook within the suite starts (e.g. runs before calling
* beforeEach in Mocha). `stepData` and `world` are Cucumber framework specific properties.
* @param test details to current running test (or step in Cucumber)
* @param context context to current running test
* @param stepData Cucumber step data
* @param world Cucumber world
*/
beforeHook?(test: any, context: any, stepData?: any, world?: any): void;
/**
* Gets executed just before initialising the webdriver session and test framework. It allows you
* to manipulate configurations depending on the capability or spec.
* @param config wdio configuration object
* @param capabilities list of capabilities details
* @param specs list of spec file paths that are to be run
*/
beforeSession?(config: Omit<TestrunnerOptions, 'capabilities'>, capabilities: RemoteCapability, specs: string[]): void;
/**
* Hook that gets executed before the suite starts.
* @param suite suite details
*/
beforeSuite?(suite: Suite): void;
/**
* Function to be executed before a test (in Mocha/Jasmine) starts.
* @param test details to current running test (or step in Cucumber)
* @param context context to current running test
*/
beforeTest?(test: Test, context: any): void;
/**
* Function to be executed after a test (in Mocha/Jasmine) ends.
* @param test details to current running test (or step in Cucumber)
* @param context context to current running test
* @param result test result
*/
afterTest?(test: Test, context: any, result: TestResult): void;
/**
* Hook that gets executed after the suite has ended
* @param suite suite details
*/
afterSuite?(suite: Suite): void;
/**
* Hook that gets executed _after_ a hook within the suite ends (e.g. runs after calling
* afterEach in Mocha). `stepData` and `world` are Cucumber framework specific.
* @param test details to current running test (or step in Cucumber)
* @param context context to current running test
* @param result test result
* @param stepData Cucumber step data
* @param world Cucumber world
*/
afterHook?(test: Test, context: any, result: TestResult): void;
/**
* Gets executed after all tests are done. You still have access to all global variables from
* the test.
* @param result number of total failing tests
* @param capabilities list of capabilities details
* @param specs list of spec file paths that are to be run
*/
after?(result: number, capabilities: RemoteCapability, specs: string[]): void;
/**
* Runs after a WebdriverIO command gets executed
* @param commandName command name
* @param args arguments that command would receive
* @param result result of the command
* @param error error in case something went wrong
*/
afterCommand?(commandName: string, args: any[], result: any, error?: Error): void;
/**
* Gets executed right after terminating the webdriver session.
* @param config wdio configuration object
* @param capabilities list of capabilities details
* @param specs list of spec file paths that are to be run
*/
afterSession?(config: TestrunnerOptions, capabilities: RemoteCapability, specs: string[]): void;
}
//# sourceMappingURL=Services.d.ts.map

4

package.json
{
"name": "@wdio/types",
"version": "7.0.0-beta.0",
"version": "7.0.0-beta.1",
"description": "Utility package providing type information for a variety of WebdriverIO interfaces",

@@ -34,3 +34,3 @@ "author": "Christian Bromann <christian@saucelabs.com>",

},
"gitHead": "bf31660d60ad4dacf04d11ff1590e794dd377dc0"
"gitHead": "8d9ac36cadb5ccba689ce76173ef0545ee72df86"
}

@@ -1,37 +0,33 @@

WebdriverIO Protocol Helper
===========================
WebdriverIO Types
=================
This package stores the definition for various automation protocols such as [WebDriver](https://w3c.github.io/webdriver/) or vendor specific protocol extensions like for [SauceLabs](https://saucelabs.com/). Unless you are interested in generating a WebDriver client there should be no reason why you should need this package. This package holds the definition of the following protocols:
This package contains a bunch of TypeScript types for internal WebdriverIO consumption. Feel free however to use them in your TypeScript project too.
- [WebDriver](https://w3c.github.io/webdriver/)
- [JSON Wire Protocol](https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol)
- [Appium](http://appium.io/)
- [Mobile JSON Wire Protocol](https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md)
- [Sauce Labs](https://saucelabs.com/)
- Chrome (WebDriver extension when running Chromedriver)
- Selenium (when running Selenium Standalone Server)
## Install
To install the package, run:
To install this package from NPM run:
```sh
$ npm install @wdio/protocols
$ npm i @wdio/types
```
## Usage
## Example
You can get data by importing the package as follows:
The package exports the following major type bundles: `Capabilities`, `Clients`, `Options`, `Services`, `Frameworks` and ` Reporters`. A lot of them are very WebdriverIO specific but you can leverage some, e.g.
```js
import { WebDriverProtocol, MJsonWProtocol, JsonWProtocol, AppiumProtocol, ChromiumProtocol, SauceLabsProtocol, SeleniumProtocol } from '@wdio/protocols'
import { Capabilities } from '@wdio/types';
/**
* get description of session command
*/
console.log(WebDriverProtocol['/session'].POST.description)
const w3cCaps: Capabilities.W3CCapabilities = {
alwaysMatch: {...},
firstMatch: [],
// fails with "Object literal may only specify known properties, and 'invalid' does not exist in type 'W3CCapabilities'.ts(2322)"
invalid: 42
}
```
For details please take a look into the individual files.
----
For more information on WebdriverIO see the [homepage](https://webdriver.io).

@@ -6,3 +6,4 @@ {

"outDir": "build",
"rootDir": "src"
"rootDir": "src",
"removeComments": false
},

@@ -9,0 +10,0 @@ "include": [

@@ -6,3 +6,4 @@ {

"outDir": "build",
"rootDir": "src"
"rootDir": "src",
"removeComments": false
},

@@ -9,0 +10,0 @@ "include": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc