@wdio/utils
Advanced tools
Comparing version 8.18.0 to 8.18.2
@@ -13,2 +13,3 @@ import fs from 'node:fs'; | ||
import { start as startEdgedriver, findEdgePath } from 'edgedriver'; | ||
import { isAppiumCapability } from '../utils.js'; | ||
import { parseParams, setupPuppeteerBrowser, definesRemoteDriver, setupChromedriver, isChrome, isFirefox, isEdge, isSafari, getCacheDir } from './utils.js'; | ||
@@ -41,6 +42,8 @@ import { SUPPORTED_BROWSERNAMES } from '../constants.js'; | ||
*/ | ||
if (isAppiumCapability(caps)) { | ||
return; | ||
} | ||
if (!caps.browserName) { | ||
throw new Error('No "browserName" defined in capabilities nor hostname or port found!\n' + | ||
'If you like to run a mobile session with Appium, make sure to set "hostname" and "port" in your ' + | ||
'WebdriverIO options. If you like to run a local browser session make sure to pick from one of ' + | ||
'If you like to run a local browser session make sure to pick from one of ' + | ||
`the following browser names: ${Object.values(SUPPORTED_BROWSERNAMES).flat(Infinity)}`); | ||
@@ -47,0 +50,0 @@ } |
import initialisePlugin from './initialisePlugin.js'; | ||
import { initialiseWorkerService, initialiseLauncherService } from './initialiseServices.js'; | ||
import webdriverMonad from './monad.js'; | ||
import { commandCallStructure, isValidParameter, getArgumentType, safeImport, isFunctionAsync, transformCommandLogResult, canAccess, sleep } from './utils.js'; | ||
import { commandCallStructure, isValidParameter, getArgumentType, safeImport, isFunctionAsync, transformCommandLogResult, canAccess, sleep, isAppiumCapability } from './utils.js'; | ||
import { wrapCommand, executeHooksWithArgs, executeAsync } from './shim.js'; | ||
@@ -11,3 +11,3 @@ import { testFnWrapper, wrapGlobalTestMethod } from './test-framework/index.js'; | ||
import { UNICODE_CHARACTERS } from './constants.js'; | ||
export { initialisePlugin, initialiseLauncherService, initialiseWorkerService, isFunctionAsync, transformCommandLogResult, webdriverMonad, commandCallStructure, isValidParameter, getArgumentType, safeImport, canAccess, sleep, startWebDriver, setupBrowser, setupDriver, | ||
export { initialisePlugin, initialiseLauncherService, initialiseWorkerService, isFunctionAsync, transformCommandLogResult, webdriverMonad, commandCallStructure, isValidParameter, getArgumentType, safeImport, canAccess, sleep, isAppiumCapability, startWebDriver, setupBrowser, setupDriver, | ||
/** | ||
@@ -14,0 +14,0 @@ * runner shim |
@@ -5,3 +5,3 @@ /* istanbul ignore file */ | ||
import webdriverMonad from './monad.js'; | ||
import { commandCallStructure, isValidParameter, getArgumentType, safeImport, isFunctionAsync, transformCommandLogResult, canAccess, sleep } from './utils.js'; | ||
import { commandCallStructure, isValidParameter, getArgumentType, safeImport, isFunctionAsync, transformCommandLogResult, canAccess, sleep, isAppiumCapability } from './utils.js'; | ||
import { wrapCommand, executeHooksWithArgs, executeAsync } from './shim.js'; | ||
@@ -13,3 +13,3 @@ import { testFnWrapper, wrapGlobalTestMethod } from './test-framework/index.js'; | ||
import { UNICODE_CHARACTERS } from './constants.js'; | ||
export { initialisePlugin, initialiseLauncherService, initialiseWorkerService, isFunctionAsync, transformCommandLogResult, webdriverMonad, commandCallStructure, isValidParameter, getArgumentType, safeImport, canAccess, sleep, startWebDriver, setupBrowser, setupDriver, | ||
export { initialisePlugin, initialiseLauncherService, initialiseWorkerService, isFunctionAsync, transformCommandLogResult, webdriverMonad, commandCallStructure, isValidParameter, getArgumentType, safeImport, canAccess, sleep, isAppiumCapability, startWebDriver, setupBrowser, setupDriver, | ||
/** | ||
@@ -16,0 +16,0 @@ * runner shim |
@@ -76,2 +76,9 @@ import type { Services } from '@wdio/types'; | ||
export declare const sleep: (ms?: number) => Promise<unknown>; | ||
/** | ||
* Checks if the provided WebdriverIO capabilities object is related to Appium. | ||
* | ||
* @param {WebdriverIO.Capabilities} caps - The capabilities object to check. | ||
* @returns {boolean} Returns true if the provided capabilities are related to Appium, false otherwise. | ||
*/ | ||
export declare function isAppiumCapability(caps: WebdriverIO.Capabilities): boolean; | ||
//# sourceMappingURL=utils.d.ts.map |
@@ -269,1 +269,12 @@ import fs from 'node:fs'; | ||
export const sleep = (ms = 0) => new Promise((r) => setTimeout(r, ms)); | ||
/** | ||
* Checks if the provided WebdriverIO capabilities object is related to Appium. | ||
* | ||
* @param {WebdriverIO.Capabilities} caps - The capabilities object to check. | ||
* @returns {boolean} Returns true if the provided capabilities are related to Appium, false otherwise. | ||
*/ | ||
export function isAppiumCapability(caps) { | ||
return Boolean(caps && | ||
// @ts-expect-error outdated jsonwp cap | ||
(caps.automationName || caps['appium:automationName'] || caps.deviceName || caps.appiumVersion)); | ||
} |
{ | ||
"name": "@wdio/utils", | ||
"version": "8.18.0", | ||
"version": "8.18.2", | ||
"description": "A WDIO helper utility to provide several utility functions used across the project.", | ||
@@ -51,3 +51,3 @@ "author": "Christian Bromann <mail@bromann.dev>", | ||
}, | ||
"gitHead": "66cd3ccfe1c8a94f89afa11fb51f58742ae379c5" | ||
"gitHead": "910c79f1640f0100e763a507fdcaee9e4f52560f" | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
152738
3164