@wdio/sync
Advanced tools
Comparing version 6.0.0-beta.0 to 6.0.0-beta.1
{ | ||
"name": "@wdio/sync", | ||
"version": "6.0.0-beta.0", | ||
"version": "6.0.0-beta.1", | ||
"description": "A WebdriverIO plugin. Helper module to run WebdriverIO commands synchronously", | ||
@@ -43,3 +43,3 @@ "author": "Christian Bromann <christian@saucelabs.com>", | ||
}, | ||
"gitHead": "478c5546246ce47c8344d29a4d36d067ab3a6983" | ||
"gitHead": "0e39d97e2a6318e01a8dd782ca3c1347cf766907" | ||
} |
@@ -25,26 +25,15 @@ // -------------------- ATTENTION -------------------- | ||
interface Cookie { | ||
name: string, | ||
value: string, | ||
domain?: string, | ||
path?: string, | ||
expiry?: number, | ||
sameSite?: boolean, | ||
isSecure?: boolean, | ||
isHttpOnly?: boolean | ||
} | ||
interface CSSProperty { | ||
property: string, | ||
value: any, | ||
property: string; | ||
value: any; | ||
parsed?: { | ||
// other | ||
unit?: string, | ||
unit?: string; | ||
// font-family | ||
value?: any, | ||
string: string, | ||
value?: any; | ||
string: string; | ||
// color | ||
hex?: string, | ||
alpha?: number, | ||
type?: string, | ||
hex?: string; | ||
alpha?: number; | ||
type?: string; | ||
rgba?: string | ||
@@ -60,25 +49,117 @@ } | ||
interface ServiceOption { | ||
[key: string]: any; | ||
} | ||
interface ServiceWithOption extends Array<string|ServiceOption>{ 0: string; 1: ServiceOption } | ||
type ServiceEntry = string | HookFunctions | [string, ServiceOption] | ||
interface Options { | ||
runner?: string, | ||
specs?: string[], | ||
exclude?: string[], | ||
suites?: object, | ||
maxInstances?: number, | ||
maxInstancesPerCapability?: number, | ||
capabilities?: WebDriver.DesiredCapabilities[] | MultiRemoteCapabilities, | ||
outputDir?: string, | ||
baseUrl?: string, | ||
bail?: number, | ||
specFileRetries?: number, | ||
readonly specFileRetryAttempts?: number, | ||
waitforTimeout?: number, | ||
waitforInterval?: number, | ||
framework?: string, | ||
mochaOpts?: object, | ||
jasmineNodeOpts?: object, | ||
reporters?: (string | object)[], | ||
services?: (string | object)[], | ||
execArgv?: string[], | ||
runner?: string; | ||
/** | ||
* Your cloud service username (only works for Sauce Labs, Browserstack, TestingBot, | ||
* CrossBrowserTesting or LambdaTest accounts). If set, WebdriverIO will automatically | ||
* set connection options for you. | ||
*/ | ||
user?: string; | ||
/** | ||
* Your cloud service access key or secret key (only works for Sauce Labs, Browserstack, | ||
* TestingBot, CrossBrowserTesting or LambdaTest accounts). If set, WebdriverIO will | ||
* automatically set connection options for you. | ||
*/ | ||
key?: string; | ||
/** | ||
* 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?: string; | ||
/** | ||
* 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?: object; | ||
/** | ||
* Maximum number of total parallel running workers. | ||
*/ | ||
maxInstances?: number; | ||
/** | ||
* Maximum number of total parallel running workers per capability. | ||
*/ | ||
maxInstancesPerCapability?: number; | ||
capabilities?: WebDriver.DesiredCapabilities[] | MultiRemoteCapabilities; | ||
/** | ||
* 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; | ||
/** | ||
* Shorten url command calls by setting a base URL. | ||
*/ | ||
baseUrl?: string; | ||
/** | ||
* 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; | ||
readonly specFileRetryAttempts?: number; | ||
/** | ||
* 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; | ||
/** | ||
* Defines the test framework to be used by the WDIO testrunner. | ||
*/ | ||
framework?: string; | ||
/** | ||
* Mocha specific configurations. | ||
*/ | ||
mochaOpts?: object; | ||
/** | ||
* Mocha specific configurations. | ||
*/ | ||
jasmineNodeOpts?: object; | ||
/** | ||
* 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?: (string | object)[]; | ||
/** | ||
* 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[]; | ||
/** | ||
* Node arguments to specify when launching child processes. | ||
*/ | ||
execArgv?: string[]; | ||
featureFlags?: { | ||
specFiltering?: boolean, | ||
specFiltering?: boolean | ||
}, | ||
@@ -103,2 +184,7 @@ } | ||
interface HookFunctions { | ||
/** | ||
* Gets executed once before all workers get launched. | ||
* @param config wdio configuration object | ||
* @param capabilities list of capabilities details | ||
*/ | ||
onPrepare?( | ||
@@ -109,2 +195,11 @@ config: Config, | ||
/** | ||
* 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?( | ||
@@ -118,6 +213,33 @@ cid: string, | ||
onComplete?(exitCode: number, config: Config, capabilities: WebDriver.DesiredCapabilities, results: Results): 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: Config, | ||
capabilities: WebDriver.DesiredCapabilities, | ||
results: Results | ||
): void; | ||
onReload?(oldSessionId: string, newSessionId: string): 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 | ||
*/ | ||
before?( | ||
@@ -128,2 +250,7 @@ capabilities: WebDriver.DesiredCapabilities, | ||
/** | ||
* Runs before a WebdriverIO command gets executed. | ||
* @param commandName command name | ||
* @param args arguments that command would receive | ||
*/ | ||
beforeCommand?( | ||
@@ -134,4 +261,19 @@ commandName: string, | ||
/** | ||
* 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?( | ||
@@ -143,4 +285,24 @@ config: Config, | ||
/** | ||
* 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; | ||
/** | ||
* 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: any, context: any, result: { | ||
@@ -154,2 +316,9 @@ error?: any, | ||
/** | ||
* 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?( | ||
@@ -161,2 +330,9 @@ result: number, | ||
/** | ||
* 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?( | ||
@@ -169,2 +345,8 @@ commandName: string, | ||
/** | ||
* 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?( | ||
@@ -176,3 +358,14 @@ config: Config, | ||
/** | ||
* Hook that gets executed after the suite has ended | ||
* @param suite suite details | ||
*/ | ||
afterSuite?(suite: Suite): 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: { | ||
@@ -209,2 +402,7 @@ error?: any, | ||
type DataMatcher = { | ||
name: string, | ||
args: Array<string> | ||
} | ||
type ReactSelectorOptions = { | ||
@@ -280,3 +478,3 @@ props?: object, | ||
$$( | ||
selector: string | Function | ||
selector: string | Function | DataMatcher | ||
): ElementArray; | ||
@@ -292,3 +490,3 @@ | ||
$( | ||
selector: string | Function | ||
selector: string | Function | DataMatcher | ||
): Element; | ||
@@ -725,3 +923,3 @@ | ||
names?: string[] | string | ||
): Cookie[]; | ||
): WebDriver.Cookie[]; | ||
@@ -811,3 +1009,3 @@ /** | ||
setCookies( | ||
cookie: Cookie[] | Cookie | ||
cookie: WebDriver.Cookie[] | WebDriver.Cookie | ||
): void; | ||
@@ -814,0 +1012,0 @@ |
@@ -33,2 +33,3 @@ /// <reference types="@wdio/sync/webdriverio-core"/> | ||
declare var browser: WebdriverIO.BrowserObject; | ||
declare var driver: WebdriverIO.BrowserObject; | ||
@@ -35,0 +36,0 @@ /** |
51196
1285
11