@serenity-js/webdriverio 3.0.0-rc.9 → 3.0.1
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 +245 -122
- package/README.md +66 -45
- package/lib/adapter/TestRunnerLoader.d.ts +3 -4
- package/lib/adapter/TestRunnerLoader.d.ts.map +1 -0
- package/lib/adapter/TestRunnerLoader.js +1 -4
- package/lib/adapter/TestRunnerLoader.js.map +1 -1
- package/lib/adapter/WebdriverIOConfig.d.ts +115 -109
- package/lib/adapter/WebdriverIOConfig.d.ts.map +1 -0
- package/lib/adapter/WebdriverIOFrameworkAdapter.d.ts +1 -3
- package/lib/adapter/WebdriverIOFrameworkAdapter.d.ts.map +1 -0
- package/lib/adapter/WebdriverIOFrameworkAdapter.js +14 -8
- package/lib/adapter/WebdriverIOFrameworkAdapter.js.map +1 -1
- package/lib/adapter/WebdriverIOFrameworkAdapterFactory.d.ts +2 -1
- package/lib/adapter/WebdriverIOFrameworkAdapterFactory.d.ts.map +1 -0
- package/lib/adapter/WebdriverIOFrameworkAdapterFactory.js +1 -1
- package/lib/adapter/WebdriverIONotifier.d.ts +1 -0
- package/lib/adapter/WebdriverIONotifier.d.ts.map +1 -0
- package/lib/adapter/WebdriverIONotifier.js +5 -5
- package/lib/adapter/WebdriverIONotifier.js.map +1 -1
- package/lib/adapter/index.d.ts +1 -1
- package/lib/adapter/index.d.ts.map +1 -0
- package/lib/adapter/index.js +5 -2
- package/lib/adapter/index.js.map +1 -1
- package/lib/adapter/reporter/BrowserCapabilitiesReporter.d.ts +1 -0
- package/lib/adapter/reporter/BrowserCapabilitiesReporter.d.ts.map +1 -0
- package/lib/adapter/reporter/BrowserCapabilitiesReporter.js +4 -1
- package/lib/adapter/reporter/BrowserCapabilitiesReporter.js.map +1 -1
- package/lib/adapter/reporter/InitialisesReporters.d.ts +1 -0
- package/lib/adapter/reporter/InitialisesReporters.d.ts.map +1 -0
- package/lib/adapter/reporter/OutputStreamBuffer.d.ts +2 -1
- package/lib/adapter/reporter/OutputStreamBuffer.d.ts.map +1 -0
- package/lib/adapter/reporter/OutputStreamBufferPrinter.d.ts +2 -1
- package/lib/adapter/reporter/OutputStreamBufferPrinter.d.ts.map +1 -0
- package/lib/adapter/reporter/OutputStreamBufferPrinter.js.map +1 -1
- package/lib/adapter/reporter/ProvidesWriteStream.d.ts +2 -1
- package/lib/adapter/reporter/ProvidesWriteStream.d.ts.map +1 -0
- package/lib/adapter/reporter/TagPrinter.d.ts +1 -0
- package/lib/adapter/reporter/TagPrinter.d.ts.map +1 -0
- package/lib/adapter/reporter/index.d.ts +1 -0
- package/lib/adapter/reporter/index.d.ts.map +1 -0
- package/lib/adapter/reporter/index.js +5 -1
- package/lib/adapter/reporter/index.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +5 -1
- package/lib/index.js.map +1 -1
- package/lib/screenplay/abilities/BrowseTheWebWithWebdriverIO.d.ts +28 -197
- package/lib/screenplay/abilities/BrowseTheWebWithWebdriverIO.d.ts.map +1 -0
- package/lib/screenplay/abilities/BrowseTheWebWithWebdriverIO.js +29 -296
- package/lib/screenplay/abilities/BrowseTheWebWithWebdriverIO.js.map +1 -1
- package/lib/screenplay/abilities/index.d.ts +1 -0
- package/lib/screenplay/abilities/index.d.ts.map +1 -0
- package/lib/screenplay/abilities/index.js +5 -1
- package/lib/screenplay/abilities/index.js.map +1 -1
- package/lib/screenplay/index.d.ts +1 -0
- package/lib/screenplay/index.d.ts.map +1 -0
- package/lib/screenplay/index.js +5 -1
- package/lib/screenplay/index.js.map +1 -1
- package/lib/screenplay/models/WebdriverIOBrowsingSession.d.ts +24 -0
- package/lib/screenplay/models/WebdriverIOBrowsingSession.d.ts.map +1 -0
- package/lib/screenplay/models/WebdriverIOBrowsingSession.js +125 -0
- package/lib/screenplay/models/WebdriverIOBrowsingSession.js.map +1 -0
- package/lib/screenplay/models/WebdriverIOCookie.d.ts +6 -0
- package/lib/screenplay/models/WebdriverIOCookie.d.ts.map +1 -0
- package/lib/screenplay/models/WebdriverIOCookie.js +7 -2
- package/lib/screenplay/models/WebdriverIOCookie.js.map +1 -1
- package/lib/screenplay/models/WebdriverIOErrorHandler.d.ts +9 -0
- package/lib/screenplay/models/WebdriverIOErrorHandler.d.ts.map +1 -0
- package/lib/screenplay/models/WebdriverIOErrorHandler.js +23 -0
- package/lib/screenplay/models/WebdriverIOErrorHandler.js.map +1 -0
- package/lib/screenplay/models/WebdriverIOModalDialogHandler.d.ts +29 -0
- package/lib/screenplay/models/WebdriverIOModalDialogHandler.d.ts.map +1 -0
- package/lib/screenplay/models/WebdriverIOModalDialogHandler.js +77 -0
- package/lib/screenplay/models/WebdriverIOModalDialogHandler.js.map +1 -0
- package/lib/screenplay/models/WebdriverIOPage.d.ts +29 -5
- package/lib/screenplay/models/WebdriverIOPage.d.ts.map +1 -0
- package/lib/screenplay/models/WebdriverIOPage.js +166 -54
- package/lib/screenplay/models/WebdriverIOPage.js.map +1 -1
- package/lib/screenplay/models/WebdriverIOPageElement.d.ts +10 -10
- package/lib/screenplay/models/WebdriverIOPageElement.d.ts.map +1 -0
- package/lib/screenplay/models/WebdriverIOPageElement.js +163 -117
- package/lib/screenplay/models/WebdriverIOPageElement.js.map +1 -1
- package/lib/screenplay/models/WebdriverIOPuppeteerModalDialogHandler.d.ts +32 -0
- package/lib/screenplay/models/WebdriverIOPuppeteerModalDialogHandler.d.ts.map +1 -0
- package/lib/screenplay/models/WebdriverIOPuppeteerModalDialogHandler.js +82 -0
- package/lib/screenplay/models/WebdriverIOPuppeteerModalDialogHandler.js.map +1 -0
- package/lib/screenplay/models/WebdriverProtocolErrorCode.d.ts +39 -0
- package/lib/screenplay/models/WebdriverProtocolErrorCode.d.ts.map +1 -0
- package/lib/screenplay/models/WebdriverProtocolErrorCode.js +43 -0
- package/lib/screenplay/models/WebdriverProtocolErrorCode.js.map +1 -0
- package/lib/screenplay/models/index.d.ts +2 -1
- package/lib/screenplay/models/index.d.ts.map +1 -0
- package/lib/screenplay/models/index.js +6 -2
- package/lib/screenplay/models/index.js.map +1 -1
- package/lib/screenplay/models/locators/WebdriverIOLocator.d.ts +18 -5
- package/lib/screenplay/models/locators/WebdriverIOLocator.d.ts.map +1 -0
- package/lib/screenplay/models/locators/WebdriverIOLocator.js +84 -5
- package/lib/screenplay/models/locators/WebdriverIOLocator.js.map +1 -1
- package/lib/screenplay/models/locators/WebdriverIORootLocator.d.ts +17 -0
- package/lib/screenplay/models/locators/WebdriverIORootLocator.d.ts.map +1 -0
- package/lib/screenplay/models/locators/WebdriverIORootLocator.js +32 -0
- package/lib/screenplay/models/locators/WebdriverIORootLocator.js.map +1 -0
- package/lib/screenplay/models/locators/index.d.ts +2 -1
- package/lib/screenplay/models/locators/index.d.ts.map +1 -0
- package/lib/screenplay/models/locators/index.js +6 -2
- package/lib/screenplay/models/locators/index.js.map +1 -1
- package/package.json +31 -32
- package/src/adapter/TestRunnerLoader.ts +3 -5
- package/src/adapter/WebdriverIOConfig.ts +114 -109
- package/src/adapter/WebdriverIOFrameworkAdapter.ts +20 -12
- package/src/adapter/WebdriverIOFrameworkAdapterFactory.ts +1 -1
- package/src/adapter/WebdriverIONotifier.ts +8 -6
- package/src/adapter/index.ts +0 -1
- package/src/adapter/reporter/OutputStreamBuffer.ts +1 -1
- package/src/adapter/reporter/OutputStreamBufferPrinter.ts +1 -1
- package/src/adapter/reporter/ProvidesWriteStream.ts +1 -1
- package/src/screenplay/abilities/BrowseTheWebWithWebdriverIO.ts +29 -339
- package/src/screenplay/models/WebdriverIOBrowsingSession.ts +171 -0
- package/src/screenplay/models/WebdriverIOCookie.ts +7 -2
- package/src/screenplay/models/WebdriverIOErrorHandler.ts +25 -0
- package/src/screenplay/models/WebdriverIOModalDialogHandler.ts +100 -0
- package/src/screenplay/models/WebdriverIOPage.ts +222 -63
- package/src/screenplay/models/WebdriverIOPageElement.ts +183 -148
- package/src/screenplay/models/WebdriverIOPuppeteerModalDialogHandler.ts +97 -0
- package/src/screenplay/models/WebdriverProtocolErrorCode.ts +38 -0
- package/src/screenplay/models/index.ts +1 -1
- package/src/screenplay/models/locators/WebdriverIOLocator.ts +122 -24
- package/src/screenplay/models/locators/WebdriverIORootLocator.ts +33 -0
- package/src/screenplay/models/locators/index.ts +1 -1
- package/tsconfig.build.json +17 -0
- package/lib/screenplay/models/WebdriverIOModalDialog.d.ts +0 -11
- package/lib/screenplay/models/WebdriverIOModalDialog.js +0 -40
- package/lib/screenplay/models/WebdriverIOModalDialog.js.map +0 -1
- package/lib/screenplay/models/locators/WebdriverIONativeElementRoot.d.ts +0 -2
- package/lib/screenplay/models/locators/WebdriverIONativeElementRoot.js +0 -3
- package/lib/screenplay/models/locators/WebdriverIONativeElementRoot.js.map +0 -1
- package/src/screenplay/models/WebdriverIOModalDialog.ts +0 -45
- package/src/screenplay/models/locators/WebdriverIONativeElementRoot.ts +0 -3
- package/tsconfig.eslint.json +0 -10
package/README.md
CHANGED
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
# Serenity/JS
|
|
2
2
|
|
|
3
|
-
[Serenity/JS](https://serenity-js
|
|
4
|
-
|
|
3
|
+
[](https://www.linkedin.com/company/serenity-js)
|
|
4
|
+
[](https://www.youtube.com/@serenity-js)
|
|
5
|
+
[](https://matrix.to/#/#serenity-js:gitter.im)
|
|
6
|
+
[](https://github.com/sponsors/serenity-js)
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
[Serenity/JS](https://serenity-js.org) is an innovative framework designed to make acceptance and regression testing
|
|
9
|
+
of complex software systems faster, more collaborative and easier to scale.
|
|
8
10
|
|
|
9
|
-
[
|
|
10
|
-
[](https://twitter.com/@JanMolak)
|
|
11
|
-
[](https://gitter.im/serenity-js/Lobby)
|
|
11
|
+
To get started, check out the comprehensive [Serenity/JS Handbook](https://serenity-js.org/handbook), [API documentation](https://serenity-js.org/api/core), and [Serenity/JS project templates on GitHub](https://serenity-js.org/handbook/getting-started#serenityjs-project-templates).
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
### Learning Serenity/JS
|
|
16
|
-
|
|
17
|
-
To learn more about Serenity/JS, [follow the tutorial](https://serenity-js.org/handbook/thinking-in-serenity-js/index.html), [review the examples](https://github.com/serenity-js/serenity-js/tree/master/examples), and create your own test suite with [Serenity/JS template projects](https://github.com/serenity-js).
|
|
18
|
-
|
|
19
|
-
If you have any questions, join us on [Serenity/JS Community Chat](https://gitter.im/serenity-js/Lobby).
|
|
13
|
+
If you have any questions or just want to say hello, join the [Serenity/JS Community Chat](https://matrix.to/#/#serenity-js:gitter.im).
|
|
20
14
|
|
|
21
15
|
## Serenity/JS WebdriverIO
|
|
22
16
|
|
|
@@ -28,7 +22,7 @@ for [WebdriverIO](https://webdriver.io/), that helps with testing Web-based and
|
|
|
28
22
|
To install this module, run the following command in your [WebdriverIO project directory](https://webdriver.io/docs/gettingstarted/):
|
|
29
23
|
|
|
30
24
|
```bash
|
|
31
|
-
npm install --save-dev @serenity-js/{core,webdriverio}
|
|
25
|
+
npm install --save-dev @serenity-js/{assertions,console-reporter,core,serenity-bdd,web,webdriverio}
|
|
32
26
|
```
|
|
33
27
|
|
|
34
28
|
Next, install one of the below test runner adapters.
|
|
@@ -40,7 +34,7 @@ To use Serenity/JS WebdriverIO with Cucumber.js, install the following adapter:
|
|
|
40
34
|
npm install --save-dev @serenity-js/cucumber
|
|
41
35
|
```
|
|
42
36
|
|
|
43
|
-
**Please note** that Serenity/JS WebdriverIO / Cucumber integration supports both [Serenity/JS reporting services](https://serenity-js.org/handbook/reporting/index.html) and [native Cucumber.js reporters](https://github.com/cucumber/cucumber-js/blob/
|
|
37
|
+
**Please note** that Serenity/JS WebdriverIO / Cucumber integration supports both [Serenity/JS reporting services](https://serenity-js.org/handbook/reporting/index.html) and [native Cucumber.js reporters](https://github.com/cucumber/cucumber-js/blob/main/docs/cli.md#built-in-formatters).
|
|
44
38
|
|
|
45
39
|
#### Usage with Jasmine
|
|
46
40
|
|
|
@@ -58,14 +52,32 @@ npm install --save-dev @serenity-js/mocha
|
|
|
58
52
|
|
|
59
53
|
### Configuring Webdriverio
|
|
60
54
|
|
|
55
|
+
```typescript
|
|
56
|
+
// serenity/Actors.ts
|
|
57
|
+
import { Actor, Cast } from '@serenity-js/core';
|
|
58
|
+
import { BrowseTheWebWithWebdriverIO } from '@serenity-js/webdriverio';
|
|
59
|
+
import * as wdio from 'webdriverio';
|
|
60
|
+
|
|
61
|
+
// example Actors class, confgures Serenity/JS actors to use WebdriverIO
|
|
62
|
+
class Actors implements Cast {
|
|
63
|
+
constructor(private readonly browser: wdio.Browser<'async'>) {
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
prepare(actor: Actor): Actor {
|
|
67
|
+
return actor.whoCan(
|
|
68
|
+
BrowseTheWebWithWebdriverIO.using(this.browser),
|
|
69
|
+
// ... add other abilities as needed, like CallAnApi or TakeNotes
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
|
|
61
76
|
```typescript
|
|
62
77
|
// wdio.conf.ts
|
|
63
78
|
|
|
64
79
|
// Import Serenity/JS reporting services, a.k.a. the "Stage Crew Members"
|
|
65
|
-
import {
|
|
66
|
-
import { ConsoleReporter } from '@serenity-js/console-reporter';
|
|
67
|
-
import { SerenityBDDReporter } from '@serenity-js/serenity-bdd';
|
|
68
|
-
import { Photographer, TakePhotosOfFailures, WebdriverIOConfig } from '@serenity-js/webdriverio';
|
|
80
|
+
import { Actors } from './serenity/Actors.ts'
|
|
69
81
|
|
|
70
82
|
export const config: WebdriverIOConfig = {
|
|
71
83
|
// Tell WebdriverIO to use Serenity/JS framework
|
|
@@ -77,12 +89,17 @@ export const config: WebdriverIOConfig = {
|
|
|
77
89
|
// runner: 'mocha',
|
|
78
90
|
// runner: 'jasmine',
|
|
79
91
|
|
|
92
|
+
// register custom Actors class to configure your Serenity/JS actors
|
|
93
|
+
actors: new Actors(),
|
|
94
|
+
|
|
80
95
|
// Register StageCrewMembers we've imported at the top of this file
|
|
81
96
|
crew: [
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
Photographer
|
|
97
|
+
'@serenity-js/console-reporter',
|
|
98
|
+
'@serenity-js/serenity-bdd',
|
|
99
|
+
[ '@serenity-js/core:ArtifactArchiver', { outputDirectory: 'target/site/serenity' } ],
|
|
100
|
+
[ '@serenity-js/web:Photographer', {
|
|
101
|
+
strategy: 'TakePhotosOfFailures', // or: 'TakePhotosOfInteractions'
|
|
102
|
+
} ],
|
|
86
103
|
]
|
|
87
104
|
},
|
|
88
105
|
|
|
@@ -123,44 +140,48 @@ Learn more about:
|
|
|
123
140
|
- [Mocha configuration options](https://serenity-js.org/modules/mocha/class/src/adapter/MochaConfig.ts~MochaConfig.html)
|
|
124
141
|
- [WebdriverIO configuration file](https://webdriver.io/docs/configurationfile/)
|
|
125
142
|
|
|
126
|
-
###
|
|
143
|
+
### Usage with Mocha
|
|
127
144
|
|
|
128
145
|
```typescript
|
|
129
146
|
import { actorCalled } from '@serenity-js/core';
|
|
130
147
|
import { Ensure, equals } from '@serenity-js/assertions';
|
|
131
|
-
import {
|
|
148
|
+
import { By, Navigate, PageElement, Text } from '@serenity-js/web';
|
|
149
|
+
import { BrowseTheWebWithWebdriverIO } from '@serenity-js/webdriverio';
|
|
132
150
|
|
|
151
|
+
// example Lean Page Object describing a widget we interact with in the test
|
|
133
152
|
class SerenityJSWebsite {
|
|
134
|
-
static header =
|
|
153
|
+
static header = () =>
|
|
154
|
+
PageElement.located(By.css('h1')) // selector to identify the interactable element
|
|
155
|
+
.describedAs('header'); // description to be used in reports
|
|
135
156
|
}
|
|
136
157
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
158
|
+
describe('Serenity/JS', () => {
|
|
159
|
+
|
|
160
|
+
it('works with WebdriverIO and Mocha', async () => {
|
|
161
|
+
// actorCalled(name) instantiates or retrieves an existing actor identified by name
|
|
162
|
+
// Actors class configures the actors to use WebdriverIO
|
|
163
|
+
await actorCalled('Wendy')
|
|
164
|
+
.attemptsTo(
|
|
165
|
+
Navigate.to('https://serenity-js.org'),
|
|
166
|
+
Ensure.that(
|
|
167
|
+
Text.of(SerenityJSWebsite.header()),
|
|
168
|
+
equals('Next generation acceptance testing')
|
|
169
|
+
),
|
|
170
|
+
)
|
|
171
|
+
})
|
|
172
|
+
});
|
|
148
173
|
```
|
|
149
174
|
|
|
150
|
-
To learn more, check out the [example projects](https://github.com/serenity-js/serenity-js/tree/
|
|
175
|
+
To learn more, check out the [example projects](https://github.com/serenity-js/serenity-js/tree/main/examples).
|
|
151
176
|
|
|
152
177
|
### Template Repositories
|
|
153
178
|
|
|
154
179
|
The easiest way for you to start writing web-based acceptance tests using Serenity/JS, WebdriverIO and either [Mocha](https://mochajs.org/), [Cucumber](https://github.com/cucumber/cucumber-js) or [Jasmine](https://jasmine.github.io/) is by using one of the below template repositories:
|
|
155
180
|
|
|
156
181
|
- [Serenity/JS, Mocha, and WebdriverIO template](https://github.com/serenity-js/serenity-js-mocha-webdriverio-template)
|
|
157
|
-
- Serenity/JS, Cucumber, and WebdriverIO template
|
|
182
|
+
- [Serenity/JS, Cucumber, and WebdriverIO template](https://github.com/serenity-js/serenity-js-cucumber-webdriverio-template)
|
|
158
183
|
- Serenity/JS, Jasmine, and WebdriverIO template (coming soon!)
|
|
159
184
|
|
|
160
185
|
## More coming soon!
|
|
161
186
|
|
|
162
|
-
New features, tutorials, and demos are coming soon, so follow us on
|
|
163
|
-
|
|
164
|
-
[](https://twitter.com/@SerenityJS)
|
|
165
|
-
[](https://twitter.com/@JanMolak)
|
|
166
|
-
[](https://gitter.im/serenity-js/Lobby)
|
|
187
|
+
New features, tutorials, and demos are coming soon, so follow us on [LinkedIn](https://www.linkedin.com/company/serenity-js) and join the [Serenity/JS Community Chat channel](https://matrix.to/#/#serenity-js:gitter.im) to stay up to date!
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TestRunnerAdapter } from '@serenity-js/core/lib/adapter';
|
|
2
|
+
import { ModuleLoader, Path } from '@serenity-js/core/lib/io';
|
|
2
3
|
import { WebdriverIOConfig } from './WebdriverIOConfig';
|
|
3
|
-
/**
|
|
4
|
-
* @package
|
|
5
|
-
*/
|
|
6
4
|
export declare class TestRunnerLoader {
|
|
7
5
|
private readonly loader;
|
|
8
6
|
private readonly cwd;
|
|
@@ -15,3 +13,4 @@ export declare class TestRunnerLoader {
|
|
|
15
13
|
private jasmineAdapter;
|
|
16
14
|
private mochaAdapter;
|
|
17
15
|
}
|
|
16
|
+
//# sourceMappingURL=TestRunnerLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestRunnerLoader.d.ts","sourceRoot":"","sources":["../../src/adapter/TestRunnerLoader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAkC,YAAY,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAG9F,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,qBAAa,gBAAgB;IAKrB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,GAAG;IANxB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAa;gBAGf,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,IAAI,EACT,GAAG,EAAE,MAAM;IAMhC,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,GAAG,iBAAiB;IAiB9D,OAAO,CAAC,eAAe;IAuCvB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,YAAY;CAIvB"}
|
|
@@ -3,9 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TestRunnerLoader = void 0;
|
|
4
4
|
const core_1 = require("@serenity-js/core");
|
|
5
5
|
const io_1 = require("@serenity-js/core/lib/io");
|
|
6
|
-
/**
|
|
7
|
-
* @package
|
|
8
|
-
*/
|
|
9
6
|
class TestRunnerLoader {
|
|
10
7
|
constructor(loader, cwd, cid) {
|
|
11
8
|
this.loader = loader;
|
|
@@ -30,7 +27,7 @@ class TestRunnerLoader {
|
|
|
30
27
|
}
|
|
31
28
|
cucumberAdapter(cucumberOptions) {
|
|
32
29
|
var _a;
|
|
33
|
-
const { CucumberCLIAdapter, CucumberFormat, StandardOutput, TempFileOutput } = this.loader.require('@serenity-js/cucumber/lib/
|
|
30
|
+
const { CucumberCLIAdapter, CucumberFormat, StandardOutput, TempFileOutput } = this.loader.require('@serenity-js/cucumber/lib/adapter');
|
|
34
31
|
cucumberOptions === null || cucumberOptions === void 0 ? true : delete cucumberOptions.timeout; // todo: support setting a timeout via config?
|
|
35
32
|
cucumberOptions === null || cucumberOptions === void 0 ? true : delete cucumberOptions.parallel; // WebdriverIO handles that already
|
|
36
33
|
const cleanedCucumberOptions = new io_1.Config(cucumberOptions)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestRunnerLoader.js","sourceRoot":"","sources":["../../src/adapter/TestRunnerLoader.ts"],"names":[],"mappings":";;;AAAA,4CAAuD;
|
|
1
|
+
{"version":3,"file":"TestRunnerLoader.js","sourceRoot":"","sources":["../../src/adapter/TestRunnerLoader.ts"],"names":[],"mappings":";;;AAAA,4CAAuD;AAEvD,iDAA8F;AAK9F,MAAa,gBAAgB;IAIzB,YACqB,MAAoB,EACpB,GAAS,EACT,GAAW;QAFX,WAAM,GAAN,MAAM,CAAc;QACpB,QAAG,GAAH,GAAG,CAAM;QACT,QAAG,GAAH,GAAG,CAAQ;QAE5B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|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* }
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* }
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
4
|
+
* [WebdriverIO configuration object](https://webdriver.io/docs/configurationfile/)
|
|
5
|
+
* with Serenity/JS-specific {@apilink SerenityConfig|additions}.
|
|
6
|
+
*
|
|
7
|
+
* ## Configuring WebdriverIO with Serenity/JS and Cucumber
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* // wdio.conf.ts
|
|
11
|
+
* import { ConsoleReporter } from '@serenity-js/console-reporter'
|
|
12
|
+
* import { ArtifactArchiver } from '@serenity-js/core'
|
|
13
|
+
* import { SerenityBDDReporter } from '@serenity-js/serenity-bdd'
|
|
14
|
+
* import { WebdriverIOConfig } from '@serenity-js/webdriverio'
|
|
15
|
+
*
|
|
16
|
+
* export const config: WebdriverIOConfig = {
|
|
17
|
+
*
|
|
18
|
+
* framework: '@serenity-js/webdriverio',
|
|
19
|
+
*
|
|
20
|
+
* serenity: {
|
|
21
|
+
* runner: 'cucumber',
|
|
22
|
+
* crew: [
|
|
23
|
+
* ConsoleReporter.forDarkTerminals(),
|
|
24
|
+
* new SerenityBDDReporter(),
|
|
25
|
+
* ArtifactArchiver.storingArtifactsAt('./target/site/serenity'),
|
|
26
|
+
* ]
|
|
27
|
+
* },
|
|
28
|
+
*
|
|
29
|
+
* cucumberOpts: {
|
|
30
|
+
* // ...
|
|
31
|
+
* },
|
|
32
|
+
*
|
|
33
|
+
* specs: [
|
|
34
|
+
* './features/*.feature',
|
|
35
|
+
* ],
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* ## Configuring WebdriverIO with Serenity/JS and Mocha
|
|
40
|
+
*
|
|
41
|
+
* ```ts
|
|
42
|
+
* // wdio.conf.ts
|
|
43
|
+
* import { ConsoleReporter } from '@serenity-js/console-reporter'
|
|
44
|
+
* import { ArtifactArchiver } from '@serenity-js/core'
|
|
45
|
+
* import { SerenityBDDReporter } from '@serenity-js/serenity-bdd'
|
|
46
|
+
* import { WebdriverIOConfig } from '@serenity-js/webdriverio'
|
|
47
|
+
*
|
|
48
|
+
* export const config: WebdriverIOConfig = {
|
|
49
|
+
*
|
|
50
|
+
* framework: '@serenity-js/webdriverio',
|
|
51
|
+
*
|
|
52
|
+
* serenity: {
|
|
53
|
+
* runner: 'mocha',
|
|
54
|
+
* crew: [
|
|
55
|
+
* ConsoleReporter.forDarkTerminals(),
|
|
56
|
+
* new SerenityBDDReporter(),
|
|
57
|
+
* ArtifactArchiver.storingArtifactsAt('./target/site/serenity'),
|
|
58
|
+
* ]
|
|
59
|
+
* },
|
|
60
|
+
*
|
|
61
|
+
* mochaOpts: {
|
|
62
|
+
* // ...
|
|
63
|
+
* },
|
|
64
|
+
*
|
|
65
|
+
* specs: [
|
|
66
|
+
* './spec/*.spec.*',
|
|
67
|
+
* ],
|
|
68
|
+
* }
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* ## Configuring WebdriverIO with Serenity/JS and Jasmine
|
|
72
|
+
*
|
|
73
|
+
* ```ts
|
|
74
|
+
* // wdio.conf.ts
|
|
75
|
+
* import { ConsoleReporter } from '@serenity-js/console-reporter'
|
|
76
|
+
* import { ArtifactArchiver } from '@serenity-js/core'
|
|
77
|
+
* import { SerenityBDDReporter } from '@serenity-js/serenity-bdd'
|
|
78
|
+
* import { WebdriverIOConfig } from '@serenity-js/webdriverio'
|
|
79
|
+
*
|
|
80
|
+
* export const config: WebdriverIOConfig = {
|
|
81
|
+
*
|
|
82
|
+
* framework: '@serenity-js/webdriverio',
|
|
83
|
+
*
|
|
84
|
+
* serenity: {
|
|
85
|
+
* runner: 'jasmine',
|
|
86
|
+
* crew: [
|
|
87
|
+
* ConsoleReporter.forDarkTerminals(),
|
|
88
|
+
* new SerenityBDDReporter(),
|
|
89
|
+
* ArtifactArchiver.storingArtifactsAt('./target/site/serenity'),
|
|
90
|
+
* ]
|
|
91
|
+
* },
|
|
92
|
+
*
|
|
93
|
+
* jasmineOpts: {
|
|
94
|
+
* // ...
|
|
95
|
+
* },
|
|
96
|
+
*
|
|
97
|
+
* specs: [
|
|
98
|
+
* './spec/*.spec.*',
|
|
99
|
+
* ],
|
|
100
|
+
* }
|
|
101
|
+
* ```
|
|
102
|
+
*
|
|
103
|
+
* ## Learn more
|
|
104
|
+
*
|
|
105
|
+
* - [WebdriverIO configuration file](https://webdriver.io/docs/configurationfile/)
|
|
106
|
+
* - {@apilink CucumberConfig}
|
|
107
|
+
* - {@apilink JasmineConfig}
|
|
108
|
+
* - {@apilink MochaConfig}
|
|
109
|
+
*
|
|
110
|
+
* @group Configuration
|
|
105
111
|
*/
|
|
106
112
|
export interface WebdriverIOConfig extends Options.Testrunner {
|
|
107
113
|
/**
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
* allowing to specify the test runner, such as `cucumber`, `mocha`, or `jasmine`.
|
|
114
|
+
* Serenity/JS configuration with an additional `runner` entry
|
|
115
|
+
* allowing to specify the test runner, such as `cucumber`, `mocha`, or `jasmine`.
|
|
111
116
|
*
|
|
112
|
-
*
|
|
113
|
-
* @see {@link @serenity-js/jasmine/lib/adapter~JasmineConfig}
|
|
114
|
-
* @see {@link @serenity-js/mocha/lib/adapter~MochaConfig}
|
|
117
|
+
* #### Learn more
|
|
115
118
|
*
|
|
116
|
-
*
|
|
117
|
-
* @
|
|
119
|
+
* - [WebdriverIO configuration file](https://webdriver.io/docs/configurationfile/)
|
|
120
|
+
* - {@apilink CucumberConfig}
|
|
121
|
+
* - {@apilink JasmineConfig}
|
|
122
|
+
* - {@apilink MochaConfig}
|
|
118
123
|
*/
|
|
119
124
|
serenity?: SerenityConfig & {
|
|
120
125
|
runner?: string;
|
|
121
126
|
};
|
|
122
127
|
}
|
|
128
|
+
//# sourceMappingURL=WebdriverIOConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebdriverIOConfig.d.ts","sourceRoot":"","sources":["../../src/adapter/WebdriverIOConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4GG;AACH,MAAM,WAAW,iBAAkB,SAAQ,OAAO,CAAC,UAAU;IAEzD;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,cAAc,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACnD"}
|
|
@@ -5,9 +5,6 @@ import type { Capabilities } from '@wdio/types';
|
|
|
5
5
|
import type { EventEmitter } from 'events';
|
|
6
6
|
import { InitialisesReporters, ProvidesWriteStream } from './reporter';
|
|
7
7
|
import { WebdriverIOConfig } from './WebdriverIOConfig';
|
|
8
|
-
/**
|
|
9
|
-
* @package
|
|
10
|
-
*/
|
|
11
8
|
export declare class WebdriverIOFrameworkAdapter {
|
|
12
9
|
private readonly serenity;
|
|
13
10
|
private readonly loader;
|
|
@@ -23,3 +20,4 @@ export declare class WebdriverIOFrameworkAdapter {
|
|
|
23
20
|
run(): Promise<number>;
|
|
24
21
|
private defaultConfig;
|
|
25
22
|
}
|
|
23
|
+
//# sourceMappingURL=WebdriverIOFrameworkAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebdriverIOFrameworkAdapter.d.ts","sourceRoot":"","sources":["../../src/adapter/WebdriverIOFrameworkAdapter.ts"],"names":[],"mappings":";AAAA,OAAO,EAA6C,QAAQ,EAAa,MAAM,mBAAmB,CAAC;AAEnG,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAI3C,OAAO,EAA+B,oBAAoB,EAAsB,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGxH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAIxD,qBAAa,2BAA2B;IAMhC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAEpB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAVjC,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,QAAQ,CAAsB;gBAGjB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,IAAI,EACT,GAAG,EAAE,MAAM,EAC5B,iBAAiB,EAAE,iBAAiB,EACnB,KAAK,EAAE,MAAM,EAAE,EACf,YAAY,EAAE,YAAY,CAAC,gBAAgB,EAC5D,QAAQ,EAAE,YAAY,GAAG,mBAAmB,GAAG,oBAAoB;IAwDjE,IAAI,IAAI,OAAO,CAAC,2BAA2B,CAAC;IAOlD,QAAQ,IAAI,OAAO;IAIb,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;IAK5B,OAAO,CAAC,aAAa;CASxB"}
|
|
@@ -2,17 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WebdriverIOFrameworkAdapter = void 0;
|
|
4
4
|
const core_1 = require("@serenity-js/core");
|
|
5
|
-
const
|
|
5
|
+
const objects_1 = require("tiny-types/lib/objects");
|
|
6
|
+
const screenplay_1 = require("../screenplay");
|
|
6
7
|
const reporter_1 = require("./reporter");
|
|
7
8
|
const OutputStreamBufferPrinter_1 = require("./reporter/OutputStreamBufferPrinter");
|
|
8
9
|
const TestRunnerLoader_1 = require("./TestRunnerLoader");
|
|
9
10
|
const WebdriverIONotifier_1 = require("./WebdriverIONotifier");
|
|
10
11
|
const deepmerge = require("deepmerge");
|
|
11
|
-
/**
|
|
12
|
-
* @package
|
|
13
|
-
*/
|
|
14
12
|
class WebdriverIOFrameworkAdapter {
|
|
15
13
|
constructor(serenity, loader, cwd, cid, webdriverIOConfig, specs, capabilities, reporter) {
|
|
14
|
+
var _a;
|
|
16
15
|
this.serenity = serenity;
|
|
17
16
|
this.loader = loader;
|
|
18
17
|
this.cwd = cwd;
|
|
@@ -20,8 +19,13 @@ class WebdriverIOFrameworkAdapter {
|
|
|
20
19
|
this.specs = specs;
|
|
21
20
|
this.capabilities = capabilities;
|
|
22
21
|
const config = deepmerge(this.defaultConfig(), webdriverIOConfig, {
|
|
23
|
-
isMergeableObject:
|
|
22
|
+
isMergeableObject: objects_1.isRecord,
|
|
24
23
|
});
|
|
24
|
+
// SauceLabs service serialises the config object for debugging.
|
|
25
|
+
// However, since Serenity/JS Stage is a pub/sub mechanism,
|
|
26
|
+
// it contains cyclic references which are not serialisable.
|
|
27
|
+
// We get rid of them from the config object to avoid confusing other services.
|
|
28
|
+
delete webdriverIOConfig.serenity;
|
|
25
29
|
this.adapter = new TestRunnerLoader_1.TestRunnerLoader(this.loader, this.cwd, this.cid)
|
|
26
30
|
.runnerAdapterFor(config);
|
|
27
31
|
// This is the only (hacky) way to register a fake reporter programmatically (as of @wdio/reporter 7.4.2)
|
|
@@ -36,7 +40,8 @@ class WebdriverIOFrameworkAdapter {
|
|
|
36
40
|
this.serenity.configure({
|
|
37
41
|
outputStream: outputStreamBuffer,
|
|
38
42
|
cueTimeout: config.serenity.cueTimeout,
|
|
39
|
-
actors: config.serenity.actors,
|
|
43
|
+
actors: config.serenity.actors || core_1.Cast.where(actor => actor.whoCan(screenplay_1.BrowseTheWebWithWebdriverIO.using(browser), core_1.TakeNotes.usingAnEmptyNotepad())),
|
|
44
|
+
diffFormatter: (_a = config.serenity.diffFormatter) !== null && _a !== void 0 ? _a : new core_1.AnsiDiffFormatter(),
|
|
40
45
|
crew: [
|
|
41
46
|
...config.serenity.crew,
|
|
42
47
|
this.notifier,
|
|
@@ -51,8 +56,9 @@ class WebdriverIOFrameworkAdapter {
|
|
|
51
56
|
hasTests() {
|
|
52
57
|
return this.adapter.scenarioCount() > 0;
|
|
53
58
|
}
|
|
54
|
-
run() {
|
|
55
|
-
|
|
59
|
+
async run() {
|
|
60
|
+
await this.adapter.run();
|
|
61
|
+
return this.notifier.failureCount();
|
|
56
62
|
}
|
|
57
63
|
defaultConfig() {
|
|
58
64
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebdriverIOFrameworkAdapter.js","sourceRoot":"","sources":["../../src/adapter/WebdriverIOFrameworkAdapter.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"WebdriverIOFrameworkAdapter.js","sourceRoot":"","sources":["../../src/adapter/WebdriverIOFrameworkAdapter.ts"],"names":[],"mappings":";;;AAAA,4CAAmG;AAKnG,oDAAkD;AAElD,8CAA4D;AAC5D,yCAAwH;AACxH,oFAAiF;AACjF,yDAAsD;AAEtD,+DAA4D;AAC5D,uCAAwC;AAExC,MAAa,2BAA2B;IAKpC,YACqB,QAAkB,EAClB,MAAoB,EACpB,GAAS,EACT,GAAW,EAC5B,iBAAoC,EACnB,KAAe,EACf,YAA2C,EAC5D,QAAmE;;QAPlD,aAAQ,GAAR,QAAQ,CAAU;QAClB,WAAM,GAAN,MAAM,CAAc;QACpB,QAAG,GAAH,GAAG,CAAM;QACT,QAAG,GAAH,GAAG,CAAQ;QAEX,UAAK,GAAL,KAAK,CAAU;QACf,iBAAY,GAAZ,YAAY,CAA+B;QAG5D,MAAM,MAAM,GAAG,SAAS,CAAoB,IAAI,CAAC,aAAa,EAAE,EAAE,iBAAiB,EAAE;YACjF,iBAAiB,EAAE,kBAAQ;SAC9B,CAAC,CAAC;QAEH,gEAAgE;QAChE,2DAA2D;QAC3D,4DAA4D;QAC5D,+EAA+E;QAC/E,OAAO,iBAAiB,CAAC,QAAQ,CAAC;QAElC,IAAI,CAAC,OAAO,GAAG,IAAI,mCAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC;aAC/D,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAE9B,yGAAyG;QACzG,0IAA0I;QAC1I,uIAAuI;QACtI,QAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC;YACpD,sCAA2B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5C,CAAC;IAED,KAAK,CAAC,GAAG;QACL,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC;IACxC,CAAC;IAEO,aAAa;QACjB,OAAO;YACH,QAAQ,EAAE;gBACN,IAAI,EAAE;oBACF,uBAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,sBAAsB,CAAC;iBAC9E;aACJ;SACJ,CAAA;IACL,CAAC;CACJ;AA9FD,kEA8FC"}
|
|
@@ -7,7 +7,7 @@ import { InitialisesReporters, ProvidesWriteStream } from './reporter';
|
|
|
7
7
|
import { WebdriverIOConfig } from './WebdriverIOConfig';
|
|
8
8
|
import { WebdriverIOFrameworkAdapter } from './WebdriverIOFrameworkAdapter';
|
|
9
9
|
/**
|
|
10
|
-
* @
|
|
10
|
+
* @group Test Runner Adapter
|
|
11
11
|
*/
|
|
12
12
|
export declare class WebdriverIOFrameworkAdapterFactory {
|
|
13
13
|
private readonly serenity;
|
|
@@ -16,3 +16,4 @@ export declare class WebdriverIOFrameworkAdapterFactory {
|
|
|
16
16
|
constructor(serenity: Serenity, loader: ModuleLoader, cwd: Path);
|
|
17
17
|
init(cid: string, config: WebdriverIOConfig, specs: string[], capabilities: Capabilities.RemoteCapability, reporter: EventEmitter & ProvidesWriteStream & InitialisesReporters): Promise<WebdriverIOFrameworkAdapter>;
|
|
18
18
|
}
|
|
19
|
+
//# sourceMappingURL=WebdriverIOFrameworkAdapterFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebdriverIOFrameworkAdapterFactory.d.ts","sourceRoot":"","sources":["../../src/adapter/WebdriverIOFrameworkAdapterFactory.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAE3C,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E;;GAEG;AACH,qBAAa,kCAAkC;IAEvC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAFH,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,IAAI;IAIvB,IAAI,CACP,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,MAAM,EAAE,EACf,YAAY,EAAE,YAAY,CAAC,gBAAgB,EAC3C,QAAQ,EAAE,YAAY,GAAG,mBAAmB,GAAG,oBAAoB,GACpE,OAAO,CAAC,2BAA2B,CAAC;CAY1C"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.WebdriverIOFrameworkAdapterFactory = void 0;
|
|
4
4
|
const WebdriverIOFrameworkAdapter_1 = require("./WebdriverIOFrameworkAdapter");
|
|
5
5
|
/**
|
|
6
|
-
* @
|
|
6
|
+
* @group Test Runner Adapter
|
|
7
7
|
*/
|
|
8
8
|
class WebdriverIOFrameworkAdapterFactory {
|
|
9
9
|
constructor(serenity, loader, cwd) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebdriverIONotifier.d.ts","sourceRoot":"","sources":["../../src/adapter/WebdriverIONotifier.ts"],"names":[],"mappings":";AAAA,OAAO,EAAc,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC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