@wdio/cli 9.16.1 → 9.17.0
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/build/commands/index.d.ts.map +1 -1
- package/build/commands/repl.d.ts.map +1 -1
- package/build/commands/run.d.ts +1 -1
- package/build/commands/run.d.ts.map +1 -1
- package/build/constants.d.ts +0 -235
- package/build/constants.d.ts.map +1 -1
- package/build/index.js +120 -1737
- package/build/interface.d.ts.map +1 -1
- package/build/types.d.ts +2 -74
- package/build/types.d.ts.map +1 -1
- package/build/utils.d.ts +1 -73
- package/build/utils.d.ts.map +1 -1
- package/build/watcher.d.ts.map +1 -1
- package/package.json +10 -10
- package/build/commands/config.d.ts +0 -74
- package/build/commands/config.d.ts.map +0 -1
- package/build/commands/install.d.ts +0 -12
- package/build/commands/install.d.ts.map +0 -1
- package/build/install.d.ts +0 -4
- package/build/install.d.ts.map +0 -1
- package/build/templates/EjsHelpers.d.ts +0 -18
- package/build/templates/EjsHelpers.d.ts.map +0 -1
- package/build/templates/exampleFiles/browser/Component.css.ejs +0 -121
- package/build/templates/exampleFiles/browser/Component.lit.ejs +0 -154
- package/build/templates/exampleFiles/browser/Component.lit.test.ejs +0 -24
- package/build/templates/exampleFiles/browser/Component.preact.ejs +0 -28
- package/build/templates/exampleFiles/browser/Component.preact.test.ejs +0 -59
- package/build/templates/exampleFiles/browser/Component.react.ejs +0 -29
- package/build/templates/exampleFiles/browser/Component.react.test.ejs +0 -58
- package/build/templates/exampleFiles/browser/Component.solid.ejs +0 -28
- package/build/templates/exampleFiles/browser/Component.solid.test.ejs +0 -58
- package/build/templates/exampleFiles/browser/Component.stencil.ejs +0 -43
- package/build/templates/exampleFiles/browser/Component.stencil.test.ejs +0 -45
- package/build/templates/exampleFiles/browser/Component.svelte.ejs +0 -47
- package/build/templates/exampleFiles/browser/Component.svelte.test.ejs +0 -58
- package/build/templates/exampleFiles/browser/Component.vue.ejs +0 -34
- package/build/templates/exampleFiles/browser/Component.vue.test.ejs +0 -62
- package/build/templates/exampleFiles/browser/standalone.test.ejs +0 -13
- package/build/templates/exampleFiles/cucumber/features/login.feature +0 -12
- package/build/templates/exampleFiles/cucumber/step_definitions/steps.js.ejs +0 -55
- package/build/templates/exampleFiles/mochaJasmine/test.e2e.js.ejs +0 -11
- package/build/templates/exampleFiles/pageobjects/login.page.js.ejs +0 -45
- package/build/templates/exampleFiles/pageobjects/page.js.ejs +0 -17
- package/build/templates/exampleFiles/pageobjects/secure.page.js.ejs +0 -20
- package/build/templates/exampleFiles/serenity-js/common/config/serenity.properties.ejs +0 -1
- package/build/templates/exampleFiles/serenity-js/common/serenity/github-api/GitHubStatus.ts.ejs +0 -41
- package/build/templates/exampleFiles/serenity-js/common/serenity/todo-list-app/TodoList.ts.ejs +0 -100
- package/build/templates/exampleFiles/serenity-js/common/serenity/todo-list-app/TodoListItem.ts.ejs +0 -36
- package/build/templates/exampleFiles/serenity-js/cucumber/step-definitions/steps.ts.ejs +0 -37
- package/build/templates/exampleFiles/serenity-js/cucumber/support/parameter.config.ts.ejs +0 -18
- package/build/templates/exampleFiles/serenity-js/cucumber/todo-list/completing_items.feature.ejs +0 -23
- package/build/templates/exampleFiles/serenity-js/cucumber/todo-list/narrative.md.ejs +0 -17
- package/build/templates/exampleFiles/serenity-js/jasmine/example.spec.ts.ejs +0 -86
- package/build/templates/exampleFiles/serenity-js/mocha/example.spec.ts.ejs +0 -88
- package/build/templates/snippets/afterTest.ejs +0 -20
- package/build/templates/snippets/capabilities.ejs +0 -57
- package/build/templates/snippets/cucumber.ejs +0 -50
- package/build/templates/snippets/electronTest.js.ejs +0 -7
- package/build/templates/snippets/jasmine.ejs +0 -20
- package/build/templates/snippets/macosTest.js.ejs +0 -11
- package/build/templates/snippets/mocha.ejs +0 -14
- package/build/templates/snippets/reporters.ejs +0 -14
- package/build/templates/snippets/serenity.ejs +0 -18
- package/build/templates/snippets/services.ejs +0 -18
- package/build/templates/snippets/testWithPO.js.ejs +0 -22
- package/build/templates/snippets/testWithoutPO.js.ejs +0 -19
- package/build/templates/snippets/vscodeTest.js.ejs +0 -9
- package/build/templates/wdio.conf.tpl.ejs +0 -412
|
@@ -1,88 +0,0 @@
|
|
|
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('Example', () => {
|
|
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
|
-
})
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Function to be executed after a test (in Mocha/Jasmine only)
|
|
3
|
-
* @param {object} test test object
|
|
4
|
-
* @param {object} context scope object the test was executed with
|
|
5
|
-
* @param {Error} result.error error object in case the test fails, otherwise `undefined`
|
|
6
|
-
* @param {*} result.result return object of test function
|
|
7
|
-
* @param {number} result.duration duration of test
|
|
8
|
-
* @param {boolean} result.passed true if test has passed, otherwise false
|
|
9
|
-
* @param {object} result.retries information about spec related retries, e.g. `{ attempts: 0, limit: 0 }`
|
|
10
|
-
*/<%
|
|
11
|
-
if (reporters.length && reporters.includes('allure')) {%>
|
|
12
|
-
afterTest: async function(test, context, { error, result, duration, passed, retries }) {
|
|
13
|
-
if (!passed) {
|
|
14
|
-
await browser.takeScreenshot();
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
<% } else { %>
|
|
18
|
-
// afterTest: function(test, context, { error, result, duration, passed, retries }) {
|
|
19
|
-
// },
|
|
20
|
-
<% } %>
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
capabilities: [{<%
|
|
2
|
-
if (answers.expEnvAccessKey) { %>
|
|
3
|
-
// Experitest Access Key
|
|
4
|
-
// get more information at https://docs.experitest.com/display/TE/Obtaining+Access+Key
|
|
5
|
-
'experitest:accessKey': '<%- answers.expEnvAccessKey %>',<%
|
|
6
|
-
}
|
|
7
|
-
if (answers.browserEnvironment && answers.browserEnvironment.length) { %>
|
|
8
|
-
<%- answers.browserEnvironment.map((browserName) => {
|
|
9
|
-
return `browserName: '${browserName}'`
|
|
10
|
-
}).join('\n }, {\n ') %><%
|
|
11
|
-
} else if (answers.mobileEnvironment === 'android') { %>
|
|
12
|
-
// capabilities for local Appium web tests on an Android Emulator
|
|
13
|
-
platformName: 'Android',
|
|
14
|
-
browserName: 'Chrome',
|
|
15
|
-
'appium:deviceName': 'Android GoogleAPI Emulator',
|
|
16
|
-
'appium:platformVersion': '12.0',
|
|
17
|
-
'appium:automationName': 'UiAutomator2'<%
|
|
18
|
-
} else if (answers.mobileEnvironment === 'ios') { %>
|
|
19
|
-
// capabilities for local Appium web tests on iOS
|
|
20
|
-
platformName: 'iOS',
|
|
21
|
-
browserName: 'Safari',
|
|
22
|
-
'appium:deviceName': 'iPhone Simulator',
|
|
23
|
-
'appium:platformVersion': '16.4',
|
|
24
|
-
'appium:automationName': 'XCUITest'<%
|
|
25
|
-
} else if (answers.purpose === 'macos') { %>
|
|
26
|
-
platformName: 'Mac',
|
|
27
|
-
'appium:automationName': 'Mac2',
|
|
28
|
-
'appium:bundleId': '<%= answers.generateTestFiles ? 'com.apple.calculator' : '...' %>'<%
|
|
29
|
-
} else if (answers.purpose === 'vscode') { %>
|
|
30
|
-
browserName: 'vscode',
|
|
31
|
-
browserVersion: 'stable', // also possible: "insiders" or a specific version e.g. "1.80.0"
|
|
32
|
-
'wdio:vscodeOptions': {
|
|
33
|
-
// points to directory where extension package.json is located
|
|
34
|
-
extensionPath: __dirname,
|
|
35
|
-
// optional VS Code settings
|
|
36
|
-
userSettings: {
|
|
37
|
-
"editor.fontSize": 14
|
|
38
|
-
}
|
|
39
|
-
}<%
|
|
40
|
-
} else if (answers.purpose === 'electron') { %>
|
|
41
|
-
browserName: 'electron',
|
|
42
|
-
// Electron service options
|
|
43
|
-
// see https://webdriver.io/docs/desktop-testing/electron/configuration/#service-options
|
|
44
|
-
'wdio:electronServiceOptions': {<%
|
|
45
|
-
if (answers.electronAppBinaryPath) { %>
|
|
46
|
-
// custom path to app binary
|
|
47
|
-
appBinaryPath: '<%- answers.electronAppBinaryPath %>',<%
|
|
48
|
-
} %>
|
|
49
|
-
// custom application args
|
|
50
|
-
appArgs: []
|
|
51
|
-
}<%
|
|
52
|
-
} else {
|
|
53
|
-
%>
|
|
54
|
-
// capabilities for local browser web tests
|
|
55
|
-
browserName: 'chrome' // or "firefox", "microsoftedge", "safari"<%
|
|
56
|
-
} %>
|
|
57
|
-
}],
|
|
@@ -1,50 +0,0 @@
|
|
|
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
|
-
// <string[]> Only execute the scenarios with name matching the expression (repeatable).
|
|
15
|
-
name: [],
|
|
16
|
-
// <boolean> hide step definition snippets for pending steps
|
|
17
|
-
snippets: true,
|
|
18
|
-
// <boolean> hide source uris
|
|
19
|
-
source: true,
|
|
20
|
-
// <boolean> fail if there are any undefined or pending steps
|
|
21
|
-
strict: false,
|
|
22
|
-
// <string> (expression) only execute the features or scenarios with tags matching the expression
|
|
23
|
-
tagExpression: '',
|
|
24
|
-
// <number> timeout for step definitions
|
|
25
|
-
timeout: 60000,
|
|
26
|
-
// <boolean> Enable this config to treat undefined definitions as warnings.
|
|
27
|
-
ignoreUndefinedDefinitions: false
|
|
28
|
-
},
|
|
29
|
-
<% } else if (answers.serenityAdapter === 'cucumber') { %>
|
|
30
|
-
// Cucumber configuration, see
|
|
31
|
-
// https://serenity-js.org/api/cucumber-adapter/interface/CucumberConfig/
|
|
32
|
-
cucumberOpts: {
|
|
33
|
-
// <string[]> (file/dir) require files before executing features
|
|
34
|
-
import: [
|
|
35
|
-
<% if (answers.stepDefinitions) {
|
|
36
|
-
%>'<%- answers.stepDefinitions %>',
|
|
37
|
-
<% } %>'./features/support/*.<%- answers.isUsingTypeScript ? 'ts' : 'js' %>',
|
|
38
|
-
],
|
|
39
|
-
// <string[]> (type[:path]) specify native Cucumber.js output format, if needed. Optionally supply PATH to redirect formatter output (repeatable)
|
|
40
|
-
format: [ ],
|
|
41
|
-
// <string> (name) specify the profile to use
|
|
42
|
-
profile: '',
|
|
43
|
-
// <boolean> fail if there are any undefined or pending steps
|
|
44
|
-
strict: false,
|
|
45
|
-
// <string[] | string> (expression) only execute the features or scenarios with tags matching the expression
|
|
46
|
-
tags: [],
|
|
47
|
-
// <number> timeout for step definitions
|
|
48
|
-
timeout: 60000,
|
|
49
|
-
},
|
|
50
|
-
<% } %>
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
<% } %>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { expect, $ } from '@wdio/globals'
|
|
2
|
-
|
|
3
|
-
describe('MacOS Testing', () => {
|
|
4
|
-
it('should calculate the meaning of life', async function () {
|
|
5
|
-
await $('//XCUIElementTypeButton[@label="seven"]').click()
|
|
6
|
-
await $('//XCUIElementTypeButton[@label="multiply"]').click()
|
|
7
|
-
await $('//XCUIElementTypeButton[@label="six"]').click()
|
|
8
|
-
await $('//XCUIElementTypeButton[@title="="]').click()
|
|
9
|
-
await expect($('//XCUIElementTypeStaticText[@label="main display"]')).toHaveText('42')
|
|
10
|
-
})
|
|
11
|
-
})
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
<% } %>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// Test reporter for stdout.
|
|
2
|
-
// The only one supported by default is 'dot'
|
|
3
|
-
// see also: https://webdriver.io/docs/dot-reporter<%
|
|
4
|
-
if (reporters.length) { %>
|
|
5
|
-
reporters: [<%- reporters.map(reporter => {
|
|
6
|
-
if (reporter === 'allure') {
|
|
7
|
-
return `['${reporter}', {outputDir: 'allure-results'}]`
|
|
8
|
-
} else {
|
|
9
|
-
return `'${reporter}'`
|
|
10
|
-
}
|
|
11
|
-
}) %>],<% } else { %>
|
|
12
|
-
// reporters: ['dot'],<%
|
|
13
|
-
}
|
|
14
|
-
%>
|
|
@@ -1,18 +0,0 @@
|
|
|
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,18 +0,0 @@
|
|
|
1
|
-
services: [<%- answers.services.map((service) => {
|
|
2
|
-
if (service === 'electron') {
|
|
3
|
-
return /*js*/`'electron'`
|
|
4
|
-
} else if (service === 'sauce' && answers.useSauceConnect) {
|
|
5
|
-
return /*js*/`[
|
|
6
|
-
'sauce',
|
|
7
|
-
{
|
|
8
|
-
sauceConnect: true,
|
|
9
|
-
sauceConnectOpts: {
|
|
10
|
-
// add Sauce Connect Options if needed
|
|
11
|
-
// see more at https://docs.saucelabs.com/dev/cli/sauce-connect-5/
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
]`
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return `'${service}'`
|
|
18
|
-
}).join(', ') %>],
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<%- answers.isUsingTypeScript || answers.esmSupport
|
|
2
|
-
? `import { expect } from '@wdio/globals'`
|
|
3
|
-
: `const { expect } = require('@wdio/globals')` %>
|
|
4
|
-
<%- answers.isUsingTypeScript || answers.esmSupport
|
|
5
|
-
? `import LoginPage from '${answers.relativePath}/login.page${answers.esmSupport ? '.js' : ''}'`
|
|
6
|
-
: `const LoginPage = require('${answers.relativePath}/login.page')` %>
|
|
7
|
-
<%- answers.isUsingTypeScript || answers.esmSupport
|
|
8
|
-
? `import SecurePage from '${answers.relativePath}/secure.page${answers.esmSupport ? '.js' : ''}'`
|
|
9
|
-
: `const SecurePage = require('${answers.relativePath}/secure.page')` %>
|
|
10
|
-
|
|
11
|
-
describe('My Login application', () => {
|
|
12
|
-
it('should login with valid credentials', async () => {
|
|
13
|
-
await LoginPage.open()
|
|
14
|
-
|
|
15
|
-
await LoginPage.login('tomsmith', 'SuperSecretPassword!')
|
|
16
|
-
await expect(SecurePage.flashAlert).toBeExisting()
|
|
17
|
-
await expect(SecurePage.flashAlert).toHaveText(
|
|
18
|
-
expect.stringContaining('You logged into a secure area!'))<%-
|
|
19
|
-
answers.includeVisualTesting ? `
|
|
20
|
-
await expect(SecurePage.flashAlert).toMatchElementSnapshot('flashAlert')` : '' %>
|
|
21
|
-
})
|
|
22
|
-
})
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<%- answers.isUsingTypeScript || answers.esmSupport
|
|
2
|
-
? `import { expect, browser, $ } from '@wdio/globals'`
|
|
3
|
-
: `const { expect, browser, $ } = require('@wdio/globals')` %>
|
|
4
|
-
|
|
5
|
-
describe('My Login application', () => {
|
|
6
|
-
it('should login with valid credentials', async () => {
|
|
7
|
-
await browser.url(`https://the-internet.herokuapp.com/login`)
|
|
8
|
-
|
|
9
|
-
await $('#username').setValue('tomsmith')
|
|
10
|
-
await $('#password').setValue('SuperSecretPassword!')
|
|
11
|
-
await $('button[type="submit"]').click()
|
|
12
|
-
|
|
13
|
-
await expect($('#flash')).toBeExisting()
|
|
14
|
-
await expect($('#flash')).toHaveText(
|
|
15
|
-
expect.stringContaining('You logged into a secure area!'))<%-
|
|
16
|
-
answers.includeVisualTesting ? `
|
|
17
|
-
await expect($('#flash')).toMatchElementSnapshot('flashAlert')` : '' %>
|
|
18
|
-
})
|
|
19
|
-
})
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { browser, expect } from '@wdio/globals'
|
|
2
|
-
|
|
3
|
-
describe('VS Code Extension Testing', () => {
|
|
4
|
-
it('should be able to load VSCode', async () => {
|
|
5
|
-
const workbench = await browser.getWorkbench()
|
|
6
|
-
expect(await workbench.getTitleBar().getTitle())
|
|
7
|
-
.toContain('[Extension Development Host]')
|
|
8
|
-
})
|
|
9
|
-
})
|