@atomic-testing/vue-3 0.79.0 → 0.81.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/index.cjs +5 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +5 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/VueInteractor.ts +15 -9
package/dist/index.cjs
CHANGED
|
@@ -52,6 +52,10 @@ var VueInteractor = class VueInteractor extends _atomic_testing_dom_core.DOMInte
|
|
|
52
52
|
await super.focus(locator, option);
|
|
53
53
|
await this.flush();
|
|
54
54
|
}
|
|
55
|
+
async blur(locator, option) {
|
|
56
|
+
await super.blur(locator, option);
|
|
57
|
+
await this.flush();
|
|
58
|
+
}
|
|
55
59
|
async selectOptionValue(locator, values) {
|
|
56
60
|
await super.selectOptionValue(locator, values);
|
|
57
61
|
await this.flush();
|
|
@@ -70,7 +74,7 @@ var VueInteractor = class VueInteractor extends _atomic_testing_dom_core.DOMInte
|
|
|
70
74
|
return result;
|
|
71
75
|
}
|
|
72
76
|
clone() {
|
|
73
|
-
return new VueInteractor();
|
|
77
|
+
return new VueInteractor(this.rootEl);
|
|
74
78
|
}
|
|
75
79
|
};
|
|
76
80
|
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["DOMInteractor","defaultWaitForOption","componentOptions: any","unmount: () => void","app: App","TestEngine"],"sources":["../src/VueInteractor.ts","../src/createTestEngine.ts"],"sourcesContent":["import {\n ClickOption,\n defaultWaitForOption,\n EnterTextOption,\n FocusOption,\n HoverOption,\n Interactor,\n MouseDownOption,\n MouseEnterOption,\n MouseLeaveOption,\n MouseMoveOption,\n MouseOutOption,\n MouseUpOption,\n PartLocator,\n WaitForOption,\n WaitUntilOption,\n} from '@atomic-testing/core';\nimport { DOMInteractor } from '@atomic-testing/dom-core';\nimport { nextTick } from 'vue';\n\nexport class VueInteractor extends DOMInteractor {\n private async flush() {\n await nextTick();\n }\n\n override async enterText(locator: PartLocator, text: string, option?: Partial<EnterTextOption>): Promise<void> {\n await super.enterText(locator, text, option);\n await this.flush();\n }\n\n override async click(locator: PartLocator, option?: Partial<ClickOption>): Promise<void> {\n await super.click(locator, option);\n await this.flush();\n }\n\n override async hover(locator: PartLocator, option?: Partial<HoverOption>): Promise<void> {\n await super.hover(locator, option);\n await this.flush();\n }\n\n async mouseMove(locator: PartLocator, option?: Partial<MouseMoveOption>): Promise<void> {\n await super.mouseMove(locator, option);\n await this.flush();\n }\n\n async mouseDown(locator: PartLocator, option?: Partial<MouseDownOption>): Promise<void> {\n await super.mouseDown(locator, option);\n await this.flush();\n }\n\n async mouseUp(locator: PartLocator, option?: Partial<MouseUpOption>): Promise<void> {\n await super.mouseUp(locator, option);\n await this.flush();\n }\n\n async mouseOver(locator: PartLocator, option?: Partial<HoverOption>): Promise<void> {\n await super.mouseOver(locator, option);\n await this.flush();\n }\n\n async mouseOut(locator: PartLocator, option?: Partial<MouseOutOption>): Promise<void> {\n await super.mouseOut(locator, option);\n await this.flush();\n }\n\n async mouseEnter(locator: PartLocator, option?: Partial<MouseEnterOption>): Promise<void> {\n await super.mouseEnter(locator, option);\n await this.flush();\n }\n\n async mouseLeave(locator: PartLocator, option?: Partial<MouseLeaveOption>): Promise<void> {\n await super.mouseLeave(locator, option);\n await this.flush();\n }\n\n async focus(locator: PartLocator, option?: Partial<FocusOption>): Promise<void> {\n await super.focus(locator, option);\n await this.flush();\n }\n\n override async selectOptionValue(locator: PartLocator, values: string[]): Promise<void> {\n await super.selectOptionValue(locator, values);\n await this.flush();\n }\n\n override async wait(ms: number): Promise<void> {\n await super.wait(ms);\n await this.flush();\n }\n\n override async waitUntilComponentState(\n locator: PartLocator,\n option: Partial<Readonly<WaitForOption>> = defaultWaitForOption\n ): Promise<void> {\n await super.waitUntilComponentState(locator, option);\n await this.flush();\n }\n\n override async waitUntil<T>(option: WaitUntilOption<T>): Promise<T> {\n const result = await super.waitUntil(option);\n await this.flush();\n return result;\n }\n\n override clone(): Interactor {\n return new VueInteractor();\n }\n}\n","import { byAttribute, ScenePart, TestEngine } from '@atomic-testing/core';\nimport { render } from '@testing-library/vue';\nimport { App, Component, createApp, defineComponent } from 'vue';\n\nimport { VueInteractor } from './VueInteractor';\nimport { IVueTestEngineOption, VueSFCLikeComponent } from './types';\n\nlet _rootId = 0;\nfunction getNextRootElementId() {\n return `${_rootId++}`;\n}\n\nconst rootElementAttributeName = 'data-atomic-testing-vue';\n\nfunction isSFCLikeObject(component: any): component is VueSFCLikeComponent {\n return (\n component && typeof component === 'object' && 'template' in component && typeof component.template === 'string'\n );\n}\n\nfunction createComponentFromSFCLike(sfcObj: VueSFCLikeComponent): Component {\n const componentOptions: any = {\n name: sfcObj.name || 'SFCComponent',\n template: sfcObj.template,\n };\n\n if (sfcObj.props) {\n componentOptions.props = sfcObj.props;\n }\n\n if (sfcObj.setup) {\n componentOptions.setup = sfcObj.setup;\n }\n\n if (sfcObj.data) {\n componentOptions.data = sfcObj.data;\n }\n\n if (sfcObj.methods) {\n componentOptions.methods = sfcObj.methods;\n }\n\n if (sfcObj.computed) {\n componentOptions.computed = sfcObj.computed;\n }\n\n return defineComponent(componentOptions);\n}\n\nexport function createTestEngine<T extends ScenePart>(\n component: Component | VueSFCLikeComponent,\n partDefinitions: T,\n option?: Readonly<Partial<IVueTestEngineOption>>\n): TestEngine<T> {\n const rootEl = option?.rootElement ?? document.body;\n const container = rootEl.appendChild(document.createElement('div'));\n const rootId = getNextRootElementId();\n container.setAttribute(rootElementAttributeName, rootId);\n\n let unmount: () => void;\n let app: App;\n\n // Create component from SFC-like object if needed\n const compiledComponent = isSFCLikeObject(component)\n ? createComponentFromSFCLike(component)\n : (component as Component);\n\n try {\n const renderResult = render(compiledComponent, { container });\n unmount = renderResult.unmount;\n } catch (_error) {\n // Fallback to manual Vue app creation if render fails\n app = createApp(compiledComponent);\n app.mount(container);\n unmount = () => {\n if (app) {\n app.unmount();\n }\n };\n }\n\n const cleanup = () => {\n unmount();\n rootEl.removeChild(container);\n return Promise.resolve();\n };\n\n return new TestEngine(\n byAttribute(rootElementAttributeName, rootId),\n new VueInteractor(),\n {\n parts: partDefinitions,\n },\n cleanup\n );\n}\n\nexport function createRenderedTestEngine<T extends ScenePart>(\n rootElement: HTMLElement,\n partDefinitions: T,\n _option?: Readonly<Partial<IVueTestEngineOption>>\n): TestEngine<T> {\n const rootId = getNextRootElementId();\n rootElement.setAttribute(rootElementAttributeName, rootId);\n\n const cleanup = () => {\n rootElement.removeAttribute(rootElementAttributeName);\n return Promise.resolve();\n };\n\n return new TestEngine(\n byAttribute(rootElementAttributeName, rootId),\n new VueInteractor(),\n {\n parts: partDefinitions,\n },\n cleanup\n );\n}\n"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["DOMInteractor","defaultWaitForOption","componentOptions: any","unmount: () => void","app: App","TestEngine"],"sources":["../src/VueInteractor.ts","../src/createTestEngine.ts"],"sourcesContent":["import {\n BlurOption,\n ClickOption,\n defaultWaitForOption,\n EnterTextOption,\n FocusOption,\n HoverOption,\n Interactor,\n MouseDownOption,\n MouseEnterOption,\n MouseLeaveOption,\n MouseMoveOption,\n MouseOutOption,\n MouseUpOption,\n PartLocator,\n WaitForOption,\n WaitUntilOption,\n} from '@atomic-testing/core';\nimport { DOMInteractor } from '@atomic-testing/dom-core';\nimport { nextTick } from 'vue';\n\nexport class VueInteractor extends DOMInteractor {\n private async flush() {\n await nextTick();\n }\n\n override async enterText(locator: PartLocator, text: string, option?: Partial<EnterTextOption>): Promise<void> {\n await super.enterText(locator, text, option);\n await this.flush();\n }\n\n override async click(locator: PartLocator, option?: Partial<ClickOption>): Promise<void> {\n await super.click(locator, option);\n await this.flush();\n }\n\n override async hover(locator: PartLocator, option?: Partial<HoverOption>): Promise<void> {\n await super.hover(locator, option);\n await this.flush();\n }\n\n override async mouseMove(locator: PartLocator, option?: Partial<MouseMoveOption>): Promise<void> {\n await super.mouseMove(locator, option);\n await this.flush();\n }\n\n override async mouseDown(locator: PartLocator, option?: Partial<MouseDownOption>): Promise<void> {\n await super.mouseDown(locator, option);\n await this.flush();\n }\n\n override async mouseUp(locator: PartLocator, option?: Partial<MouseUpOption>): Promise<void> {\n await super.mouseUp(locator, option);\n await this.flush();\n }\n\n override async mouseOver(locator: PartLocator, option?: Partial<HoverOption>): Promise<void> {\n await super.mouseOver(locator, option);\n await this.flush();\n }\n\n override async mouseOut(locator: PartLocator, option?: Partial<MouseOutOption>): Promise<void> {\n await super.mouseOut(locator, option);\n await this.flush();\n }\n\n override async mouseEnter(locator: PartLocator, option?: Partial<MouseEnterOption>): Promise<void> {\n await super.mouseEnter(locator, option);\n await this.flush();\n }\n\n override async mouseLeave(locator: PartLocator, option?: Partial<MouseLeaveOption>): Promise<void> {\n await super.mouseLeave(locator, option);\n await this.flush();\n }\n\n override async focus(locator: PartLocator, option?: Partial<FocusOption>): Promise<void> {\n await super.focus(locator, option);\n await this.flush();\n }\n\n override async blur(locator: PartLocator, option?: Partial<BlurOption>): Promise<void> {\n await super.blur(locator, option);\n await this.flush();\n }\n\n override async selectOptionValue(locator: PartLocator, values: string[]): Promise<void> {\n await super.selectOptionValue(locator, values);\n await this.flush();\n }\n\n override async wait(ms: number): Promise<void> {\n await super.wait(ms);\n await this.flush();\n }\n\n override async waitUntilComponentState(\n locator: PartLocator,\n option: Partial<Readonly<WaitForOption>> = defaultWaitForOption\n ): Promise<void> {\n await super.waitUntilComponentState(locator, option);\n await this.flush();\n }\n\n override async waitUntil<T>(option: WaitUntilOption<T>): Promise<T> {\n const result = await super.waitUntil(option);\n await this.flush();\n return result;\n }\n\n override clone(): Interactor {\n return new VueInteractor(this.rootEl);\n }\n}\n","import { byAttribute, ScenePart, TestEngine } from '@atomic-testing/core';\nimport { render } from '@testing-library/vue';\nimport { App, Component, createApp, defineComponent } from 'vue';\n\nimport { VueInteractor } from './VueInteractor';\nimport { IVueTestEngineOption, VueSFCLikeComponent } from './types';\n\nlet _rootId = 0;\nfunction getNextRootElementId() {\n return `${_rootId++}`;\n}\n\nconst rootElementAttributeName = 'data-atomic-testing-vue';\n\nfunction isSFCLikeObject(component: any): component is VueSFCLikeComponent {\n return (\n component && typeof component === 'object' && 'template' in component && typeof component.template === 'string'\n );\n}\n\nfunction createComponentFromSFCLike(sfcObj: VueSFCLikeComponent): Component {\n const componentOptions: any = {\n name: sfcObj.name || 'SFCComponent',\n template: sfcObj.template,\n };\n\n if (sfcObj.props) {\n componentOptions.props = sfcObj.props;\n }\n\n if (sfcObj.setup) {\n componentOptions.setup = sfcObj.setup;\n }\n\n if (sfcObj.data) {\n componentOptions.data = sfcObj.data;\n }\n\n if (sfcObj.methods) {\n componentOptions.methods = sfcObj.methods;\n }\n\n if (sfcObj.computed) {\n componentOptions.computed = sfcObj.computed;\n }\n\n return defineComponent(componentOptions);\n}\n\nexport function createTestEngine<T extends ScenePart>(\n component: Component | VueSFCLikeComponent,\n partDefinitions: T,\n option?: Readonly<Partial<IVueTestEngineOption>>\n): TestEngine<T> {\n const rootEl = option?.rootElement ?? document.body;\n const container = rootEl.appendChild(document.createElement('div'));\n const rootId = getNextRootElementId();\n container.setAttribute(rootElementAttributeName, rootId);\n\n let unmount: () => void;\n let app: App;\n\n // Create component from SFC-like object if needed\n const compiledComponent = isSFCLikeObject(component)\n ? createComponentFromSFCLike(component)\n : (component as Component);\n\n try {\n const renderResult = render(compiledComponent, { container });\n unmount = renderResult.unmount;\n } catch (_error) {\n // Fallback to manual Vue app creation if render fails\n app = createApp(compiledComponent);\n app.mount(container);\n unmount = () => {\n if (app) {\n app.unmount();\n }\n };\n }\n\n const cleanup = () => {\n unmount();\n rootEl.removeChild(container);\n return Promise.resolve();\n };\n\n return new TestEngine(\n byAttribute(rootElementAttributeName, rootId),\n new VueInteractor(),\n {\n parts: partDefinitions,\n },\n cleanup\n );\n}\n\nexport function createRenderedTestEngine<T extends ScenePart>(\n rootElement: HTMLElement,\n partDefinitions: T,\n _option?: Readonly<Partial<IVueTestEngineOption>>\n): TestEngine<T> {\n const rootId = getNextRootElementId();\n rootElement.setAttribute(rootElementAttributeName, rootId);\n\n const cleanup = () => {\n rootElement.removeAttribute(rootElementAttributeName);\n return Promise.resolve();\n };\n\n return new TestEngine(\n byAttribute(rootElementAttributeName, rootId),\n new VueInteractor(),\n {\n parts: partDefinitions,\n },\n cleanup\n );\n}\n"],"mappings":"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"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClickOption, EnterTextOption, FocusOption, HoverOption, IComponentDriverOption, Interactor, MouseDownOption, MouseEnterOption, MouseLeaveOption, MouseMoveOption, MouseOutOption, MouseUpOption, PartLocator, ScenePart, TestEngine, WaitForOption, WaitUntilOption } from "@atomic-testing/core";
|
|
1
|
+
import { BlurOption, ClickOption, EnterTextOption, FocusOption, HoverOption, IComponentDriverOption, Interactor, MouseDownOption, MouseEnterOption, MouseLeaveOption, MouseMoveOption, MouseOutOption, MouseUpOption, PartLocator, ScenePart, TestEngine, WaitForOption, WaitUntilOption } from "@atomic-testing/core";
|
|
2
2
|
import { Component } from "vue";
|
|
3
3
|
import { DOMInteractor } from "@atomic-testing/dom-core";
|
|
4
4
|
|
|
@@ -34,6 +34,7 @@ declare class VueInteractor extends DOMInteractor {
|
|
|
34
34
|
mouseEnter(locator: PartLocator, option?: Partial<MouseEnterOption>): Promise<void>;
|
|
35
35
|
mouseLeave(locator: PartLocator, option?: Partial<MouseLeaveOption>): Promise<void>;
|
|
36
36
|
focus(locator: PartLocator, option?: Partial<FocusOption>): Promise<void>;
|
|
37
|
+
blur(locator: PartLocator, option?: Partial<BlurOption>): Promise<void>;
|
|
37
38
|
selectOptionValue(locator: PartLocator, values: string[]): Promise<void>;
|
|
38
39
|
wait(ms: number): Promise<void>;
|
|
39
40
|
waitUntilComponentState(locator: PartLocator, option?: Partial<Readonly<WaitForOption>>): Promise<void>;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClickOption, EnterTextOption, FocusOption, HoverOption, IComponentDriverOption, Interactor, MouseDownOption, MouseEnterOption, MouseLeaveOption, MouseMoveOption, MouseOutOption, MouseUpOption, PartLocator, ScenePart, TestEngine, WaitForOption, WaitUntilOption } from "@atomic-testing/core";
|
|
1
|
+
import { BlurOption, ClickOption, EnterTextOption, FocusOption, HoverOption, IComponentDriverOption, Interactor, MouseDownOption, MouseEnterOption, MouseLeaveOption, MouseMoveOption, MouseOutOption, MouseUpOption, PartLocator, ScenePart, TestEngine, WaitForOption, WaitUntilOption } from "@atomic-testing/core";
|
|
2
2
|
import { Component } from "vue";
|
|
3
3
|
import { DOMInteractor } from "@atomic-testing/dom-core";
|
|
4
4
|
|
|
@@ -34,6 +34,7 @@ declare class VueInteractor extends DOMInteractor {
|
|
|
34
34
|
mouseEnter(locator: PartLocator, option?: Partial<MouseEnterOption>): Promise<void>;
|
|
35
35
|
mouseLeave(locator: PartLocator, option?: Partial<MouseLeaveOption>): Promise<void>;
|
|
36
36
|
focus(locator: PartLocator, option?: Partial<FocusOption>): Promise<void>;
|
|
37
|
+
blur(locator: PartLocator, option?: Partial<BlurOption>): Promise<void>;
|
|
37
38
|
selectOptionValue(locator: PartLocator, values: string[]): Promise<void>;
|
|
38
39
|
wait(ms: number): Promise<void>;
|
|
39
40
|
waitUntilComponentState(locator: PartLocator, option?: Partial<Readonly<WaitForOption>>): Promise<void>;
|
package/dist/index.mjs
CHANGED
|
@@ -52,6 +52,10 @@ var VueInteractor = class VueInteractor extends DOMInteractor {
|
|
|
52
52
|
await super.focus(locator, option);
|
|
53
53
|
await this.flush();
|
|
54
54
|
}
|
|
55
|
+
async blur(locator, option) {
|
|
56
|
+
await super.blur(locator, option);
|
|
57
|
+
await this.flush();
|
|
58
|
+
}
|
|
55
59
|
async selectOptionValue(locator, values) {
|
|
56
60
|
await super.selectOptionValue(locator, values);
|
|
57
61
|
await this.flush();
|
|
@@ -70,7 +74,7 @@ var VueInteractor = class VueInteractor extends DOMInteractor {
|
|
|
70
74
|
return result;
|
|
71
75
|
}
|
|
72
76
|
clone() {
|
|
73
|
-
return new VueInteractor();
|
|
77
|
+
return new VueInteractor(this.rootEl);
|
|
74
78
|
}
|
|
75
79
|
};
|
|
76
80
|
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["componentOptions: any","unmount: () => void","app: App"],"sources":["../src/VueInteractor.ts","../src/createTestEngine.ts"],"sourcesContent":["import {\n ClickOption,\n defaultWaitForOption,\n EnterTextOption,\n FocusOption,\n HoverOption,\n Interactor,\n MouseDownOption,\n MouseEnterOption,\n MouseLeaveOption,\n MouseMoveOption,\n MouseOutOption,\n MouseUpOption,\n PartLocator,\n WaitForOption,\n WaitUntilOption,\n} from '@atomic-testing/core';\nimport { DOMInteractor } from '@atomic-testing/dom-core';\nimport { nextTick } from 'vue';\n\nexport class VueInteractor extends DOMInteractor {\n private async flush() {\n await nextTick();\n }\n\n override async enterText(locator: PartLocator, text: string, option?: Partial<EnterTextOption>): Promise<void> {\n await super.enterText(locator, text, option);\n await this.flush();\n }\n\n override async click(locator: PartLocator, option?: Partial<ClickOption>): Promise<void> {\n await super.click(locator, option);\n await this.flush();\n }\n\n override async hover(locator: PartLocator, option?: Partial<HoverOption>): Promise<void> {\n await super.hover(locator, option);\n await this.flush();\n }\n\n async mouseMove(locator: PartLocator, option?: Partial<MouseMoveOption>): Promise<void> {\n await super.mouseMove(locator, option);\n await this.flush();\n }\n\n async mouseDown(locator: PartLocator, option?: Partial<MouseDownOption>): Promise<void> {\n await super.mouseDown(locator, option);\n await this.flush();\n }\n\n async mouseUp(locator: PartLocator, option?: Partial<MouseUpOption>): Promise<void> {\n await super.mouseUp(locator, option);\n await this.flush();\n }\n\n async mouseOver(locator: PartLocator, option?: Partial<HoverOption>): Promise<void> {\n await super.mouseOver(locator, option);\n await this.flush();\n }\n\n async mouseOut(locator: PartLocator, option?: Partial<MouseOutOption>): Promise<void> {\n await super.mouseOut(locator, option);\n await this.flush();\n }\n\n async mouseEnter(locator: PartLocator, option?: Partial<MouseEnterOption>): Promise<void> {\n await super.mouseEnter(locator, option);\n await this.flush();\n }\n\n async mouseLeave(locator: PartLocator, option?: Partial<MouseLeaveOption>): Promise<void> {\n await super.mouseLeave(locator, option);\n await this.flush();\n }\n\n async focus(locator: PartLocator, option?: Partial<FocusOption>): Promise<void> {\n await super.focus(locator, option);\n await this.flush();\n }\n\n override async selectOptionValue(locator: PartLocator, values: string[]): Promise<void> {\n await super.selectOptionValue(locator, values);\n await this.flush();\n }\n\n override async wait(ms: number): Promise<void> {\n await super.wait(ms);\n await this.flush();\n }\n\n override async waitUntilComponentState(\n locator: PartLocator,\n option: Partial<Readonly<WaitForOption>> = defaultWaitForOption\n ): Promise<void> {\n await super.waitUntilComponentState(locator, option);\n await this.flush();\n }\n\n override async waitUntil<T>(option: WaitUntilOption<T>): Promise<T> {\n const result = await super.waitUntil(option);\n await this.flush();\n return result;\n }\n\n override clone(): Interactor {\n return new VueInteractor();\n }\n}\n","import { byAttribute, ScenePart, TestEngine } from '@atomic-testing/core';\nimport { render } from '@testing-library/vue';\nimport { App, Component, createApp, defineComponent } from 'vue';\n\nimport { VueInteractor } from './VueInteractor';\nimport { IVueTestEngineOption, VueSFCLikeComponent } from './types';\n\nlet _rootId = 0;\nfunction getNextRootElementId() {\n return `${_rootId++}`;\n}\n\nconst rootElementAttributeName = 'data-atomic-testing-vue';\n\nfunction isSFCLikeObject(component: any): component is VueSFCLikeComponent {\n return (\n component && typeof component === 'object' && 'template' in component && typeof component.template === 'string'\n );\n}\n\nfunction createComponentFromSFCLike(sfcObj: VueSFCLikeComponent): Component {\n const componentOptions: any = {\n name: sfcObj.name || 'SFCComponent',\n template: sfcObj.template,\n };\n\n if (sfcObj.props) {\n componentOptions.props = sfcObj.props;\n }\n\n if (sfcObj.setup) {\n componentOptions.setup = sfcObj.setup;\n }\n\n if (sfcObj.data) {\n componentOptions.data = sfcObj.data;\n }\n\n if (sfcObj.methods) {\n componentOptions.methods = sfcObj.methods;\n }\n\n if (sfcObj.computed) {\n componentOptions.computed = sfcObj.computed;\n }\n\n return defineComponent(componentOptions);\n}\n\nexport function createTestEngine<T extends ScenePart>(\n component: Component | VueSFCLikeComponent,\n partDefinitions: T,\n option?: Readonly<Partial<IVueTestEngineOption>>\n): TestEngine<T> {\n const rootEl = option?.rootElement ?? document.body;\n const container = rootEl.appendChild(document.createElement('div'));\n const rootId = getNextRootElementId();\n container.setAttribute(rootElementAttributeName, rootId);\n\n let unmount: () => void;\n let app: App;\n\n // Create component from SFC-like object if needed\n const compiledComponent = isSFCLikeObject(component)\n ? createComponentFromSFCLike(component)\n : (component as Component);\n\n try {\n const renderResult = render(compiledComponent, { container });\n unmount = renderResult.unmount;\n } catch (_error) {\n // Fallback to manual Vue app creation if render fails\n app = createApp(compiledComponent);\n app.mount(container);\n unmount = () => {\n if (app) {\n app.unmount();\n }\n };\n }\n\n const cleanup = () => {\n unmount();\n rootEl.removeChild(container);\n return Promise.resolve();\n };\n\n return new TestEngine(\n byAttribute(rootElementAttributeName, rootId),\n new VueInteractor(),\n {\n parts: partDefinitions,\n },\n cleanup\n );\n}\n\nexport function createRenderedTestEngine<T extends ScenePart>(\n rootElement: HTMLElement,\n partDefinitions: T,\n _option?: Readonly<Partial<IVueTestEngineOption>>\n): TestEngine<T> {\n const rootId = getNextRootElementId();\n rootElement.setAttribute(rootElementAttributeName, rootId);\n\n const cleanup = () => {\n rootElement.removeAttribute(rootElementAttributeName);\n return Promise.resolve();\n };\n\n return new TestEngine(\n byAttribute(rootElementAttributeName, rootId),\n new VueInteractor(),\n {\n parts: partDefinitions,\n },\n cleanup\n );\n}\n"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["componentOptions: any","unmount: () => void","app: App"],"sources":["../src/VueInteractor.ts","../src/createTestEngine.ts"],"sourcesContent":["import {\n BlurOption,\n ClickOption,\n defaultWaitForOption,\n EnterTextOption,\n FocusOption,\n HoverOption,\n Interactor,\n MouseDownOption,\n MouseEnterOption,\n MouseLeaveOption,\n MouseMoveOption,\n MouseOutOption,\n MouseUpOption,\n PartLocator,\n WaitForOption,\n WaitUntilOption,\n} from '@atomic-testing/core';\nimport { DOMInteractor } from '@atomic-testing/dom-core';\nimport { nextTick } from 'vue';\n\nexport class VueInteractor extends DOMInteractor {\n private async flush() {\n await nextTick();\n }\n\n override async enterText(locator: PartLocator, text: string, option?: Partial<EnterTextOption>): Promise<void> {\n await super.enterText(locator, text, option);\n await this.flush();\n }\n\n override async click(locator: PartLocator, option?: Partial<ClickOption>): Promise<void> {\n await super.click(locator, option);\n await this.flush();\n }\n\n override async hover(locator: PartLocator, option?: Partial<HoverOption>): Promise<void> {\n await super.hover(locator, option);\n await this.flush();\n }\n\n override async mouseMove(locator: PartLocator, option?: Partial<MouseMoveOption>): Promise<void> {\n await super.mouseMove(locator, option);\n await this.flush();\n }\n\n override async mouseDown(locator: PartLocator, option?: Partial<MouseDownOption>): Promise<void> {\n await super.mouseDown(locator, option);\n await this.flush();\n }\n\n override async mouseUp(locator: PartLocator, option?: Partial<MouseUpOption>): Promise<void> {\n await super.mouseUp(locator, option);\n await this.flush();\n }\n\n override async mouseOver(locator: PartLocator, option?: Partial<HoverOption>): Promise<void> {\n await super.mouseOver(locator, option);\n await this.flush();\n }\n\n override async mouseOut(locator: PartLocator, option?: Partial<MouseOutOption>): Promise<void> {\n await super.mouseOut(locator, option);\n await this.flush();\n }\n\n override async mouseEnter(locator: PartLocator, option?: Partial<MouseEnterOption>): Promise<void> {\n await super.mouseEnter(locator, option);\n await this.flush();\n }\n\n override async mouseLeave(locator: PartLocator, option?: Partial<MouseLeaveOption>): Promise<void> {\n await super.mouseLeave(locator, option);\n await this.flush();\n }\n\n override async focus(locator: PartLocator, option?: Partial<FocusOption>): Promise<void> {\n await super.focus(locator, option);\n await this.flush();\n }\n\n override async blur(locator: PartLocator, option?: Partial<BlurOption>): Promise<void> {\n await super.blur(locator, option);\n await this.flush();\n }\n\n override async selectOptionValue(locator: PartLocator, values: string[]): Promise<void> {\n await super.selectOptionValue(locator, values);\n await this.flush();\n }\n\n override async wait(ms: number): Promise<void> {\n await super.wait(ms);\n await this.flush();\n }\n\n override async waitUntilComponentState(\n locator: PartLocator,\n option: Partial<Readonly<WaitForOption>> = defaultWaitForOption\n ): Promise<void> {\n await super.waitUntilComponentState(locator, option);\n await this.flush();\n }\n\n override async waitUntil<T>(option: WaitUntilOption<T>): Promise<T> {\n const result = await super.waitUntil(option);\n await this.flush();\n return result;\n }\n\n override clone(): Interactor {\n return new VueInteractor(this.rootEl);\n }\n}\n","import { byAttribute, ScenePart, TestEngine } from '@atomic-testing/core';\nimport { render } from '@testing-library/vue';\nimport { App, Component, createApp, defineComponent } from 'vue';\n\nimport { VueInteractor } from './VueInteractor';\nimport { IVueTestEngineOption, VueSFCLikeComponent } from './types';\n\nlet _rootId = 0;\nfunction getNextRootElementId() {\n return `${_rootId++}`;\n}\n\nconst rootElementAttributeName = 'data-atomic-testing-vue';\n\nfunction isSFCLikeObject(component: any): component is VueSFCLikeComponent {\n return (\n component && typeof component === 'object' && 'template' in component && typeof component.template === 'string'\n );\n}\n\nfunction createComponentFromSFCLike(sfcObj: VueSFCLikeComponent): Component {\n const componentOptions: any = {\n name: sfcObj.name || 'SFCComponent',\n template: sfcObj.template,\n };\n\n if (sfcObj.props) {\n componentOptions.props = sfcObj.props;\n }\n\n if (sfcObj.setup) {\n componentOptions.setup = sfcObj.setup;\n }\n\n if (sfcObj.data) {\n componentOptions.data = sfcObj.data;\n }\n\n if (sfcObj.methods) {\n componentOptions.methods = sfcObj.methods;\n }\n\n if (sfcObj.computed) {\n componentOptions.computed = sfcObj.computed;\n }\n\n return defineComponent(componentOptions);\n}\n\nexport function createTestEngine<T extends ScenePart>(\n component: Component | VueSFCLikeComponent,\n partDefinitions: T,\n option?: Readonly<Partial<IVueTestEngineOption>>\n): TestEngine<T> {\n const rootEl = option?.rootElement ?? document.body;\n const container = rootEl.appendChild(document.createElement('div'));\n const rootId = getNextRootElementId();\n container.setAttribute(rootElementAttributeName, rootId);\n\n let unmount: () => void;\n let app: App;\n\n // Create component from SFC-like object if needed\n const compiledComponent = isSFCLikeObject(component)\n ? createComponentFromSFCLike(component)\n : (component as Component);\n\n try {\n const renderResult = render(compiledComponent, { container });\n unmount = renderResult.unmount;\n } catch (_error) {\n // Fallback to manual Vue app creation if render fails\n app = createApp(compiledComponent);\n app.mount(container);\n unmount = () => {\n if (app) {\n app.unmount();\n }\n };\n }\n\n const cleanup = () => {\n unmount();\n rootEl.removeChild(container);\n return Promise.resolve();\n };\n\n return new TestEngine(\n byAttribute(rootElementAttributeName, rootId),\n new VueInteractor(),\n {\n parts: partDefinitions,\n },\n cleanup\n );\n}\n\nexport function createRenderedTestEngine<T extends ScenePart>(\n rootElement: HTMLElement,\n partDefinitions: T,\n _option?: Readonly<Partial<IVueTestEngineOption>>\n): TestEngine<T> {\n const rootId = getNextRootElementId();\n rootElement.setAttribute(rootElementAttributeName, rootId);\n\n const cleanup = () => {\n rootElement.removeAttribute(rootElementAttributeName);\n return Promise.resolve();\n };\n\n return new TestEngine(\n byAttribute(rootElementAttributeName, rootId),\n new VueInteractor(),\n {\n parts: partDefinitions,\n },\n cleanup\n );\n}\n"],"mappings":";;;;;;AAqBA,IAAa,gBAAb,MAAa,sBAAsB,cAAc;CAC/C,MAAc,QAAQ;AACpB,QAAM,UAAU;;CAGlB,MAAe,UAAU,SAAsB,MAAc,QAAkD;AAC7G,QAAM,MAAM,UAAU,SAAS,MAAM,OAAO;AAC5C,QAAM,KAAK,OAAO;;CAGpB,MAAe,MAAM,SAAsB,QAA8C;AACvF,QAAM,MAAM,MAAM,SAAS,OAAO;AAClC,QAAM,KAAK,OAAO;;CAGpB,MAAe,MAAM,SAAsB,QAA8C;AACvF,QAAM,MAAM,MAAM,SAAS,OAAO;AAClC,QAAM,KAAK,OAAO;;CAGpB,MAAe,UAAU,SAAsB,QAAkD;AAC/F,QAAM,MAAM,UAAU,SAAS,OAAO;AACtC,QAAM,KAAK,OAAO;;CAGpB,MAAe,UAAU,SAAsB,QAAkD;AAC/F,QAAM,MAAM,UAAU,SAAS,OAAO;AACtC,QAAM,KAAK,OAAO;;CAGpB,MAAe,QAAQ,SAAsB,QAAgD;AAC3F,QAAM,MAAM,QAAQ,SAAS,OAAO;AACpC,QAAM,KAAK,OAAO;;CAGpB,MAAe,UAAU,SAAsB,QAA8C;AAC3F,QAAM,MAAM,UAAU,SAAS,OAAO;AACtC,QAAM,KAAK,OAAO;;CAGpB,MAAe,SAAS,SAAsB,QAAiD;AAC7F,QAAM,MAAM,SAAS,SAAS,OAAO;AACrC,QAAM,KAAK,OAAO;;CAGpB,MAAe,WAAW,SAAsB,QAAmD;AACjG,QAAM,MAAM,WAAW,SAAS,OAAO;AACvC,QAAM,KAAK,OAAO;;CAGpB,MAAe,WAAW,SAAsB,QAAmD;AACjG,QAAM,MAAM,WAAW,SAAS,OAAO;AACvC,QAAM,KAAK,OAAO;;CAGpB,MAAe,MAAM,SAAsB,QAA8C;AACvF,QAAM,MAAM,MAAM,SAAS,OAAO;AAClC,QAAM,KAAK,OAAO;;CAGpB,MAAe,KAAK,SAAsB,QAA6C;AACrF,QAAM,MAAM,KAAK,SAAS,OAAO;AACjC,QAAM,KAAK,OAAO;;CAGpB,MAAe,kBAAkB,SAAsB,QAAiC;AACtF,QAAM,MAAM,kBAAkB,SAAS,OAAO;AAC9C,QAAM,KAAK,OAAO;;CAGpB,MAAe,KAAK,IAA2B;AAC7C,QAAM,MAAM,KAAK,GAAG;AACpB,QAAM,KAAK,OAAO;;CAGpB,MAAe,wBACb,SACA,SAA2C,sBAC5B;AACf,QAAM,MAAM,wBAAwB,SAAS,OAAO;AACpD,QAAM,KAAK,OAAO;;CAGpB,MAAe,UAAa,QAAwC;EAClE,MAAM,SAAS,MAAM,MAAM,UAAU,OAAO;AAC5C,QAAM,KAAK,OAAO;AAClB,SAAO;;CAGT,AAAS,QAAoB;AAC3B,SAAO,IAAI,cAAc,KAAK,OAAO;;;;;;ACxGzC,IAAI,UAAU;AACd,SAAS,uBAAuB;AAC9B,QAAO,GAAG;;AAGZ,MAAM,2BAA2B;AAEjC,SAAS,gBAAgB,WAAkD;AACzE,QACE,aAAa,OAAO,cAAc,YAAY,cAAc,aAAa,OAAO,UAAU,aAAa;;AAI3G,SAAS,2BAA2B,QAAwC;CAC1E,MAAMA,mBAAwB;EAC5B,MAAM,OAAO,QAAQ;EACrB,UAAU,OAAO;EAClB;AAED,KAAI,OAAO,MACT,kBAAiB,QAAQ,OAAO;AAGlC,KAAI,OAAO,MACT,kBAAiB,QAAQ,OAAO;AAGlC,KAAI,OAAO,KACT,kBAAiB,OAAO,OAAO;AAGjC,KAAI,OAAO,QACT,kBAAiB,UAAU,OAAO;AAGpC,KAAI,OAAO,SACT,kBAAiB,WAAW,OAAO;AAGrC,QAAO,gBAAgB,iBAAiB;;AAG1C,SAAgB,iBACd,WACA,iBACA,QACe;CACf,MAAM,SAAS,QAAQ,eAAe,SAAS;CAC/C,MAAM,YAAY,OAAO,YAAY,SAAS,cAAc,MAAM,CAAC;CACnE,MAAM,SAAS,sBAAsB;AACrC,WAAU,aAAa,0BAA0B,OAAO;CAExD,IAAIC;CACJ,IAAIC;CAGJ,MAAM,oBAAoB,gBAAgB,UAAU,GAChD,2BAA2B,UAAU,GACpC;AAEL,KAAI;AAEF,YADqB,OAAO,mBAAmB,EAAE,WAAW,CAAC,CACtC;UAChB,QAAQ;AAEf,QAAM,UAAU,kBAAkB;AAClC,MAAI,MAAM,UAAU;AACpB,kBAAgB;AACd,OAAI,IACF,KAAI,SAAS;;;CAKnB,MAAM,gBAAgB;AACpB,WAAS;AACT,SAAO,YAAY,UAAU;AAC7B,SAAO,QAAQ,SAAS;;AAG1B,QAAO,IAAI,WACT,YAAY,0BAA0B,OAAO,EAC7C,IAAI,eAAe,EACnB,EACE,OAAO,iBACR,EACD,QACD;;AAGH,SAAgB,yBACd,aACA,iBACA,SACe;CACf,MAAM,SAAS,sBAAsB;AACrC,aAAY,aAAa,0BAA0B,OAAO;CAE1D,MAAM,gBAAgB;AACpB,cAAY,gBAAgB,yBAAyB;AACrD,SAAO,QAAQ,SAAS;;AAG1B,QAAO,IAAI,WACT,YAAY,0BAA0B,OAAO,EAC7C,IAAI,eAAe,EACnB,EACE,OAAO,iBACR,EACD,QACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atomic-testing/vue-3",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.81.0",
|
|
4
4
|
"description": "The @atomic-testing/vue-3 package is a Vue 3 test adapter that extends Atomic Testing's component driver pattern to Vue applications. It enables testing Vue components using the same high-level semantic APIs used across React, Playwright, and DOM environments.",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@testing-library/dom": "^10.4.0",
|
|
27
27
|
"@testing-library/vue": "^8.1.0",
|
|
28
28
|
"@vue/compiler-sfc": "^3.5.0",
|
|
29
|
-
"@atomic-testing/core": "0.
|
|
30
|
-
"@atomic-testing/dom-core": "0.
|
|
29
|
+
"@atomic-testing/core": "0.81.0",
|
|
30
|
+
"@atomic-testing/dom-core": "0.81.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"vue": "^3.5.0"
|
package/src/VueInteractor.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
BlurOption,
|
|
2
3
|
ClickOption,
|
|
3
4
|
defaultWaitForOption,
|
|
4
5
|
EnterTextOption,
|
|
@@ -38,46 +39,51 @@ export class VueInteractor extends DOMInteractor {
|
|
|
38
39
|
await this.flush();
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
async mouseMove(locator: PartLocator, option?: Partial<MouseMoveOption>): Promise<void> {
|
|
42
|
+
override async mouseMove(locator: PartLocator, option?: Partial<MouseMoveOption>): Promise<void> {
|
|
42
43
|
await super.mouseMove(locator, option);
|
|
43
44
|
await this.flush();
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
async mouseDown(locator: PartLocator, option?: Partial<MouseDownOption>): Promise<void> {
|
|
47
|
+
override async mouseDown(locator: PartLocator, option?: Partial<MouseDownOption>): Promise<void> {
|
|
47
48
|
await super.mouseDown(locator, option);
|
|
48
49
|
await this.flush();
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
async mouseUp(locator: PartLocator, option?: Partial<MouseUpOption>): Promise<void> {
|
|
52
|
+
override async mouseUp(locator: PartLocator, option?: Partial<MouseUpOption>): Promise<void> {
|
|
52
53
|
await super.mouseUp(locator, option);
|
|
53
54
|
await this.flush();
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
async mouseOver(locator: PartLocator, option?: Partial<HoverOption>): Promise<void> {
|
|
57
|
+
override async mouseOver(locator: PartLocator, option?: Partial<HoverOption>): Promise<void> {
|
|
57
58
|
await super.mouseOver(locator, option);
|
|
58
59
|
await this.flush();
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
async mouseOut(locator: PartLocator, option?: Partial<MouseOutOption>): Promise<void> {
|
|
62
|
+
override async mouseOut(locator: PartLocator, option?: Partial<MouseOutOption>): Promise<void> {
|
|
62
63
|
await super.mouseOut(locator, option);
|
|
63
64
|
await this.flush();
|
|
64
65
|
}
|
|
65
66
|
|
|
66
|
-
async mouseEnter(locator: PartLocator, option?: Partial<MouseEnterOption>): Promise<void> {
|
|
67
|
+
override async mouseEnter(locator: PartLocator, option?: Partial<MouseEnterOption>): Promise<void> {
|
|
67
68
|
await super.mouseEnter(locator, option);
|
|
68
69
|
await this.flush();
|
|
69
70
|
}
|
|
70
71
|
|
|
71
|
-
async mouseLeave(locator: PartLocator, option?: Partial<MouseLeaveOption>): Promise<void> {
|
|
72
|
+
override async mouseLeave(locator: PartLocator, option?: Partial<MouseLeaveOption>): Promise<void> {
|
|
72
73
|
await super.mouseLeave(locator, option);
|
|
73
74
|
await this.flush();
|
|
74
75
|
}
|
|
75
76
|
|
|
76
|
-
async focus(locator: PartLocator, option?: Partial<FocusOption>): Promise<void> {
|
|
77
|
+
override async focus(locator: PartLocator, option?: Partial<FocusOption>): Promise<void> {
|
|
77
78
|
await super.focus(locator, option);
|
|
78
79
|
await this.flush();
|
|
79
80
|
}
|
|
80
81
|
|
|
82
|
+
override async blur(locator: PartLocator, option?: Partial<BlurOption>): Promise<void> {
|
|
83
|
+
await super.blur(locator, option);
|
|
84
|
+
await this.flush();
|
|
85
|
+
}
|
|
86
|
+
|
|
81
87
|
override async selectOptionValue(locator: PartLocator, values: string[]): Promise<void> {
|
|
82
88
|
await super.selectOptionValue(locator, values);
|
|
83
89
|
await this.flush();
|
|
@@ -103,6 +109,6 @@ export class VueInteractor extends DOMInteractor {
|
|
|
103
109
|
}
|
|
104
110
|
|
|
105
111
|
override clone(): Interactor {
|
|
106
|
-
return new VueInteractor();
|
|
112
|
+
return new VueInteractor(this.rootEl);
|
|
107
113
|
}
|
|
108
114
|
}
|