cypress 10.3.0 → 10.3.1
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/exec/open.js +1 -2
- package/lib/exec/spawn.js +7 -2
- package/mount-utils/dist/index.js +8 -1
- package/mount-utils/package.json +1 -0
- package/package.json +13 -8
- package/react/dist/cypress-react.browser.js +16 -1
- package/react/dist/cypress-react.cjs.js +16 -1
- package/react/dist/cypress-react.esm-bundler.js +16 -1
- package/types/cypress.d.ts +1 -1
- package/vue/README.md +1 -0
- package/vue/dist/@vue/test-utils/baseWrapper.d.ts +61 -0
- package/vue/dist/@vue/test-utils/components/RouterLinkStub.d.ts +21 -0
- package/vue/dist/@vue/test-utils/config.d.ts +28 -0
- package/vue/dist/@vue/test-utils/constants/dom-events.d.ts +900 -0
- package/vue/dist/@vue/test-utils/createDomEvent.d.ts +9 -0
- package/vue/dist/@vue/test-utils/domWrapper.d.ts +18 -0
- package/vue/dist/@vue/test-utils/emit.d.ts +4 -0
- package/vue/dist/@vue/test-utils/errorWrapper.d.ts +1 -0
- package/vue/dist/@vue/test-utils/index.d.ts +10 -0
- package/vue/dist/@vue/test-utils/interfaces/wrapperLike.d.ts +56 -0
- package/vue/dist/@vue/test-utils/mount.d.ts +33 -0
- package/vue/dist/@vue/test-utils/stubs.d.ts +26 -0
- package/vue/dist/@vue/test-utils/types.d.ts +125 -0
- package/vue/dist/@vue/test-utils/utils/autoUnmount.d.ts +5 -0
- package/vue/dist/@vue/test-utils/utils/compileSlots.d.ts +2 -0
- package/vue/dist/@vue/test-utils/utils/componentName.d.ts +4 -0
- package/vue/dist/@vue/test-utils/utils/find.d.ts +10 -0
- package/vue/dist/@vue/test-utils/utils/flushPromises.d.ts +1 -0
- package/vue/dist/@vue/test-utils/utils/getRootNodes.d.ts +2 -0
- package/vue/dist/@vue/test-utils/utils/isElement.d.ts +1 -0
- package/vue/dist/@vue/test-utils/utils/isElementVisible.d.ts +6 -0
- package/vue/dist/@vue/test-utils/utils/matchName.d.ts +1 -0
- package/vue/dist/@vue/test-utils/utils/stringifyNode.d.ts +1 -0
- package/vue/dist/@vue/test-utils/utils/vueCompatSupport.d.ts +8 -0
- package/vue/dist/@vue/test-utils/utils/vueShared.d.ts +3 -0
- package/vue/dist/@vue/test-utils/utils.d.ts +13 -0
- package/vue/dist/@vue/test-utils/vueWrapper.d.ts +34 -0
- package/vue/dist/@vue/test-utils/wrapperFactory.d.ts +14 -0
- package/vue/dist/cypress-vue.cjs.js +223 -138
- package/vue/dist/cypress-vue.esm-bundler.js +223 -139
- package/vue/dist/index.d.ts +34 -3
- package/vue/package.json +10 -6
- package/vue2/dist/cypress-vue2.browser.js +16 -1
- package/vue2/dist/cypress-vue2.cjs.js +16 -1
- package/vue2/dist/cypress-vue2.esm-bundler.js +16 -1
- package/vue2/package.json +1 -1
package/lib/exec/open.js
CHANGED
@@ -86,8 +86,7 @@ module.exports = {
|
|
86
86
|
const args = processOpenOptions(options);
|
87
87
|
return spawn.start(args, {
|
88
88
|
dev: options.dev,
|
89
|
-
detached: Boolean(options.detached)
|
90
|
-
stdio: 'inherit'
|
89
|
+
detached: Boolean(options.detached)
|
91
90
|
});
|
92
91
|
} catch (err) {
|
93
92
|
if (err.details) {
|
package/lib/exec/spawn.js
CHANGED
@@ -43,8 +43,13 @@ const isDbusWarning = /Failed to connect to the bus:/; // Electron began logging
|
|
43
43
|
// ----- Certificate i=0 (OU=Cypress Proxy Server Certificate,O=Cypress Proxy CA,L=Internet,ST=Internet,C=Internet,CN=www.googletagmanager.com) -----
|
44
44
|
// ERROR: No matching issuer found
|
45
45
|
|
46
|
-
const isCertVerifyProcBuiltin = /(^\[.*ERROR:cert_verify_proc_builtin\.cc|^----- Certificate i=0 \(OU=Cypress Proxy|^ERROR: No matching issuer found$)/;
|
47
|
-
|
46
|
+
const isCertVerifyProcBuiltin = /(^\[.*ERROR:cert_verify_proc_builtin\.cc|^----- Certificate i=0 \(OU=Cypress Proxy|^ERROR: No matching issuer found$)/; // Electron logs a benign warning about WebSwapCGLLayer on MacOS v12 and Electron v18 due to a naming collision in shared libraries.
|
47
|
+
// Once this is fixed upstream this regex can be removed: https://github.com/electron/electron/issues/33685
|
48
|
+
// Sample:
|
49
|
+
// objc[60540]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x7ffa5a006318) and /{path/to/app}/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libGLESv2.dylib (0x10f8a89c8). One of the two will be used. Which one is undefined.
|
50
|
+
|
51
|
+
const isMacOSElectronWebSwapCGLLayerWarning = /^objc\[\d+\]: Class WebSwapCGLLayer is implemented in both.*Which one is undefined\./;
|
52
|
+
const GARBAGE_WARNINGS = [isXlibOrLibudevRe, isHighSierraWarningRe, isRenderWorkerRe, isDbusWarning, isCertVerifyProcBuiltin, isMacOSElectronWebSwapCGLLayerWarning];
|
48
53
|
|
49
54
|
const isGarbageLineWarning = str => {
|
50
55
|
return _.some(GARBAGE_WARNINGS, re => {
|
@@ -4,7 +4,7 @@ export const getContainerEl = () => {
|
|
4
4
|
if (el) {
|
5
5
|
return el;
|
6
6
|
}
|
7
|
-
throw Error(`No element found that matches selector ${ROOT_SELECTOR}. Please
|
7
|
+
throw Error(`No element found that matches selector ${ROOT_SELECTOR}. Please add a root element with data-cy-root attribute to your "component-index.html" file so that Cypress can attach your component to the DOM.`);
|
8
8
|
};
|
9
9
|
/**
|
10
10
|
* Remove any style or extra link elements from the iframe placeholder
|
@@ -120,6 +120,13 @@ export const injectStylesBeforeElement = (options, document, el) => {
|
|
120
120
|
return insertLocalCssFiles(cssFiles, document, el, options.log);
|
121
121
|
};
|
122
122
|
export function setupHooks(optionalCallback) {
|
123
|
+
// Consumed by the framework "mount" libs. A user might register their own mount in the scaffolded 'commands.js'
|
124
|
+
// file that is imported by e2e and component support files by default. We don't want CT side effects to run when e2e
|
125
|
+
// testing so we early return.
|
126
|
+
// System test to verify CT side effects do not pollute e2e: system-tests/test/e2e_with_mount_import_spec.ts
|
127
|
+
if (Cypress.testingType !== 'component') {
|
128
|
+
return;
|
129
|
+
}
|
123
130
|
// When running component specs, we cannot allow "cy.visit"
|
124
131
|
// because it will wipe out our preparation work, and does not make much sense
|
125
132
|
// thus we overwrite "cy.visit" to throw an error
|
package/mount-utils/package.json
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "cypress",
|
3
|
-
"version": "10.3.
|
3
|
+
"version": "10.3.1",
|
4
4
|
"main": "index.js",
|
5
5
|
"scripts": {
|
6
6
|
"postinstall": "node index.js --exec install",
|
@@ -72,15 +72,18 @@
|
|
72
72
|
"exports": {
|
73
73
|
".": {
|
74
74
|
"import": "./index.mjs",
|
75
|
-
"require": "./index.js"
|
75
|
+
"require": "./index.js",
|
76
|
+
"types": "./types/index.d.ts"
|
76
77
|
},
|
77
78
|
"./vue": {
|
78
79
|
"import": "./vue/dist/cypress-vue.esm-bundler.js",
|
79
|
-
"require": "./vue/dist/cypress-vue.cjs.js"
|
80
|
+
"require": "./vue/dist/cypress-vue.cjs.js",
|
81
|
+
"types": "./vue/dist/index.d.ts"
|
80
82
|
},
|
81
83
|
"./vue2": {
|
82
84
|
"import": "./vue2/dist/cypress-vue2.esm-bundler.js",
|
83
|
-
"require": "./vue2/dist/cypress-vue2.cjs.js"
|
85
|
+
"require": "./vue2/dist/cypress-vue2.cjs.js",
|
86
|
+
"types": "./vue2/dist/index.d.ts"
|
84
87
|
},
|
85
88
|
"./package.json": {
|
86
89
|
"import": "./package.json",
|
@@ -88,16 +91,18 @@
|
|
88
91
|
},
|
89
92
|
"./react": {
|
90
93
|
"import": "./react/dist/cypress-react.esm-bundler.js",
|
91
|
-
"require": "./react/dist/cypress-react.cjs.js"
|
94
|
+
"require": "./react/dist/cypress-react.cjs.js",
|
95
|
+
"types": "./react/dist/index.d.ts"
|
92
96
|
},
|
93
97
|
"./mount-utils": {
|
94
|
-
"require": "./mount-utils/dist/index.js"
|
98
|
+
"require": "./mount-utils/dist/index.js",
|
99
|
+
"types": "./mount-utils/dist/index.d.ts"
|
95
100
|
}
|
96
101
|
},
|
97
102
|
"buildInfo": {
|
98
103
|
"commitBranch": "develop",
|
99
|
-
"commitSha": "
|
100
|
-
"commitDate": "2022-
|
104
|
+
"commitSha": "0aebe4a47d49c94d519fc00af81967ed8da65483",
|
105
|
+
"commitDate": "2022-07-18T17:25:43.000Z",
|
101
106
|
"stable": true
|
102
107
|
},
|
103
108
|
"description": "Cypress.io end to end testing tool",
|
@@ -106,7 +106,7 @@ var CypressReact = (function (exports, React, ReactDOM) {
|
|
106
106
|
if (el) {
|
107
107
|
return el;
|
108
108
|
}
|
109
|
-
throw Error(`No element found that matches selector ${ROOT_SELECTOR}. Please
|
109
|
+
throw Error(`No element found that matches selector ${ROOT_SELECTOR}. Please add a root element with data-cy-root attribute to your "component-index.html" file so that Cypress can attach your component to the DOM.`);
|
110
110
|
};
|
111
111
|
/**
|
112
112
|
* Remove any style or extra link elements from the iframe placeholder
|
@@ -222,6 +222,13 @@ var CypressReact = (function (exports, React, ReactDOM) {
|
|
222
222
|
return insertLocalCssFiles(cssFiles, document, el, options.log);
|
223
223
|
};
|
224
224
|
function setupHooks(optionalCallback) {
|
225
|
+
// Consumed by the framework "mount" libs. A user might register their own mount in the scaffolded 'commands.js'
|
226
|
+
// file that is imported by e2e and component support files by default. We don't want CT side effects to run when e2e
|
227
|
+
// testing so we early return.
|
228
|
+
// System test to verify CT side effects do not pollute e2e: system-tests/test/e2e_with_mount_import_spec.ts
|
229
|
+
if (Cypress.testingType !== 'component') {
|
230
|
+
return;
|
231
|
+
}
|
225
232
|
// When running component specs, we cannot allow "cy.visit"
|
226
233
|
// because it will wipe out our preparation work, and does not make much sense
|
227
234
|
// thus we overwrite "cy.visit" to throw an error
|
@@ -419,6 +426,14 @@ var CypressReact = (function (exports, React, ReactDOM) {
|
|
419
426
|
return mount(element, __assign(__assign({}, defaultOptions), options));
|
420
427
|
};
|
421
428
|
};
|
429
|
+
// Side effects from "import { mount } from '@cypress/<my-framework>'" are annoying, we should avoid doing this
|
430
|
+
// by creating an explicit function/import that the user can register in their 'component.js' support file,
|
431
|
+
// such as:
|
432
|
+
// import 'cypress/<my-framework>/support'
|
433
|
+
// or
|
434
|
+
// import { registerCT } from 'cypress/<my-framework>'
|
435
|
+
// registerCT()
|
436
|
+
// Note: This would be a breaking change
|
422
437
|
// it is required to unmount component in beforeEach hook in order to provide a clean state inside test
|
423
438
|
// because `mount` can be called after some preparation that can side effect unmount
|
424
439
|
// @see npm/react/cypress/component/advanced/set-timeout-example/loading-indicator-spec.js
|
@@ -110,7 +110,7 @@ const getContainerEl = () => {
|
|
110
110
|
if (el) {
|
111
111
|
return el;
|
112
112
|
}
|
113
|
-
throw Error(`No element found that matches selector ${ROOT_SELECTOR}. Please
|
113
|
+
throw Error(`No element found that matches selector ${ROOT_SELECTOR}. Please add a root element with data-cy-root attribute to your "component-index.html" file so that Cypress can attach your component to the DOM.`);
|
114
114
|
};
|
115
115
|
/**
|
116
116
|
* Remove any style or extra link elements from the iframe placeholder
|
@@ -226,6 +226,13 @@ const injectStylesBeforeElement = (options, document, el) => {
|
|
226
226
|
return insertLocalCssFiles(cssFiles, document, el, options.log);
|
227
227
|
};
|
228
228
|
function setupHooks(optionalCallback) {
|
229
|
+
// Consumed by the framework "mount" libs. A user might register their own mount in the scaffolded 'commands.js'
|
230
|
+
// file that is imported by e2e and component support files by default. We don't want CT side effects to run when e2e
|
231
|
+
// testing so we early return.
|
232
|
+
// System test to verify CT side effects do not pollute e2e: system-tests/test/e2e_with_mount_import_spec.ts
|
233
|
+
if (Cypress.testingType !== 'component') {
|
234
|
+
return;
|
235
|
+
}
|
229
236
|
// When running component specs, we cannot allow "cy.visit"
|
230
237
|
// because it will wipe out our preparation work, and does not make much sense
|
231
238
|
// thus we overwrite "cy.visit" to throw an error
|
@@ -423,6 +430,14 @@ var createMount = function (defaultOptions) {
|
|
423
430
|
return mount(element, __assign(__assign({}, defaultOptions), options));
|
424
431
|
};
|
425
432
|
};
|
433
|
+
// Side effects from "import { mount } from '@cypress/<my-framework>'" are annoying, we should avoid doing this
|
434
|
+
// by creating an explicit function/import that the user can register in their 'component.js' support file,
|
435
|
+
// such as:
|
436
|
+
// import 'cypress/<my-framework>/support'
|
437
|
+
// or
|
438
|
+
// import { registerCT } from 'cypress/<my-framework>'
|
439
|
+
// registerCT()
|
440
|
+
// Note: This would be a breaking change
|
426
441
|
// it is required to unmount component in beforeEach hook in order to provide a clean state inside test
|
427
442
|
// because `mount` can be called after some preparation that can side effect unmount
|
428
443
|
// @see npm/react/cypress/component/advanced/set-timeout-example/loading-indicator-spec.js
|
@@ -85,7 +85,7 @@ const getContainerEl = () => {
|
|
85
85
|
if (el) {
|
86
86
|
return el;
|
87
87
|
}
|
88
|
-
throw Error(`No element found that matches selector ${ROOT_SELECTOR}. Please
|
88
|
+
throw Error(`No element found that matches selector ${ROOT_SELECTOR}. Please add a root element with data-cy-root attribute to your "component-index.html" file so that Cypress can attach your component to the DOM.`);
|
89
89
|
};
|
90
90
|
/**
|
91
91
|
* Remove any style or extra link elements from the iframe placeholder
|
@@ -201,6 +201,13 @@ const injectStylesBeforeElement = (options, document, el) => {
|
|
201
201
|
return insertLocalCssFiles(cssFiles, document, el, options.log);
|
202
202
|
};
|
203
203
|
function setupHooks(optionalCallback) {
|
204
|
+
// Consumed by the framework "mount" libs. A user might register their own mount in the scaffolded 'commands.js'
|
205
|
+
// file that is imported by e2e and component support files by default. We don't want CT side effects to run when e2e
|
206
|
+
// testing so we early return.
|
207
|
+
// System test to verify CT side effects do not pollute e2e: system-tests/test/e2e_with_mount_import_spec.ts
|
208
|
+
if (Cypress.testingType !== 'component') {
|
209
|
+
return;
|
210
|
+
}
|
204
211
|
// When running component specs, we cannot allow "cy.visit"
|
205
212
|
// because it will wipe out our preparation work, and does not make much sense
|
206
213
|
// thus we overwrite "cy.visit" to throw an error
|
@@ -398,6 +405,14 @@ var createMount = function (defaultOptions) {
|
|
398
405
|
return mount(element, __assign(__assign({}, defaultOptions), options));
|
399
406
|
};
|
400
407
|
};
|
408
|
+
// Side effects from "import { mount } from '@cypress/<my-framework>'" are annoying, we should avoid doing this
|
409
|
+
// by creating an explicit function/import that the user can register in their 'component.js' support file,
|
410
|
+
// such as:
|
411
|
+
// import 'cypress/<my-framework>/support'
|
412
|
+
// or
|
413
|
+
// import { registerCT } from 'cypress/<my-framework>'
|
414
|
+
// registerCT()
|
415
|
+
// Note: This would be a breaking change
|
401
416
|
// it is required to unmount component in beforeEach hook in order to provide a clean state inside test
|
402
417
|
// because `mount` can be called after some preparation that can side effect unmount
|
403
418
|
// @see npm/react/cypress/component/advanced/set-timeout-example/loading-indicator-spec.js
|
package/types/cypress.d.ts
CHANGED
@@ -2941,7 +2941,7 @@ declare namespace Cypress {
|
|
2941
2941
|
/**
|
2942
2942
|
* Hosts mappings to IP addresses.
|
2943
2943
|
*/
|
2944
|
-
hosts: null | string
|
2944
|
+
hosts: null | {[key: string]: string}
|
2945
2945
|
/**
|
2946
2946
|
* Whether Cypress was launched via 'cypress open' (interactive mode)
|
2947
2947
|
*/
|
package/vue/README.md
CHANGED
@@ -19,6 +19,7 @@ This package allows you to use the [Cypress](https://www.cypress.io/) test runne
|
|
19
19
|
It uses [Vue Test Utils](https://github.com/vuejs/vue-test-utils) under the hood. This is more of a replacement for node-based testing than it is replacing Vue Test Utils and its API. Instead of running your tests in node (using Jest or Mocha), the Cypress Component Testing Library runs each component in the **real browser** with full power of the Cypress Framework: [live GUI, full API, screen recording, CI support, cross-platform](https://www.cypress.io/features/). One benefit to using Cypress instead of a node-based runner is that limitations of Vue Test Utils in Node (e.g. manually awaiting Vue's internal event loop) are hidden from the user due to Cypress's retry-ability logic.
|
20
20
|
|
21
21
|
- If you like using `@testing-library/vue`, you can use `@testing-library/cypress` for the same `findBy`, `queryBy` commands, see one of the examples in the list below
|
22
|
+
- If you need to access the underlying Vue Test Utils API, you can do so by importing it: `import { VueTestUtils } from 'cypress/vue'`.
|
22
23
|
|
23
24
|
### How is this different from @cypress/vue2?
|
24
25
|
Cypress packages the current version of Vue under @cypress/vue, and older versions under separate package names. Use [@cypress/vue2](cypress-vue2-npm-url) if you're still using vue@2, and this package if you're on vue@3.
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import type { TriggerOptions } from './createDomEvent';
|
2
|
+
import { ComponentInternalInstance, ComponentPublicInstance, FunctionalComponent } from 'vue';
|
3
|
+
import { DomEventNameWithModifier } from './constants/dom-events';
|
4
|
+
import type { VueWrapper } from './vueWrapper';
|
5
|
+
import { DefinedComponent, FindAllComponentsSelector, FindComponentSelector, NameSelector, RefSelector, VueNode } from './types';
|
6
|
+
import WrapperLike from './interfaces/wrapperLike';
|
7
|
+
import type { DOMWrapper } from './domWrapper';
|
8
|
+
export default abstract class BaseWrapper<ElementType extends Node> implements WrapperLike {
|
9
|
+
protected readonly wrapperElement: VueNode<ElementType>;
|
10
|
+
protected abstract getRootNodes(): VueNode[];
|
11
|
+
get element(): VueNode<ElementType>;
|
12
|
+
constructor(element: ElementType);
|
13
|
+
protected findAllDOMElements(selector: string): Element[];
|
14
|
+
find<K extends keyof HTMLElementTagNameMap>(selector: K): DOMWrapper<HTMLElementTagNameMap[K]>;
|
15
|
+
find<K extends keyof SVGElementTagNameMap>(selector: K): DOMWrapper<SVGElementTagNameMap[K]>;
|
16
|
+
find<T extends Element = Element>(selector: string): DOMWrapper<T>;
|
17
|
+
find<T extends Node = Node>(selector: string | RefSelector): DOMWrapper<T>;
|
18
|
+
abstract findAll<K extends keyof HTMLElementTagNameMap>(selector: K): DOMWrapper<HTMLElementTagNameMap[K]>[];
|
19
|
+
abstract findAll<K extends keyof SVGElementTagNameMap>(selector: K): DOMWrapper<SVGElementTagNameMap[K]>[];
|
20
|
+
abstract findAll<T extends Element>(selector: string): DOMWrapper<T>[];
|
21
|
+
abstract findAll(selector: string): DOMWrapper<Element>[];
|
22
|
+
findComponent<T extends never>(selector: string): WrapperLike;
|
23
|
+
findComponent<T extends DefinedComponent>(selector: T | Exclude<FindComponentSelector, FunctionalComponent>): VueWrapper<InstanceType<T>>;
|
24
|
+
findComponent<T extends FunctionalComponent>(selector: T): DOMWrapper<Node>;
|
25
|
+
findComponent<T extends FunctionalComponent>(selector: string): DOMWrapper<Element>;
|
26
|
+
findComponent<T extends never>(selector: NameSelector | RefSelector): VueWrapper;
|
27
|
+
findComponent<T extends ComponentPublicInstance>(selector: T | FindComponentSelector): VueWrapper<T>;
|
28
|
+
findComponent<T extends never>(selector: FindComponentSelector): WrapperLike;
|
29
|
+
findAllComponents<T extends never>(selector: string): WrapperLike[];
|
30
|
+
findAllComponents<T extends DefinedComponent>(selector: T | Exclude<FindAllComponentsSelector, FunctionalComponent>): VueWrapper<InstanceType<T>>[];
|
31
|
+
findAllComponents<T extends FunctionalComponent>(selector: T): DOMWrapper<Node>[];
|
32
|
+
findAllComponents<T extends FunctionalComponent>(selector: string): DOMWrapper<Element>[];
|
33
|
+
findAllComponents<T extends never>(selector: NameSelector): VueWrapper[];
|
34
|
+
findAllComponents<T extends ComponentPublicInstance>(selector: T | FindAllComponentsSelector): VueWrapper<T>[];
|
35
|
+
findAllComponents<T extends never>(selector: FindAllComponentsSelector): WrapperLike[];
|
36
|
+
abstract setValue(value?: any): Promise<void>;
|
37
|
+
html(): string;
|
38
|
+
classes(): string[];
|
39
|
+
classes(className: string): boolean;
|
40
|
+
attributes(): {
|
41
|
+
[key: string]: string;
|
42
|
+
};
|
43
|
+
attributes(key: string): string | undefined;
|
44
|
+
text(): string;
|
45
|
+
exists(): boolean;
|
46
|
+
get<K extends keyof HTMLElementTagNameMap>(selector: K): Omit<DOMWrapper<HTMLElementTagNameMap[K]>, 'exists'>;
|
47
|
+
get<K extends keyof SVGElementTagNameMap>(selector: K): Omit<DOMWrapper<SVGElementTagNameMap[K]>, 'exists'>;
|
48
|
+
get<T extends Element = Element>(selector: string): Omit<DOMWrapper<T>, 'exists'>;
|
49
|
+
get<T extends Node = Node>(selector: string | RefSelector): Omit<DOMWrapper<T>, 'exists'>;
|
50
|
+
getComponent<T extends never>(selector: string): Omit<WrapperLike, 'exists'>;
|
51
|
+
getComponent<T extends DefinedComponent>(selector: T | Exclude<FindComponentSelector, FunctionalComponent>): Omit<VueWrapper<InstanceType<T>>, 'exists'>;
|
52
|
+
getComponent<T extends FunctionalComponent>(selector: T | string): Omit<DOMWrapper<Element>, 'exists'>;
|
53
|
+
getComponent<T extends never>(selector: NameSelector | RefSelector): Omit<VueWrapper, 'exists'>;
|
54
|
+
getComponent<T extends ComponentPublicInstance>(selector: T | FindComponentSelector): Omit<VueWrapper<T>, 'exists'>;
|
55
|
+
getComponent<T extends never>(selector: FindComponentSelector): Omit<WrapperLike, 'exists'>;
|
56
|
+
protected isDisabled: () => boolean;
|
57
|
+
isVisible(): boolean;
|
58
|
+
protected abstract getCurrentComponent(): ComponentInternalInstance | void;
|
59
|
+
trigger(eventString: DomEventNameWithModifier, options?: TriggerOptions): Promise<void>;
|
60
|
+
trigger(eventString: string, options?: TriggerOptions): Promise<void>;
|
61
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
export declare const RouterLinkStub: import("vue").DefineComponent<{
|
2
|
+
to: {
|
3
|
+
type: (StringConstructor | ObjectConstructor)[];
|
4
|
+
required: true;
|
5
|
+
};
|
6
|
+
custom: {
|
7
|
+
type: BooleanConstructor;
|
8
|
+
default: boolean;
|
9
|
+
};
|
10
|
+
}, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
11
|
+
to: {
|
12
|
+
type: (StringConstructor | ObjectConstructor)[];
|
13
|
+
required: true;
|
14
|
+
};
|
15
|
+
custom: {
|
16
|
+
type: BooleanConstructor;
|
17
|
+
default: boolean;
|
18
|
+
};
|
19
|
+
}>>, {
|
20
|
+
custom: boolean;
|
21
|
+
}>;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { GlobalMountOptions } from './types';
|
2
|
+
import { VueWrapper } from './vueWrapper';
|
3
|
+
import { DOMWrapper } from './domWrapper';
|
4
|
+
import { CustomCreateStub } from './stubs';
|
5
|
+
export interface GlobalConfigOptions {
|
6
|
+
global: Required<GlobalMountOptions>;
|
7
|
+
plugins: {
|
8
|
+
VueWrapper: Pluggable<VueWrapper>;
|
9
|
+
DOMWrapper: Pluggable<DOMWrapper<Node>>;
|
10
|
+
createStubs?: CustomCreateStub;
|
11
|
+
};
|
12
|
+
renderStubDefaultSlot: boolean;
|
13
|
+
}
|
14
|
+
interface Plugin<Instance, O> {
|
15
|
+
handler(instance: Instance): Record<string, any>;
|
16
|
+
handler(instance: Instance, options: O): Record<string, any>;
|
17
|
+
options: O;
|
18
|
+
}
|
19
|
+
declare class Pluggable<Instance = DOMWrapper<Node>> {
|
20
|
+
installedPlugins: Plugin<Instance, any>[];
|
21
|
+
install<O>(handler: (instance: Instance) => Record<string, any>): void;
|
22
|
+
install<O>(handler: (instance: Instance, options: O) => Record<string, any>, options: O): void;
|
23
|
+
extend(instance: Instance): void;
|
24
|
+
/** For testing */
|
25
|
+
reset(): void;
|
26
|
+
}
|
27
|
+
export declare const config: GlobalConfigOptions;
|
28
|
+
export {};
|