expect-webdriverio 5.4.0 → 5.4.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.
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { executeCommandBe } from '../../utils.js';
|
|
2
2
|
import { DEFAULT_OPTIONS } from '../../constants.js';
|
|
3
|
-
export async function toBeDisplayed(received, options = DEFAULT_OPTIONS) {
|
|
3
|
+
export async function toBeDisplayed(received, { withinViewport = false, contentVisibilityAuto = true, opacityProperty = true, visibilityProperty = true } = {}, options = DEFAULT_OPTIONS) {
|
|
4
4
|
this.expectation = this.expectation || 'displayed';
|
|
5
5
|
await options.beforeAssertion?.({
|
|
6
6
|
matcherName: 'toBeDisplayed',
|
|
7
7
|
options,
|
|
8
8
|
});
|
|
9
|
-
const result = await executeCommandBe.call(this, received, el => el?.isDisplayed(), options);
|
|
9
|
+
const result = await executeCommandBe.call(this, received, el => el?.isDisplayed({ withinViewport, contentVisibilityAuto, opacityProperty, visibilityProperty }), options);
|
|
10
10
|
await options.afterAssertion?.({
|
|
11
11
|
matcherName: 'toBeDisplayed',
|
|
12
12
|
options,
|
package/lib/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import deepEql from 'deep-eql';
|
|
2
2
|
import { expect } from 'expect';
|
|
3
3
|
import { DEFAULT_OPTIONS } from './constants.js';
|
|
4
4
|
import { wrapExpectedWithArray } from './util/elementsUtil.js';
|
|
@@ -215,7 +215,7 @@ export const compareObject = (actual, expected) => {
|
|
|
215
215
|
}
|
|
216
216
|
return {
|
|
217
217
|
value: actual,
|
|
218
|
-
result:
|
|
218
|
+
result: deepEql(actual, expected),
|
|
219
219
|
};
|
|
220
220
|
};
|
|
221
221
|
export const compareStyle = async (actualEl, style, { ignoreCase = true, trim = false }) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expect-webdriverio",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.2",
|
|
4
4
|
"author": "Mykola Grybyk <mykola.grybyk@gmail.com>",
|
|
5
5
|
"description": "WebdriverIO Assertion Library",
|
|
6
6
|
"license": "MIT",
|
|
@@ -61,14 +61,13 @@
|
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@vitest/snapshot": "^3.2.4",
|
|
64
|
+
"deep-eql": "^5.0.2",
|
|
64
65
|
"expect": "^30.0.0",
|
|
65
|
-
"jest-matcher-utils": "^30.0.0"
|
|
66
|
-
"lodash.isequal": "^4.5.0"
|
|
66
|
+
"jest-matcher-utils": "^30.0.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@types/debug": "^4.1.12",
|
|
70
70
|
"@types/jest": "^30.0.0",
|
|
71
|
-
"@types/lodash.isequal": "^4.5.8",
|
|
72
71
|
"@types/node": "^24.0.3",
|
|
73
72
|
"@vitest/coverage-v8": "^3.2.4",
|
|
74
73
|
"@wdio/eslint": "^0.1.1",
|