Socket
Socket
Sign inDemoInstall

@serenity-js/webdriverio

Package Overview
Dependencies
Maintainers
1
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@serenity-js/webdriverio - npm Package Compare versions

Comparing version 3.3.1 to 3.4.0

16

CHANGELOG.md

@@ -6,2 +6,18 @@ # Change Log

# [3.4.0](https://github.com/serenity-js/serenity-js/compare/v3.3.1...v3.4.0) (2023-06-10)
### Bug Fixes
* **webdriverio:** support for WebdriverIO 8.11 APIs ([cebbeec](https://github.com/serenity-js/serenity-js/commit/cebbeecb1176b2d4bb4d3a1b4a2b48a46ea4b2be)), closes [#1739](https://github.com/serenity-js/serenity-js/issues/1739)
### Features
* **core:** compile Serenity/JS against ES2021 ([6b31184](https://github.com/serenity-js/serenity-js/commit/6b31184986f78b454ec1eeed53553fba8ebc868c))
## [3.3.1](https://github.com/serenity-js/serenity-js/compare/v3.3.0...v3.3.1) (2023-06-08)

@@ -8,0 +24,0 @@

2

esm/adapter/WebdriverIONotifier.js

@@ -166,3 +166,3 @@ import { LogicError } from '@serenity-js/core';

parentSuiteName() {
return this.suites[this.suites.length - 1]?.name.value || '';
return this.suites.at(-1)?.name.value || '';
}

@@ -169,0 +169,0 @@ /**

@@ -13,3 +13,3 @@ import { RootLocator } from '@serenity-js/web';

nativeElement(): Promise<Pick<Browser, '$' | '$$'>>;
switchToFrame(frame: Element): Promise<void>;
switchToFrame(frame: Element | object): Promise<void>;
switchToParentFrame(): Promise<void>;

@@ -16,0 +16,0 @@ switchToMainFrame(): Promise<void>;

@@ -65,3 +65,3 @@ import { LogicError } from '@serenity-js/core';

if (allHandles.length > 0) {
const handle = allHandles[allHandles.length - 1];
const handle = allHandles.at(-1);
await this.browser.switchToWindow(handle);

@@ -68,0 +68,0 @@ return handle;

@@ -15,20 +15,18 @@ "use strict";

runnerAdapterFor(config) {
var _a, _b;
switch ((_a = config === null || config === void 0 ? void 0 : config.serenity) === null || _a === void 0 ? void 0 : _a.runner) {
switch (config?.serenity?.runner) {
case 'cucumber':
return this.cucumberAdapter(config === null || config === void 0 ? void 0 : config.cucumberOpts);
return this.cucumberAdapter(config?.cucumberOpts);
case 'jasmine':
return this.jasmineAdapter(config === null || config === void 0 ? void 0 : config.jasmineOpts);
return this.jasmineAdapter(config?.jasmineOpts);
case 'mocha':
case undefined:
return this.mochaAdapter(config === null || config === void 0 ? void 0 : config.mochaOpts);
return this.mochaAdapter(config?.mochaOpts);
default:
throw new core_1.ConfigurationError(`"${(_b = config === null || config === void 0 ? void 0 : config.serenity) === null || _b === void 0 ? void 0 : _b.runner}" is not a supported test runner. Please use "mocha", "jasmine", or "cucumber"`);
throw new core_1.ConfigurationError(`"${config?.serenity?.runner}" is not a supported test runner. Please use "mocha", "jasmine", or "cucumber"`);
}
}
cucumberAdapter(cucumberOptions) {
var _a;
const { CucumberCLIAdapter, CucumberFormat, StandardOutput, TempFileOutput } = this.loader.require('@serenity-js/cucumber/lib/adapter/index.js');
cucumberOptions === null || cucumberOptions === void 0 ? true : delete cucumberOptions.timeout; // todo: support setting a timeout via config?
cucumberOptions === null || cucumberOptions === void 0 ? true : delete cucumberOptions.parallel; // WebdriverIO handles that already
delete cucumberOptions?.timeout; // todo: support setting a timeout via config?
delete cucumberOptions?.parallel; // WebdriverIO handles that already
const cleanedCucumberOptions = new index_js_1.Config(cucumberOptions)

@@ -50,3 +48,3 @@ .where('require', requires => this.finder.filesMatching(requires).map(p => p.value))

// check if we need to free up stdout for any native reporters
const output = ((_a = cleanedCucumberOptions === null || cleanedCucumberOptions === void 0 ? void 0 : cleanedCucumberOptions.format) === null || _a === void 0 ? void 0 : _a.some(format => new CucumberFormat(format).output === ''))
const output = cleanedCucumberOptions?.format?.some(format => new CucumberFormat(format).output === '')
? new TempFileOutput(this.fileSystem)

@@ -53,0 +51,0 @@ : new StandardOutput();

@@ -38,3 +38,2 @@ "use strict";

constructor(serenity, loader, cwd, cid, webdriverIOConfig, specs, capabilities, reporter) {
var _a;
this.serenity = serenity;

@@ -64,3 +63,3 @@ this.loader = loader;

interactionTimeout: config.serenity.interactionTimeout,
diffFormatter: (_a = config.serenity.diffFormatter) !== null && _a !== void 0 ? _a : new core_1.AnsiDiffFormatter(),
diffFormatter: config.serenity.diffFormatter ?? new core_1.AnsiDiffFormatter(),
actors: config.serenity.actors || core_1.Cast.where(actor => actor.whoCan(index_js_2.BrowseTheWebWithWebdriverIO.using(global.browser), core_1.TakeNotes.usingAnEmptyNotepad())),

@@ -67,0 +66,0 @@ crew: [

@@ -169,4 +169,3 @@ "use strict";

parentSuiteName() {
var _a;
return ((_a = this.suites[this.suites.length - 1]) === null || _a === void 0 ? void 0 : _a.name.value) || '';
return this.suites.at(-1)?.name.value || '';
}

@@ -173,0 +172,0 @@ /**

@@ -13,3 +13,3 @@ import { RootLocator } from '@serenity-js/web';

nativeElement(): Promise<Pick<Browser, '$' | '$$'>>;
switchToFrame(frame: Element): Promise<void>;
switchToFrame(frame: Element | object): Promise<void>;
switchToParentFrame(): Promise<void>;

@@ -16,0 +16,0 @@ switchToMainFrame(): Promise<void>;

@@ -68,3 +68,3 @@ "use strict";

if (allHandles.length > 0) {
const handle = allHandles[allHandles.length - 1];
const handle = allHandles.at(-1);
await this.browser.switchToWindow(handle);

@@ -71,0 +71,0 @@ return handle;

{
"name": "@serenity-js/webdriverio",
"version": "3.3.1",
"version": "3.4.0",
"description": "Serenity/JS reporter and Screenplay Pattern library for WebdriverIO",

@@ -67,5 +67,5 @@ "author": {

"dependencies": {
"@serenity-js/core": "3.3.1",
"@serenity-js/web": "3.3.1",
"@wdio/reporter": "^8.10.6",
"@serenity-js/core": "3.4.0",
"@serenity-js/web": "3.4.0",
"@wdio/reporter": "^8.11.0",
"deepmerge": "^4.3.1",

@@ -78,4 +78,4 @@ "tiny-types": "^1.19.1"

"@serenity-js/mocha": "^3.0.0",
"@wdio/cli": "^8.10.7",
"webdriverio": "^8.10.7"
"@wdio/cli": "^8.11.1",
"webdriverio": "^8.11.1"
},

@@ -96,7 +96,7 @@ "peerDependenciesMeta": {

"@types/mocha": "^10.0.1",
"@wdio/cli": "8.10.7",
"@wdio/devtools-service": "8.10.7",
"@wdio/dot-reporter": "8.10.6",
"@wdio/local-runner": "8.10.7",
"@wdio/spec-reporter": "8.10.6",
"@wdio/cli": "8.11.1",
"@wdio/devtools-service": "8.11.1",
"@wdio/dot-reporter": "8.11.0",
"@wdio/local-runner": "8.11.1",
"@wdio/spec-reporter": "8.11.0",
"@wdio/types": "8.10.4",

@@ -111,5 +111,5 @@ "axios": "^1.4.0",

"start-server-and-test": "^2.0.0",
"webdriverio": "8.10.7"
"webdriverio": "8.11.1"
},
"gitHead": "d036ce75c1eb131d3cde28b04e668dc24f959e2f"
"gitHead": "e69967f05819bc21324f537afc66ddb73adf772d"
}

@@ -233,3 +233,3 @@ import { LogicError, Stage, StageCrewMember } from '@serenity-js/core';

private parentSuiteName() {
return this.suites[this.suites.length - 1]?.name.value || '';
return this.suites.at(-1)?.name.value || '';
}

@@ -236,0 +236,0 @@

@@ -22,3 +22,3 @@ import { RootLocator } from '@serenity-js/web';

async switchToFrame(frame: Element): Promise<void> {
async switchToFrame(frame: Element | object): Promise<void> {
await this.browser.switchToFrame(frame);

@@ -25,0 +25,0 @@ }

@@ -90,3 +90,3 @@ import { LogicError } from '@serenity-js/core';

if (allHandles.length > 0) {
const handle = allHandles[allHandles.length - 1];
const handle = allHandles.at(-1);
await this.browser.switchToWindow(handle);

@@ -93,0 +93,0 @@

@@ -26,3 +26,3 @@ import { LogicError } from '@serenity-js/core';

// eslint-disable-next-line unicorn/consistent-function-scoping
async function removeCharactersFrom(browser: Browser, inputElement: Element, numberOfCharacters: number): Promise<void> {
async function removeCharactersFrom(browser: Browser | Element, inputElement: Element, numberOfCharacters: number): Promise<void> {
await browser.execute(

@@ -257,8 +257,8 @@ /* c8 ignore next */

private async browserFor(nativeElement: Element | Browser): Promise<Browser> {
private async browserFor(nativeElement: Element | Browser): Promise<Element | Browser> {
const element = nativeElement as Element;
return element.parent
? this.browserFor(element.parent)
? this.browserFor(element.parent as (Element | Browser))
: nativeElement
}
}

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

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

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