@wdio/cli 8.17.0 → 8.18.2

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.
Files changed (31) hide show
  1. package/build/commands/config.d.ts.map +1 -1
  2. package/build/commands/config.js +13 -5
  3. package/build/constants.d.ts +10 -3
  4. package/build/constants.d.ts.map +1 -1
  5. package/build/constants.js +47 -23
  6. package/build/templates/EjsHelpers.d.ts +18 -0
  7. package/build/templates/EjsHelpers.d.ts.map +1 -0
  8. package/build/templates/EjsHelpers.js +59 -0
  9. package/build/templates/EjsHelpers.ts +84 -0
  10. package/build/templates/exampleFiles/serenity-js/common/config/serenity.properties.ejs +1 -0
  11. package/build/templates/exampleFiles/serenity-js/common/serenity/github-api/GitHubStatus.ts.ejs +41 -0
  12. package/build/templates/exampleFiles/serenity-js/common/serenity/todo-list-app/TodoList.ts.ejs +100 -0
  13. package/build/templates/exampleFiles/serenity-js/common/serenity/todo-list-app/TodoListItem.ts.ejs +36 -0
  14. package/build/templates/exampleFiles/serenity-js/cucumber/step-definitions/steps.ts.ejs +37 -0
  15. package/build/templates/exampleFiles/serenity-js/cucumber/support/parameter.config.ts.ejs +18 -0
  16. package/build/templates/exampleFiles/serenity-js/cucumber/todo-list/completing_items.feature.ejs +23 -0
  17. package/build/templates/exampleFiles/serenity-js/cucumber/todo-list/narrative.md.ejs +17 -0
  18. package/build/templates/exampleFiles/serenity-js/jasmine/example.spec.ts.ejs +86 -0
  19. package/build/templates/exampleFiles/serenity-js/mocha/example.spec.ts.ejs +88 -0
  20. package/build/templates/snippets/capabilities.ejs +9 -3
  21. package/build/templates/snippets/cucumber.ejs +48 -0
  22. package/build/templates/snippets/jasmine.ejs +20 -0
  23. package/build/templates/snippets/mocha.ejs +14 -0
  24. package/build/templates/snippets/serenity.ejs +18 -0
  25. package/build/templates/wdio.conf.tpl.ejs +11 -86
  26. package/build/types.d.ts +5 -1
  27. package/build/types.d.ts.map +1 -1
  28. package/build/utils.d.ts +4 -2
  29. package/build/utils.d.ts.map +1 -1
  30. package/build/utils.js +170 -81
  31. package/package.json +7 -7
@@ -0,0 +1,37 @@
1
+ <%- _.import('Given, When, Then, type DataTable', '@cucumber/cucumber') %>
2
+ <%- _.import('Ensure, equals', '@serenity-js/assertions') %>
3
+ <%- _.import('type Actor', '@serenity-js/core') %>
4
+ <%- _.import('TodoList', '../../serenity/todo-list-app/TodoList') %>
5
+
6
+ Given('{actor} starts/started with a list containing:', async (<%- _.param('actor', 'Actor') %>, <%- _.param('table', 'DataTable') %>) => {
7
+ await actor.attemptsTo(
8
+ TodoList.createListContaining(itemsFrom(table)),
9
+ )
10
+ })
11
+
12
+ When('{pronoun} marks/marked the following item(s) as completed:', async (<%- _.param('actor', 'Actor') %>, <%- _.param('table', 'DataTable') %>) => {
13
+ await actor.attemptsTo(
14
+ TodoList.markAsCompleted(itemsFrom(table)),
15
+ )
16
+ })
17
+
18
+ When('{pronoun} marks/marked the following item(s) as outstanding:', async (<%- _.param('actor', 'Actor') %>, <%- _.param('table', 'DataTable') %>) => {
19
+ await actor.attemptsTo(
20
+ TodoList.markAsOutstanding(itemsFrom(table)),
21
+ )
22
+ })
23
+
24
+ Then('{pronoun} should see that she has {int} item(s) outstanding', async (<%- _.param('actor', 'Actor') %>, <%- _.param('expectedCount', 'number') %>) => {
25
+ await actor.attemptsTo(
26
+ Ensure.that(TodoList.outstandingItemsCount(), equals(expectedCount)),
27
+ )
28
+ })
29
+
30
+ /**
31
+ * Extracts the data from a single-column Cucumber DataTable and returns it as an `Array<string>`
32
+ *
33
+ * @param table
34
+ */
35
+ function itemsFrom(<%- _.param('table', 'DataTable') %>)<%- _.returns('string[]') %> {
36
+ return table.raw().map(row => row[0])
37
+ }
@@ -0,0 +1,18 @@
1
+ <%- _.import('defineParameterType', '@cucumber/cucumber') %>
2
+ <%- _.import('actorCalled, actorInTheSpotlight', '@serenity-js/core') %>
3
+
4
+ defineParameterType({
5
+ regexp: /[A-Z][a-z]+/,
6
+ transformer(<%- _.param('name', 'string') %>) {
7
+ return actorCalled(name)
8
+ },
9
+ name: 'actor',
10
+ })
11
+
12
+ defineParameterType({
13
+ regexp: /he|she|they|his|her|their/,
14
+ transformer() {
15
+ return actorInTheSpotlight()
16
+ },
17
+ name: 'pronoun',
18
+ })
@@ -0,0 +1,23 @@
1
+ Feature: Completing items
2
+
3
+ Scenario: Counting outstanding items
4
+
5
+ Given Alice started with a list containing:
6
+ | Buy dog food |
7
+ | Feed the dog |
8
+ | Book a vet's appointment |
9
+ When she marks the following items as completed:
10
+ | Buy dog food |
11
+ | Feed the dog |
12
+ Then she should see that she has 1 item outstanding
13
+
14
+ Scenario: Marking items as not completed
15
+
16
+ Given Alice started with a list containing:
17
+ | Buy dog food |
18
+ | Feed the dog |
19
+ And she marked the following items as completed:
20
+ | Buy dog food |
21
+ When she marks the following items as outstanding:
22
+ | Buy dog food |
23
+ Then she should see that she has 2 items outstanding
@@ -0,0 +1,17 @@
1
+ Serenity/JS Todo List Example
2
+
3
+ Narrative:
4
+
5
+ This is a simple example of a Serenity/JS project, interacting with a [TodoMVC](http://todomvc.com/) application
6
+ available at [todo-app.serenity-js.org/](https://todo-app.serenity-js.org/).
7
+
8
+ This note is called _"the narrative"_. It can be used to provide the context around the business capability of your
9
+ product ("Reporting Results" in this case) and its features that help to enable this capability.
10
+
11
+ **Please note:** While [Cucumber](https://github.com/cucumber/cucumber-js) allows you to capture a description
12
+ of each feature in the `.feature` file, [Serenity/JS](https://serenityjs.org) allows us to group those `.feature`
13
+ files in directories corresponding to "epics", "themes" or "business capabilities" of your system and provide
14
+ each one of those with additional context using this `narrative.txt` file.
15
+
16
+ **By the way:** Did you notice that you can use **[markdown syntax](https://www.markdownguide.org/)** to better express
17
+ your thoughts?
@@ -0,0 +1,86 @@
1
+ <%- _.import('Ensure, equals', '@serenity-js/assertions') %>
2
+ <%- _.import('actorCalled', '@serenity-js/core') %>
3
+ <%- _.import('By, Navigate, PageElement, Text', '@serenity-js/web') %>
4
+
5
+ <%- _.import('GitHubStatus', '../serenity/github-api/GitHubStatus') %>
6
+ <%- _.import('TodoList', '../serenity/todo-list-app/TodoList') %>
7
+
8
+ /**
9
+ * Serenity/JS Screenplay Pattern test scenarios use one or more actors to represent people and external systems
10
+ * interacting with the system under test.
11
+ *
12
+ * To design a test scenario, give each actor a series of tasks and interactions to perform
13
+ * and instruct them to answer questions about the state of the system under test
14
+ * to ensure that the answers meet the expected results.
15
+ *
16
+ * This example test file demonstrates several ways of writing test scenarios using the Screenplay Pattern.
17
+ *
18
+ * Learn more:
19
+ * - Serenity/JS Screenplay Pattern - https://serenity-js.org/handbook/design/screenplay-pattern/
20
+ * - Web Testing with Serenity/JS - https://serenity-js.org/handbook/web-testing/
21
+ * - API Testing with Serenity/JS - https://serenity-js.org/handbook/api-testing/
22
+ * - Serenity/JS web module - https://serenity-js.org/api/web/
23
+ * - Serenity/JS REST module - https://serenity-js.org/api/rest/
24
+ * - Serenity/JS assertions module - https://serenity-js.org/api/assertions/
25
+ */
26
+ describe('Serenity/JS Website', () => {
27
+
28
+ /**
29
+ * This is the most basic example of a Serenity/JS Screenplay Pattern test scenario.
30
+ *
31
+ * This scenario uses a single actor configured to perform a series of web-based interactions,
32
+ * and uses only the low-level abstractions provided by the Serenity/JS web module.
33
+ */
34
+ it('offers a web testing tutorial', async () => {
35
+ await actorCalled('Alice').attemptsTo(
36
+ Navigate.to('https://serenity-js.org'),
37
+ Ensure.that(
38
+ Text.of(PageElement.located(By.id('cta-start-automating'))),
39
+ equals('Start automating 🚀')
40
+ ),
41
+ )
42
+ })
43
+
44
+ /**
45
+ * This is a more advanced example of a Serenity/JS Screenplay Pattern test scenario.
46
+ *
47
+ * This scenario uses two actors:
48
+ * - Apisitt, responsible for interacting with an API to check if the system is up and running before performing any UI checks
49
+ * - Wendy, responsible for interacting with the website to perform the actual acceptance test
50
+ *
51
+ * In this scenario, rather than list all the interactions in the test itself, we use:
52
+ * - API Actions Class Pattern to group tasks concerning interacting with the GitHubStatus API
53
+ * - Screenplay Pattern flavour of Page Objects to group tasks and questions concerning interacting with the Serenity/JS Todo List app
54
+ *
55
+ * Note that apart from strongly encouraging the Screenplay Pattern,
56
+ * Serenity/JS doesn't require you to organise your code in any particular way.
57
+ * This gives you the freedom to choose patterns and abstractions that work best for you, your team,
58
+ * and reflect the domain of your system under test.
59
+ */
60
+ it(`offers examples to help you practice test automation`, async () => {
61
+
62
+ // You can use API interactions to manage test data, or to ensure services are up and running before performing any UI checks.
63
+ // Since Serenity/JS demo website is deployed to GitHub Pages,
64
+ // before interacting with the website we ensure that GitHub itself is up and running.
65
+ await actorCalled('Apisitt').attemptsTo(
66
+ GitHubStatus.ensureAllSystemsOperational(),
67
+ )
68
+
69
+ // Once we know the system is up and running, Wendy can proceed with the web-based scenario.
70
+ await actorCalled('Wendy').attemptsTo(
71
+ TodoList.createListContaining([
72
+ `Buy dog food`,
73
+ `Feed the dog`,
74
+ `Book a vet's appointment`,
75
+ ]),
76
+ TodoList.markAsCompleted([
77
+ `Buy dog food`,
78
+ `Feed the dog`,
79
+ ]),
80
+ Ensure.that(
81
+ TodoList.outstandingItemsCount(),
82
+ equals(1)
83
+ ),
84
+ )
85
+ })
86
+ })
@@ -0,0 +1,88 @@
1
+ <%- _.import('describe, it', 'mocha') %>
2
+
3
+ <%- _.import('Ensure, equals', '@serenity-js/assertions') %>
4
+ <%- _.import('actorCalled', '@serenity-js/core') %>
5
+ <%- _.import('By, Navigate, PageElement, Text', '@serenity-js/web') %>
6
+
7
+ <%- _.import('GitHubStatus', '../serenity/github-api/GitHubStatus') %>
8
+ <%- _.import('TodoList', '../serenity/todo-list-app/TodoList') %>
9
+
10
+ /**
11
+ * Serenity/JS Screenplay Pattern test scenarios use one or more actors to represent people and external systems
12
+ * interacting with the system under test.
13
+ *
14
+ * To design a test scenario, give each actor a series of tasks and interactions to perform
15
+ * and instruct them to answer questions about the state of the system under test
16
+ * to ensure that the answers meet the expected results.
17
+ *
18
+ * This example test file demonstrates several ways of writing test scenarios using the Screenplay Pattern.
19
+ *
20
+ * Learn more:
21
+ * - Serenity/JS Screenplay Pattern - https://serenity-js.org/handbook/design/screenplay-pattern/
22
+ * - Web Testing with Serenity/JS - https://serenity-js.org/handbook/web-testing/
23
+ * - API Testing with Serenity/JS - https://serenity-js.org/handbook/api-testing/
24
+ * - Serenity/JS web module - https://serenity-js.org/api/web/
25
+ * - Serenity/JS REST module - https://serenity-js.org/api/rest/
26
+ * - Serenity/JS assertions module - https://serenity-js.org/api/assertions/
27
+ */
28
+ describe('Serenity/JS Website', () => {
29
+
30
+ /**
31
+ * This is the most basic example of a Serenity/JS Screenplay Pattern test scenario.
32
+ *
33
+ * This scenario uses a single actor configured to perform a series of web-based interactions,
34
+ * and uses only the low-level abstractions provided by the Serenity/JS web module.
35
+ */
36
+ it('offers a web testing tutorial', async () => {
37
+ await actorCalled('Alice').attemptsTo(
38
+ Navigate.to('https://serenity-js.org'),
39
+ Ensure.that(
40
+ Text.of(PageElement.located(By.id('cta-start-automating'))),
41
+ equals('Start automating 🚀')
42
+ ),
43
+ )
44
+ })
45
+
46
+ /**
47
+ * This is a more advanced example of a Serenity/JS Screenplay Pattern test scenario.
48
+ *
49
+ * This scenario uses two actors:
50
+ * - Apisitt, responsible for interacting with an API to check if the system is up and running before performing any UI checks
51
+ * - Wendy, responsible for interacting with the website to perform the actual acceptance test
52
+ *
53
+ * In this scenario, rather than list all the interactions in the test itself, we use:
54
+ * - API Actions Class Pattern to group tasks concerning interacting with the GitHubStatus API
55
+ * - Screenplay Pattern flavour of Page Objects to group tasks and questions concerning interacting with the Serenity/JS Todo List app
56
+ *
57
+ * Note that apart from strongly encouraging the Screenplay Pattern,
58
+ * Serenity/JS doesn't require you to organise your code in any particular way.
59
+ * This gives you the freedom to choose patterns and abstractions that work best for you, your team,
60
+ * and reflect the domain of your system under test.
61
+ */
62
+ it(`offers examples to help you practice test automation`, async () => {
63
+
64
+ // You can use API interactions to manage test data, or to ensure services are up and running before performing any UI checks.
65
+ // Since Serenity/JS demo website is deployed to GitHub Pages,
66
+ // before interacting with the website we ensure that GitHub itself is up and running.
67
+ await actorCalled('Apisitt').attemptsTo(
68
+ GitHubStatus.ensureAllSystemsOperational(),
69
+ )
70
+
71
+ // Once we know the system is up and running, Wendy can proceed with the web-based scenario.
72
+ await actorCalled('Wendy').attemptsTo(
73
+ TodoList.createListContaining([
74
+ `Buy dog food`,
75
+ `Feed the dog`,
76
+ `Book a vet's appointment`,
77
+ ]),
78
+ TodoList.markAsCompleted([
79
+ `Buy dog food`,
80
+ `Feed the dog`,
81
+ ]),
82
+ Ensure.that(
83
+ TodoList.outstandingItemsCount(),
84
+ equals(1)
85
+ ),
86
+ )
87
+ })
88
+ })
@@ -39,9 +39,15 @@ capabilities: [{<%
39
39
  }<%
40
40
  } else if (answers.purpose === 'electron') { %>
41
41
  browserName: 'electron',
42
- 'wdio:electronServiceOptions': {
43
- appBinaryPath: <%- answers.electronAppBinaryPath ? `'${answers.electronAppBinaryPath}'` : 'getBinaryPath(electronAppRepoPath, productName, electronBuilderOutputDirectory)' %>,
44
- appArgs: ['foo', 'bar=baz']
42
+ // Electron service options
43
+ // see https://webdriver.io/docs/wdio-electron-service/#configuration
44
+ 'wdio:electronServiceOptions': {<%
45
+ if (answers.electronAppBinaryPath) { %>
46
+ // custom path to app binary
47
+ appBinaryPath: '<%- answers.electronAppBinaryPath %>',<%
48
+ } %>
49
+ // custom application args
50
+ appArgs: []
45
51
  }<%
46
52
  } else {
47
53
  %>
@@ -0,0 +1,48 @@
1
+ <% if (answers.framework === 'cucumber') { %>
2
+ // If you are using Cucumber you need to specify the location of your step definitions.
3
+ cucumberOpts: {
4
+ // <string[]> (file/dir) require files before executing features
5
+ require: ['<%- answers.stepDefinitions %>'],
6
+ // <boolean> show full backtrace for errors
7
+ backtrace: false,
8
+ // <string[]> ("extension:module") require files with the given EXTENSION after requiring MODULE (repeatable)
9
+ requireModule: [],
10
+ // <boolean> invoke formatters without executing steps
11
+ dryRun: false,
12
+ // <boolean> abort the run on first failure
13
+ failFast: false,
14
+ // <boolean> hide step definition snippets for pending steps
15
+ snippets: true,
16
+ // <boolean> hide source uris
17
+ source: true,
18
+ // <boolean> fail if there are any undefined or pending steps
19
+ strict: false,
20
+ // <string> (expression) only execute the features or scenarios with tags matching the expression
21
+ tagExpression: '',
22
+ // <number> timeout for step definitions
23
+ timeout: 60000,
24
+ // <boolean> Enable this config to treat undefined definitions as warnings.
25
+ ignoreUndefinedDefinitions: false
26
+ },
27
+ <% } else if (answers.serenityAdapter === 'cucumber') { %>
28
+ // Cucumber configuration, see
29
+ // https://serenity-js.org/api/cucumber-adapter/interface/CucumberConfig/
30
+ cucumberOpts: {
31
+ // <string[]> (file/dir) require files before executing features
32
+ import: [
33
+ <% if (answers.stepDefinitions) {
34
+ %>'<%- answers.stepDefinitions %>',
35
+ <% } %>'./features/support/*.<%- answers.isUsingTypeScript ? 'ts' : 'js' %>',
36
+ ],
37
+ // <string[]> (type[:path]) specify native Cucumber.js output format, if needed. Optionally supply PATH to redirect formatter output (repeatable)
38
+ format: [ ],
39
+ // <string> (name) specify the profile to use
40
+ profile: '',
41
+ // <boolean> fail if there are any undefined or pending steps
42
+ strict: false,
43
+ // <string[] | string> (expression) only execute the features or scenarios with tags matching the expression
44
+ tags: [],
45
+ // <number> timeout for step definitions
46
+ timeout: 60000,
47
+ },
48
+ <% } %>
@@ -0,0 +1,20 @@
1
+ <% if (answers.framework === 'jasmine') { %>
2
+ // Options to be passed to Jasmine.
3
+ jasmineOpts: {
4
+ // Jasmine default timeout
5
+ defaultTimeoutInterval: 60000,
6
+ //
7
+ // The Jasmine framework allows interception of each assertion in order to log the state of the application
8
+ // or website depending on the result. For example, it is pretty handy to take a screenshot every time
9
+ // an assertion fails.
10
+ expectationResultHandler: function(passed, assertion) {
11
+ // do something
12
+ }
13
+ },
14
+ <% } else if (answers.serenityAdapter === 'jasmine') { %>
15
+ // Jasmine configuration, see:
16
+ // https://serenity-js.org/api/jasmine-adapter/interface/JasmineConfig
17
+ jasmineOpts: {
18
+ defaultTimeoutInterval: 60000,
19
+ },
20
+ <% } %>
@@ -0,0 +1,14 @@
1
+ <% if (answers.framework === 'mocha') { %>
2
+ // Options to be passed to Mocha.
3
+ // See the full list at http://mochajs.org/
4
+ mochaOpts: {
5
+ ui: 'bdd',
6
+ timeout: 60000
7
+ },
8
+ <% } else if (answers.serenityAdapter === 'mocha') { %>
9
+ // Mocha configuration, see:
10
+ // https://serenity-js.org/api/mocha-adapter/interface/MochaConfig/
11
+ mochaOpts: {
12
+ timeout: 60000
13
+ },
14
+ <% } %>
@@ -0,0 +1,18 @@
1
+ //
2
+ // Serenity/JS configuration, see:
3
+ // https://serenity-js.org/handbook/getting-started/serenity-js-with-webdriverio/
4
+ serenity: {
5
+ runner: '<%- answers.serenityAdapter %>',
6
+
7
+ // Configure reporting services, see:
8
+ // https://serenity-js.org/handbook/reporting/
9
+ crew: [
10
+ '@serenity-js/console-reporter',
11
+ '@serenity-js/serenity-bdd',
12
+ [ '@serenity-js/core:ArtifactArchiver', { outputDirectory: 'target/site/serenity' } ],
13
+ [ '@serenity-js/web:Photographer', {
14
+ // strategy: 'TakePhotosOfFailures' // fast execution, screenshots only when tests fail
15
+ strategy: 'TakePhotosOfInteractions' // slower execution, more comprehensive reports
16
+ } ],
17
+ ]
18
+ },
@@ -1,43 +1,14 @@
1
1
  <%
2
- const electronBuilderConfigIsJson = () => answers.electronBuilderConfigPath.endsWith('.json')
3
- const electronBuilderConfigIsPackageJson = () => answers.electronBuilderConfigPath.endsWith('package.json')
4
-
5
- if (answers.purpose === 'electron') {
6
- if (answers.electronBuildTool === 'electron-builder' && electronBuilderConfigIsJson()) {
7
- %>import fs from 'node:fs'
8
- <% }
9
- if (answers.electronBuildTool === 'electron-builder' && !answers.electronAppBinaryPath) {
10
- %>import path from 'node:path'
11
-
12
- import { getBinaryPath } from 'wdio-electron-service/utils'
13
-
14
- <% }
15
- }
16
-
17
- if (answers.isUsingTypeScript) {
2
+ if (answers.isUsingTypeScript && !answers.serenityAdapter) {
18
3
  %>import type { Options } from '@wdio/types'
19
-
20
4
  <% }
21
5
 
22
- if (answers.purpose === 'electron' && answers.electronBuildTool === 'electron-builder') {
23
- if (electronBuilderConfigIsJson()) {
24
- %>const electronAppRepoPath = path.dirname('<%- answers.electronBuilderConfigPath %>')
25
- <% }
26
- if (electronBuilderConfigIsPackageJson()) {
27
- %>const packageJson = JSON.parse(fs.readFileSync('<%- answers.electronBuilderConfigPath %>'), 'utf-8'))
28
- const productName = packageJson.build.productName
29
- const electronBuilderOutputDirectory = packageJson.build.directories?.output
30
-
31
- <% } else if (electronBuilderConfigIsJson()) {
32
- %>const electronBuilderJson = JSON.parse(fs.readFileSync('<%- answers.electronBuilderConfigPath %>', 'utf-8'))
33
- const productName = electronBuilderJson.productName
34
- const electronBuilderOutputDirectory = electronBuilderJson.directories?.output
35
-
36
- <% }
37
- }
6
+ if (answers.isUsingTypeScript && answers.serenityAdapter) {
7
+ %>import type { WebdriverIOConfig } from '@serenity-js/webdriverio'
8
+ <% }
38
9
 
39
10
  if (answers.isUsingTypeScript) {
40
- %>export const config: Options.Testrunner = {<%
11
+ %>export const config: <%= answers.serenityAdapter ? 'WebdriverIOConfig' : 'Options.Testrunner' %> = {<%
41
12
  } else if (answers.esmSupport) {
42
13
  %>export const config = {<%
43
14
  } else {
@@ -221,6 +192,7 @@ if (answers.isUsingTypeScript) {
221
192
  // Make sure you have the wdio adapter package for the specific framework installed
222
193
  // before running any tests.
223
194
  framework: '<%- answers.framework %>',
195
+ <%- answers.framework === '@serenity-js/webdriverio' ? include('snippets/serenity', { answers }) : '' %>
224
196
  //
225
197
  // The number of times to retry the entire specfile when it fails as a whole
226
198
  // specFileRetries: 1,
@@ -231,58 +203,11 @@ if (answers.isUsingTypeScript) {
231
203
  // Whether or not retried spec files should be retried immediately or deferred to the end of the queue
232
204
  // specFileRetriesDeferred: false,
233
205
  //
234
- <%- include('snippets/reporters', { reporters: answers.reporters }) %>
235
- <% if(answers.framework === 'mocha') { %>
236
- //
237
- // Options to be passed to Mocha.
238
- // See the full list at http://mochajs.org/
239
- mochaOpts: {
240
- ui: 'bdd',
241
- timeout: 60000
242
- },<%
243
- }
244
- if(answers.framework === 'jasmine') { %>
245
- //
246
- // Options to be passed to Jasmine.
247
- jasmineOpts: {
248
- // Jasmine default timeout
249
- defaultTimeoutInterval: 60000,
250
- //
251
- // The Jasmine framework allows interception of each assertion in order to log the state of the application
252
- // or website depending on the result. For example, it is pretty handy to take a screenshot every time
253
- // an assertion fails.
254
- expectationResultHandler: function(passed, assertion) {
255
- // do something
256
- }
257
- },
258
- <% }
259
- if(answers.framework === 'cucumber') { %>//
260
- // If you are using Cucumber you need to specify the location of your step definitions.
261
- cucumberOpts: {
262
- // <string[]> (file/dir) require files before executing features
263
- require: ['<%- answers.stepDefinitions %>'],
264
- // <boolean> show full backtrace for errors
265
- backtrace: false,
266
- // <string[]> ("extension:module") require files with the given EXTENSION after requiring MODULE (repeatable)
267
- requireModule: [],
268
- // <boolean> invoke formatters without executing steps
269
- dryRun: false,
270
- // <boolean> abort the run on first failure
271
- failFast: false,
272
- // <boolean> hide step definition snippets for pending steps
273
- snippets: true,
274
- // <boolean> hide source uris
275
- source: true,
276
- // <boolean> fail if there are any undefined or pending steps
277
- strict: false,
278
- // <string> (expression) only execute the features or scenarios with tags matching the expression
279
- tagExpression: '',
280
- // <number> timeout for step definitions
281
- timeout: 60000,
282
- // <boolean> Enable this config to treat undefined definitions as warnings.
283
- ignoreUndefinedDefinitions: false
284
- },
285
- <% } %>
206
+ <%- include('snippets/reporters', { reporters: answers.reporters })
207
+ %><%- _.if([ answers.serenityAdapter, answers.framework ].includes('mocha'), include('snippets/mocha', { answers }))
208
+ %><%- _.if([ answers.serenityAdapter, answers.framework ].includes('jasmine'), include('snippets/jasmine', { answers }))
209
+ %><%- _.if([ answers.serenityAdapter, answers.framework ].includes('cucumber'), include('snippets/cucumber', { answers }))
210
+ %>
286
211
  //
287
212
  // =====
288
213
  // Hooks
package/build/types.d.ts CHANGED
@@ -7,7 +7,7 @@ export interface Questionnair {
7
7
  installTestingLibrary?: boolean;
8
8
  electronAppBinaryPath?: string;
9
9
  electronBuildTool?: ElectronBuildToolChoice;
10
- electronBuilderConfigPath: string;
10
+ electronBuilderConfigPath?: string;
11
11
  backend?: BackendChoice;
12
12
  hostname?: string;
13
13
  port?: string;
@@ -29,6 +29,7 @@ export interface Questionnair {
29
29
  isUsingCompiler: CompilerOptions;
30
30
  reporters: string[];
31
31
  services: string[];
32
+ serenityLibPath?: string;
32
33
  plugins: string[];
33
34
  outputDir?: string;
34
35
  baseUrl: string;
@@ -43,6 +44,7 @@ export interface Questionnair {
43
44
  export interface ParsedAnswers extends Omit<Questionnair, 'runner' | 'framework' | 'reporters' | 'services' | 'plugins'> {
44
45
  rawAnswers: Questionnair;
45
46
  runner: 'local' | 'browser';
47
+ projectName: string;
46
48
  framework: string;
47
49
  purpose: string;
48
50
  reporters: string[];
@@ -51,6 +53,7 @@ export interface ParsedAnswers extends Omit<Questionnair, 'runner' | 'framework'
51
53
  packagesToInstall: string[];
52
54
  isUsingTypeScript: boolean;
53
55
  isUsingBabel: boolean;
56
+ serenityAdapter: string | false;
54
57
  esmSupport: boolean;
55
58
  isSync: boolean;
56
59
  _async: string;
@@ -58,6 +61,7 @@ export interface ParsedAnswers extends Omit<Questionnair, 'runner' | 'framework'
58
61
  projectRootDir: string;
59
62
  destSpecRootPath: string;
60
63
  destPageObjectRootPath: string;
64
+ destSerenityLibRootPath: string;
61
65
  relativePath: string;
62
66
  hasRootTSConfig: boolean;
63
67
  tsConfigFilePath: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,KAA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E,OAAO,CAAA;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,qBAAqB,CAAA;CACrC"}
package/build/utils.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  /// <reference types="node" />
2
2
  import type { SpawnOptions } from 'node:child_process';
3
3
  import { SevereServiceError } from 'webdriverio';
4
- import type { Options, Capabilities, Services } from '@wdio/types';
4
+ import type { Capabilities, Options, Services } from '@wdio/types';
5
5
  import { CompilerOptions } from './constants.js';
6
- import type { ReplCommandArguments, Questionnair, SupportedPackage, OnCompleteResult, ParsedAnswers, ProjectProps } from './types.js';
6
+ import type { OnCompleteResult, ParsedAnswers, ProjectProps, Questionnair, ReplCommandArguments, SupportedPackage } from './types.js';
7
7
  export declare const renderFile: (path: string, data: Record<string, any>) => Promise<string>;
8
8
  export declare class HookError extends SevereServiceError {
9
9
  origin: string;
@@ -40,6 +40,7 @@ export declare function addServiceDeps(names: SupportedPackage[], packages: stri
40
40
  * @todo add JSComments
41
41
  */
42
42
  export declare function convertPackageHashToObject(pkg: string, hash?: string): SupportedPackage;
43
+ export declare function getSerenityPackages(answers: Questionnair): string[];
43
44
  export declare function getCapabilities(arg: ReplCommandArguments): Promise<{
44
45
  capabilities: {
45
46
  deviceName: string;
@@ -102,6 +103,7 @@ export declare function getPathForFileGeneration(answers: Questionnair, projectR
102
103
  destSpecRootPath: string;
103
104
  destStepRootPath: string;
104
105
  destPageObjectRootPath: string;
106
+ destSerenityLibRootPath: string;
105
107
  relativePath: string;
106
108
  };
107
109
  export declare function getDefaultFiles(answers: Questionnair, pattern: string): Promise<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAetD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAGhD,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ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