@vonage/vivid-test-utils 5.15.0 → 5.16.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/dist/components.generated-Bgf7lMJM.js +2336 -0
- package/dist/components.generated-DNNSCeHI.cjs +1 -0
- package/dist/components.generated.d.ts +370 -309
- package/dist/cypress.cjs +1 -3
- package/dist/cypress.js +118 -133
- package/dist/dom.cjs +1 -3
- package/dist/dom.js +110 -120
- package/dist/jsdom-polyfill.cjs +1 -1
- package/dist/jsdom-polyfill.js +18 -34
- package/dist/playwright.cjs +1 -3
- package/dist/playwright.js +72 -87
- package/package.json +14 -11
- package/dist/components.generated-7mfpO6v0.cjs +0 -1
- package/dist/components.generated-jnFpmMnu.js +0 -3671
package/dist/cypress.cjs
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Original error: ${o.message}`);throw t&&(c.stack=t),c}});break;case"count":r.el().should("have.length",e);break}},wrapAction:r=>function e(...a){if(!n){const t=new Error;Error.captureStackTrace(t,e),n=t.stack}try{return r(...a)}finally{n=void 0}},wrapExpect:r=>function e(...a){if(!n){const t=new Error;Error.captureStackTrace(t,e),n=t.stack}try{return r(...a)}finally{n=void 0}},wrapSelector:r=>function e(...a){if(!n){const t=new Error;Error.captureStackTrace(t,e),n=t.stack}try{return r(...a)}finally{n=void 0}}}},v=i=>{const u={rootLocator:i,driver:k(i)};return new d.VividWrapper(u)};exports.vividCypress=v;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./components.generated-DNNSCeHI.cjs`);var t=async()=>new Promise(e=>requestAnimationFrame(()=>e())),n=e=>{let n=t=>t===e,r,i=e=>{let t=r;return((...n)=>{let r=window.Error;window.Error=class extends Error{constructor(e){super(e),e===`userInvocationStack`&&(this.stack=t)}static captureStackTrace(e,t){e.message!==`userInvocationStack`&&super.captureStackTrace(e,t)}};try{return e(...n)}finally{window.Error=r}})};return{querySelector:(e,t)=>i(()=>n(e)?e.get(t):e().find(t)),enterShadow:e=>i(()=>e().shadow()),querySelectorAll:(e,t)=>i(()=>n(e)?e.get(t):e().find(t)),nth:(e,t)=>i(()=>e().eq(t)),userClick:e=>e().click(),userClear:e=>e().clear(),userFocus:e=>e().focus(),userBlur:e=>e().blur(),userHover:e=>e().then(e=>e.get(0).dispatchEvent(new MouseEvent(`mouseover`))),userFill:(e,t)=>t===``?e().clear():e().clear().type(t),userDragSlider:(e,n,r,i)=>{e().then(e=>{r().then(async n=>{let r=e.get(0),a=n.get(0);a.id===`start-thumb`?(r.startAsNumber=i,r.$emit(`input:start`),r.$emit(`input`)):a.id===`end-thumb`?(r.endAsNumber=i,r.$emit(`input:end`),r.$emit(`input`)):r.valueAsNumber=i,await t()})})},eval:(e,t,n,i)=>{let a=r;e().then(async e=>{r=a;try{let r=await t(e.get(0),n);await i?.(r)}finally{r=void 0}})},waitForUpdate(e){e().then(()=>new Promise(e=>{requestAnimationFrame(()=>{e()})}))},expectEq:(e,t,n)=>{let i=r;switch(e.type){case`eval`:e.el().should(r=>{try{expect(e.fn(r.get(0),e.arg)).to.deep.equal(t)}catch(e){let t=Error(`${n}\n\nOriginal error: ${e.message}`);throw i&&(t.stack=i),t}});break;case`count`:e.el().should(`have.length`,t);break}},wrapAction:e=>function t(...n){if(!r){let e=Error();Error.captureStackTrace(e,t),r=e.stack}try{return e(...n)}finally{r=void 0}},wrapExpect:e=>function t(...n){if(!r){let e=Error();Error.captureStackTrace(e,t),r=e.stack}try{return e(...n)}finally{r=void 0}},wrapSelector:e=>function t(...n){if(!r){let e=Error();Error.captureStackTrace(e,t),r=e.stack}try{return e(...n)}finally{r=void 0}}}},r=t=>new e.t({rootLocator:t,driver:n(t)});exports.vividCypress=r;
|
package/dist/cypress.js
CHANGED
|
@@ -1,133 +1,118 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
} finally {
|
|
120
|
-
a = void 0;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
}, v = (i) => {
|
|
125
|
-
const u = {
|
|
126
|
-
rootLocator: i,
|
|
127
|
-
driver: k(i)
|
|
128
|
-
};
|
|
129
|
-
return new w(u);
|
|
130
|
-
};
|
|
131
|
-
export {
|
|
132
|
-
v as vividCypress
|
|
133
|
-
};
|
|
1
|
+
import { t as e } from "./components.generated-Bgf7lMJM.js";
|
|
2
|
+
//#region src/drivers/cypress.ts
|
|
3
|
+
var t = async () => new Promise((e) => requestAnimationFrame(() => e())), n = (e) => {
|
|
4
|
+
let n = (t) => t === e, r, i = (e) => {
|
|
5
|
+
let t = r;
|
|
6
|
+
return ((...n) => {
|
|
7
|
+
let r = window.Error;
|
|
8
|
+
window.Error = class extends Error {
|
|
9
|
+
constructor(e) {
|
|
10
|
+
super(e), e === "userInvocationStack" && (this.stack = t);
|
|
11
|
+
}
|
|
12
|
+
static captureStackTrace(e, t) {
|
|
13
|
+
e.message !== "userInvocationStack" && super.captureStackTrace(e, t);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
try {
|
|
17
|
+
return e(...n);
|
|
18
|
+
} finally {
|
|
19
|
+
window.Error = r;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
querySelector: (e, t) => i(() => n(e) ? e.get(t) : e().find(t)),
|
|
25
|
+
enterShadow: (e) => i(() => e().shadow()),
|
|
26
|
+
querySelectorAll: (e, t) => i(() => n(e) ? e.get(t) : e().find(t)),
|
|
27
|
+
nth: (e, t) => i(() => e().eq(t)),
|
|
28
|
+
userClick: (e) => e().click(),
|
|
29
|
+
userClear: (e) => e().clear(),
|
|
30
|
+
userFocus: (e) => e().focus(),
|
|
31
|
+
userBlur: (e) => e().blur(),
|
|
32
|
+
userHover: (e) => e().then((e) => e.get(0).dispatchEvent(new MouseEvent("mouseover"))),
|
|
33
|
+
userFill: (e, t) => t === "" ? e().clear() : e().clear().type(t),
|
|
34
|
+
userDragSlider: (e, n, r, i) => {
|
|
35
|
+
e().then((e) => {
|
|
36
|
+
r().then(async (n) => {
|
|
37
|
+
let r = e.get(0), a = n.get(0);
|
|
38
|
+
a.id === "start-thumb" ? (r.startAsNumber = i, r.$emit("input:start"), r.$emit("input")) : a.id === "end-thumb" ? (r.endAsNumber = i, r.$emit("input:end"), r.$emit("input")) : r.valueAsNumber = i, await t();
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
eval: (e, t, n, i) => {
|
|
43
|
+
let a = r;
|
|
44
|
+
e().then(async (e) => {
|
|
45
|
+
r = a;
|
|
46
|
+
try {
|
|
47
|
+
let r = await t(e.get(0), n);
|
|
48
|
+
await i?.(r);
|
|
49
|
+
} finally {
|
|
50
|
+
r = void 0;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
waitForUpdate(e) {
|
|
55
|
+
e().then(() => new Promise((e) => {
|
|
56
|
+
requestAnimationFrame(() => {
|
|
57
|
+
e();
|
|
58
|
+
});
|
|
59
|
+
}));
|
|
60
|
+
},
|
|
61
|
+
expectEq: (e, t, n) => {
|
|
62
|
+
let i = r;
|
|
63
|
+
switch (e.type) {
|
|
64
|
+
case "eval":
|
|
65
|
+
e.el().should((r) => {
|
|
66
|
+
try {
|
|
67
|
+
expect(e.fn(r.get(0), e.arg)).to.deep.equal(t);
|
|
68
|
+
} catch (e) {
|
|
69
|
+
let t = /* @__PURE__ */ Error(`${n}\n\nOriginal error: ${e.message}`);
|
|
70
|
+
throw i && (t.stack = i), t;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
break;
|
|
74
|
+
case "count":
|
|
75
|
+
e.el().should("have.length", t);
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
wrapAction: (e) => function t(...n) {
|
|
80
|
+
if (!r) {
|
|
81
|
+
let e = /* @__PURE__ */ Error();
|
|
82
|
+
Error.captureStackTrace(e, t), r = e.stack;
|
|
83
|
+
}
|
|
84
|
+
try {
|
|
85
|
+
return e(...n);
|
|
86
|
+
} finally {
|
|
87
|
+
r = void 0;
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
wrapExpect: (e) => function t(...n) {
|
|
91
|
+
if (!r) {
|
|
92
|
+
let e = /* @__PURE__ */ Error();
|
|
93
|
+
Error.captureStackTrace(e, t), r = e.stack;
|
|
94
|
+
}
|
|
95
|
+
try {
|
|
96
|
+
return e(...n);
|
|
97
|
+
} finally {
|
|
98
|
+
r = void 0;
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
wrapSelector: (e) => function t(...n) {
|
|
102
|
+
if (!r) {
|
|
103
|
+
let e = /* @__PURE__ */ Error();
|
|
104
|
+
Error.captureStackTrace(e, t), r = e.stack;
|
|
105
|
+
}
|
|
106
|
+
try {
|
|
107
|
+
return e(...n);
|
|
108
|
+
} finally {
|
|
109
|
+
r = void 0;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
}, r = (t) => new e({
|
|
114
|
+
rootLocator: t,
|
|
115
|
+
driver: n(t)
|
|
116
|
+
});
|
|
117
|
+
//#endregion
|
|
118
|
+
export { r as vividCypress };
|
package/dist/dom.cjs
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Original error: ${e.message}`),e}break;case"count":c(r.el.length).toEqual(t);break}},wrapAction:r=>async function t(...a){try{return await r(...a)}catch(e){throw e instanceof Error&&Error.captureStackTrace(e,t),e}},wrapExpect:r=>function t(...a){try{return r(...a)}catch(e){throw e instanceof Error&&Error.captureStackTrace(e,t),e}},wrapSelector:r=>function t(...a){try{return r(...a)}catch(e){throw e instanceof Error&&Error.captureStackTrace(e,t),e}}}},p=(c,s)=>{const i={rootLocator:s,driver:l(c)};return new u.VividWrapper(i)};exports.vividDOM=p;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const c=require(`./components.generated-DNNSCeHI.cjs`);let l=require(`@testing-library/user-event`);l=s(l);var u=()=>new Promise(e=>{requestAnimationFrame(()=>e())}),d=e=>{let t=l.default.setup(),n=async e=>{e.focus(),e.value=``,e.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0}))};return{querySelector:(e,t)=>{let n=e.querySelector(t);if(!n)throw Error(`Could not find element: ${t}`);return n},enterShadow(e){if(!e.shadowRoot)throw Error(`Element ${e.outerHTML} does not have a shadow root`);return e.shadowRoot},querySelectorAll:(e,t)=>e?Array.from(e.querySelectorAll(t)):[],nth:(e,t)=>{if(t<0||t>e.length-1)throw Error(`Could not find element with index "${t}". Collection only has "${e.length}" elements.`);return e[t]},userClick:async e=>{await t.click(e),await u()},userFill:async(e,r)=>{await n(e),r&&await t.type(e,r),await u()},userClear:async e=>{await n(e),await u()},userFocus:async e=>{e.focus(),await u()},userBlur:async e=>{e.blur(),(e.tagName===`INPUT`||e.tagName===`TEXTAREA`)&&e.dispatchEvent(new InputEvent(`change`,{bubbles:!0,composed:!0})),await u()},userHover:async e=>{await t.hover(e),await u()},userDragSlider:async(e,t,n,r)=>{if(n.id===`start-thumb`){let t=e;t.startAsNumber=r,t.$emit(`input:start`),t.$emit(`input`)}else if(n.id===`end-thumb`){let t=e;t.endAsNumber=r,t.$emit(`input:end`),t.$emit(`input`)}else{let t=e;t.valueAsNumber=r}await u()},eval:async(e,t,n,r)=>{let i=await t(e,n);await r?.(i)},waitForUpdate:async()=>{await u()},expectEq:(t,n,r)=>{switch(t.type){case`eval`:try{e(t.fn(t.el,t.arg)).toEqual(n)}catch(e){throw e instanceof Error&&(e.message=`${r}\n\nOriginal error: ${e.message}`),e}break;case`count`:e(t.el.length).toEqual(n);break}},wrapAction:e=>async function t(...n){try{return await e(...n)}catch(e){throw e instanceof Error&&Error.captureStackTrace(e,t),e}},wrapExpect:e=>function t(...n){try{return e(...n)}catch(e){throw e instanceof Error&&Error.captureStackTrace(e,t),e}},wrapSelector:e=>function t(...n){try{return e(...n)}catch(e){throw e instanceof Error&&Error.captureStackTrace(e,t),e}}}},f=(e,t)=>new c.t({rootLocator:t,driver:d(e)});exports.t=s,exports.vividDOM=f;
|
package/dist/dom.js
CHANGED
|
@@ -1,120 +1,110 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}, f = (c, s) => {
|
|
112
|
-
const i = {
|
|
113
|
-
rootLocator: s,
|
|
114
|
-
driver: p(c)
|
|
115
|
-
};
|
|
116
|
-
return new u(i);
|
|
117
|
-
};
|
|
118
|
-
export {
|
|
119
|
-
f as vividDOM
|
|
120
|
-
};
|
|
1
|
+
import { t as e } from "./components.generated-Bgf7lMJM.js";
|
|
2
|
+
import t from "@testing-library/user-event";
|
|
3
|
+
//#region src/drivers/dom.ts
|
|
4
|
+
var n = () => new Promise((e) => {
|
|
5
|
+
requestAnimationFrame(() => e());
|
|
6
|
+
}), r = (e) => {
|
|
7
|
+
let r = t.setup(), i = async (e) => {
|
|
8
|
+
e.focus(), e.value = "", e.dispatchEvent(new InputEvent("input", {
|
|
9
|
+
bubbles: !0,
|
|
10
|
+
composed: !0
|
|
11
|
+
}));
|
|
12
|
+
};
|
|
13
|
+
return {
|
|
14
|
+
querySelector: (e, t) => {
|
|
15
|
+
let n = e.querySelector(t);
|
|
16
|
+
if (!n) throw Error(`Could not find element: ${t}`);
|
|
17
|
+
return n;
|
|
18
|
+
},
|
|
19
|
+
enterShadow(e) {
|
|
20
|
+
if (!e.shadowRoot) throw Error(`Element ${e.outerHTML} does not have a shadow root`);
|
|
21
|
+
return e.shadowRoot;
|
|
22
|
+
},
|
|
23
|
+
querySelectorAll: (e, t) => e ? Array.from(e.querySelectorAll(t)) : [],
|
|
24
|
+
nth: (e, t) => {
|
|
25
|
+
if (t < 0 || t > e.length - 1) throw Error(`Could not find element with index "${t}". Collection only has "${e.length}" elements.`);
|
|
26
|
+
return e[t];
|
|
27
|
+
},
|
|
28
|
+
userClick: async (e) => {
|
|
29
|
+
await r.click(e), await n();
|
|
30
|
+
},
|
|
31
|
+
userFill: async (e, t) => {
|
|
32
|
+
await i(e), t && await r.type(e, t), await n();
|
|
33
|
+
},
|
|
34
|
+
userClear: async (e) => {
|
|
35
|
+
await i(e), await n();
|
|
36
|
+
},
|
|
37
|
+
userFocus: async (e) => {
|
|
38
|
+
e.focus(), await n();
|
|
39
|
+
},
|
|
40
|
+
userBlur: async (e) => {
|
|
41
|
+
e.blur(), (e.tagName === "INPUT" || e.tagName === "TEXTAREA") && e.dispatchEvent(new InputEvent("change", {
|
|
42
|
+
bubbles: !0,
|
|
43
|
+
composed: !0
|
|
44
|
+
})), await n();
|
|
45
|
+
},
|
|
46
|
+
userHover: async (e) => {
|
|
47
|
+
await r.hover(e), await n();
|
|
48
|
+
},
|
|
49
|
+
userDragSlider: async (e, t, r, i) => {
|
|
50
|
+
if (r.id === "start-thumb") {
|
|
51
|
+
let t = e;
|
|
52
|
+
t.startAsNumber = i, t.$emit("input:start"), t.$emit("input");
|
|
53
|
+
} else if (r.id === "end-thumb") {
|
|
54
|
+
let t = e;
|
|
55
|
+
t.endAsNumber = i, t.$emit("input:end"), t.$emit("input");
|
|
56
|
+
} else {
|
|
57
|
+
let t = e;
|
|
58
|
+
t.valueAsNumber = i;
|
|
59
|
+
}
|
|
60
|
+
await n();
|
|
61
|
+
},
|
|
62
|
+
eval: async (e, t, n, r) => {
|
|
63
|
+
let i = await t(e, n);
|
|
64
|
+
await r?.(i);
|
|
65
|
+
},
|
|
66
|
+
waitForUpdate: async () => {
|
|
67
|
+
await n();
|
|
68
|
+
},
|
|
69
|
+
expectEq: (t, n, r) => {
|
|
70
|
+
switch (t.type) {
|
|
71
|
+
case "eval":
|
|
72
|
+
try {
|
|
73
|
+
e(t.fn(t.el, t.arg)).toEqual(n);
|
|
74
|
+
} catch (e) {
|
|
75
|
+
throw e instanceof Error && (e.message = `${r}\n\nOriginal error: ${e.message}`), e;
|
|
76
|
+
}
|
|
77
|
+
break;
|
|
78
|
+
case "count":
|
|
79
|
+
e(t.el.length).toEqual(n);
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
wrapAction: (e) => async function t(...n) {
|
|
84
|
+
try {
|
|
85
|
+
return await e(...n);
|
|
86
|
+
} catch (e) {
|
|
87
|
+
throw e instanceof Error && Error.captureStackTrace(e, t), e;
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
wrapExpect: (e) => function t(...n) {
|
|
91
|
+
try {
|
|
92
|
+
return e(...n);
|
|
93
|
+
} catch (e) {
|
|
94
|
+
throw e instanceof Error && Error.captureStackTrace(e, t), e;
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
wrapSelector: (e) => function t(...n) {
|
|
98
|
+
try {
|
|
99
|
+
return e(...n);
|
|
100
|
+
} catch (e) {
|
|
101
|
+
throw e instanceof Error && Error.captureStackTrace(e, t), e;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}, i = (t, n) => new e({
|
|
106
|
+
rootLocator: n,
|
|
107
|
+
driver: r(t)
|
|
108
|
+
});
|
|
109
|
+
//#endregion
|
|
110
|
+
export { i as vividDOM };
|
package/dist/jsdom-polyfill.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./dom.cjs`);let e=require(`@vonage/vivid`);function t(){HTMLDialogElement.prototype.showModal=function(){this.open=!0,this.setAttribute(`open`,``)},HTMLDialogElement.prototype.close=function(){this.open=!1,this.removeAttribute(`open`)},HTMLElement.prototype.hidePopover=function(){},HTMLElement.prototype.showPopover=function(){},HTMLElement.prototype.scrollIntoView=function(){},Object.defineProperty(Object.getPrototypeOf(e.VwcButtonElement).prototype,`handleUnsupportedDelegatesFocus`,{set(){},get(){return()=>void 0}}),window.ResizeObserver=class{constructor(){}observe(){}disconnect(){}}}t(),window.HTMLElement.prototype.scrollIntoView=function(){},window.HTMLElement.prototype.scrollTo=function(){},exports.setDialogPolyfill=t;
|
package/dist/jsdom-polyfill.js
CHANGED
|
@@ -1,37 +1,21 @@
|
|
|
1
1
|
import { VwcButtonElement as e } from "@vonage/vivid";
|
|
2
|
+
//#region src/jsdom-polyfill.ts
|
|
2
3
|
function t() {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return () => {
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
), window.ResizeObserver = class {
|
|
22
|
-
constructor() {
|
|
23
|
-
}
|
|
24
|
-
observe() {
|
|
25
|
-
}
|
|
26
|
-
disconnect() {
|
|
27
|
-
}
|
|
28
|
-
};
|
|
4
|
+
HTMLDialogElement.prototype.showModal = function() {
|
|
5
|
+
this.open = !0, this.setAttribute("open", "");
|
|
6
|
+
}, HTMLDialogElement.prototype.close = function() {
|
|
7
|
+
this.open = !1, this.removeAttribute("open");
|
|
8
|
+
}, HTMLElement.prototype.hidePopover = function() {}, HTMLElement.prototype.showPopover = function() {}, HTMLElement.prototype.scrollIntoView = function() {}, Object.defineProperty(Object.getPrototypeOf(e).prototype, "handleUnsupportedDelegatesFocus", {
|
|
9
|
+
set() {},
|
|
10
|
+
get() {
|
|
11
|
+
return () => void 0;
|
|
12
|
+
}
|
|
13
|
+
}), window.ResizeObserver = class {
|
|
14
|
+
constructor() {}
|
|
15
|
+
observe() {}
|
|
16
|
+
disconnect() {}
|
|
17
|
+
};
|
|
29
18
|
}
|
|
30
|
-
t();
|
|
31
|
-
|
|
32
|
-
};
|
|
33
|
-
window.HTMLElement.prototype.scrollTo = function() {
|
|
34
|
-
};
|
|
35
|
-
export {
|
|
36
|
-
t as setDialogPolyfill
|
|
37
|
-
};
|
|
19
|
+
t(), window.HTMLElement.prototype.scrollIntoView = function() {}, window.HTMLElement.prototype.scrollTo = function() {};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { t as setDialogPolyfill };
|
package/dist/playwright.cjs
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Original error: ${t.message}`),t}break;case"count":await c(r.el).toHaveCount(e);break}},wrapAction:r=>async function e(...a){try{return await r(...a)}catch(t){throw t instanceof Error&&Error.captureStackTrace(t,e),t}},wrapExpect:r=>async function e(...a){try{return await r(...a)}catch(t){throw t instanceof Error&&Error.captureStackTrace(t,e),t}},wrapSelector:r=>r}),p=(c,r)=>{const e={rootLocator:c,driver:w(r)};return new u.VividWrapper(e)};exports.vividPlaywright=p;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./components.generated-DNNSCeHI.cjs`);var t=e=>({querySelector:(e,t)=>e.locator(t),enterShadow:e=>e,querySelectorAll:(e,t)=>e.locator(t),nth:(e,t)=>e.nth(t),userClick:e=>e.click(),userFill:(e,t)=>e.fill(t),userClear:e=>e.clear(),userFocus:e=>e.focus(),userBlur:e=>e.blur(),userHover:e=>e.hover(),userDragSlider:async(e,t,n,r)=>{let i=await n.getAttribute(`id`);await e.evaluate((e,[t,n])=>{if(t===`start-thumb`){let t=e;t.startAsNumber=n,t.$emit(`input:start`),t.$emit(`input`)}else if(t===`end-thumb`){let t=e;t.endAsNumber=n,t.$emit(`input:end`),t.$emit(`input`)}else{let t=e;t.valueAsNumber=n}},[i,r])},eval:async(e,t,n,r)=>{let i=await e.evaluate(t,n);await r?.(i)},waitForUpdate:async e=>{await e.evaluate(()=>new Promise(e=>{requestAnimationFrame(()=>e())}))},expectEq:async(t,n,r)=>{switch(t.type){case`eval`:try{await e(async()=>e(await t.el.evaluate(t.fn,t.arg)).toEqual(n)).toPass()}catch(e){throw e instanceof Error&&(e.message=`${r}\n\nOriginal error: ${e.message}`),e}break;case`count`:await e(t.el).toHaveCount(n);break}},wrapAction:e=>async function t(...n){try{return await e(...n)}catch(e){throw e instanceof Error&&Error.captureStackTrace(e,t),e}},wrapExpect:e=>async function t(...n){try{return await e(...n)}catch(e){throw e instanceof Error&&Error.captureStackTrace(e,t),e}},wrapSelector:e=>e}),n=(n,r)=>new e.t({rootLocator:n,driver:t(r)});exports.vividPlaywright=n;
|