@serenity-js/webdriverio 3.10.2 → 3.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/esm/adapter/WebdriverIOFrameworkAdapter.d.ts +1 -0
- package/esm/adapter/WebdriverIOFrameworkAdapter.d.ts.map +1 -1
- package/esm/adapter/WebdriverIOFrameworkAdapter.js +1 -0
- package/esm/adapter/WebdriverIOFrameworkAdapter.js.map +1 -1
- package/esm/config/WebdriverIOConfig.d.ts +35 -68
- package/esm/config/WebdriverIOConfig.d.ts.map +1 -1
- package/esm/screenplay/abilities/BrowseTheWebWithWebdriverIO.d.ts +3 -3
- package/esm/screenplay/abilities/BrowseTheWebWithWebdriverIO.d.ts.map +1 -1
- package/esm/screenplay/abilities/BrowseTheWebWithWebdriverIO.js +1 -0
- package/esm/screenplay/abilities/BrowseTheWebWithWebdriverIO.js.map +1 -1
- package/esm/screenplay/models/WebdriverIOBrowsingSession.d.ts +3 -3
- package/esm/screenplay/models/WebdriverIOBrowsingSession.d.ts.map +1 -1
- package/esm/screenplay/models/WebdriverIOBrowsingSession.js +1 -0
- package/esm/screenplay/models/WebdriverIOBrowsingSession.js.map +1 -1
- package/esm/screenplay/models/WebdriverIOCookie.d.ts +2 -2
- package/esm/screenplay/models/WebdriverIOCookie.d.ts.map +1 -1
- package/esm/screenplay/models/WebdriverIOCookie.js +1 -0
- package/esm/screenplay/models/WebdriverIOCookie.js.map +1 -1
- package/esm/screenplay/models/WebdriverIOModalDialogHandler.d.ts +2 -2
- package/esm/screenplay/models/WebdriverIOModalDialogHandler.d.ts.map +1 -1
- package/esm/screenplay/models/WebdriverIOModalDialogHandler.js +1 -0
- package/esm/screenplay/models/WebdriverIOModalDialogHandler.js.map +1 -1
- package/esm/screenplay/models/WebdriverIOPage.d.ts +6 -6
- package/esm/screenplay/models/WebdriverIOPage.d.ts.map +1 -1
- package/esm/screenplay/models/WebdriverIOPage.js +1 -0
- package/esm/screenplay/models/WebdriverIOPage.js.map +1 -1
- package/esm/screenplay/models/WebdriverIOPageElement.d.ts +2 -2
- package/esm/screenplay/models/WebdriverIOPageElement.d.ts.map +1 -1
- package/esm/screenplay/models/WebdriverIOPageElement.js +1 -0
- package/esm/screenplay/models/WebdriverIOPageElement.js.map +1 -1
- package/esm/screenplay/models/locators/WebdriverIOLocator.d.ts +14 -14
- package/esm/screenplay/models/locators/WebdriverIOLocator.d.ts.map +1 -1
- package/esm/screenplay/models/locators/WebdriverIOLocator.js +1 -0
- package/esm/screenplay/models/locators/WebdriverIOLocator.js.map +1 -1
- package/esm/screenplay/models/locators/WebdriverIORootLocator.d.ts +4 -4
- package/esm/screenplay/models/locators/WebdriverIORootLocator.d.ts.map +1 -1
- package/esm/screenplay/models/locators/WebdriverIORootLocator.js +1 -0
- package/esm/screenplay/models/locators/WebdriverIORootLocator.js.map +1 -1
- package/lib/adapter/WebdriverIOFrameworkAdapter.d.ts +1 -0
- package/lib/adapter/WebdriverIOFrameworkAdapter.d.ts.map +1 -1
- package/lib/adapter/WebdriverIOFrameworkAdapter.js +1 -0
- package/lib/adapter/WebdriverIOFrameworkAdapter.js.map +1 -1
- package/lib/config/WebdriverIOConfig.d.ts +35 -68
- package/lib/config/WebdriverIOConfig.d.ts.map +1 -1
- package/lib/screenplay/abilities/BrowseTheWebWithWebdriverIO.d.ts +3 -3
- package/lib/screenplay/abilities/BrowseTheWebWithWebdriverIO.d.ts.map +1 -1
- package/lib/screenplay/abilities/BrowseTheWebWithWebdriverIO.js +1 -0
- package/lib/screenplay/abilities/BrowseTheWebWithWebdriverIO.js.map +1 -1
- package/lib/screenplay/models/WebdriverIOBrowsingSession.d.ts +3 -3
- package/lib/screenplay/models/WebdriverIOBrowsingSession.d.ts.map +1 -1
- package/lib/screenplay/models/WebdriverIOBrowsingSession.js +1 -0
- package/lib/screenplay/models/WebdriverIOBrowsingSession.js.map +1 -1
- package/lib/screenplay/models/WebdriverIOCookie.d.ts +2 -2
- package/lib/screenplay/models/WebdriverIOCookie.d.ts.map +1 -1
- package/lib/screenplay/models/WebdriverIOCookie.js +1 -0
- package/lib/screenplay/models/WebdriverIOCookie.js.map +1 -1
- package/lib/screenplay/models/WebdriverIOModalDialogHandler.d.ts +2 -2
- package/lib/screenplay/models/WebdriverIOModalDialogHandler.d.ts.map +1 -1
- package/lib/screenplay/models/WebdriverIOModalDialogHandler.js +1 -0
- package/lib/screenplay/models/WebdriverIOModalDialogHandler.js.map +1 -1
- package/lib/screenplay/models/WebdriverIOPage.d.ts +6 -6
- package/lib/screenplay/models/WebdriverIOPage.d.ts.map +1 -1
- package/lib/screenplay/models/WebdriverIOPage.js +1 -0
- package/lib/screenplay/models/WebdriverIOPage.js.map +1 -1
- package/lib/screenplay/models/WebdriverIOPageElement.d.ts +2 -2
- package/lib/screenplay/models/WebdriverIOPageElement.d.ts.map +1 -1
- package/lib/screenplay/models/WebdriverIOPageElement.js +1 -0
- package/lib/screenplay/models/WebdriverIOPageElement.js.map +1 -1
- package/lib/screenplay/models/locators/WebdriverIOLocator.d.ts +14 -14
- package/lib/screenplay/models/locators/WebdriverIOLocator.d.ts.map +1 -1
- package/lib/screenplay/models/locators/WebdriverIOLocator.js +1 -0
- package/lib/screenplay/models/locators/WebdriverIOLocator.js.map +1 -1
- package/lib/screenplay/models/locators/WebdriverIORootLocator.d.ts +4 -4
- package/lib/screenplay/models/locators/WebdriverIORootLocator.d.ts.map +1 -1
- package/lib/screenplay/models/locators/WebdriverIORootLocator.js +1 -0
- package/lib/screenplay/models/locators/WebdriverIORootLocator.js.map +1 -1
- package/package.json +14 -14
- package/src/adapter/WebdriverIOFrameworkAdapter.ts +3 -2
- package/src/config/WebdriverIOConfig.ts +35 -68
- package/src/screenplay/abilities/BrowseTheWebWithWebdriverIO.ts +4 -3
- package/src/screenplay/models/WebdriverIOBrowsingSession.ts +3 -2
- package/src/screenplay/models/WebdriverIOCookie.ts +3 -2
- package/src/screenplay/models/WebdriverIOModalDialogHandler.ts +3 -2
- package/src/screenplay/models/WebdriverIOPage.ts +7 -6
- package/src/screenplay/models/WebdriverIOPageElement.ts +8 -7
- package/src/screenplay/models/locators/WebdriverIOLocator.ts +19 -18
- package/src/screenplay/models/locators/WebdriverIORootLocator.ts +5 -4
|
@@ -1,33 +1,33 @@
|
|
|
1
|
+
import 'webdriverio';
|
|
1
2
|
import type { PageElement, RootLocator, Selector } from '@serenity-js/web';
|
|
2
3
|
import { Locator } from '@serenity-js/web';
|
|
3
|
-
import type { Element } from 'webdriverio';
|
|
4
4
|
import type { WebdriverIOErrorHandler } from '../WebdriverIOErrorHandler.js';
|
|
5
5
|
/**
|
|
6
6
|
* WebdriverIO-specific implementation of {@apilink Locator}.
|
|
7
7
|
*
|
|
8
8
|
* @group Models
|
|
9
9
|
*/
|
|
10
|
-
export declare class WebdriverIOLocator extends Locator<Element, string> {
|
|
10
|
+
export declare class WebdriverIOLocator extends Locator<WebdriverIO.Element, string> {
|
|
11
11
|
private readonly errorHandler;
|
|
12
|
-
constructor(parent: RootLocator<Element>, selector: Selector, errorHandler: WebdriverIOErrorHandler);
|
|
12
|
+
constructor(parent: RootLocator<WebdriverIO.Element>, selector: Selector, errorHandler: WebdriverIOErrorHandler);
|
|
13
13
|
protected nativeSelector(): string;
|
|
14
14
|
isPresent(): Promise<boolean>;
|
|
15
|
-
nativeElement(): Promise<Element>;
|
|
16
|
-
protected resolveNativeElement(): Promise<Element>;
|
|
17
|
-
allNativeElements(): Promise<Array<Element>>;
|
|
18
|
-
of(parent: WebdriverIOLocator): Locator<Element, string>;
|
|
19
|
-
closestTo(child: WebdriverIOLocator): Locator<Element, string>;
|
|
20
|
-
locate(child: WebdriverIOLocator): Locator<Element, string>;
|
|
21
|
-
element(): PageElement<Element>;
|
|
22
|
-
allElements(): Promise<Array<PageElement<Element>>>;
|
|
15
|
+
nativeElement(): Promise<WebdriverIO.Element>;
|
|
16
|
+
protected resolveNativeElement(): Promise<WebdriverIO.Element>;
|
|
17
|
+
allNativeElements(): Promise<Array<WebdriverIO.Element>>;
|
|
18
|
+
of(parent: WebdriverIOLocator): Locator<WebdriverIO.Element, string>;
|
|
19
|
+
closestTo(child: WebdriverIOLocator): Locator<WebdriverIO.Element, string>;
|
|
20
|
+
locate(child: WebdriverIOLocator): Locator<WebdriverIO.Element, string>;
|
|
21
|
+
element(): PageElement<WebdriverIO.Element>;
|
|
22
|
+
allElements(): Promise<Array<PageElement<WebdriverIO.Element>>>;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* @internal
|
|
26
26
|
*/
|
|
27
27
|
export declare class WebdriverIOExistingElementLocator extends WebdriverIOLocator {
|
|
28
28
|
private readonly existingNativeElement;
|
|
29
|
-
constructor(parentRoot: RootLocator<Element>, selector: Selector, errorHandler: WebdriverIOErrorHandler, existingNativeElement: Element);
|
|
30
|
-
nativeElement(): Promise<Element>;
|
|
31
|
-
allNativeElements(): Promise<Array<Element>>;
|
|
29
|
+
constructor(parentRoot: RootLocator<WebdriverIO.Element>, selector: Selector, errorHandler: WebdriverIOErrorHandler, existingNativeElement: WebdriverIO.Element);
|
|
30
|
+
nativeElement(): Promise<WebdriverIO.Element>;
|
|
31
|
+
allNativeElements(): Promise<Array<WebdriverIO.Element>>;
|
|
32
32
|
}
|
|
33
33
|
//# sourceMappingURL=WebdriverIOLocator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebdriverIOLocator.d.ts","sourceRoot":"","sources":["../../../../src/screenplay/models/locators/WebdriverIOLocator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WebdriverIOLocator.d.ts","sourceRoot":"","sources":["../../../../src/screenplay/models/locators/WebdriverIOLocator.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAGrB,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAmE,OAAO,EAAE,MAAM,kBAAkB,C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AAW,CAAC,OAAO;IAKzD,aAAa,IAAI,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC;IAI7C,iBAAiB,IAAI,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;CAGjE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WebdriverIOExistingElementLocator = exports.WebdriverIOLocator = void 0;
|
|
4
|
+
require("webdriverio");
|
|
4
5
|
const core_1 = require("@serenity-js/core");
|
|
5
6
|
const web_1 = require("@serenity-js/web");
|
|
6
7
|
const WebdriverIOPageElement_js_1 = require("../WebdriverIOPageElement.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebdriverIOLocator.js","sourceRoot":"","sources":["../../../../src/screenplay/models/locators/WebdriverIOLocator.ts"],"names":[],"mappings":";;;AAAA,4CAAkD;AAElD,0CAA4G;
|
|
1
|
+
{"version":3,"file":"WebdriverIOLocator.js","sourceRoot":"","sources":["../../../../src/screenplay/models/locators/WebdriverIOLocator.ts"],"names":[],"mappings":";;;AAAA,uBAAqB;AAErB,4CAAkD;AAElD,0CAA4G;AAG5G,4EAAsE;AAGtE;;;;GAIG;AACH,MAAa,kBAAmB,SAAQ,aAAoC;IAExE,YACI,MAAwC,EACxC,QAAkB,EACD,YAAqC;QAEtD,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAFP,iBAAY,GAAZ,YAAY,CAAyB;IAG1D,CAAC;IAED,4EAA4E;IAClE,cAAc;QACpB,IAAI,IAAI,CAAC,QAAQ,YAAY,WAAK,EAAE;YAChC,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;SAC9B;QAED,IAAI,IAAI,CAAC,QAAQ,YAAY,eAAS,EAAE;YACpC,OAAO,OAAQ,IAAI,CAAC,QAAQ,CAAC,KAAM,EAAE,CAAC;SACzC;QAED,IAAI,IAAI,C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3
|
/**
|
|
4
4
|
* WebdriverIO-specific implementation of {@apilink RootLocator}.
|
|
5
5
|
*
|
|
6
6
|
* @group Models
|
|
7
7
|
*/
|
|
8
|
-
export declare class WebdriverIORootLocator extends RootLocator<Browser> {
|
|
8
|
+
export declare class WebdriverIORootLocator extends RootLocator<WebdriverIO.Browser> {
|
|
9
9
|
private readonly browser;
|
|
10
|
-
constructor(browser: Browser);
|
|
10
|
+
constructor(browser: WebdriverIO.Browser);
|
|
11
11
|
isPresent(): Promise<boolean>;
|
|
12
|
-
nativeElement(): Promise<Pick<Browser, '$' | '$$'>>;
|
|
12
|
+
nativeElement(): Promise<Pick<WebdriverIO.Browser, '$' | '$$'>>;
|
|
13
13
|
switchToFrame(frame: Element | object): Promise<void>;
|
|
14
14
|
switchToParentFrame(): Promise<void>;
|
|
15
15
|
switchToMainFrame(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebdriverIORootLocator.d.ts","sourceRoot":"","sources":["../../../../src/screenplay/models/locators/WebdriverIORootLocator.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"WebdriverIORootLocator.d.ts","sourceRoot":"","sources":["../../../../src/screenplay/models/locators/WebdriverIORootLocator.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC;IAC5D,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,WAAW,CAAC,OAAO;IAInD,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAI7B,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC,CAAC;IAI/D,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrD,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;CAG3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebdriverIORootLocator.js","sourceRoot":"","sources":["../../../../src/screenplay/models/locators/WebdriverIORootLocator.ts"],"names":[],"mappings":";;;AAAA,0CAA+C;
|
|
1
|
+
{"version":3,"file":"WebdriverIORootLocator.js","sourceRoot":"","sources":["../../../../src/screenplay/models/locators/WebdriverIORootLocator.ts"],"names":[],"mappings":";;;AAAA,uBAAqB;AAErB,0CAA+C;AAE/C;;;;GAIG;AACH,MAAa,sBAAuB,SAAQ,iBAAgC;IACxE,YAA6B,OAA4B;QACrD,KAAK,EAAE,CAAC;QADiB,YAAO,GAAP,OAAO,CAAqB;IAEzD,CAAC;IAED,KAAK,CAAC,SAAS;QACX,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,aAAa;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,KAAuB;QACvC,MAAM,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,mBAAmB;QACrB,MAAM,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,iBAAiB;QACnB,MAAM,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,sCAAsC;IAClF,CAAC;CACJ;AAxBD,wDAwBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serenity-js/webdriverio",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.3",
|
|
4
4
|
"description": "Serenity/JS reporter and Screenplay Pattern library for WebdriverIO",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jan Molak",
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
"node": "^16.13 || ^18.12 || ^20"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@serenity-js/core": "3.10.
|
|
68
|
-
"@serenity-js/web": "3.10.
|
|
69
|
-
"@wdio/reporter": "8.
|
|
67
|
+
"@serenity-js/core": "3.10.3",
|
|
68
|
+
"@serenity-js/web": "3.10.3",
|
|
69
|
+
"@wdio/reporter": "8.16.7",
|
|
70
70
|
"deepmerge": "^4.3.1",
|
|
71
71
|
"tiny-types": "^1.20.0"
|
|
72
72
|
},
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"@serenity-js/cucumber": "^3.0.0",
|
|
75
75
|
"@serenity-js/jasmine": "^3.0.0",
|
|
76
76
|
"@serenity-js/mocha": "^3.0.0",
|
|
77
|
-
"@wdio/cli": "^8.
|
|
78
|
-
"webdriverio": "^8.
|
|
77
|
+
"@wdio/cli": "^8.16.7",
|
|
78
|
+
"webdriverio": "^8.16.7"
|
|
79
79
|
},
|
|
80
80
|
"peerDependenciesMeta": {
|
|
81
81
|
"@serenity-js/cucumber": {
|
|
@@ -91,12 +91,12 @@
|
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@integration/testing-tools": "3.0.0",
|
|
93
93
|
"@types/mocha": "^10.0.1",
|
|
94
|
-
"@wdio/cli": "8.
|
|
95
|
-
"@wdio/devtools-service": "8.
|
|
96
|
-
"@wdio/dot-reporter": "8.
|
|
97
|
-
"@wdio/local-runner": "8.
|
|
98
|
-
"@wdio/spec-reporter": "8.
|
|
99
|
-
"@wdio/types": "8.
|
|
94
|
+
"@wdio/cli": "8.16.7",
|
|
95
|
+
"@wdio/devtools-service": "8.16.7",
|
|
96
|
+
"@wdio/dot-reporter": "8.16.7",
|
|
97
|
+
"@wdio/local-runner": "8.16.7",
|
|
98
|
+
"@wdio/spec-reporter": "8.16.7",
|
|
99
|
+
"@wdio/types": "8.16.7",
|
|
100
100
|
"axios": "^1.5.0",
|
|
101
101
|
"c8": "8.0.1",
|
|
102
102
|
"cross-env": "^7.0.3",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"mocha-testdata": "^1.2.0",
|
|
106
106
|
"puppeteer-core": "^20.9.0",
|
|
107
107
|
"start-server-and-test": "^2.0.0",
|
|
108
|
-
"webdriverio": "8.
|
|
108
|
+
"webdriverio": "8.16.7"
|
|
109
109
|
},
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "064edb63e8d4dee447feaab63cf61cbcf6414fdf"
|
|
111
111
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import 'webdriverio';
|
|
2
|
+
|
|
1
3
|
import type { Serenity} from '@serenity-js/core';
|
|
2
4
|
import { AnsiDiffFormatter, ArtifactArchiver, Cast, TakeNotes } from '@serenity-js/core';
|
|
3
5
|
import type { TestRunnerAdapter } from '@serenity-js/core/lib/adapter/index.js';
|
|
@@ -7,7 +9,6 @@ import type { Capabilities } from '@wdio/types';
|
|
|
7
9
|
import * as deepmerge from 'deepmerge';
|
|
8
10
|
import type { EventEmitter } from 'events';
|
|
9
11
|
import { isRecord } from 'tiny-types/lib/objects/isRecord.js';
|
|
10
|
-
import type { Browser } from 'webdriverio';
|
|
11
12
|
|
|
12
13
|
import type { WebdriverIOConfig } from '../config/index.js';
|
|
13
14
|
import { BrowseTheWebWithWebdriverIO } from '../screenplay/index.js';
|
|
@@ -77,7 +78,7 @@ export class WebdriverIOFrameworkAdapter {
|
|
|
77
78
|
diffFormatter: config.serenity.diffFormatter ?? new AnsiDiffFormatter(),
|
|
78
79
|
|
|
79
80
|
actors: config.serenity.actors || Cast.where(actor => actor.whoCan(
|
|
80
|
-
BrowseTheWebWithWebdriverIO.using(global.browser as unknown as Browser),
|
|
81
|
+
BrowseTheWebWithWebdriverIO.using(global.browser as unknown as WebdriverIO.Browser),
|
|
81
82
|
TakeNotes.usingAnEmptyNotepad(),
|
|
82
83
|
)),
|
|
83
84
|
|
|
@@ -2,16 +2,13 @@ import type { SerenityConfig } from '@serenity-js/core';
|
|
|
2
2
|
import type { Options } from '@wdio/types';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* [WebdriverIO configuration object](https://webdriver.io/docs/configurationfile/)
|
|
5
|
+
* [WebdriverIO configuration object](https://webdriver.io/docs/configurationfile/),
|
|
6
6
|
* with Serenity/JS-specific {@apilink SerenityConfig|additions}.
|
|
7
7
|
*
|
|
8
|
-
* ##
|
|
8
|
+
* ## Integrating WebdriverIO with Serenity/JS
|
|
9
9
|
*
|
|
10
10
|
* ```ts
|
|
11
11
|
* // wdio.conf.ts
|
|
12
|
-
* import { ConsoleReporter } from '@serenity-js/console-reporter'
|
|
13
|
-
* import { ArtifactArchiver } from '@serenity-js/core'
|
|
14
|
-
* import { SerenityBDDReporter } from '@serenity-js/serenity-bdd'
|
|
15
12
|
* import { WebdriverIOConfig } from '@serenity-js/webdriverio'
|
|
16
13
|
*
|
|
17
14
|
* export const config: WebdriverIOConfig = {
|
|
@@ -20,84 +17,54 @@ import type { Options } from '@wdio/types';
|
|
|
20
17
|
*
|
|
21
18
|
* serenity: {
|
|
22
19
|
* runner: 'cucumber',
|
|
20
|
+
* // runner: 'mocha',
|
|
21
|
+
* // runner: 'jasmine',
|
|
22
|
+
*
|
|
23
23
|
* crew: [
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* // Optional, print test execution results to standard output
|
|
25
|
+
* '@serenity-js/console-reporter',
|
|
26
|
+
*
|
|
27
|
+
* // Optional, produce Serenity BDD reports
|
|
28
|
+
* // and living documentation (HTML)
|
|
29
|
+
* '@serenity-js/serenity-bdd',
|
|
30
|
+
* [ '@serenity-js/core:ArtifactArchiver', {
|
|
31
|
+
* outputDirectory: 'target/site/serenity'
|
|
32
|
+
* } ],
|
|
33
|
+
*
|
|
34
|
+
* // Optional, automatically capture screenshots
|
|
35
|
+
* // upon interaction failure
|
|
36
|
+
* [ '@serenity-js/web:Photographer', {
|
|
37
|
+
* strategy: 'TakePhotosOfFailures'
|
|
38
|
+
* // strategy: 'TakePhotosOfInteractions'
|
|
39
|
+
* } ],
|
|
27
40
|
* ]
|
|
28
41
|
* },
|
|
29
42
|
*
|
|
43
|
+
* // Configure your Cucumber runner
|
|
30
44
|
* cucumberOpts: {
|
|
31
|
-
* //
|
|
45
|
+
* // see Cucumber configuration options below
|
|
32
46
|
* },
|
|
33
47
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* }
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* ## Configuring WebdriverIO with Serenity/JS and Mocha
|
|
41
|
-
*
|
|
42
|
-
* ```ts
|
|
43
|
-
* // wdio.conf.ts
|
|
44
|
-
* import { ConsoleReporter } from '@serenity-js/console-reporter'
|
|
45
|
-
* import { ArtifactArchiver } from '@serenity-js/core'
|
|
46
|
-
* import { SerenityBDDReporter } from '@serenity-js/serenity-bdd'
|
|
47
|
-
* import { WebdriverIOConfig } from '@serenity-js/webdriverio'
|
|
48
|
-
*
|
|
49
|
-
* export const config: WebdriverIOConfig = {
|
|
50
|
-
*
|
|
51
|
-
* framework: '@serenity-js/webdriverio',
|
|
52
|
-
*
|
|
53
|
-
* serenity: {
|
|
54
|
-
* runner: 'mocha',
|
|
55
|
-
* crew: [
|
|
56
|
-
* ConsoleReporter.forDarkTerminals(),
|
|
57
|
-
* new SerenityBDDReporter(),
|
|
58
|
-
* ArtifactArchiver.storingArtifactsAt('./target/site/serenity'),
|
|
59
|
-
* ]
|
|
48
|
+
* // ... or Jasmine runner
|
|
49
|
+
* jasmineOpts: {
|
|
50
|
+
* // see Jasmine configuration options below
|
|
60
51
|
* },
|
|
61
52
|
*
|
|
53
|
+
* // ... or Mocha runner
|
|
62
54
|
* mochaOpts: {
|
|
63
|
-
*
|
|
64
|
-
* },
|
|
65
|
-
*
|
|
66
|
-
* specs: [
|
|
67
|
-
* './spec/*.spec.*',
|
|
68
|
-
* ],
|
|
69
|
-
* }
|
|
70
|
-
* ```
|
|
71
|
-
*
|
|
72
|
-
* ## Configuring WebdriverIO with Serenity/JS and Jasmine
|
|
73
|
-
*
|
|
74
|
-
* ```ts
|
|
75
|
-
* // wdio.conf.ts
|
|
76
|
-
* import { ConsoleReporter } from '@serenity-js/console-reporter'
|
|
77
|
-
* import { ArtifactArchiver } from '@serenity-js/core'
|
|
78
|
-
* import { SerenityBDDReporter } from '@serenity-js/serenity-bdd'
|
|
79
|
-
* import { WebdriverIOConfig } from '@serenity-js/webdriverio'
|
|
80
|
-
*
|
|
81
|
-
* export const config: WebdriverIOConfig = {
|
|
82
|
-
*
|
|
83
|
-
* framework: '@serenity-js/webdriverio',
|
|
84
|
-
*
|
|
85
|
-
* serenity: {
|
|
86
|
-
* runner: 'jasmine',
|
|
87
|
-
* crew: [
|
|
88
|
-
* ConsoleReporter.forDarkTerminals(),
|
|
89
|
-
* new SerenityBDDReporter(),
|
|
90
|
-
* ArtifactArchiver.storingArtifactsAt('./target/site/serenity'),
|
|
91
|
-
* ]
|
|
55
|
+
* // see Mocha configuration options below
|
|
92
56
|
* },
|
|
93
57
|
*
|
|
94
|
-
*
|
|
95
|
-
* // ...
|
|
96
|
-
* },
|
|
58
|
+
* runner: 'local',
|
|
97
59
|
*
|
|
98
60
|
* specs: [
|
|
99
|
-
* './
|
|
61
|
+
* './features/*.feature',
|
|
62
|
+
*
|
|
63
|
+
* // or for Mocha/Jasmine
|
|
64
|
+
* // './*.spec.ts'
|
|
100
65
|
* ],
|
|
66
|
+
*
|
|
67
|
+
* // Any other WebdriverIO configuration
|
|
101
68
|
* }
|
|
102
69
|
* ```
|
|
103
70
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import 'webdriverio';
|
|
2
|
+
|
|
1
3
|
import { BrowseTheWeb } from '@serenity-js/web';
|
|
2
|
-
import type { Browser, Element } from 'webdriverio';
|
|
3
4
|
|
|
4
5
|
import { WebdriverIOBrowsingSession } from '../models/index.js';
|
|
5
6
|
|
|
@@ -37,9 +38,9 @@ import { WebdriverIOBrowsingSession } from '../models/index.js';
|
|
|
37
38
|
*
|
|
38
39
|
* @group Abilities
|
|
39
40
|
*/
|
|
40
|
-
export class BrowseTheWebWithWebdriverIO extends BrowseTheWeb<Element> {
|
|
41
|
+
export class BrowseTheWebWithWebdriverIO extends BrowseTheWeb<WebdriverIO.Element> {
|
|
41
42
|
|
|
42
|
-
static using(browserInstance: Browser): BrowseTheWebWithWebdriverIO {
|
|
43
|
+
static using(browserInstance: WebdriverIO.Browser): BrowseTheWebWithWebdriverIO {
|
|
43
44
|
return new BrowseTheWebWithWebdriverIO(new WebdriverIOBrowsingSession(browserInstance));
|
|
44
45
|
}
|
|
45
46
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import 'webdriverio';
|
|
2
|
+
|
|
1
3
|
import { LogicError } from '@serenity-js/core';
|
|
2
4
|
import { CorrelationId } from '@serenity-js/core/lib/model/index.js';
|
|
3
5
|
import type { BrowserCapabilities, ModalDialogHandler } from '@serenity-js/web';
|
|
4
6
|
import { BrowsingSession } from '@serenity-js/web';
|
|
5
7
|
import type { Page } from 'puppeteer-core';
|
|
6
|
-
import type { Browser } from 'webdriverio';
|
|
7
8
|
|
|
8
9
|
import { WebdriverIOPage } from '../models/index.js';
|
|
9
10
|
import { WebdriverIOErrorHandler } from './WebdriverIOErrorHandler.js';
|
|
@@ -17,7 +18,7 @@ import { WebdriverIOPuppeteerModalDialogHandler } from './WebdriverIOPuppeteerMo
|
|
|
17
18
|
*/
|
|
18
19
|
export class WebdriverIOBrowsingSession extends BrowsingSession<WebdriverIOPage> {
|
|
19
20
|
|
|
20
|
-
constructor(protected readonly browser: Browser) {
|
|
21
|
+
constructor(protected readonly browser: WebdriverIO.Browser) {
|
|
21
22
|
super();
|
|
22
23
|
|
|
23
24
|
if (! browser.$ || ! browser.$$) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import 'webdriverio';
|
|
2
|
+
|
|
1
3
|
import { Timestamp } from '@serenity-js/core';
|
|
2
4
|
import type { CookieData} from '@serenity-js/web';
|
|
3
5
|
import { Cookie, CookieMissingError } from '@serenity-js/web';
|
|
4
6
|
import { ensure, isDefined } from 'tiny-types';
|
|
5
|
-
import type { Browser } from 'webdriverio';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* WebdriverIO-specific implementation of {@apilink Cookie}.
|
|
@@ -12,7 +13,7 @@ import type { Browser } from 'webdriverio';
|
|
|
12
13
|
export class WebdriverIOCookie extends Cookie {
|
|
13
14
|
|
|
14
15
|
constructor(
|
|
15
|
-
private readonly browser: Browser,
|
|
16
|
+
private readonly browser: WebdriverIO.Browser,
|
|
16
17
|
cookieName: string,
|
|
17
18
|
) {
|
|
18
19
|
super(cookieName);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import 'webdriverio';
|
|
2
|
+
|
|
1
3
|
import type { ModalDialog} from '@serenity-js/web';
|
|
2
4
|
import { AbsentModalDialog, AcceptedModalDialog, DismissedModalDialog, ModalDialogHandler } from '@serenity-js/web';
|
|
3
|
-
import type { Browser } from 'webdriverio';
|
|
4
5
|
|
|
5
6
|
import type { WebdriverIOErrorHandler } from './WebdriverIOErrorHandler.js';
|
|
6
7
|
import { WebdriverProtocolErrorCode } from './WebdriverProtocolErrorCode.js';
|
|
@@ -28,7 +29,7 @@ export class WebdriverIOModalDialogHandler extends ModalDialogHandler {
|
|
|
28
29
|
private currentHandler: () => Promise<void>;
|
|
29
30
|
|
|
30
31
|
constructor(
|
|
31
|
-
private readonly browser: Browser,
|
|
32
|
+
private readonly browser: WebdriverIO.Browser,
|
|
32
33
|
private readonly errorHandler: WebdriverIOErrorHandler,
|
|
33
34
|
) {
|
|
34
35
|
super();
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import 'webdriverio';
|
|
2
|
+
|
|
1
3
|
import { List, LogicError } from '@serenity-js/core';
|
|
2
4
|
import type { CorrelationId } from '@serenity-js/core/lib/model/index.js';
|
|
3
5
|
import type { Cookie, CookieData, ModalDialogHandler, PageElement, PageElements, Selector } from '@serenity-js/web';
|
|
4
6
|
import { BrowserWindowClosedError, ByCss, Key, Page, PageElementsLocator } from '@serenity-js/web';
|
|
5
7
|
import { URL } from 'url';
|
|
6
|
-
import type { Browser, Element } from 'webdriverio';
|
|
7
8
|
|
|
8
9
|
import { WebdriverIOExistingElementLocator, WebdriverIOLocator, WebdriverIORootLocator } from './locators/index.js';
|
|
9
10
|
import type { WebdriverIOBrowsingSession } from './WebdriverIOBrowsingSession.js';
|
|
@@ -16,13 +17,13 @@ import { WebdriverIOPageElement } from './WebdriverIOPageElement.js';
|
|
|
16
17
|
*
|
|
17
18
|
* @group Models
|
|
18
19
|
*/
|
|
19
|
-
export class WebdriverIOPage extends Page<Element> {
|
|
20
|
+
export class WebdriverIOPage extends Page<WebdriverIO.Element> {
|
|
20
21
|
|
|
21
22
|
private lastScriptExecutionSummary: LastScriptExecutionSummary;
|
|
22
23
|
|
|
23
24
|
constructor(
|
|
24
25
|
session: WebdriverIOBrowsingSession,
|
|
25
|
-
private readonly browser: Browser,
|
|
26
|
+
private readonly browser: WebdriverIO.Browser,
|
|
26
27
|
modalDialogHandler: ModalDialogHandler,
|
|
27
28
|
private readonly errorHandler: WebdriverIOErrorHandler,
|
|
28
29
|
pageId: CorrelationId,
|
|
@@ -35,7 +36,7 @@ export class WebdriverIOPage extends Page<Element> {
|
|
|
35
36
|
);
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
createPageElement(nativeElement: Element): PageElement<Element> {
|
|
39
|
+
createPageElement(nativeElement: WebdriverIO.Element): PageElement<WebdriverIO.Element> {
|
|
39
40
|
return new WebdriverIOPageElement(
|
|
40
41
|
new WebdriverIOExistingElementLocator(
|
|
41
42
|
this.rootLocator,
|
|
@@ -46,13 +47,13 @@ export class WebdriverIOPage extends Page<Element> {
|
|
|
46
47
|
);
|
|
47
48
|
}
|
|
48
49
|
|
|
49
|
-
locate(selector: Selector): PageElement<Element> {
|
|
50
|
+
locate(selector: Selector): PageElement<WebdriverIO.Element> {
|
|
50
51
|
return new WebdriverIOPageElement(
|
|
51
52
|
new WebdriverIOLocator(this.rootLocator, selector, this.errorHandler)
|
|
52
53
|
)
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
locateAll(selector: Selector): PageElements<Element> {
|
|
56
|
+
locateAll(selector: Selector): PageElements<WebdriverIO.Element> {
|
|
56
57
|
return List.of(
|
|
57
58
|
new PageElementsLocator(
|
|
58
59
|
new WebdriverIOLocator(this.rootLocator, selector, this.errorHandler)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import 'webdriverio';
|
|
2
|
+
|
|
1
3
|
import { LogicError } from '@serenity-js/core';
|
|
2
4
|
import type { SwitchableOrigin } from '@serenity-js/web';
|
|
3
5
|
import { Key, PageElement, SelectOption } from '@serenity-js/web';
|
|
4
6
|
import * as scripts from '@serenity-js/web/lib/scripts/index.js';
|
|
5
|
-
import type { Browser, Element } from 'webdriverio';
|
|
6
7
|
|
|
7
8
|
import type { WebdriverIOLocator } from './locators/index.js';
|
|
8
9
|
import { WebdriverProtocolErrorCode } from './WebdriverProtocolErrorCode.js';
|
|
@@ -12,7 +13,7 @@ import { WebdriverProtocolErrorCode } from './WebdriverProtocolErrorCode.js';
|
|
|
12
13
|
*
|
|
13
14
|
* @group Models
|
|
14
15
|
*/
|
|
15
|
-
export class WebdriverIOPageElement extends PageElement<Element> {
|
|
16
|
+
export class WebdriverIOPageElement extends PageElement<WebdriverIO.Element> {
|
|
16
17
|
of(parent: WebdriverIOPageElement): WebdriverIOPageElement {
|
|
17
18
|
return new WebdriverIOPageElement(this.locator.of(parent.locator))
|
|
18
19
|
}
|
|
@@ -28,7 +29,7 @@ export class WebdriverIOPageElement extends PageElement<Element> {
|
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
// eslint-disable-next-line unicorn/consistent-function-scoping
|
|
31
|
-
async function removeCharactersFrom(browser: Browser | Element, inputElement: Element, numberOfCharacters: number): Promise<void> {
|
|
32
|
+
async function removeCharactersFrom(browser: WebdriverIO.Browser | WebdriverIO.Element, inputElement: WebdriverIO.Element, numberOfCharacters: number): Promise<void> {
|
|
32
33
|
await browser.execute(
|
|
33
34
|
/* c8 ignore next */
|
|
34
35
|
function focusOn(element: any) {
|
|
@@ -150,7 +151,7 @@ export class WebdriverIOPageElement extends PageElement<Element> {
|
|
|
150
151
|
|
|
151
152
|
async switchTo(): Promise<SwitchableOrigin> {
|
|
152
153
|
try {
|
|
153
|
-
const element: Element = await this.locator.nativeElement()
|
|
154
|
+
const element: WebdriverIO.Element = await this.locator.nativeElement()
|
|
154
155
|
|
|
155
156
|
if (element.error) {
|
|
156
157
|
throw element.error;
|
|
@@ -258,10 +259,10 @@ export class WebdriverIOPageElement extends PageElement<Element> {
|
|
|
258
259
|
|
|
259
260
|
// based on https://github.com/webdriverio/webdriverio/blob/dec6da76b0e218af935dbf39735ae3491d5edd8c/packages/webdriverio/src/utils/index.ts#L98
|
|
260
261
|
|
|
261
|
-
private async browserFor(nativeElement: Element | Browser): Promise<Element | Browser> {
|
|
262
|
-
const element = nativeElement as Element;
|
|
262
|
+
private async browserFor(nativeElement: WebdriverIO.Element | WebdriverIO.Browser): Promise<WebdriverIO.Element | WebdriverIO.Browser> {
|
|
263
|
+
const element = nativeElement as WebdriverIO.Element;
|
|
263
264
|
return element.parent
|
|
264
|
-
? this.browserFor(element.parent
|
|
265
|
+
? this.browserFor(element.parent)
|
|
265
266
|
: nativeElement
|
|
266
267
|
}
|
|
267
268
|
}
|