expect-webdriverio 4.5.2 → 4.6.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/lib/constants.js +2 -0
- package/lib/matchers/browser/toHaveClipboardText.js +37 -0
- package/lib/matchers/browser/toHaveTitle.js +22 -4
- package/lib/matchers/browser/toHaveUrl.js +22 -4
- package/lib/matchers/element/toBeClickable.js +12 -2
- package/lib/matchers/element/toBeDisabled.js +12 -2
- package/lib/matchers/element/toBeDisplayed.js +11 -1
- package/lib/matchers/element/toBeDisplayedInViewport.js +12 -2
- package/lib/matchers/element/toBeEnabled.js +12 -2
- package/lib/matchers/element/toBeExisting.js +12 -2
- package/lib/matchers/element/toBeFocused.js +12 -2
- package/lib/matchers/element/toBeSelected.js +24 -4
- package/lib/matchers/element/toHaveAttribute.js +25 -9
- package/lib/matchers/element/toHaveChildren.js +17 -5
- package/lib/matchers/element/toHaveClass.js +28 -6
- package/lib/matchers/element/toHaveComputedLabel.js +23 -5
- package/lib/matchers/element/toHaveComputedRole.js +23 -5
- package/lib/matchers/element/toHaveElementProperty.js +14 -2
- package/lib/matchers/element/toHaveHTML.js +22 -4
- package/lib/matchers/element/toHaveHeight.js +17 -5
- package/lib/matchers/element/toHaveHref.js +22 -3
- package/lib/matchers/element/toHaveId.js +15 -3
- package/lib/matchers/element/toHaveSize.js +17 -5
- package/lib/matchers/element/toHaveStyle.js +16 -4
- package/lib/matchers/element/toHaveText.js +22 -4
- package/lib/matchers/element/toHaveValue.js +6 -0
- package/lib/matchers/element/toHaveWidth.js +17 -5
- package/lib/matchers/elements/toBeElementsArrayOfSize.js +18 -6
- package/lib/matchers/mock/toBeRequested.js +1 -1
- package/lib/matchers/mock/toBeRequestedTimes.js +18 -6
- package/lib/matchers/mock/toBeRequestedWith.js +23 -11
- package/lib/matchers.js +4 -14
- package/package.json +2 -1
- package/types/expect-webdriverio.d.ts +74 -5
- package/lib/matchers/browser/toHaveTitleContaining.js +0 -7
- package/lib/matchers/browser/toHaveUrlContaining.js +0 -7
- package/lib/matchers/element/toHaveAttributeContaining.js +0 -8
- package/lib/matchers/element/toHaveClassContaining.js +0 -10
- package/lib/matchers/element/toHaveComputedLabelContaining.js +0 -7
- package/lib/matchers/element/toHaveComputedRoleContaining.js +0 -7
- package/lib/matchers/element/toHaveHTMLContaining.js +0 -7
- package/lib/matchers/element/toHaveHrefContaining.js +0 -8
- package/lib/matchers/element/toHaveTextContaining.js +0 -7
- package/lib/matchers/element/toHaveValueContaining.js +0 -7
|
@@ -6,21 +6,33 @@ async function condition(el, height) {
|
|
|
6
6
|
result: actualHeight === height,
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
|
-
export async function toHaveHeight(received,
|
|
9
|
+
export async function toHaveHeight(received, expectedValue, options = {}) {
|
|
10
10
|
const isNot = this.isNot;
|
|
11
11
|
const { expectation = 'height', verb = 'have' } = this;
|
|
12
|
+
await options.beforeAssertion?.({
|
|
13
|
+
matcherName: 'toHaveHeight',
|
|
14
|
+
expectedValue,
|
|
15
|
+
options,
|
|
16
|
+
});
|
|
12
17
|
let el = await received;
|
|
13
18
|
let actualHeight;
|
|
14
19
|
const pass = await waitUntil(async () => {
|
|
15
|
-
const result = await executeCommand.call(this, el, condition, options, [
|
|
20
|
+
const result = await executeCommand.call(this, el, condition, options, [expectedValue, options]);
|
|
16
21
|
el = result.el;
|
|
17
22
|
actualHeight = result.values;
|
|
18
23
|
return result.success;
|
|
19
24
|
}, isNot, options);
|
|
20
25
|
updateElementsArray(pass, received, el);
|
|
21
|
-
const message = enhanceError(el, wrapExpectedWithArray(el, actualHeight,
|
|
22
|
-
|
|
26
|
+
const message = enhanceError(el, wrapExpectedWithArray(el, actualHeight, expectedValue), actualHeight, this, verb, expectation, '', options);
|
|
27
|
+
const result = {
|
|
23
28
|
pass,
|
|
24
|
-
message: () => message
|
|
29
|
+
message: () => message
|
|
25
30
|
};
|
|
31
|
+
await options.afterAssertion?.({
|
|
32
|
+
matcherName: 'toHaveHeight',
|
|
33
|
+
expectedValue,
|
|
34
|
+
options,
|
|
35
|
+
result
|
|
36
|
+
});
|
|
37
|
+
return result;
|
|
26
38
|
}
|
|
@@ -1,5 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export function toHaveHref(el,
|
|
3
|
-
|
|
1
|
+
import { toHaveAttributeAndValue } from './toHaveAttribute.js';
|
|
2
|
+
export async function toHaveHref(el, expectedValue, options = {}) {
|
|
3
|
+
await options.beforeAssertion?.({
|
|
4
|
+
matcherName: 'toHaveHref',
|
|
5
|
+
expectedValue,
|
|
6
|
+
options,
|
|
7
|
+
});
|
|
8
|
+
const result = await toHaveAttributeAndValue.call(this, el, 'href', expectedValue, options);
|
|
9
|
+
await options.afterAssertion?.({
|
|
10
|
+
matcherName: 'toHaveHref',
|
|
11
|
+
expectedValue,
|
|
12
|
+
options,
|
|
13
|
+
result
|
|
14
|
+
});
|
|
15
|
+
return result;
|
|
4
16
|
}
|
|
5
17
|
export const toHaveLink = toHaveHref;
|
|
18
|
+
export function toHaveHrefContaining(el, href, options = {}) {
|
|
19
|
+
return toHaveHref.call(this, el, href, {
|
|
20
|
+
...options,
|
|
21
|
+
containing: true
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export const toHaveLinkContaining = toHaveHrefContaining;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export function toHaveId(el,
|
|
3
|
-
|
|
1
|
+
import { toHaveAttributeAndValue } from './toHaveAttribute.js';
|
|
2
|
+
export async function toHaveId(el, expectedValue, options = {}) {
|
|
3
|
+
await options.beforeAssertion?.({
|
|
4
|
+
matcherName: 'toHaveId',
|
|
5
|
+
expectedValue,
|
|
6
|
+
options,
|
|
7
|
+
});
|
|
8
|
+
const result = await toHaveAttributeAndValue.call(this, el, 'id', expectedValue, options);
|
|
9
|
+
await options.afterAssertion?.({
|
|
10
|
+
matcherName: 'toHaveId',
|
|
11
|
+
expectedValue,
|
|
12
|
+
options,
|
|
13
|
+
result
|
|
14
|
+
});
|
|
15
|
+
return result;
|
|
4
16
|
}
|
|
@@ -3,21 +3,33 @@ async function condition(el, size) {
|
|
|
3
3
|
const actualSize = await el.getSize();
|
|
4
4
|
return compareObject(actualSize, size);
|
|
5
5
|
}
|
|
6
|
-
export async function toHaveSize(received,
|
|
6
|
+
export async function toHaveSize(received, expectedValue, options = {}) {
|
|
7
7
|
const isNot = this.isNot;
|
|
8
8
|
const { expectation = 'size', verb = 'have' } = this;
|
|
9
|
+
await options.beforeAssertion?.({
|
|
10
|
+
matcherName: 'toHaveSize',
|
|
11
|
+
expectedValue,
|
|
12
|
+
options,
|
|
13
|
+
});
|
|
9
14
|
let el = await received;
|
|
10
15
|
let actualSize;
|
|
11
16
|
const pass = await waitUntil(async () => {
|
|
12
|
-
const result = await executeCommand.call(this, el, condition, options, [
|
|
17
|
+
const result = await executeCommand.call(this, el, condition, options, [expectedValue, options]);
|
|
13
18
|
el = result.el;
|
|
14
19
|
actualSize = result.values;
|
|
15
20
|
return result.success;
|
|
16
21
|
}, isNot, options);
|
|
17
22
|
updateElementsArray(pass, received, el);
|
|
18
|
-
const message = enhanceError(el, wrapExpectedWithArray(el, actualSize,
|
|
19
|
-
|
|
23
|
+
const message = enhanceError(el, wrapExpectedWithArray(el, actualSize, expectedValue), actualSize, this, verb, expectation, '', options);
|
|
24
|
+
const result = {
|
|
20
25
|
pass,
|
|
21
|
-
message: () => message
|
|
26
|
+
message: () => message
|
|
22
27
|
};
|
|
28
|
+
await options.afterAssertion?.({
|
|
29
|
+
matcherName: 'toHaveSize',
|
|
30
|
+
expectedValue,
|
|
31
|
+
options,
|
|
32
|
+
result
|
|
33
|
+
});
|
|
34
|
+
return result;
|
|
23
35
|
}
|
|
@@ -2,21 +2,33 @@ import { waitUntil, enhanceError, compareStyle, executeCommand, wrapExpectedWith
|
|
|
2
2
|
async function condition(el, style, options) {
|
|
3
3
|
return compareStyle(el, style, options);
|
|
4
4
|
}
|
|
5
|
-
export async function toHaveStyle(received,
|
|
5
|
+
export async function toHaveStyle(received, expectedValue, options = {}) {
|
|
6
6
|
const isNot = this.isNot;
|
|
7
7
|
const { expectation = 'style', verb = 'have' } = this;
|
|
8
|
+
await options.beforeAssertion?.({
|
|
9
|
+
matcherName: 'toHaveStyle',
|
|
10
|
+
expectedValue,
|
|
11
|
+
options,
|
|
12
|
+
});
|
|
8
13
|
let el = await received;
|
|
9
14
|
let actualStyle;
|
|
10
15
|
const pass = await waitUntil(async () => {
|
|
11
|
-
const result = await executeCommand.call(this, el, condition, options, [
|
|
16
|
+
const result = await executeCommand.call(this, el, condition, options, [expectedValue, options]);
|
|
12
17
|
el = result.el;
|
|
13
18
|
actualStyle = result.values;
|
|
14
19
|
return result.success;
|
|
15
20
|
}, isNot, options);
|
|
16
21
|
updateElementsArray(pass, received, el);
|
|
17
|
-
const message = enhanceError(el, wrapExpectedWithArray(el, actualStyle,
|
|
18
|
-
|
|
22
|
+
const message = enhanceError(el, wrapExpectedWithArray(el, actualStyle, expectedValue), actualStyle, this, verb, expectation, '', options);
|
|
23
|
+
const result = {
|
|
19
24
|
pass,
|
|
20
25
|
message: () => message
|
|
21
26
|
};
|
|
27
|
+
await options.afterAssertion?.({
|
|
28
|
+
matcherName: 'toHaveStyle',
|
|
29
|
+
expectedValue,
|
|
30
|
+
options,
|
|
31
|
+
result
|
|
32
|
+
});
|
|
33
|
+
return result;
|
|
22
34
|
}
|
|
@@ -6,21 +6,39 @@ async function condition(el, text, options) {
|
|
|
6
6
|
}
|
|
7
7
|
return compareText(actualText, text, options);
|
|
8
8
|
}
|
|
9
|
-
export async function toHaveText(received,
|
|
9
|
+
export async function toHaveText(received, expectedValue, options = {}) {
|
|
10
10
|
const isNot = this.isNot;
|
|
11
11
|
const { expectation = 'text', verb = 'have' } = this;
|
|
12
|
+
await options.beforeAssertion?.({
|
|
13
|
+
matcherName: 'toHaveText',
|
|
14
|
+
expectedValue,
|
|
15
|
+
options,
|
|
16
|
+
});
|
|
12
17
|
let el = await received;
|
|
13
18
|
let actualText;
|
|
14
19
|
const pass = await waitUntil(async () => {
|
|
15
|
-
const result = await executeCommand.call(this, el, condition, options, [
|
|
20
|
+
const result = await executeCommand.call(this, el, condition, options, [expectedValue, options]);
|
|
16
21
|
el = result.el;
|
|
17
22
|
actualText = result.values;
|
|
18
23
|
return result.success;
|
|
19
24
|
}, isNot, options);
|
|
20
25
|
updateElementsArray(pass, received, el);
|
|
21
|
-
const message = enhanceError(el, wrapExpectedWithArray(el, actualText,
|
|
22
|
-
|
|
26
|
+
const message = enhanceError(el, wrapExpectedWithArray(el, actualText, expectedValue), actualText, this, verb, expectation, '', options);
|
|
27
|
+
const result = {
|
|
23
28
|
pass,
|
|
24
29
|
message: () => message
|
|
25
30
|
};
|
|
31
|
+
await options.afterAssertion?.({
|
|
32
|
+
matcherName: 'toHaveText',
|
|
33
|
+
expectedValue,
|
|
34
|
+
options,
|
|
35
|
+
result
|
|
36
|
+
});
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
export function toHaveTextContaining(el, text, options = {}) {
|
|
40
|
+
return toHaveText.call(this, el, text, {
|
|
41
|
+
...options,
|
|
42
|
+
containing: true
|
|
43
|
+
});
|
|
26
44
|
}
|
|
@@ -2,3 +2,9 @@ import { toHaveElementProperty } from './toHaveElementProperty.js';
|
|
|
2
2
|
export function toHaveValue(el, value, options = {}) {
|
|
3
3
|
return toHaveElementProperty.call(this, el, 'value', value, options);
|
|
4
4
|
}
|
|
5
|
+
export function toHaveValueContaining(el, value, options = {}) {
|
|
6
|
+
return toHaveValue.call(this, el, value, {
|
|
7
|
+
...options,
|
|
8
|
+
containing: true
|
|
9
|
+
});
|
|
10
|
+
}
|
|
@@ -6,21 +6,33 @@ async function condition(el, width) {
|
|
|
6
6
|
result: actualWidth === width,
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
|
-
export async function toHaveWidth(received,
|
|
9
|
+
export async function toHaveWidth(received, expectedValue, options = {}) {
|
|
10
10
|
const isNot = this.isNot;
|
|
11
11
|
const { expectation = 'width', verb = 'have' } = this;
|
|
12
|
+
await options.beforeAssertion?.({
|
|
13
|
+
matcherName: 'toHaveWidth',
|
|
14
|
+
expectedValue,
|
|
15
|
+
options,
|
|
16
|
+
});
|
|
12
17
|
let el = await received;
|
|
13
18
|
let actualWidth;
|
|
14
19
|
const pass = await waitUntil(async () => {
|
|
15
|
-
const result = await executeCommand.call(this, el, condition, options, [
|
|
20
|
+
const result = await executeCommand.call(this, el, condition, options, [expectedValue, options]);
|
|
16
21
|
el = result.el;
|
|
17
22
|
actualWidth = result.values;
|
|
18
23
|
return result.success;
|
|
19
24
|
}, isNot, options);
|
|
20
25
|
updateElementsArray(pass, received, el);
|
|
21
|
-
const message = enhanceError(el, wrapExpectedWithArray(el, actualWidth,
|
|
22
|
-
|
|
26
|
+
const message = enhanceError(el, wrapExpectedWithArray(el, actualWidth, expectedValue), actualWidth, this, verb, expectation, '', options);
|
|
27
|
+
const result = {
|
|
23
28
|
pass,
|
|
24
|
-
message: () => message
|
|
29
|
+
message: () => message
|
|
25
30
|
};
|
|
31
|
+
await options.afterAssertion?.({
|
|
32
|
+
matcherName: 'toHaveWidth',
|
|
33
|
+
expectedValue,
|
|
34
|
+
options,
|
|
35
|
+
result
|
|
36
|
+
});
|
|
37
|
+
return result;
|
|
26
38
|
}
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { waitUntil, enhanceError, compareNumbers, numberError, updateElementsArray } from '../../utils.js';
|
|
2
2
|
import { refetchElements } from '../../util/refetchElements.js';
|
|
3
|
-
export async function toBeElementsArrayOfSize(received,
|
|
3
|
+
export async function toBeElementsArrayOfSize(received, expectedValue, options = {}) {
|
|
4
4
|
const isNot = this.isNot;
|
|
5
5
|
const { expectation = 'elements array of size', verb = 'be' } = this;
|
|
6
|
+
await options.beforeAssertion?.({
|
|
7
|
+
matcherName: 'toBeElementsArrayOfSize',
|
|
8
|
+
expectedValue,
|
|
9
|
+
options,
|
|
10
|
+
});
|
|
6
11
|
let numberOptions;
|
|
7
|
-
if (typeof
|
|
8
|
-
numberOptions = { eq:
|
|
12
|
+
if (typeof expectedValue === 'number') {
|
|
13
|
+
numberOptions = { eq: expectedValue };
|
|
9
14
|
}
|
|
10
|
-
else if (!
|
|
15
|
+
else if (!expectedValue || (typeof expectedValue.eq !== 'number' && typeof expectedValue.gte !== 'number' && typeof expectedValue.lte !== 'number')) {
|
|
11
16
|
throw new Error('Invalid params passed to toBeElementsArrayOfSize.');
|
|
12
17
|
}
|
|
13
18
|
else {
|
|
14
|
-
numberOptions =
|
|
19
|
+
numberOptions = expectedValue;
|
|
15
20
|
}
|
|
16
21
|
let elements = await received;
|
|
17
22
|
const arrLength = elements.length;
|
|
@@ -22,8 +27,15 @@ export async function toBeElementsArrayOfSize(received, expected, options = {})
|
|
|
22
27
|
updateElementsArray(pass, received, elements, true);
|
|
23
28
|
const error = numberError(numberOptions);
|
|
24
29
|
const message = enhanceError(elements, error, arrLength, this, verb, expectation, '', numberOptions);
|
|
25
|
-
|
|
30
|
+
const result = {
|
|
26
31
|
pass,
|
|
27
32
|
message: () => message
|
|
28
33
|
};
|
|
34
|
+
await options.afterAssertion?.({
|
|
35
|
+
matcherName: 'toBeElementsArrayOfSize',
|
|
36
|
+
expectedValue,
|
|
37
|
+
options,
|
|
38
|
+
result
|
|
39
|
+
});
|
|
40
|
+
return result;
|
|
29
41
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { toBeRequestedTimes } from './toBeRequestedTimes.js';
|
|
2
2
|
export function toBeRequested(received, options = {}) {
|
|
3
|
-
return toBeRequestedTimes.call({ ...(this || {}), expectation: 'called' }, received, {
|
|
3
|
+
return toBeRequestedTimes.call({ ...(this || {}), expectation: 'called' }, received, { gte: 1 }, options);
|
|
4
4
|
}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { waitUntil, enhanceError, compareNumbers } from '../../utils.js';
|
|
2
2
|
import { numberError } from '../../util/formatMessage.js';
|
|
3
|
-
export async function toBeRequestedTimes(received,
|
|
3
|
+
export async function toBeRequestedTimes(received, expectedValue = {}, options = {}) {
|
|
4
4
|
const isNot = this.isNot || false;
|
|
5
|
-
const { expectation = `called${typeof
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
const { expectation = `called${typeof expectedValue === 'number' ? ' ' + expectedValue : ''} time${expectedValue !== 1 ? 's' : ''}`, verb = 'be' } = this;
|
|
6
|
+
await options.beforeAssertion?.({
|
|
7
|
+
matcherName: 'toBeRequestedTimes',
|
|
8
|
+
expectedValue,
|
|
9
|
+
options,
|
|
10
|
+
});
|
|
11
|
+
const numberOptions = typeof expectedValue === 'number'
|
|
12
|
+
? { eq: expectedValue }
|
|
13
|
+
: expectedValue || {};
|
|
9
14
|
let actual;
|
|
10
15
|
const pass = await waitUntil(async () => {
|
|
11
16
|
actual = received.calls.length;
|
|
@@ -13,8 +18,15 @@ export async function toBeRequestedTimes(received, expected = {}, options = {})
|
|
|
13
18
|
}, isNot, { ...numberOptions, ...options });
|
|
14
19
|
const error = numberError(numberOptions);
|
|
15
20
|
const message = enhanceError('mock', error, actual, this, verb, expectation, '', numberOptions);
|
|
16
|
-
|
|
21
|
+
const result = {
|
|
17
22
|
pass,
|
|
18
23
|
message: () => message
|
|
19
24
|
};
|
|
25
|
+
await options.afterAssertion?.({
|
|
26
|
+
matcherName: 'toBeRequestedTimes',
|
|
27
|
+
expectedValue,
|
|
28
|
+
options,
|
|
29
|
+
result
|
|
30
|
+
});
|
|
31
|
+
return result;
|
|
20
32
|
}
|
|
@@ -2,30 +2,42 @@ import { waitUntil, enhanceError } from '../../utils.js';
|
|
|
2
2
|
import { equals } from '../../jasmineUtils.js';
|
|
3
3
|
const STR_LIMIT = 80;
|
|
4
4
|
const KEY_LIMIT = 12;
|
|
5
|
-
export async function toBeRequestedWith(received,
|
|
5
|
+
export async function toBeRequestedWith(received, expectedValue = {}, options = {}) {
|
|
6
6
|
const isNot = this.isNot || false;
|
|
7
7
|
const { expectation = 'called with', verb = 'be' } = this;
|
|
8
|
+
await options.beforeAssertion?.({
|
|
9
|
+
matcherName: 'toBeRequestedWith',
|
|
10
|
+
expectedValue,
|
|
11
|
+
options,
|
|
12
|
+
});
|
|
8
13
|
let actual;
|
|
9
14
|
const pass = await waitUntil(async () => {
|
|
10
15
|
for (const call of received.calls) {
|
|
11
16
|
actual = call;
|
|
12
|
-
if (methodMatcher(call.method,
|
|
13
|
-
statusCodeMatcher(call.statusCode,
|
|
14
|
-
urlMatcher(call.url,
|
|
15
|
-
headersMatcher(call.headers,
|
|
16
|
-
headersMatcher(call.responseHeaders,
|
|
17
|
-
bodyMatcher(call.postData,
|
|
18
|
-
bodyMatcher(call.body,
|
|
17
|
+
if (methodMatcher(call.method, expectedValue.method) &&
|
|
18
|
+
statusCodeMatcher(call.statusCode, expectedValue.statusCode) &&
|
|
19
|
+
urlMatcher(call.url, expectedValue.url) &&
|
|
20
|
+
headersMatcher(call.headers, expectedValue.requestHeaders) &&
|
|
21
|
+
headersMatcher(call.responseHeaders, expectedValue.responseHeaders) &&
|
|
22
|
+
bodyMatcher(call.postData, expectedValue.postData) &&
|
|
23
|
+
bodyMatcher(call.body, expectedValue.response)) {
|
|
19
24
|
return true;
|
|
20
25
|
}
|
|
21
26
|
}
|
|
22
27
|
return false;
|
|
23
28
|
}, isNot, { ...options, wait: isNot ? 0 : options.wait });
|
|
24
|
-
const message = enhanceError('mock', minifyRequestedWith(
|
|
25
|
-
|
|
29
|
+
const message = enhanceError('mock', minifyRequestedWith(expectedValue), minifyRequestMock(actual, expectedValue) || 'was not called', this, verb, expectation, '', options);
|
|
30
|
+
const result = {
|
|
26
31
|
pass,
|
|
27
|
-
message: () => message
|
|
32
|
+
message: () => message
|
|
28
33
|
};
|
|
34
|
+
await options.afterAssertion?.({
|
|
35
|
+
matcherName: 'toBeRequestedWith',
|
|
36
|
+
expectedValue,
|
|
37
|
+
options,
|
|
38
|
+
result
|
|
39
|
+
});
|
|
40
|
+
return result;
|
|
29
41
|
}
|
|
30
42
|
const methodMatcher = (method, expected) => {
|
|
31
43
|
if (typeof expected === 'undefined') {
|
package/lib/matchers.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import * as toHaveClipboardText from './matchers/browser/toHaveClipboardText.js';
|
|
1
2
|
import * as toHaveTitle from './matchers/browser/toHaveTitle.js';
|
|
2
|
-
import * as toHaveTitleContaining from './matchers/browser/toHaveTitleContaining.js';
|
|
3
3
|
import * as toHaveUrl from './matchers/browser/toHaveUrl.js';
|
|
4
|
-
import * as toHaveUrlContaining from './matchers/browser/toHaveUrlContaining.js';
|
|
5
4
|
import * as toBeElementsArrayOfSize from './matchers/elements/toBeElementsArrayOfSize.js';
|
|
6
5
|
import * as toBeClickable from './matchers/element/toBeClickable.js';
|
|
7
6
|
import * as toBeDisabled from './matchers/element/toBeDisabled.js';
|
|
@@ -12,27 +11,22 @@ import * as toBeExisting from './matchers/element/toBeExisting.js';
|
|
|
12
11
|
import * as toBeFocused from './matchers/element/toBeFocused.js';
|
|
13
12
|
import * as toBeSelected from './matchers/element/toBeSelected.js';
|
|
14
13
|
import * as toHaveAttribute from './matchers/element/toHaveAttribute.js';
|
|
15
|
-
import * as toHaveAttributeContaining from './matchers/element/toHaveAttributeContaining.js';
|
|
16
14
|
import * as toHaveChildren from './matchers/element/toHaveChildren.js';
|
|
17
15
|
import * as toHaveClass from './matchers/element/toHaveClass.js';
|
|
18
|
-
import * as toHaveClassContaining from './matchers/element/toHaveClassContaining.js';
|
|
19
16
|
import * as toHaveHref from './matchers/element/toHaveHref.js';
|
|
20
|
-
import * as toHaveHrefContaining from './matchers/element/toHaveHrefContaining.js';
|
|
21
17
|
import * as toHaveId from './matchers/element/toHaveId.js';
|
|
18
|
+
import * as toHaveSize from './matchers/element/toHaveSize.js';
|
|
22
19
|
import * as toHaveElementProperty from './matchers/element/toHaveElementProperty.js';
|
|
23
20
|
import * as toHaveText from './matchers/element/toHaveText.js';
|
|
24
|
-
import * as toHaveTextContaining from './matchers/element/toHaveTextContaining.js';
|
|
25
21
|
import * as toHaveValue from './matchers/element/toHaveValue.js';
|
|
26
|
-
import * as toHaveValueContaining from './matchers/element/toHaveValueContaining.js';
|
|
27
22
|
import * as toHaveStyle from './matchers/element/toHaveStyle.js';
|
|
28
23
|
import * as toBeRequested from './matchers/mock/toBeRequested.js';
|
|
29
24
|
import * as toBeRequestedTimes from './matchers/mock/toBeRequestedTimes.js';
|
|
30
25
|
import * as toBeRequestedWith from './matchers/mock/toBeRequestedWith.js';
|
|
31
26
|
const matchers = {
|
|
27
|
+
...toHaveClipboardText,
|
|
32
28
|
...toHaveTitle,
|
|
33
|
-
...toHaveTitleContaining,
|
|
34
29
|
...toHaveUrl,
|
|
35
|
-
...toHaveUrlContaining,
|
|
36
30
|
...toBeElementsArrayOfSize,
|
|
37
31
|
...toBeClickable,
|
|
38
32
|
...toBeDisabled,
|
|
@@ -43,18 +37,14 @@ const matchers = {
|
|
|
43
37
|
...toBeFocused,
|
|
44
38
|
...toBeSelected,
|
|
45
39
|
...toHaveAttribute,
|
|
46
|
-
...toHaveAttributeContaining,
|
|
47
40
|
...toHaveChildren,
|
|
48
41
|
...toHaveClass,
|
|
49
|
-
...toHaveClassContaining,
|
|
50
42
|
...toHaveHref,
|
|
51
|
-
...toHaveHrefContaining,
|
|
52
43
|
...toHaveId,
|
|
44
|
+
...toHaveSize,
|
|
53
45
|
...toHaveElementProperty,
|
|
54
46
|
...toHaveText,
|
|
55
|
-
...toHaveTextContaining,
|
|
56
47
|
...toHaveValue,
|
|
57
|
-
...toHaveValueContaining,
|
|
58
48
|
...toHaveStyle,
|
|
59
49
|
...toBeRequested,
|
|
60
50
|
...toBeRequestedTimes,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expect-webdriverio",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"author": "Mykola Grybyk <mykola.grybyk@gmail.com>",
|
|
5
5
|
"description": "WebdriverIO Assertion Library",
|
|
6
6
|
"license": "MIT",
|
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
},
|
|
82
82
|
"optionalDependencies": {
|
|
83
83
|
"@wdio/globals": "^8.23.1",
|
|
84
|
+
"@wdio/logger": "^8.16.17",
|
|
84
85
|
"webdriverio": "^8.23.1"
|
|
85
86
|
},
|
|
86
87
|
"dependencies": {
|