expect-webdriverio 5.0.0-alpha.0 → 5.0.0-alpha.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.
- package/lib/matchers/browser/toHaveClipboardText.js +0 -6
- package/lib/matchers/browser/toHaveTitle.js +0 -6
- package/lib/matchers/browser/toHaveUrl.js +0 -6
- package/lib/matchers/element/toHaveAttribute.js +1 -8
- package/lib/matchers/element/toHaveChildren.js +2 -2
- package/lib/matchers/element/toHaveClass.js +1 -4
- package/lib/matchers/element/toHaveComputedLabel.js +1 -7
- package/lib/matchers/element/toHaveComputedRole.js +1 -7
- package/lib/matchers/element/toHaveElementProperty.js +1 -1
- package/lib/matchers/element/toHaveHTML.js +6 -8
- package/lib/matchers/element/toHaveHeight.js +1 -1
- package/lib/matchers/element/toHaveHref.js +0 -7
- package/lib/matchers/element/toHaveSize.js +1 -1
- package/lib/matchers/element/toHaveStyle.js +1 -1
- package/lib/matchers/element/toHaveText.js +5 -7
- package/lib/matchers/element/toHaveValue.js +0 -6
- package/lib/matchers/element/toHaveWidth.js +1 -1
- package/lib/matchers/mock/toBeRequestedWith.js +17 -60
- package/lib/matchers/snapshot.js +3 -1
- package/lib/utils.js +1 -2
- package/package.json +33 -22
- package/types/expect-webdriverio.d.ts +1 -116
|
@@ -30,9 +30,3 @@ export async function toHaveClipboardText(browser, expectedValue, options = DEFA
|
|
|
30
30
|
});
|
|
31
31
|
return result;
|
|
32
32
|
}
|
|
33
|
-
export function toHaveClipboardTextContaining(browser, clipboardText, options = {}) {
|
|
34
|
-
return toHaveClipboardText.call(this, browser, clipboardText, {
|
|
35
|
-
...options,
|
|
36
|
-
containing: true
|
|
37
|
-
});
|
|
38
|
-
}
|
|
@@ -26,9 +26,3 @@ export async function toHaveTitle(browser, expectedValue, options = DEFAULT_OPTI
|
|
|
26
26
|
});
|
|
27
27
|
return result;
|
|
28
28
|
}
|
|
29
|
-
export function toHaveTitleContaining(browser, title, options = {}) {
|
|
30
|
-
return toHaveTitle.call(this, browser, title, {
|
|
31
|
-
...options,
|
|
32
|
-
containing: true
|
|
33
|
-
});
|
|
34
|
-
}
|
|
@@ -26,9 +26,3 @@ export async function toHaveUrl(browser, expectedValue, options = DEFAULT_OPTION
|
|
|
26
26
|
});
|
|
27
27
|
return result;
|
|
28
28
|
}
|
|
29
|
-
export function toHaveUrlContaining(browser, url, options = DEFAULT_OPTIONS) {
|
|
30
|
-
return toHaveUrl.call(this, browser, url, {
|
|
31
|
-
...options,
|
|
32
|
-
containing: true
|
|
33
|
-
});
|
|
34
|
-
}
|
|
@@ -19,7 +19,7 @@ async function conditionAttrAndValue(el, attribute, value, options) {
|
|
|
19
19
|
export async function toHaveAttributeAndValue(received, attribute, value, options = DEFAULT_OPTIONS) {
|
|
20
20
|
const isNot = this.isNot;
|
|
21
21
|
const { expectation = 'attribute', verb = 'have' } = this;
|
|
22
|
-
let el = await received;
|
|
22
|
+
let el = await received.getElement();
|
|
23
23
|
let attr;
|
|
24
24
|
const pass = await waitUntil(async () => {
|
|
25
25
|
const result = await executeCommand.call(this, el, conditionAttrAndValue, options, [attribute, value, options]);
|
|
@@ -66,11 +66,4 @@ export async function toHaveAttribute(received, attribute, value, options = DEFA
|
|
|
66
66
|
});
|
|
67
67
|
return result;
|
|
68
68
|
}
|
|
69
|
-
export function toHaveAttributeContaining(el, attribute, value, options = DEFAULT_OPTIONS) {
|
|
70
|
-
return toHaveAttributeAndValue.call(this, el, attribute, value, {
|
|
71
|
-
...options,
|
|
72
|
-
containing: true
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
export const toHaveAttrContaining = toHaveAttributeContaining;
|
|
76
69
|
export const toHaveAttr = toHaveAttribute;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DEFAULT_OPTIONS } from '../../constants.js';
|
|
2
2
|
import { compareNumbers, enhanceError, executeCommand, numberError, waitUntil, wrapExpectedWithArray } from '../../utils.js';
|
|
3
3
|
async function condition(el, options) {
|
|
4
|
-
const children = await el.$$('./*');
|
|
4
|
+
const children = await el.$$('./*').getElements();
|
|
5
5
|
if (typeof options.lte !== 'number' &&
|
|
6
6
|
typeof options.gte !== 'number' &&
|
|
7
7
|
typeof options.eq !== 'number') {
|
|
@@ -26,7 +26,7 @@ export async function toHaveChildren(received, expectedValue, options = DEFAULT_
|
|
|
26
26
|
const numberOptions = typeof expectedValue === 'number'
|
|
27
27
|
? { eq: expectedValue }
|
|
28
28
|
: expectedValue || {};
|
|
29
|
-
let el = await received;
|
|
29
|
+
let el = await received.getElement();
|
|
30
30
|
let children;
|
|
31
31
|
const pass = await waitUntil(async () => {
|
|
32
32
|
const result = await executeCommand.call(this, el, condition, numberOptions, [numberOptions]);
|
|
@@ -32,7 +32,7 @@ export async function toHaveElementClass(received, expectedValue, options = DEFA
|
|
|
32
32
|
options,
|
|
33
33
|
});
|
|
34
34
|
const attribute = 'class';
|
|
35
|
-
let el = await received;
|
|
35
|
+
let el = await received.getElement();
|
|
36
36
|
let attr;
|
|
37
37
|
const pass = await waitUntil(async () => {
|
|
38
38
|
const result = await executeCommand.call(this, el, condition, options, [attribute, expectedValue, options]);
|
|
@@ -53,9 +53,6 @@ export async function toHaveElementClass(received, expectedValue, options = DEFA
|
|
|
53
53
|
});
|
|
54
54
|
return result;
|
|
55
55
|
}
|
|
56
|
-
export function toHaveElementClassContaining(...args) {
|
|
57
|
-
return toHaveClassContaining.call(this, ...args);
|
|
58
|
-
}
|
|
59
56
|
export function toHaveClassContaining(el, className, options = DEFAULT_OPTIONS) {
|
|
60
57
|
return toHaveAttributeAndValue.call(this, el, 'class', className, {
|
|
61
58
|
...options,
|
|
@@ -15,7 +15,7 @@ export async function toHaveComputedLabel(received, expectedValue, options = DEF
|
|
|
15
15
|
expectedValue,
|
|
16
16
|
options,
|
|
17
17
|
});
|
|
18
|
-
let el = await received;
|
|
18
|
+
let el = await received.getElement();
|
|
19
19
|
let actualLabel;
|
|
20
20
|
const pass = await waitUntil(async () => {
|
|
21
21
|
const result = await executeCommand.call(this, el, condition, options, [expectedValue, options]);
|
|
@@ -36,9 +36,3 @@ export async function toHaveComputedLabel(received, expectedValue, options = DEF
|
|
|
36
36
|
});
|
|
37
37
|
return result;
|
|
38
38
|
}
|
|
39
|
-
export function toHaveComputedLabelContaining(el, label, options = DEFAULT_OPTIONS) {
|
|
40
|
-
return toHaveComputedLabel.call(this, el, label, {
|
|
41
|
-
...options,
|
|
42
|
-
containing: true
|
|
43
|
-
});
|
|
44
|
-
}
|
|
@@ -15,7 +15,7 @@ export async function toHaveComputedRole(received, expectedValue, options = DEFA
|
|
|
15
15
|
expectedValue,
|
|
16
16
|
options,
|
|
17
17
|
});
|
|
18
|
-
let el = await received;
|
|
18
|
+
let el = await received.getElement();
|
|
19
19
|
let actualRole;
|
|
20
20
|
const pass = await waitUntil(async () => {
|
|
21
21
|
const result = await executeCommand.call(this, el, condition, options, [expectedValue, options]);
|
|
@@ -36,9 +36,3 @@ export async function toHaveComputedRole(received, expectedValue, options = DEFA
|
|
|
36
36
|
});
|
|
37
37
|
return result;
|
|
38
38
|
}
|
|
39
|
-
export function toHaveComputedRoleContaining(el, role, options = DEFAULT_OPTIONS) {
|
|
40
|
-
return toHaveComputedRole.call(this, el, role, {
|
|
41
|
-
...options,
|
|
42
|
-
containing: true
|
|
43
|
-
});
|
|
44
|
-
}
|
|
@@ -23,7 +23,7 @@ export async function toHaveElementProperty(received, property, value, options =
|
|
|
23
23
|
expectedValue: [property, value],
|
|
24
24
|
options,
|
|
25
25
|
});
|
|
26
|
-
let el = await received;
|
|
26
|
+
let el = await received.getElement();
|
|
27
27
|
let prop;
|
|
28
28
|
const pass = await waitUntil(async () => {
|
|
29
29
|
const result = await executeCommand.call(this, el, condition, options, [property, value]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DEFAULT_OPTIONS } from '../../constants.js';
|
|
2
2
|
import { compareText, compareTextWithArray, enhanceError, executeCommand, waitUntil, wrapExpectedWithArray } from '../../utils.js';
|
|
3
3
|
async function condition(el, html, options) {
|
|
4
|
-
const actualHTML = await el.getHTML(options
|
|
4
|
+
const actualHTML = await el.getHTML(options);
|
|
5
5
|
if (Array.isArray(html)) {
|
|
6
6
|
return compareTextWithArray(actualHTML, html, options);
|
|
7
7
|
}
|
|
@@ -15,7 +15,11 @@ export async function toHaveHTML(received, expectedValue, options = DEFAULT_OPTI
|
|
|
15
15
|
expectedValue,
|
|
16
16
|
options,
|
|
17
17
|
});
|
|
18
|
-
let el =
|
|
18
|
+
let el = 'getElement' in received
|
|
19
|
+
? await received.getElement()
|
|
20
|
+
: 'getElements' in received
|
|
21
|
+
? await received.getElements()
|
|
22
|
+
: received;
|
|
19
23
|
let actualHTML;
|
|
20
24
|
const pass = await waitUntil(async () => {
|
|
21
25
|
const result = await executeCommand.call(this, el, condition, options, [expectedValue, options]);
|
|
@@ -36,9 +40,3 @@ export async function toHaveHTML(received, expectedValue, options = DEFAULT_OPTI
|
|
|
36
40
|
});
|
|
37
41
|
return result;
|
|
38
42
|
}
|
|
39
|
-
export function toHaveHTMLContaining(el, html, options = DEFAULT_OPTIONS) {
|
|
40
|
-
return toHaveHTML.call(this, el, html, {
|
|
41
|
-
...options,
|
|
42
|
-
containing: true
|
|
43
|
-
});
|
|
44
|
-
}
|
|
@@ -15,7 +15,7 @@ export async function toHaveHeight(received, expectedValue, options = DEFAULT_OP
|
|
|
15
15
|
expectedValue,
|
|
16
16
|
options,
|
|
17
17
|
});
|
|
18
|
-
let el = await received;
|
|
18
|
+
let el = await received.getElement();
|
|
19
19
|
let actualHeight;
|
|
20
20
|
const pass = await waitUntil(async () => {
|
|
21
21
|
const result = await executeCommand.call(this, el, condition, options, [expectedValue, options]);
|
|
@@ -16,10 +16,3 @@ export async function toHaveHref(el, expectedValue, options = DEFAULT_OPTIONS) {
|
|
|
16
16
|
return result;
|
|
17
17
|
}
|
|
18
18
|
export const toHaveLink = toHaveHref;
|
|
19
|
-
export function toHaveHrefContaining(el, href, options = DEFAULT_OPTIONS) {
|
|
20
|
-
return toHaveHref.call(this, el, href, {
|
|
21
|
-
...options,
|
|
22
|
-
containing: true
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
export const toHaveLinkContaining = toHaveHrefContaining;
|
|
@@ -12,7 +12,7 @@ export async function toHaveSize(received, expectedValue, options = DEFAULT_OPTI
|
|
|
12
12
|
expectedValue,
|
|
13
13
|
options,
|
|
14
14
|
});
|
|
15
|
-
let el = await received;
|
|
15
|
+
let el = await received.getElement();
|
|
16
16
|
let actualSize;
|
|
17
17
|
const pass = await waitUntil(async () => {
|
|
18
18
|
const result = await executeCommand.call(this, el, condition, options, [expectedValue, options]);
|
|
@@ -11,7 +11,7 @@ export async function toHaveStyle(received, expectedValue, options = DEFAULT_OPT
|
|
|
11
11
|
expectedValue,
|
|
12
12
|
options,
|
|
13
13
|
});
|
|
14
|
-
let el = await received;
|
|
14
|
+
let el = await received.getElement();
|
|
15
15
|
let actualStyle;
|
|
16
16
|
const pass = await waitUntil(async () => {
|
|
17
17
|
const result = await executeCommand.call(this, el, condition, options, [expectedValue, options]);
|
|
@@ -35,7 +35,11 @@ export async function toHaveText(received, expectedValue, options = DEFAULT_OPTI
|
|
|
35
35
|
expectedValue,
|
|
36
36
|
options,
|
|
37
37
|
});
|
|
38
|
-
let el =
|
|
38
|
+
let el = 'getElement' in received
|
|
39
|
+
? await received.getElement()
|
|
40
|
+
: 'getElements' in received
|
|
41
|
+
? await received.getElements()
|
|
42
|
+
: received;
|
|
39
43
|
let actualText;
|
|
40
44
|
const pass = await waitUntil(async () => {
|
|
41
45
|
const result = await executeCommand.call(this, el, condition, options, [expectedValue, options]);
|
|
@@ -56,9 +60,3 @@ export async function toHaveText(received, expectedValue, options = DEFAULT_OPTI
|
|
|
56
60
|
});
|
|
57
61
|
return result;
|
|
58
62
|
}
|
|
59
|
-
export function toHaveTextContaining(el, text, options = DEFAULT_OPTIONS) {
|
|
60
|
-
return toHaveText.call(this, el, text, {
|
|
61
|
-
...options,
|
|
62
|
-
containing: true
|
|
63
|
-
});
|
|
64
|
-
}
|
|
@@ -3,9 +3,3 @@ import { DEFAULT_OPTIONS } from '../../constants.js';
|
|
|
3
3
|
export function toHaveValue(el, value, options = DEFAULT_OPTIONS) {
|
|
4
4
|
return toHaveElementProperty.call(this, el, 'value', value, options);
|
|
5
5
|
}
|
|
6
|
-
export function toHaveValueContaining(el, value, options = DEFAULT_OPTIONS) {
|
|
7
|
-
return toHaveValue.call(this, el, value, {
|
|
8
|
-
...options,
|
|
9
|
-
containing: true
|
|
10
|
-
});
|
|
11
|
-
}
|
|
@@ -15,7 +15,7 @@ export async function toHaveWidth(received, expectedValue, options = DEFAULT_OPT
|
|
|
15
15
|
expectedValue,
|
|
16
16
|
options,
|
|
17
17
|
});
|
|
18
|
-
let el = await received;
|
|
18
|
+
let el = await received.getElement();
|
|
19
19
|
let actualWidth;
|
|
20
20
|
const pass = await waitUntil(async () => {
|
|
21
21
|
const result = await executeCommand.call(this, el, condition, options, [expectedValue, options]);
|
|
@@ -3,6 +3,12 @@ import { equals } from '../../jasmineUtils.js';
|
|
|
3
3
|
import { DEFAULT_OPTIONS } from '../../constants.js';
|
|
4
4
|
const STR_LIMIT = 80;
|
|
5
5
|
const KEY_LIMIT = 12;
|
|
6
|
+
function reduceHeaders(headers) {
|
|
7
|
+
return Object.entries(headers).reduce((acc, [, value]) => {
|
|
8
|
+
acc[value.name] = value.value.value;
|
|
9
|
+
return acc;
|
|
10
|
+
}, {});
|
|
11
|
+
}
|
|
6
12
|
export async function toBeRequestedWith(received, expectedValue = {}, options = DEFAULT_OPTIONS) {
|
|
7
13
|
const isNot = this.isNot || false;
|
|
8
14
|
const { expectation = 'called with', verb = 'be' } = this;
|
|
@@ -15,13 +21,11 @@ export async function toBeRequestedWith(received, expectedValue = {}, options =
|
|
|
15
21
|
const pass = await waitUntil(async () => {
|
|
16
22
|
for (const call of received.calls) {
|
|
17
23
|
actual = call;
|
|
18
|
-
if (methodMatcher(call.method, expectedValue.method) &&
|
|
19
|
-
statusCodeMatcher(call.
|
|
20
|
-
urlMatcher(call.url, expectedValue.url) &&
|
|
21
|
-
headersMatcher(call.headers, expectedValue.requestHeaders) &&
|
|
22
|
-
headersMatcher(call.
|
|
23
|
-
bodyMatcher(call.postData, expectedValue.postData) &&
|
|
24
|
-
bodyMatcher(call.body, expectedValue.response)) {
|
|
24
|
+
if (methodMatcher(call.request.method, expectedValue.method) &&
|
|
25
|
+
statusCodeMatcher(call.response.status, expectedValue.statusCode) &&
|
|
26
|
+
urlMatcher(call.request.url, expectedValue.url) &&
|
|
27
|
+
headersMatcher(reduceHeaders(call.request.headers), expectedValue.requestHeaders) &&
|
|
28
|
+
headersMatcher(reduceHeaders(call.response.headers), expectedValue.responseHeaders)) {
|
|
25
29
|
return true;
|
|
26
30
|
}
|
|
27
31
|
}
|
|
@@ -75,7 +79,8 @@ const urlMatcher = (url, expected) => {
|
|
|
75
79
|
return equals(url, expected);
|
|
76
80
|
};
|
|
77
81
|
const headersMatcher = (headers, expected) => {
|
|
78
|
-
if (typeof expected === 'undefined'
|
|
82
|
+
if (typeof expected === 'undefined' ||
|
|
83
|
+
typeof expected === 'object' && Object.keys(expected).length === 0) {
|
|
79
84
|
return true;
|
|
80
85
|
}
|
|
81
86
|
if (typeof expected === 'function') {
|
|
@@ -83,66 +88,18 @@ const headersMatcher = (headers, expected) => {
|
|
|
83
88
|
}
|
|
84
89
|
return equals(headers, expected);
|
|
85
90
|
};
|
|
86
|
-
const bodyMatcher = (body, expected) => {
|
|
87
|
-
if (typeof expected === 'undefined') {
|
|
88
|
-
return true;
|
|
89
|
-
}
|
|
90
|
-
if (typeof expected === 'function') {
|
|
91
|
-
return expected(body);
|
|
92
|
-
}
|
|
93
|
-
if (typeof body === 'undefined') {
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
let parsedBody = body;
|
|
97
|
-
if (body instanceof Buffer) {
|
|
98
|
-
parsedBody = body.toString();
|
|
99
|
-
}
|
|
100
|
-
if (typeof (body) === 'string' && isExpectedJsonLike(expected)) {
|
|
101
|
-
parsedBody = tryParseBody(body);
|
|
102
|
-
if (parsedBody === null) {
|
|
103
|
-
return false;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return equals(parsedBody, expected);
|
|
107
|
-
};
|
|
108
|
-
const isExpectedJsonLike = (expected) => {
|
|
109
|
-
if (typeof expected === 'undefined') {
|
|
110
|
-
return false;
|
|
111
|
-
}
|
|
112
|
-
const actualSample = isMatcher(expected)
|
|
113
|
-
? expected.sample
|
|
114
|
-
: expected;
|
|
115
|
-
return (Array.isArray(actualSample) ||
|
|
116
|
-
(typeof actualSample === 'object' &&
|
|
117
|
-
actualSample !== null &&
|
|
118
|
-
actualSample instanceof RegExp === false));
|
|
119
|
-
};
|
|
120
91
|
const isMatcher = (filter) => {
|
|
121
92
|
return typeof filter.__proto__?.asymmetricMatch === 'function';
|
|
122
93
|
};
|
|
123
|
-
const tryParseBody = (jsonString, fallback = null) => {
|
|
124
|
-
try {
|
|
125
|
-
return typeof jsonString === 'undefined' ? fallback : JSON.parse(jsonString);
|
|
126
|
-
}
|
|
127
|
-
catch {
|
|
128
|
-
return fallback;
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
94
|
const minifyRequestMock = (requestMock, requestedWith) => {
|
|
132
95
|
if (typeof requestMock === 'undefined') {
|
|
133
96
|
return requestMock;
|
|
134
97
|
}
|
|
135
98
|
const r = {
|
|
136
|
-
url: requestMock.url,
|
|
137
|
-
method: requestMock.method,
|
|
138
|
-
requestHeaders: requestMock.headers,
|
|
139
|
-
responseHeaders: requestMock.
|
|
140
|
-
postData: typeof requestMock.postData === 'string' && isExpectedJsonLike(requestedWith.postData)
|
|
141
|
-
? tryParseBody(requestMock.postData, requestMock.postData)
|
|
142
|
-
: requestMock.postData,
|
|
143
|
-
response: typeof requestMock.body === 'string' && isExpectedJsonLike(requestedWith.response)
|
|
144
|
-
? tryParseBody(requestMock.body, requestMock.body)
|
|
145
|
-
: requestMock.body,
|
|
99
|
+
url: requestMock.request.url,
|
|
100
|
+
method: requestMock.request.method,
|
|
101
|
+
requestHeaders: requestMock.request.headers,
|
|
102
|
+
responseHeaders: requestMock.response.headers,
|
|
146
103
|
};
|
|
147
104
|
deleteUndefinedValues(r, requestedWith);
|
|
148
105
|
return minifyRequestedWith(r);
|
package/lib/matchers/snapshot.js
CHANGED
|
@@ -40,7 +40,9 @@ function toMatchSnapshotAssert(received, message, inlineOptions) {
|
|
|
40
40
|
async function toMatchSnapshotAsync(asyncReceived, message, inlineOptions) {
|
|
41
41
|
let received = await asyncReceived;
|
|
42
42
|
if (received && typeof received === 'object' && 'elementId' in received) {
|
|
43
|
-
received = await received.getHTML(
|
|
43
|
+
received = await received.getHTML({
|
|
44
|
+
includeSelectorTag: true
|
|
45
|
+
});
|
|
44
46
|
}
|
|
45
47
|
return toMatchSnapshotAssert(received, message, inlineOptions);
|
|
46
48
|
}
|
package/lib/utils.js
CHANGED
|
@@ -49,8 +49,7 @@ const waitUntil = async (condition, isNot = false, { wait = DEFAULT_OPTIONS.wait
|
|
|
49
49
|
};
|
|
50
50
|
async function executeCommandBe(received, command, options) {
|
|
51
51
|
const { isNot, expectation, verb = 'be' } = this;
|
|
52
|
-
|
|
53
|
-
let el = received;
|
|
52
|
+
let el = await received.getElement();
|
|
54
53
|
const pass = await waitUntil(async () => {
|
|
55
54
|
const result = await executeCommand.call(this, el, async (element) => ({ result: await command(element) }), options);
|
|
56
55
|
el = result.el;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expect-webdriverio",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.2",
|
|
4
4
|
"author": "Mykola Grybyk <mykola.grybyk@gmail.com>",
|
|
5
5
|
"description": "WebdriverIO Assertion Library",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"types": "./types/standalone.d.ts",
|
|
39
39
|
"typeScriptVersion": "3.8.3",
|
|
40
40
|
"engines": {
|
|
41
|
-
"node": ">=
|
|
41
|
+
"node": ">=18 || >=20 || >=22"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "run-s clean compile",
|
|
@@ -57,36 +57,47 @@
|
|
|
57
57
|
"watch": "npm run compile -- --watch",
|
|
58
58
|
"prepare": "husky install"
|
|
59
59
|
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"@vitest/snapshot": "^1.6.0",
|
|
62
|
+
"expect": "^29.7.0",
|
|
63
|
+
"jest-matcher-utils": "^29.7.0",
|
|
64
|
+
"lodash.isequal": "^4.5.0"
|
|
65
|
+
},
|
|
60
66
|
"devDependencies": {
|
|
61
67
|
"@types/debug": "^4.1.12",
|
|
62
|
-
"@types/jest": "^29.5.
|
|
68
|
+
"@types/jest": "^29.5.12",
|
|
63
69
|
"@types/lodash.isequal": "^4.5.8",
|
|
64
|
-
"@types/node": "^20.
|
|
65
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
66
|
-
"@typescript-eslint/parser": "^7.0
|
|
67
|
-
"@vitest/coverage-v8": "^1.
|
|
70
|
+
"@types/node": "^20.14.9",
|
|
71
|
+
"@typescript-eslint/eslint-plugin": "^7.15.0",
|
|
72
|
+
"@typescript-eslint/parser": "^7.15.0",
|
|
73
|
+
"@vitest/coverage-v8": "^1.6.0",
|
|
68
74
|
"c8": "^10.1.2",
|
|
69
75
|
"eslint": "^8.56.0",
|
|
70
76
|
"eslint-plugin-import": "^2.29.1",
|
|
71
77
|
"eslint-plugin-unicorn": "^54.0.0",
|
|
72
|
-
"husky": "^9.0.
|
|
73
|
-
"npm-run-all2": "^6.
|
|
74
|
-
"release-it": "^17.
|
|
75
|
-
"rimraf": "^5.0.
|
|
78
|
+
"husky": "^9.0.11",
|
|
79
|
+
"npm-run-all2": "^6.2.0",
|
|
80
|
+
"release-it": "^17.4.1",
|
|
81
|
+
"rimraf": "^5.0.7",
|
|
76
82
|
"shelljs": "^0.8.5",
|
|
77
|
-
"typescript": "^5.
|
|
83
|
+
"typescript": "^5.5.3",
|
|
78
84
|
"vitest": "1.6.0",
|
|
79
|
-
"webdriverio": "
|
|
85
|
+
"webdriverio": "9.0.0-alpha.350"
|
|
80
86
|
},
|
|
81
|
-
"
|
|
82
|
-
"@wdio/globals": "^
|
|
83
|
-
"@wdio/logger": "^
|
|
84
|
-
"webdriverio": "^
|
|
87
|
+
"peerDependencies": {
|
|
88
|
+
"@wdio/globals": "^9.0.0-alpha.350",
|
|
89
|
+
"@wdio/logger": "^9.0.0-alpha.350",
|
|
90
|
+
"webdriverio": "^9.0.0-alpha.350"
|
|
85
91
|
},
|
|
86
|
-
"
|
|
87
|
-
"@
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
"
|
|
92
|
+
"peerDependenciesMeta": {
|
|
93
|
+
"@wdio/globals": {
|
|
94
|
+
"optional": false
|
|
95
|
+
},
|
|
96
|
+
"@wdio/logger": {
|
|
97
|
+
"optional": false
|
|
98
|
+
},
|
|
99
|
+
"webdriverio": {
|
|
100
|
+
"optional": false
|
|
101
|
+
}
|
|
91
102
|
}
|
|
92
103
|
}
|
|
@@ -185,27 +185,6 @@ declare namespace ExpectWebdriverIO {
|
|
|
185
185
|
*/
|
|
186
186
|
toHaveAttr(attribute: string, value?: string | RegExp | ExpectWebdriverIO.PartialMatcher, options?: ExpectWebdriverIO.StringOptions): R
|
|
187
187
|
|
|
188
|
-
/**
|
|
189
|
-
* `WebdriverIO.Element` -> `getAttribute`
|
|
190
|
-
* Element's attribute includes the value.
|
|
191
|
-
* @deprecated use `expect(el).toHaveAttribute('attribute', expect.stringContaining('...'))` instead
|
|
192
|
-
*/
|
|
193
|
-
toHaveAttributeContaining(
|
|
194
|
-
attribute: string,
|
|
195
|
-
contains: string | RegExp | ExpectWebdriverIO.PartialMatcher,
|
|
196
|
-
options?: ExpectWebdriverIO.StringOptions
|
|
197
|
-
): R
|
|
198
|
-
/**
|
|
199
|
-
* `WebdriverIO.Element` -> `getAttribute`
|
|
200
|
-
* Element's attribute includes the value.
|
|
201
|
-
* @deprecated use `expect(el).toHaveAttr('attribute', expect.stringContaining('...'))` instead
|
|
202
|
-
*/
|
|
203
|
-
toHaveAttrContaining(
|
|
204
|
-
attribute: string,
|
|
205
|
-
contains: string | RegExp | ExpectWebdriverIO.PartialMatcher,
|
|
206
|
-
options?: ExpectWebdriverIO.StringOptions
|
|
207
|
-
): R
|
|
208
|
-
|
|
209
188
|
/**
|
|
210
189
|
* `WebdriverIO.Element` -> `getAttribute` class
|
|
211
190
|
* @deprecated since v1.3.1 - use `toHaveElementClass` instead.
|
|
@@ -230,20 +209,6 @@ declare namespace ExpectWebdriverIO {
|
|
|
230
209
|
*/
|
|
231
210
|
toHaveElementClass(className: string | RegExp | Array<string | RegExp> | ExpectWebdriverIO.PartialMatcher, options?: ExpectWebdriverIO.StringOptions): R
|
|
232
211
|
|
|
233
|
-
/**
|
|
234
|
-
* `WebdriverIO.Element` -> `getAttribute` class
|
|
235
|
-
* Element's class includes the className.
|
|
236
|
-
* @deprecated since v1.3.1 - use `toHaveElementClassContaining` instead.
|
|
237
|
-
*/
|
|
238
|
-
toHaveClassContaining(className: string | RegExp | ExpectWebdriverIO.PartialMatcher, options?: ExpectWebdriverIO.StringOptions): R
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* `WebdriverIO.Element` -> `getAttribute` class
|
|
242
|
-
* Element's class includes the className.
|
|
243
|
-
* @deprecated use `expect(el).toHaveElementClass(expect.stringContaining('...'))` instead
|
|
244
|
-
*/
|
|
245
|
-
toHaveElementClassContaining(className: string | RegExp | ExpectWebdriverIO.PartialMatcher, options?: ExpectWebdriverIO.StringOptions): R
|
|
246
|
-
|
|
247
212
|
/**
|
|
248
213
|
* `WebdriverIO.Element` -> `getProperty`
|
|
249
214
|
*/
|
|
@@ -257,12 +222,6 @@ declare namespace ExpectWebdriverIO {
|
|
|
257
222
|
* `WebdriverIO.Element` -> `getProperty` value
|
|
258
223
|
*/
|
|
259
224
|
toHaveValue(value: string | RegExp | ExpectWebdriverIO.PartialMatcher, options?: ExpectWebdriverIO.StringOptions): R
|
|
260
|
-
/**
|
|
261
|
-
* `WebdriverIO.Element` -> `getProperty` value
|
|
262
|
-
* Element's value includes the value.
|
|
263
|
-
* @deprecated use `expect(el).toHaveValue(expect.stringContaining('...'))` instead
|
|
264
|
-
*/
|
|
265
|
-
toHaveValueContaining(value: string | RegExp | ExpectWebdriverIO.PartialMatcher, options?: ExpectWebdriverIO.StringOptions): R
|
|
266
225
|
|
|
267
226
|
/**
|
|
268
227
|
* `WebdriverIO.Element` -> `isClickable`
|
|
@@ -317,19 +276,6 @@ declare namespace ExpectWebdriverIO {
|
|
|
317
276
|
*/
|
|
318
277
|
toHaveLink(href: string | RegExp | ExpectWebdriverIO.PartialMatcher, options?: ExpectWebdriverIO.StringOptions): R
|
|
319
278
|
|
|
320
|
-
/**
|
|
321
|
-
* `WebdriverIO.Element` -> `getAttribute` href
|
|
322
|
-
* Element's href includes the value provided
|
|
323
|
-
* @deprecated use `expect(el).toHaveHref(expect.stringContaining('...'))` instead
|
|
324
|
-
*/
|
|
325
|
-
toHaveHrefContaining(href: string | RegExp | ExpectWebdriverIO.PartialMatcher, options?: ExpectWebdriverIO.StringOptions): R
|
|
326
|
-
/**
|
|
327
|
-
* `WebdriverIO.Element` -> `getAttribute` href
|
|
328
|
-
* Element's href includes the value provided
|
|
329
|
-
* @deprecated use `expect(el).toHaveLink(expect.stringContaining('...'))` instead
|
|
330
|
-
*/
|
|
331
|
-
toHaveLinkContaining(href: string | RegExp | ExpectWebdriverIO.PartialMatcher, options?: ExpectWebdriverIO.StringOptions): R
|
|
332
|
-
|
|
333
279
|
/**
|
|
334
280
|
* `WebdriverIO.Element` -> `getProperty` value
|
|
335
281
|
*/
|
|
@@ -338,7 +284,7 @@ declare namespace ExpectWebdriverIO {
|
|
|
338
284
|
/**
|
|
339
285
|
* `WebdriverIO.Element` -> `getSize` value
|
|
340
286
|
*/
|
|
341
|
-
toHaveSize(
|
|
287
|
+
toHaveSize(size: { height: number; width: number }, options?: ExpectWebdriverIO.StringOptions): R
|
|
342
288
|
|
|
343
289
|
/**
|
|
344
290
|
* `WebdriverIO.Element` -> `getText`
|
|
@@ -363,30 +309,12 @@ declare namespace ExpectWebdriverIO {
|
|
|
363
309
|
text: string | RegExp | ExpectWebdriverIO.PartialMatcher | Array<string | RegExp>,
|
|
364
310
|
options?: ExpectWebdriverIO.StringOptions
|
|
365
311
|
): R
|
|
366
|
-
/**
|
|
367
|
-
* `WebdriverIO.Element` -> `getText`
|
|
368
|
-
* Element's text includes the text provided
|
|
369
|
-
* @deprecated use `expect(el).toHaveText(expect.stringContaining('...'))` instead
|
|
370
|
-
*/
|
|
371
|
-
toHaveTextContaining(
|
|
372
|
-
text: string | RegExp | ExpectWebdriverIO.PartialMatcher | Array<string | RegExp>,
|
|
373
|
-
options?: ExpectWebdriverIO.StringOptions
|
|
374
|
-
): R
|
|
375
312
|
|
|
376
313
|
/**
|
|
377
314
|
* `WebdriverIO.Element` -> `getHTML`
|
|
378
315
|
* Element's html equals the html provided
|
|
379
316
|
*/
|
|
380
317
|
toHaveHTML(html: string | RegExp | ExpectWebdriverIO.PartialMatcher | Array<string | RegExp>, options?: ExpectWebdriverIO.HTMLOptions): R
|
|
381
|
-
/**
|
|
382
|
-
* `WebdriverIO.Element` -> `getHTML`
|
|
383
|
-
* Element's html includes the html provided
|
|
384
|
-
* @deprecated use `expect(el).toHaveHTML(expect.stringContaining('...'))` instead
|
|
385
|
-
*/
|
|
386
|
-
toHaveHTMLContaining(
|
|
387
|
-
html: string | RegExp | ExpectWebdriverIO.PartialMatcher | Array<string | RegExp>,
|
|
388
|
-
options?: ExpectWebdriverIO.HTMLOptions
|
|
389
|
-
): R
|
|
390
318
|
|
|
391
319
|
/**
|
|
392
320
|
* `WebdriverIO.Element` -> `getComputedLabel`
|
|
@@ -396,15 +324,6 @@ declare namespace ExpectWebdriverIO {
|
|
|
396
324
|
computedLabel: string | RegExp | ExpectWebdriverIO.PartialMatcher | Array<string | RegExp>,
|
|
397
325
|
options?: ExpectWebdriverIO.StringOptions
|
|
398
326
|
): R
|
|
399
|
-
/**
|
|
400
|
-
* `WebdriverIO.Element` -> `getComputedLabel`
|
|
401
|
-
* Element's computed label includes the computed label provided
|
|
402
|
-
* @deprecated use `expect(el).toHaveComputedLabel(expect.stringContaining('...'))` instead
|
|
403
|
-
*/
|
|
404
|
-
toHaveComputedLabelContaining(
|
|
405
|
-
computedLabel: string | RegExp | ExpectWebdriverIO.PartialMatcher | Array<string | RegExp>,
|
|
406
|
-
options?: ExpectWebdriverIO.StringOptions
|
|
407
|
-
): R
|
|
408
327
|
|
|
409
328
|
/**
|
|
410
329
|
* `WebdriverIO.Element` -> `getComputedRole`
|
|
@@ -414,15 +333,6 @@ declare namespace ExpectWebdriverIO {
|
|
|
414
333
|
computedRole: string | RegExp | ExpectWebdriverIO.PartialMatcher | Array<string | RegExp>,
|
|
415
334
|
options?: ExpectWebdriverIO.StringOptions
|
|
416
335
|
): R
|
|
417
|
-
/**
|
|
418
|
-
* `WebdriverIO.Element` -> `getComputedRole`
|
|
419
|
-
* Element's computed role includes the computed role provided
|
|
420
|
-
* @deprecated use `expect(el).toHaveComputedRole(expect.stringContaining('...'))` instead
|
|
421
|
-
*/
|
|
422
|
-
toHaveComputedRoleContaining(
|
|
423
|
-
computedRole: string | RegExp | ExpectWebdriverIO.PartialMatcher | Array<string | RegExp>,
|
|
424
|
-
options?: ExpectWebdriverIO.StringOptions
|
|
425
|
-
): R
|
|
426
336
|
|
|
427
337
|
/**
|
|
428
338
|
* `WebdriverIO.Element` -> `getSize('width')`
|
|
@@ -453,41 +363,16 @@ declare namespace ExpectWebdriverIO {
|
|
|
453
363
|
*/
|
|
454
364
|
toHaveUrl(url: string | RegExp | ExpectWebdriverIO.PartialMatcher, options?: ExpectWebdriverIO.StringOptions): R
|
|
455
365
|
|
|
456
|
-
// ===== browser only =====
|
|
457
|
-
/**
|
|
458
|
-
* `WebdriverIO.Browser` -> `getUrl`
|
|
459
|
-
* Browser's url includes the provided text
|
|
460
|
-
* @deprecated use `expect(el).toHaveUrl(expect.stringContaining('...'))` instead
|
|
461
|
-
*/
|
|
462
|
-
toHaveUrlContaining(url: string | RegExp | ExpectWebdriverIO.PartialMatcher, options?: ExpectWebdriverIO.StringOptions): R
|
|
463
|
-
|
|
464
366
|
/**
|
|
465
367
|
* `WebdriverIO.Browser` -> `getTitle`
|
|
466
368
|
*/
|
|
467
369
|
toHaveTitle(title: string | RegExp | ExpectWebdriverIO.PartialMatcher, options?: ExpectWebdriverIO.StringOptions): R
|
|
468
370
|
|
|
469
|
-
// ===== browser only =====
|
|
470
|
-
/**
|
|
471
|
-
* `WebdriverIO.Browser` -> `getTitle`
|
|
472
|
-
* Browser's title includes the provided text
|
|
473
|
-
* @deprecated use `expect(el).toHaveTitle(expect.stringContaining('...'))` instead
|
|
474
|
-
*/
|
|
475
|
-
toHaveTitleContaining(title: string | RegExp | ExpectWebdriverIO.PartialMatcher, options?: ExpectWebdriverIO.StringOptions): R
|
|
476
|
-
|
|
477
371
|
/**
|
|
478
372
|
* `WebdriverIO.Browser` -> `execute`
|
|
479
373
|
*/
|
|
480
374
|
toHaveClipboardText(clipboardText: string | RegExp | ExpectWebdriverIO.PartialMatcher, options?: ExpectWebdriverIO.StringOptions): R
|
|
481
375
|
|
|
482
|
-
// ===== browser only =====
|
|
483
|
-
/**
|
|
484
|
-
* `WebdriverIO.Browser` -> `execute`
|
|
485
|
-
* Browser's clipboard includes the provided text
|
|
486
|
-
* @deprecated use `expect(el).toHaveClipboardText(expect.stringContaining('...'))` instead
|
|
487
|
-
*/
|
|
488
|
-
toHaveClipboardTextContaining(clipboardText: string | RegExp | ExpectWebdriverIO.PartialMatcher, options?: ExpectWebdriverIO.StringOptions): R
|
|
489
|
-
|
|
490
|
-
|
|
491
376
|
// ===== $$ only =====
|
|
492
377
|
/**
|
|
493
378
|
* `WebdriverIO.ElementArray` -> `$$('...').length`
|