@quickpickle/vitest-browser 0.0.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.
- package/CHANGELOG.md +15 -0
- package/LICENSE +21 -0
- package/README.md +4 -0
- package/dist/VitestBrowserWorld.cjs +179 -0
- package/dist/VitestBrowserWorld.cjs.map +1 -0
- package/dist/VitestBrowserWorld.d.ts +103 -0
- package/dist/VitestBrowserWorld.mjs +176 -0
- package/dist/VitestBrowserWorld.mjs.map +1 -0
- package/dist/actions.steps.cjs +157 -0
- package/dist/actions.steps.cjs.map +1 -0
- package/dist/actions.steps.d.ts +1 -0
- package/dist/actions.steps.mjs +155 -0
- package/dist/actions.steps.mjs.map +1 -0
- package/dist/frameworks/ReactBrowserWorld.cjs +38 -0
- package/dist/frameworks/ReactBrowserWorld.cjs.map +1 -0
- package/dist/frameworks/ReactBrowserWorld.d.ts +10 -0
- package/dist/frameworks/ReactBrowserWorld.mjs +36 -0
- package/dist/frameworks/ReactBrowserWorld.mjs.map +1 -0
- package/dist/frameworks/SvelteBrowserWorld.cjs +17 -0
- package/dist/frameworks/SvelteBrowserWorld.cjs.map +1 -0
- package/dist/frameworks/SvelteBrowserWorld.d.ts +9 -0
- package/dist/frameworks/SvelteBrowserWorld.mjs +15 -0
- package/dist/frameworks/SvelteBrowserWorld.mjs.map +1 -0
- package/dist/frameworks/VueBrowserWorld.cjs +25 -0
- package/dist/frameworks/VueBrowserWorld.cjs.map +1 -0
- package/dist/frameworks/VueBrowserWorld.d.ts +10 -0
- package/dist/frameworks/VueBrowserWorld.mjs +23 -0
- package/dist/frameworks/VueBrowserWorld.mjs.map +1 -0
- package/dist/frameworks/react.cjs +11 -0
- package/dist/frameworks/react.cjs.map +1 -0
- package/dist/frameworks/react.d.ts +1 -0
- package/dist/frameworks/react.mjs +9 -0
- package/dist/frameworks/react.mjs.map +1 -0
- package/dist/frameworks/svelte.cjs +10 -0
- package/dist/frameworks/svelte.cjs.map +1 -0
- package/dist/frameworks/svelte.d.ts +1 -0
- package/dist/frameworks/svelte.mjs +8 -0
- package/dist/frameworks/svelte.mjs.map +1 -0
- package/dist/frameworks/vue.cjs +10 -0
- package/dist/frameworks/vue.cjs.map +1 -0
- package/dist/frameworks/vue.d.ts +1 -0
- package/dist/frameworks/vue.mjs +8 -0
- package/dist/frameworks/vue.mjs.map +1 -0
- package/dist/outcomes.steps.cjs +186 -0
- package/dist/outcomes.steps.cjs.map +1 -0
- package/dist/outcomes.steps.d.ts +1 -0
- package/dist/outcomes.steps.mjs +184 -0
- package/dist/outcomes.steps.mjs.map +1 -0
- package/package.json +103 -0
- package/rollup.config.js +58 -0
- package/src/VitestBrowserWorld.ts +205 -0
- package/src/actions.steps.ts +169 -0
- package/src/frameworks/ReactBrowserWorld.ts +41 -0
- package/src/frameworks/SvelteBrowserWorld.ts +15 -0
- package/src/frameworks/VueBrowserWorld.ts +23 -0
- package/src/frameworks/react.ts +4 -0
- package/src/frameworks/svelte.ts +4 -0
- package/src/frameworks/vue.ts +4 -0
- package/src/outcomes.steps.ts +190 -0
- package/tests/react/Hello.tsx +23 -0
- package/tests/react/react.feature +15 -0
- package/tests/svelte/Hello.svelte +31 -0
- package/tests/svelte/svelte.feature +16 -0
- package/tests/vue/Hello.vue +31 -0
- package/tests/vue/vue.feature +16 -0
- package/tsconfig.json +17 -0
- package/vite.config.ts +8 -0
- package/vitest.workspace.ts +95 -0
- package/world.ts +7 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svelte.mjs","sources":["../../src/frameworks/svelte.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAGA,CAAmB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var quickpickle = require('quickpickle');
|
|
4
|
+
var frameworks_VueBrowserWorld = require('./VueBrowserWorld.cjs');
|
|
5
|
+
require('../VitestBrowserWorld.cjs');
|
|
6
|
+
require('lodash/defaultsDeep');
|
|
7
|
+
require('vitest-browser-vue');
|
|
8
|
+
|
|
9
|
+
quickpickle.setWorldConstructor(frameworks_VueBrowserWorld.VueBrowserWorld);
|
|
10
|
+
//# sourceMappingURL=vue.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue.cjs","sources":["../../src/frameworks/vue.ts"],"sourcesContent":[null],"names":["setWorldConstructor","VueBrowserWorld"],"mappings":";;;;;;;;AAGAA,+BAAmB,CAACC,0CAAe,CAAC;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { setWorldConstructor } from 'quickpickle';
|
|
2
|
+
import { VueBrowserWorld } from './VueBrowserWorld.mjs';
|
|
3
|
+
import '../VitestBrowserWorld.mjs';
|
|
4
|
+
import 'lodash-es';
|
|
5
|
+
import 'vitest-browser-vue';
|
|
6
|
+
|
|
7
|
+
setWorldConstructor(VueBrowserWorld);
|
|
8
|
+
//# sourceMappingURL=vue.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue.mjs","sources":["../../src/frameworks/vue.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAGA,CAAmB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,eAAe,CAAC"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var quickpickle = require('quickpickle');
|
|
4
|
+
var vitest = require('vitest');
|
|
5
|
+
|
|
6
|
+
/// <reference types="@vitest/browser/providers/playwright" />
|
|
7
|
+
// ================
|
|
8
|
+
// Text on page
|
|
9
|
+
quickpickle.Then('I should see {string}( on the page)', async function (world, text) {
|
|
10
|
+
await world.expectText(world.page, text);
|
|
11
|
+
});
|
|
12
|
+
quickpickle.Then('I should not/NOT see {string}( on the page)', async function (world, text) {
|
|
13
|
+
await world.expectText(world.page, text, false);
|
|
14
|
+
});
|
|
15
|
+
quickpickle.Then('the text {string} should be visible( on the page)', async function (world, text) {
|
|
16
|
+
await world.expectText(world.page, text);
|
|
17
|
+
});
|
|
18
|
+
quickpickle.Then('the text {string} should not/NOT be visible( on the page)', async function (world, text) {
|
|
19
|
+
await world.expectText(world.page, text, false);
|
|
20
|
+
});
|
|
21
|
+
// ================
|
|
22
|
+
// Elements on page
|
|
23
|
+
quickpickle.Then('I should see a/an/the {string} {word}', async function (world, identifier, role) {
|
|
24
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
25
|
+
await world.expectElement(locator);
|
|
26
|
+
});
|
|
27
|
+
quickpickle.Then('I should not/NOT see a/an/the {string} {word}', async function (world, identifier, role) {
|
|
28
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
29
|
+
await world.expectElement(locator, false);
|
|
30
|
+
});
|
|
31
|
+
quickpickle.Then('I should see a/an/the {string} (element )with (the )(text ){string}', async function (world, identifier, text) {
|
|
32
|
+
let locator = await world.getLocator(world.page, identifier, 'element', text);
|
|
33
|
+
await world.expectElement(locator);
|
|
34
|
+
});
|
|
35
|
+
quickpickle.Then('I should not/NOT see a/an/the {string} (element )with (the )(text ){string}', async function (world, identifier, text) {
|
|
36
|
+
let locator = await world.getLocator(world.page, identifier, 'element', text);
|
|
37
|
+
await world.expectElement(locator, false);
|
|
38
|
+
});
|
|
39
|
+
// ================
|
|
40
|
+
// Element state
|
|
41
|
+
quickpickle.Then('a/an/the {string} {word} should be visible/hidden/invisible', async function (world, identifier, role) {
|
|
42
|
+
let state = world.info.step?.match(/(\w+)$/)[0];
|
|
43
|
+
let locator = world.getLocator(world.page, identifier, role);
|
|
44
|
+
await world.expectElement(locator, true, state === 'visible');
|
|
45
|
+
});
|
|
46
|
+
quickpickle.Then('a/an/the {string} (element )with (the )(text ){string} should be visible/hidden/invisible', async function (world, identifier, text) {
|
|
47
|
+
let state = world.info.step?.match(/(\w+)$/)[0];
|
|
48
|
+
let locator = world.getLocator(world.page, identifier, 'element', text);
|
|
49
|
+
await world.expectElement(locator, true, state === 'visible');
|
|
50
|
+
});
|
|
51
|
+
// Then('a/an/the {string} {word} should be attached/detatched', async function (world:VitestBrowserWorld, identifier, role) {
|
|
52
|
+
// let state = world.info.step?.match(/(\w)$/)![0] as 'attached'|'detached'
|
|
53
|
+
// let locator = world.getLocator(world.page, identifier, role)
|
|
54
|
+
// await locator.waitFor({ state, timeout:world.worldConfig.stepTimeout })
|
|
55
|
+
// })
|
|
56
|
+
// Then('a/an/the {string} (element )with (the )(text ){string} should be attached/detatched', async function (world:VitestBrowserWorld, identifier, text) {
|
|
57
|
+
// let state = world.info.step?.match(/(\w)$/)![0] as 'attached'|'detached'
|
|
58
|
+
// let locator = world.getLocator(world.page, identifier, 'element', text)
|
|
59
|
+
// await locator.waitFor({ state, timeout:world.worldConfig.stepTimeout })
|
|
60
|
+
// })
|
|
61
|
+
// disabled / enabled
|
|
62
|
+
quickpickle.Then('a/an/the {string} {word} should be disabled', async function (world, identifier, role) {
|
|
63
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
64
|
+
await vitest.expect(locator).toBeDisabled();
|
|
65
|
+
});
|
|
66
|
+
quickpickle.Then('a/an/the {string} {word} should be enabled', async function (world, identifier, role) {
|
|
67
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
68
|
+
await vitest.expect(locator).toBeEnabled();
|
|
69
|
+
});
|
|
70
|
+
quickpickle.Then('a/an/the {string} (element )with (the )(text ){string} should be disabled', async function (world, identifier, text) {
|
|
71
|
+
let locator = await world.getLocator(world.page, identifier, 'element', text);
|
|
72
|
+
await vitest.expect(locator).toBeDisabled();
|
|
73
|
+
});
|
|
74
|
+
quickpickle.Then('a/an/the {string} (element )with (the )(text ){string} should be enabled', async function (world, identifier, text) {
|
|
75
|
+
let locator = await world.getLocator(world.page, identifier, 'element', text);
|
|
76
|
+
await vitest.expect(locator).toBeEnabled();
|
|
77
|
+
});
|
|
78
|
+
// checked / unchecked
|
|
79
|
+
quickpickle.Then('a/an/the {string} {word} should be checked', async function (world, identifier, role) {
|
|
80
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
81
|
+
await vitest.expect(locator).toBeChecked();
|
|
82
|
+
});
|
|
83
|
+
quickpickle.Then('a/an/the {string} {word} should be unchecked', async function (world, identifier, role) {
|
|
84
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
85
|
+
await vitest.expect(locator).not.toBeChecked();
|
|
86
|
+
});
|
|
87
|
+
quickpickle.Then('a/an/the {string} (element )with (the )(text ){string} should be checked', async function (world, identifier, text) {
|
|
88
|
+
let locator = await world.getLocator(world.page, identifier, 'element', text);
|
|
89
|
+
await vitest.expect(locator).toBeChecked();
|
|
90
|
+
});
|
|
91
|
+
quickpickle.Then('a/an/the {string} (element )with (the )(text ){string} should be unchecked', async function (world, identifier, text) {
|
|
92
|
+
let locator = await world.getLocator(world.page, identifier, 'element', text);
|
|
93
|
+
await vitest.expect(locator).not.toBeChecked();
|
|
94
|
+
});
|
|
95
|
+
// focused / unfocused
|
|
96
|
+
quickpickle.Then('a/an/the {string} {word} should be focused/active', async function (world, identifier, role) {
|
|
97
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
98
|
+
await vitest.expect(locator).toHaveFocus();
|
|
99
|
+
});
|
|
100
|
+
quickpickle.Then('a/an/the {string} {word} should be unfocused/blurred', async function (world, identifier, role) {
|
|
101
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
102
|
+
await vitest.expect(locator).not.toHaveFocus();
|
|
103
|
+
});
|
|
104
|
+
quickpickle.Then('a/an/the {string} (element )with (the )(text ){string} should be focused/active', async function (world, identifier, text) {
|
|
105
|
+
let locator = await world.getLocator(world.page, identifier, 'element', text);
|
|
106
|
+
await vitest.expect(locator).toHaveFocus();
|
|
107
|
+
});
|
|
108
|
+
quickpickle.Then('a/an/the {string} (element )with (the )(text ){string} should be unfocused/blurred', async function (world, identifier, text) {
|
|
109
|
+
let locator = await world.getLocator(world.page, identifier, 'element', text);
|
|
110
|
+
await vitest.expect(locator).not.toHaveFocus();
|
|
111
|
+
});
|
|
112
|
+
// Values
|
|
113
|
+
quickpickle.Then('a/an/the (value of ){string} should contain/include/be/equal {string}', async function (world, identifier, expected) {
|
|
114
|
+
let exact = world.info.step?.match(/ should (?:be|equal) ['"]/) ? true : false;
|
|
115
|
+
let locator = await world.getLocator(world.page, identifier, 'input');
|
|
116
|
+
if (exact)
|
|
117
|
+
await vitest.expect(locator).toHaveValue(expected);
|
|
118
|
+
else {
|
|
119
|
+
let actual = (await locator.element())?.value ?? '';
|
|
120
|
+
await vitest.expect(actual).toContain(expected);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
quickpickle.Then('a/an/the (value of )(the ){string} {word} should contain/include/be/equal {string}', async function (world, identifier, role, expected) {
|
|
124
|
+
let exact = world.info.step?.match(/ should (?:be|equal) ['"]/) ? true : false;
|
|
125
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
126
|
+
if (exact)
|
|
127
|
+
await vitest.expect(locator).toHaveValue(expected);
|
|
128
|
+
else {
|
|
129
|
+
let actual = (await locator.element())?.value ?? '';
|
|
130
|
+
await vitest.expect(actual).toContain(expected);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
quickpickle.Then('a/an/the (value of )(the ){string} should not/NOT contain/include/be/equal {string}', async function (world, identifier, expected) {
|
|
134
|
+
let exact = world.info.step?.match(/ should (?:not|NOT) (?:be|equal) ['"]/) ? true : false;
|
|
135
|
+
let locator = await world.getLocator(world.page, identifier, 'input');
|
|
136
|
+
if (exact)
|
|
137
|
+
await vitest.expect(locator).not.toHaveValue(expected);
|
|
138
|
+
else {
|
|
139
|
+
let actual = (await locator.element())?.value ?? '';
|
|
140
|
+
await vitest.expect(actual).not.toContain(expected);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
quickpickle.Then('a/an/the (value of )(the ){string} {word} should not/NOT contain/include/be/equal {string}', async function (world, identifier, role, expected) {
|
|
144
|
+
let exact = world.info.step?.match(/ should (?:not|NOT) (?:be|equal) ['"]/) ? true : false;
|
|
145
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
146
|
+
if (exact)
|
|
147
|
+
await vitest.expect(locator).not.toHaveValue(expected);
|
|
148
|
+
else {
|
|
149
|
+
let actual = (await locator.element())?.value ?? '';
|
|
150
|
+
await vitest.expect(actual).not.toContain(expected);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
// Visual regression testing
|
|
154
|
+
quickpickle.Then('(the )screenshot/snapshot should match', async function (world) {
|
|
155
|
+
await vitest.expect(world.page).toMatchImageSnapshot({
|
|
156
|
+
...world.worldConfig.screenshotOptions,
|
|
157
|
+
customSnapshotsDir: world.screenshotDir,
|
|
158
|
+
customSnapshotIdentifier: world.screenshotFilename,
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
quickpickle.Then('(the )screenshot/snapshot {string} should match', async function (world, name) {
|
|
162
|
+
let explodedTags = world.info.explodedIdx ? `_(${world.info.tags.join(',')})` : '';
|
|
163
|
+
await vitest.expect(world.page).toMatchImageSnapshot({
|
|
164
|
+
...world.worldConfig.screenshotOptions,
|
|
165
|
+
customSnapshotsDir: world.screenshotDir,
|
|
166
|
+
customSnapshotIdentifier: `${name}${explodedTags}`,
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
quickpickle.Then('(the )screenshot/snapshot of the {string} {word} should match', async function (world, identifier, role) {
|
|
170
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
171
|
+
await vitest.expect(locator).toMatchImageSnapshot({
|
|
172
|
+
...world.worldConfig.screenshotOptions,
|
|
173
|
+
customSnapshotsDir: world.screenshotDir,
|
|
174
|
+
customSnapshotIdentifier: world.screenshotFilename,
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
quickpickle.Then('(the )screenshot/snapshot {string} of the {string} {word} should match', async function (world, name, identifier, role) {
|
|
178
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
179
|
+
let explodedTags = world.info.explodedIdx ? `_(${world.info.tags.join(',')})` : '';
|
|
180
|
+
await vitest.expect(locator).toMatchImageSnapshot({
|
|
181
|
+
...world.worldConfig.screenshotOptions,
|
|
182
|
+
customSnapshotsDir: world.screenshotDir,
|
|
183
|
+
customSnapshotIdentifier: `${name}${explodedTags}`,
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
//# sourceMappingURL=outcomes.steps.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outcomes.steps.cjs","sources":["../src/outcomes.steps.ts"],"sourcesContent":[null],"names":["Then","expect"],"mappings":";;;;;AAIA;AAEA;AACA;AAEAA,gBAAI,CAAC,qCAAqC,EAAE,gBAAgB,KAAwB,EAAE,IAAI,EAAA;IACxF,MAAM,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC;AAC1C,CAAC,CAAC;AACFA,gBAAI,CAAC,6CAA6C,EAAE,gBAAgB,KAAwB,EAAE,IAAI,EAAA;AAChG,IAAA,MAAM,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC;AACjD,CAAC,CAAC;AACFA,gBAAI,CAAC,mDAAmD,EAAE,gBAAgB,KAAwB,EAAE,IAAI,EAAA;IACtG,MAAM,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC;AAC1C,CAAC,CAAC;AACFA,gBAAI,CAAC,2DAA2D,EAAE,gBAAgB,KAAwB,EAAE,IAAI,EAAA;AAC9G,IAAA,MAAM,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI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A;AAC9H,IAAA,IAAI,OAAO,GAAG,MAAM,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC;AAClE,IAAA,MAAMC,aAAM,CAAC,OAAO,CAAC,CAAC,oBAAoB,CAAC;AACzC,QAAA,GAAG,KAAK,CAAC,WAAW,CAAC,iBAAiB;QACtC,kBAAkB,EAAE,KAAK,CAAC,aAAa;QACvC,wBAAwB,EAAE,KAAK,CAAC,kBAAkB;AACnD,KAAA,CAAC;AACJ,CAAC,CAAC;AACFD,gBAAI,CAAC,wEAAwE,EAAE,gBAAgB,KAAwB,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAA;AAC7I,IAAA,IAAI,OAAO,GAAG,MAAM,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC;IAClE,IAAI,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,GAAG,CAAA,EAAA,EAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA,CAAA,CAAG,GAAG,EAAE;AAClF,IAAA,MAAMC,aAAM,CAAC,OAAO,CAAC,CAAC,oBAAoB,CAAC;AACzC,QAAA,GAAG,KAAK,CAAC,WAAW,CAAC,iBAAiB;QACtC,kBAAkB,EAAE,KAAK,CAAC,aAAa;AACvC,QAAA,wBAAwB,EAAE,CAAA,EAAG,IAAI,CAAA,EAAG,YAAY,CAAE,CAAA;AACnD,KAAA,CAAC;AACJ,CAAC,CAAC;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { Then } from 'quickpickle';
|
|
2
|
+
import { expect } from 'vitest';
|
|
3
|
+
|
|
4
|
+
/// <reference types="@vitest/browser/providers/playwright" />
|
|
5
|
+
// ================
|
|
6
|
+
// Text on page
|
|
7
|
+
Then('I should see {string}( on the page)', async function (world, text) {
|
|
8
|
+
await world.expectText(world.page, text);
|
|
9
|
+
});
|
|
10
|
+
Then('I should not/NOT see {string}( on the page)', async function (world, text) {
|
|
11
|
+
await world.expectText(world.page, text, false);
|
|
12
|
+
});
|
|
13
|
+
Then('the text {string} should be visible( on the page)', async function (world, text) {
|
|
14
|
+
await world.expectText(world.page, text);
|
|
15
|
+
});
|
|
16
|
+
Then('the text {string} should not/NOT be visible( on the page)', async function (world, text) {
|
|
17
|
+
await world.expectText(world.page, text, false);
|
|
18
|
+
});
|
|
19
|
+
// ================
|
|
20
|
+
// Elements on page
|
|
21
|
+
Then('I should see a/an/the {string} {word}', async function (world, identifier, role) {
|
|
22
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
23
|
+
await world.expectElement(locator);
|
|
24
|
+
});
|
|
25
|
+
Then('I should not/NOT see a/an/the {string} {word}', async function (world, identifier, role) {
|
|
26
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
27
|
+
await world.expectElement(locator, false);
|
|
28
|
+
});
|
|
29
|
+
Then('I should see a/an/the {string} (element )with (the )(text ){string}', async function (world, identifier, text) {
|
|
30
|
+
let locator = await world.getLocator(world.page, identifier, 'element', text);
|
|
31
|
+
await world.expectElement(locator);
|
|
32
|
+
});
|
|
33
|
+
Then('I should not/NOT see a/an/the {string} (element )with (the )(text ){string}', async function (world, identifier, text) {
|
|
34
|
+
let locator = await world.getLocator(world.page, identifier, 'element', text);
|
|
35
|
+
await world.expectElement(locator, false);
|
|
36
|
+
});
|
|
37
|
+
// ================
|
|
38
|
+
// Element state
|
|
39
|
+
Then('a/an/the {string} {word} should be visible/hidden/invisible', async function (world, identifier, role) {
|
|
40
|
+
let state = world.info.step?.match(/(\w+)$/)[0];
|
|
41
|
+
let locator = world.getLocator(world.page, identifier, role);
|
|
42
|
+
await world.expectElement(locator, true, state === 'visible');
|
|
43
|
+
});
|
|
44
|
+
Then('a/an/the {string} (element )with (the )(text ){string} should be visible/hidden/invisible', async function (world, identifier, text) {
|
|
45
|
+
let state = world.info.step?.match(/(\w+)$/)[0];
|
|
46
|
+
let locator = world.getLocator(world.page, identifier, 'element', text);
|
|
47
|
+
await world.expectElement(locator, true, state === 'visible');
|
|
48
|
+
});
|
|
49
|
+
// Then('a/an/the {string} {word} should be attached/detatched', async function (world:VitestBrowserWorld, identifier, role) {
|
|
50
|
+
// let state = world.info.step?.match(/(\w)$/)![0] as 'attached'|'detached'
|
|
51
|
+
// let locator = world.getLocator(world.page, identifier, role)
|
|
52
|
+
// await locator.waitFor({ state, timeout:world.worldConfig.stepTimeout })
|
|
53
|
+
// })
|
|
54
|
+
// Then('a/an/the {string} (element )with (the )(text ){string} should be attached/detatched', async function (world:VitestBrowserWorld, identifier, text) {
|
|
55
|
+
// let state = world.info.step?.match(/(\w)$/)![0] as 'attached'|'detached'
|
|
56
|
+
// let locator = world.getLocator(world.page, identifier, 'element', text)
|
|
57
|
+
// await locator.waitFor({ state, timeout:world.worldConfig.stepTimeout })
|
|
58
|
+
// })
|
|
59
|
+
// disabled / enabled
|
|
60
|
+
Then('a/an/the {string} {word} should be disabled', async function (world, identifier, role) {
|
|
61
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
62
|
+
await expect(locator).toBeDisabled();
|
|
63
|
+
});
|
|
64
|
+
Then('a/an/the {string} {word} should be enabled', async function (world, identifier, role) {
|
|
65
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
66
|
+
await expect(locator).toBeEnabled();
|
|
67
|
+
});
|
|
68
|
+
Then('a/an/the {string} (element )with (the )(text ){string} should be disabled', async function (world, identifier, text) {
|
|
69
|
+
let locator = await world.getLocator(world.page, identifier, 'element', text);
|
|
70
|
+
await expect(locator).toBeDisabled();
|
|
71
|
+
});
|
|
72
|
+
Then('a/an/the {string} (element )with (the )(text ){string} should be enabled', async function (world, identifier, text) {
|
|
73
|
+
let locator = await world.getLocator(world.page, identifier, 'element', text);
|
|
74
|
+
await expect(locator).toBeEnabled();
|
|
75
|
+
});
|
|
76
|
+
// checked / unchecked
|
|
77
|
+
Then('a/an/the {string} {word} should be checked', async function (world, identifier, role) {
|
|
78
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
79
|
+
await expect(locator).toBeChecked();
|
|
80
|
+
});
|
|
81
|
+
Then('a/an/the {string} {word} should be unchecked', async function (world, identifier, role) {
|
|
82
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
83
|
+
await expect(locator).not.toBeChecked();
|
|
84
|
+
});
|
|
85
|
+
Then('a/an/the {string} (element )with (the )(text ){string} should be checked', async function (world, identifier, text) {
|
|
86
|
+
let locator = await world.getLocator(world.page, identifier, 'element', text);
|
|
87
|
+
await expect(locator).toBeChecked();
|
|
88
|
+
});
|
|
89
|
+
Then('a/an/the {string} (element )with (the )(text ){string} should be unchecked', async function (world, identifier, text) {
|
|
90
|
+
let locator = await world.getLocator(world.page, identifier, 'element', text);
|
|
91
|
+
await expect(locator).not.toBeChecked();
|
|
92
|
+
});
|
|
93
|
+
// focused / unfocused
|
|
94
|
+
Then('a/an/the {string} {word} should be focused/active', async function (world, identifier, role) {
|
|
95
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
96
|
+
await expect(locator).toHaveFocus();
|
|
97
|
+
});
|
|
98
|
+
Then('a/an/the {string} {word} should be unfocused/blurred', async function (world, identifier, role) {
|
|
99
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
100
|
+
await expect(locator).not.toHaveFocus();
|
|
101
|
+
});
|
|
102
|
+
Then('a/an/the {string} (element )with (the )(text ){string} should be focused/active', async function (world, identifier, text) {
|
|
103
|
+
let locator = await world.getLocator(world.page, identifier, 'element', text);
|
|
104
|
+
await expect(locator).toHaveFocus();
|
|
105
|
+
});
|
|
106
|
+
Then('a/an/the {string} (element )with (the )(text ){string} should be unfocused/blurred', async function (world, identifier, text) {
|
|
107
|
+
let locator = await world.getLocator(world.page, identifier, 'element', text);
|
|
108
|
+
await expect(locator).not.toHaveFocus();
|
|
109
|
+
});
|
|
110
|
+
// Values
|
|
111
|
+
Then('a/an/the (value of ){string} should contain/include/be/equal {string}', async function (world, identifier, expected) {
|
|
112
|
+
let exact = world.info.step?.match(/ should (?:be|equal) ['"]/) ? true : false;
|
|
113
|
+
let locator = await world.getLocator(world.page, identifier, 'input');
|
|
114
|
+
if (exact)
|
|
115
|
+
await expect(locator).toHaveValue(expected);
|
|
116
|
+
else {
|
|
117
|
+
let actual = (await locator.element())?.value ?? '';
|
|
118
|
+
await expect(actual).toContain(expected);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
Then('a/an/the (value of )(the ){string} {word} should contain/include/be/equal {string}', async function (world, identifier, role, expected) {
|
|
122
|
+
let exact = world.info.step?.match(/ should (?:be|equal) ['"]/) ? true : false;
|
|
123
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
124
|
+
if (exact)
|
|
125
|
+
await expect(locator).toHaveValue(expected);
|
|
126
|
+
else {
|
|
127
|
+
let actual = (await locator.element())?.value ?? '';
|
|
128
|
+
await expect(actual).toContain(expected);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
Then('a/an/the (value of )(the ){string} should not/NOT contain/include/be/equal {string}', async function (world, identifier, expected) {
|
|
132
|
+
let exact = world.info.step?.match(/ should (?:not|NOT) (?:be|equal) ['"]/) ? true : false;
|
|
133
|
+
let locator = await world.getLocator(world.page, identifier, 'input');
|
|
134
|
+
if (exact)
|
|
135
|
+
await expect(locator).not.toHaveValue(expected);
|
|
136
|
+
else {
|
|
137
|
+
let actual = (await locator.element())?.value ?? '';
|
|
138
|
+
await expect(actual).not.toContain(expected);
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
Then('a/an/the (value of )(the ){string} {word} should not/NOT contain/include/be/equal {string}', async function (world, identifier, role, expected) {
|
|
142
|
+
let exact = world.info.step?.match(/ should (?:not|NOT) (?:be|equal) ['"]/) ? true : false;
|
|
143
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
144
|
+
if (exact)
|
|
145
|
+
await expect(locator).not.toHaveValue(expected);
|
|
146
|
+
else {
|
|
147
|
+
let actual = (await locator.element())?.value ?? '';
|
|
148
|
+
await expect(actual).not.toContain(expected);
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
// Visual regression testing
|
|
152
|
+
Then('(the )screenshot/snapshot should match', async function (world) {
|
|
153
|
+
await expect(world.page).toMatchImageSnapshot({
|
|
154
|
+
...world.worldConfig.screenshotOptions,
|
|
155
|
+
customSnapshotsDir: world.screenshotDir,
|
|
156
|
+
customSnapshotIdentifier: world.screenshotFilename,
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
Then('(the )screenshot/snapshot {string} should match', async function (world, name) {
|
|
160
|
+
let explodedTags = world.info.explodedIdx ? `_(${world.info.tags.join(',')})` : '';
|
|
161
|
+
await expect(world.page).toMatchImageSnapshot({
|
|
162
|
+
...world.worldConfig.screenshotOptions,
|
|
163
|
+
customSnapshotsDir: world.screenshotDir,
|
|
164
|
+
customSnapshotIdentifier: `${name}${explodedTags}`,
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
Then('(the )screenshot/snapshot of the {string} {word} should match', async function (world, identifier, role) {
|
|
168
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
169
|
+
await expect(locator).toMatchImageSnapshot({
|
|
170
|
+
...world.worldConfig.screenshotOptions,
|
|
171
|
+
customSnapshotsDir: world.screenshotDir,
|
|
172
|
+
customSnapshotIdentifier: world.screenshotFilename,
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
Then('(the )screenshot/snapshot {string} of the {string} {word} should match', async function (world, name, identifier, role) {
|
|
176
|
+
let locator = await world.getLocator(world.page, identifier, role);
|
|
177
|
+
let explodedTags = world.info.explodedIdx ? `_(${world.info.tags.join(',')})` : '';
|
|
178
|
+
await expect(locator).toMatchImageSnapshot({
|
|
179
|
+
...world.worldConfig.screenshotOptions,
|
|
180
|
+
customSnapshotsDir: world.screenshotDir,
|
|
181
|
+
customSnapshotIdentifier: `${name}${explodedTags}`,
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
//# sourceMappingURL=outcomes.steps.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outcomes.steps.mjs","sources":["../src/outcomes.steps.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAIA;AAEA;AACA;AAEA,IAAI,CAAC,qCAAqC,EAAE,gBAAgB,KAAwB,EAAE,IAAI,EAAA;IACxF,MAAM,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC;AAC1C,CAAC,CAAC;AACF,IAAI,CAAC,6CAA6C,EAAE,gBAAgB,KAAwB,EAAE,IAAI,EAAA;AAChG,IAAA,MAAM,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC;AACjD,CAAC,CAAC;AACF,IAAI,CAAC,mDAAmD,EAAE,gBAAgB,KAAwB,EAAE,IAAI,EAAA;IACtG,MAAM,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC;AAC1C,CAAC,CAAC;AACF,IAAI,CAAC,2DAA2D,EAAE,gBAAgB,KAAwB,EAAE,IAAI,EAAA;AAC9G,IAAA,MAAM,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC;AACjD,CAAC,CAAC;AAEF;AACA;AACA,IAAI,CAAC,uCAAuC,EAAE,gBAAgB,KAAwB,EAAE,UAAU,EAAE,IAAI,EAAA;AACtG,IAAA,IAAI,OAAO,GAAG,MAAM,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC;AAClE,IAAA,MAAM,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC;AACpC,CAAC,CAAC;AACF,IAAI,CAAC,+CAA+C,EAAE,gBAAgB,KAAwB,EAAE,UAAU,EAAE,IAAI,EAAA;AA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,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC;IAClE,IAAI,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,GAAG,CAAA,EAAA,EAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA,CAAA,CAAG,GAAG,EAAE;AAClF,IAAA,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,oBAAoB,CAAC;AACzC,QAAA,GAAG,KAAK,CAAC,WAAW,CAAC,iBAAiB;QACtC,kBAAkB,EAAE,KAAK,CAAC,aAAa;AACvC,QAAA,wBAAwB,EAAE,CAAA,EAAG,IAAI,CAAA,EAAG,YAAY,CAAE,CAAA;AACnD,KAAA,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@quickpickle/vitest-browser",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "Support files for running Gherkin/Cucumber tests in Vitest Browser mode, for testing components.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"BDD",
|
|
7
|
+
"components",
|
|
8
|
+
"testing",
|
|
9
|
+
"behavioral",
|
|
10
|
+
"cucumber",
|
|
11
|
+
"gherkin",
|
|
12
|
+
"vitest",
|
|
13
|
+
"playwright",
|
|
14
|
+
"react",
|
|
15
|
+
"svelte",
|
|
16
|
+
"vue",
|
|
17
|
+
"angular"
|
|
18
|
+
],
|
|
19
|
+
"homepage": "https://github.com/dnotes/quickpickle#readme",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/dnotes/quickpickle/issues"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://github.com/dnotes/quickpickle.git"
|
|
26
|
+
},
|
|
27
|
+
"author": "David Hunt",
|
|
28
|
+
"license": "ISC",
|
|
29
|
+
"type": "module",
|
|
30
|
+
"main": "./dist/VitestBrowserWorld.cjs",
|
|
31
|
+
"module": "./dist/VitestBrowserWorld.mjs",
|
|
32
|
+
"types": "./dist/VitestBrowserWorld.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"require": "./dist/VitestBrowserWorld.cjs",
|
|
36
|
+
"import": "./dist/VitestBrowserWorld.mjs"
|
|
37
|
+
},
|
|
38
|
+
"./VitestBrowserWorld": {
|
|
39
|
+
"require": "./dist/VitestBrowserWorld.cjs",
|
|
40
|
+
"import": "./dist/VitestBrowserWorld.mjs"
|
|
41
|
+
},
|
|
42
|
+
"./actions": {
|
|
43
|
+
"require": "./dist/actions.steps.cjs",
|
|
44
|
+
"import": "./dist/actions.steps.mjs"
|
|
45
|
+
},
|
|
46
|
+
"./outcomes": {
|
|
47
|
+
"require": "./dist/outcomes.steps.cjs",
|
|
48
|
+
"import": "./dist/outcomes.steps.mjs"
|
|
49
|
+
},
|
|
50
|
+
"./frameworks/svelte": {
|
|
51
|
+
"require": "./dist/frameworks/svelte.cjs",
|
|
52
|
+
"import": "./dist/frameworks/svelte.mjs"
|
|
53
|
+
},
|
|
54
|
+
"./frameworks/SvelteBrowserWorld": {
|
|
55
|
+
"require": "./dist/frameworks/SvelteBrowserWorld.cjs",
|
|
56
|
+
"import": "./dist/frameworks/SvelteBrowserWorld.mjs"
|
|
57
|
+
},
|
|
58
|
+
"./frameworks/vue": {
|
|
59
|
+
"require": "./dist/frameworks/vue.cjs",
|
|
60
|
+
"import": "./dist/frameworks/vue.mjs"
|
|
61
|
+
},
|
|
62
|
+
"./frameworks/VueBrowserWorld": {
|
|
63
|
+
"require": "./dist/frameworks/VueBrowserWorld.cjs",
|
|
64
|
+
"import": "./dist/frameworks/VueBrowserWorld.mjs"
|
|
65
|
+
},
|
|
66
|
+
"./frameworks/react": {
|
|
67
|
+
"require": "./dist/frameworks/react.cjs",
|
|
68
|
+
"import": "./dist/frameworks/react.mjs"
|
|
69
|
+
},
|
|
70
|
+
"./frameworks/ReactBrowserWorld": {
|
|
71
|
+
"require": "./dist/frameworks/ReactBrowserWorld.cjs",
|
|
72
|
+
"import": "./dist/frameworks/ReactBrowserWorld.mjs"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@sveltejs/vite-plugin-svelte": "^5",
|
|
77
|
+
"@types/react": "^19.1.4",
|
|
78
|
+
"@vitejs/plugin-react": "^4.4.1",
|
|
79
|
+
"@vitejs/plugin-vue": "^5.2.4",
|
|
80
|
+
"@vitest/browser": "^3.1.3",
|
|
81
|
+
"react": "^19.1.0",
|
|
82
|
+
"rollup": "^4",
|
|
83
|
+
"svelte": "^5",
|
|
84
|
+
"vite": "^6",
|
|
85
|
+
"vitest": "^3.1.3"
|
|
86
|
+
},
|
|
87
|
+
"dependencies": {
|
|
88
|
+
"vitest-browser-react": "^0.1.1",
|
|
89
|
+
"vitest-browser-svelte": "^0.1.0",
|
|
90
|
+
"vitest-browser-vue": "^0.2.0",
|
|
91
|
+
"quickpickle": "^1.7.0"
|
|
92
|
+
},
|
|
93
|
+
"scripts": {
|
|
94
|
+
"build": "rollup -c && FORMAT=cjs rollup -c",
|
|
95
|
+
"type-check": "tsc --noEmit",
|
|
96
|
+
"test:browser": "SHOW_BROWSER=true vitest",
|
|
97
|
+
"test:svelte": "SHOW_BROWSER=true vitest --project svelte",
|
|
98
|
+
"test:vue": "SHOW_BROWSER=true vitest --project vue",
|
|
99
|
+
"test:react": "SHOW_BROWSER=true vitest --project react",
|
|
100
|
+
"test:watch": "vitest",
|
|
101
|
+
"test": "vitest --run"
|
|
102
|
+
}
|
|
103
|
+
}
|
package/rollup.config.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import typescript from '@rollup/plugin-typescript';
|
|
2
|
+
import replace from '@rollup/plugin-replace';
|
|
3
|
+
import glob from 'fast-glob';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { optimizeLodashImports } from '@optimize-lodash/rollup-plugin'
|
|
6
|
+
|
|
7
|
+
let cjs = process.env.FORMAT === 'cjs' ? 'cjs' : '';
|
|
8
|
+
|
|
9
|
+
const input = Object.fromEntries(
|
|
10
|
+
glob.sync('src/**/*.ts').map(file => [
|
|
11
|
+
// This will remove `src/` from the beginning and `.ts` from the end
|
|
12
|
+
path.relative('src', file.slice(0, -3)),
|
|
13
|
+
file
|
|
14
|
+
])
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
input,
|
|
19
|
+
output: [
|
|
20
|
+
{
|
|
21
|
+
dir: 'dist',
|
|
22
|
+
format: cjs || 'esm',
|
|
23
|
+
sourcemap: true,
|
|
24
|
+
exports: 'named',
|
|
25
|
+
entryFileNames: `[name].${cjs || 'mjs'}`
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
plugins: [
|
|
29
|
+
replace({
|
|
30
|
+
preventAssignment: true,
|
|
31
|
+
values: {
|
|
32
|
+
'import.meta?.env?.MODE': JSON.stringify('production'),
|
|
33
|
+
'process?.env?.NODE_ENV': JSON.stringify('production'),
|
|
34
|
+
'lodash-es': cjs ? 'lodash' : 'lodash-es',
|
|
35
|
+
}
|
|
36
|
+
}),
|
|
37
|
+
optimizeLodashImports({
|
|
38
|
+
appendDotJs: false,
|
|
39
|
+
}),
|
|
40
|
+
typescript({
|
|
41
|
+
tsconfig: './tsconfig.json',
|
|
42
|
+
declaration: true,
|
|
43
|
+
}),
|
|
44
|
+
],
|
|
45
|
+
external: [
|
|
46
|
+
'quickpickle',
|
|
47
|
+
'vite',
|
|
48
|
+
'vitest',
|
|
49
|
+
'@vitest/browser/context',
|
|
50
|
+
'vitest-browser-svelte',
|
|
51
|
+
'vitest-browser-vue',
|
|
52
|
+
'vitest-browser-react',
|
|
53
|
+
/^lodash/,
|
|
54
|
+
'react',
|
|
55
|
+
'pngjs',
|
|
56
|
+
'pixelmatch',
|
|
57
|
+
]
|
|
58
|
+
};
|