@quickpickle/playwright 0.9.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 David Hunt
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ var playwright = require('playwright');
4
+ var quickpickle = require('quickpickle');
5
+ var lodashEs = require('lodash-es');
6
+
7
+ const defaultPlaywrightWorldConfig = {
8
+ nojsTags: ['@nojs', '@noscript'],
9
+ headless: true,
10
+ slowMo: 0,
11
+ };
12
+ class PlaywrightWorld extends quickpickle.QuickPickleWorld {
13
+ constructor(context, info, worldConfig) {
14
+ super(context, info);
15
+ this.playwrightConfig = defaultPlaywrightWorldConfig;
16
+ let newConfig = lodashEs.defaults(defaultPlaywrightWorldConfig, worldConfig || {});
17
+ newConfig.nojsTags = quickpickle.normalizeTags(newConfig.nojsTags);
18
+ this.playwrightConfig = newConfig;
19
+ }
20
+ async init() {
21
+ this.browser = await playwright.chromium.launch();
22
+ this.browserContext = await this.browser.newContext({
23
+ serviceWorkers: 'block',
24
+ javaScriptEnabled: lodashEs.intersection(this.info.tags, this.playwrightConfig.nojsTags)?.length ? false : true,
25
+ });
26
+ this.page = await this.browserContext.newPage();
27
+ }
28
+ async reset() {
29
+ await this.page?.close();
30
+ await this.browserContext?.close();
31
+ this.browserContext = await this.browser.newContext({
32
+ serviceWorkers: 'block'
33
+ });
34
+ this.page = await this.browserContext.newPage();
35
+ }
36
+ async close() {
37
+ await this.browser.close();
38
+ }
39
+ }
40
+ quickpickle.After(async (world) => {
41
+ await world.browserContext.close();
42
+ });
43
+
44
+ exports.PlaywrightWorld = PlaywrightWorld;
45
+ exports.defaultPlaywrightWorldConfig = defaultPlaywrightWorldConfig;
46
+ //# sourceMappingURL=PlaywrightWorld.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlaywrightWorld.cjs","sources":["../src/PlaywrightWorld.ts"],"sourcesContent":[null],"names":["QuickPickleWorld","defaults","normalizeTags","chromium","intersection","After"],"mappings":";;;;;;AAYa,MAAA,4BAA4B,GAAG;AAC1C,IAAA,QAAQ,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;AAChC,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,MAAM,EAAE,CAAC;EACV;AAIK,MAAO,eAAgB,SAAQA,4BAAgB,CAAA;AAMnD,IAAA,WAAA,CAAY,OAAmB,EAAE,IAAgD,EAAE,WAAyC,EAAA;AAC1H,QAAA,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;QAHtB,IAAgB,CAAA,gBAAA,GAAyB,4BAA4B,CAAA;QAInE,IAAI,SAAS,GAAGC,iBAAQ,CAAC,4BAA4B,EAAE,WAAW,IAAI,EAAE,CAAC,CAAA;QACzE,SAAS,CAAC,QAAQ,GAAGC,yBAAa,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quickpickle';
3
+ import type { TestContext } from 'vitest';
4
+ export type PlaywrightWorldConfigSetting = {
5
+ nojsTags?: string | string[];
6
+ headless: boolean;
7
+ sloMo: number;
8
+ };
9
+ export declare const defaultPlaywrightWorldConfig: {
10
+ nojsTags: string[];
11
+ headless: boolean;
12
+ slowMo: number;
13
+ };
14
+ export type PlaywrightWorldConfig = typeof defaultPlaywrightWorldConfig;
15
+ export declare class PlaywrightWorld extends QuickPickleWorld {
16
+ browser: Browser;
17
+ browserContext: BrowserContext;
18
+ page: Page;
19
+ playwrightConfig: PlaywrightWorldConfig;
20
+ constructor(context: TestContext, info: QuickPickleWorldInterface['info'] | undefined, worldConfig?: PlaywrightWorldConfigSetting);
21
+ init(): Promise<void>;
22
+ reset(): Promise<void>;
23
+ close(): Promise<void>;
24
+ }
@@ -0,0 +1,43 @@
1
+ import { chromium } from 'playwright';
2
+ import { After, QuickPickleWorld, normalizeTags } from 'quickpickle';
3
+ import { defaults, intersection } from 'lodash-es';
4
+
5
+ const defaultPlaywrightWorldConfig = {
6
+ nojsTags: ['@nojs', '@noscript'],
7
+ headless: true,
8
+ slowMo: 0,
9
+ };
10
+ class PlaywrightWorld extends QuickPickleWorld {
11
+ constructor(context, info, worldConfig) {
12
+ super(context, info);
13
+ this.playwrightConfig = defaultPlaywrightWorldConfig;
14
+ let newConfig = defaults(defaultPlaywrightWorldConfig, worldConfig || {});
15
+ newConfig.nojsTags = normalizeTags(newConfig.nojsTags);
16
+ this.playwrightConfig = newConfig;
17
+ }
18
+ async init() {
19
+ this.browser = await chromium.launch();
20
+ this.browserContext = await this.browser.newContext({
21
+ serviceWorkers: 'block',
22
+ javaScriptEnabled: intersection(this.info.tags, this.playwrightConfig.nojsTags)?.length ? false : true,
23
+ });
24
+ this.page = await this.browserContext.newPage();
25
+ }
26
+ async reset() {
27
+ await this.page?.close();
28
+ await this.browserContext?.close();
29
+ this.browserContext = await this.browser.newContext({
30
+ serviceWorkers: 'block'
31
+ });
32
+ this.page = await this.browserContext.newPage();
33
+ }
34
+ async close() {
35
+ await this.browser.close();
36
+ }
37
+ }
38
+ After(async (world) => {
39
+ await world.browserContext.close();
40
+ });
41
+
42
+ export { PlaywrightWorld, defaultPlaywrightWorldConfig };
43
+ //# sourceMappingURL=PlaywrightWorld.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlaywrightWorld.esm.js","sources":["../src/PlaywrightWorld.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAYa,MAAA,4BAA4B,GAAG;AAC1C,IAAA,QAAQ,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;AAChC,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,MAAM,EAAE,CAAC;EACV;AAIK,MAAO,eAAgB,SAAQ,gBAAgB,CAAA;AAMnD,IAAA,WAAA,CAAY,OAAmB,EAAE,IAAgD,EAAE,WAAyC,EAAA;AAC1H,QAAA,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;QAHtB,IAAgB,CAAA,gBAAA,GAAyB,4BAA4B,CAAA;QAInE,IAAI,SAAS,GAAG,QAAQ,CAAC,4BAA4B,EAAE,WAAW,IAAI,EAAE,CAAC,CAAA;QACzE,SAAS,CAAC,QAAQ,GAAG,aAAa,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;AACtD,QAAA,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAA;KAClC;AAED,IAAA,MAAM,IAAI,GAAA;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,EAAE,CAAA;QACtC,IAAI,CAAC,cAAc,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;AAClD,YAAA,cAAc,EAAE,OAAO;YACvB,iBAAiB,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,IAAI;AACvG,SAAA,CAAC,CAAA;QACF,IAAI,CAAC,IAAI,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAA;KAChD;AAED,IAAA,MAAM,KAAK,GAAA;AACT,QAAA,MAAM,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAA;AACxB,QAAA,MAAM,IAAI,CAAC,cAAc,EAAE,KAAK,EAAE,CAAA;QAClC,IAAI,CAAC,cAAc,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;AAClD,YAAA,cAAc,EAAE,OAAO;AACxB,SAAA,CAAC,CAAA;QACF,IAAI,CAAC,IAAI,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAA;KAChD;AAED,IAAA,MAAM,KAAK,GAAA;AACT,QAAA,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAA;KAC3B;AACF,CAAA;AAED,KAAK,CAAC,OAAO,KAAqB,KAAI;AACpC,IAAA,MAAM,KAAK,CAAC,cAAc,CAAC,KAAK,EAAE,CAAA;AACpC,CAAC,CAAC;;;;"}
@@ -0,0 +1,106 @@
1
+ 'use strict';
2
+
3
+ var quickpickle = require('quickpickle');
4
+ var path = require('node:path');
5
+ var url = require('node:url');
6
+
7
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
8
+ const projectRoot = path.resolve(path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('actions.steps.cjs', document.baseURI).href)))), '..');
9
+ quickpickle.Given('I am on {string}', async function (world, path) {
10
+ let url = new URL(path, 'http://localhost:5173');
11
+ await world.page.goto(url.href);
12
+ await world.page.waitForTimeout(80);
13
+ });
14
+ quickpickle.When(`I visit {string}`, async function (world, path) {
15
+ let url = new URL(path, 'http://localhost:5173');
16
+ await world.page.goto(url.href);
17
+ await world.page.waitForTimeout(80);
18
+ });
19
+ quickpickle.When(`I navigate/go to {string}`, async function (world, path) {
20
+ let url = new URL(path, 'http://localhost:5173');
21
+ await world.page.goto(url.href);
22
+ await world.page.waitForTimeout(80);
23
+ });
24
+ quickpickle.When('I click/press/tap/touch (on ){string}', async function (world, identifier) {
25
+ let locator = await world.page.getByText(identifier).or(world.page.locator(identifier));
26
+ await locator.click();
27
+ });
28
+ quickpickle.When('I click/press/tap/touch (on )the {string} {word}', async function (world, identifier, role) {
29
+ let locator = await world.page.getByRole(role, { name: identifier });
30
+ await locator.click();
31
+ });
32
+ quickpickle.When('I focus/select/activate (on ){string}', async function (world, identifier) {
33
+ let locator = await world.page.locator(identifier);
34
+ await locator.focus();
35
+ });
36
+ quickpickle.When('I focus/select/activate (on )the {string} {word}', async function (world, identifier, role) {
37
+ let locator = await world.page.getByRole(role, { name: identifier });
38
+ await locator.focus();
39
+ });
40
+ quickpickle.When("for (the ){string} I enter/fill (in ){string}", async function (world, identifier, text) {
41
+ let locator = await world.page.getByLabel(identifier).or(world.page.getByPlaceholder(identifier)).or(world.page.locator(identifier));
42
+ await locator.fill(text);
43
+ });
44
+ quickpickle.When("for (the ){string} I enter/fill (in )the following( text):", async function (world, identifier, text) {
45
+ let locator = await world.page.getByLabel(identifier).or(await world.page.getByPlaceholder(identifier)).or(await world.page.locator(identifier));
46
+ await locator.fill(text);
47
+ });
48
+ quickpickle.When('I enter/fill (in )the following( fields):', async function (world, table) {
49
+ for (let row of table.raw()) {
50
+ let [identifier, text] = row;
51
+ let locator = await world.page.getByLabel(identifier).or(world.page.getByPlaceholder(identifier)).or(world.page.locator(identifier));
52
+ let tag = await locator.evaluate(e => e.tagName.toLowerCase());
53
+ let type = await locator.getAttribute('type');
54
+ if (tag === 'select') {
55
+ await locator.selectOption(text);
56
+ }
57
+ else if (type === 'checkbox' || type === 'radio') {
58
+ let checked = (['', 'false', 'no', 'unchecked', 'null', 'undefined', '0']).includes(text.toLowerCase()) ? false : true;
59
+ await locator.setChecked(checked);
60
+ }
61
+ else {
62
+ await locator.fill(text);
63
+ }
64
+ }
65
+ });
66
+ quickpickle.When(/^I wait for "([^"]+)" to be (attached|detatched|visible|hidden)$/, async function (world, identifier, state) {
67
+ let locator = await world.page.getByText(identifier).or(world.page.getByLabel(identifier)).or(world.page.locator(identifier));
68
+ await locator.waitFor({ state });
69
+ });
70
+ quickpickle.When(/^I scroll (down|up|left|right)$/, async function (world, direction) {
71
+ let num = 100;
72
+ let horiz = direction.includes('t');
73
+ if (horiz)
74
+ await world.page.mouse.wheel(direction === 'right' ? num : -num, 0);
75
+ await world.page.mouse.wheel(0, direction === 'down' ? num : -num);
76
+ });
77
+ quickpickle.When(/^I scroll (down|up|left|right) (\d*)(?:px| pixels?)$/, async function (world, direction, int) {
78
+ let num = parseInt(int || '100');
79
+ let horiz = direction.includes('t');
80
+ if (horiz)
81
+ await world.page.mouse.wheel(direction === 'right' ? num : -num, 0);
82
+ await world.page.mouse.wheel(0, direction === 'down' ? num : -num);
83
+ });
84
+ quickpickle.When('I type the following keys: {}', async function (world, keys) {
85
+ let keyPresses = keys.split(' ');
86
+ for (let key of keyPresses) {
87
+ await world.page.keyboard.press(key);
88
+ }
89
+ });
90
+ quickpickle.When(/^I go (back|forwards?)$/, async function (world, direction) {
91
+ if (direction === 'back')
92
+ await world.page.goBack();
93
+ else
94
+ await world.page.goForward();
95
+ });
96
+ quickpickle.Then('(I )take (a )screenshot', async function (world, str) {
97
+ await world.page.waitForTimeout(50);
98
+ await world.page.screenshot({ path: `${projectRoot}/screenshots/${world.info.scenario}__${world.info.line}.png`.replace(/\/\//g, '/') });
99
+ });
100
+ quickpickle.Then('(I )take (a )screenshot #{int} in (the folder ){string}', async function (world, dir) {
101
+ await world.page.waitForTimeout(50);
102
+ await world.page.screenshot({ path: `${projectRoot}/${dir}/${world.info.scenario}__${world.info.line}.png`.replace(/\/\//g, '/') });
103
+ });
104
+
105
+ exports.projectRoot = projectRoot;
106
+ //# sourceMappingURL=actions.steps.cjs.map
@@ -0,0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AM,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,CAAA;AACnC,CAAC,CAAC,CAAA;AAEFC,gBAAI,CAAC,yBAAyB,EAAE,gBAAgB,KAAqB,EAAE,GAAU,EAAA;IAC/E,MAAM,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAA;AACnC,IAAA,MAAM,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,CAAG,EAAA,WAAW,CAAgB,aAAA,EAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAA,EAAA,EAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAM,IAAA,CAAA,CAAC,OAAO,CAAC,OAAO,EAAC,GAAG,CAAC,EAAE,CAAC,CAAA;AACzI,CAAC,CAAC,CAAA;AACFA,gBAAI,CAAC,yDAAyD,EAAE,gBAAgB,KAAqB,EAAE,GAAU,EAAA;IAC/G,MAAM,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAA;AACnC,IAAA,MAAM,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,CAAA,CAAA,EAAI,GAAG,CAAA,CAAA,EAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAM,IAAA,CAAA,CAAC,OAAO,CAAC,OAAO,EAAC,GAAG,CAAC,EAAE,CAAC,CAAA;AACpI,CAAC,CAAC;;;;"}
@@ -0,0 +1 @@
1
+ export declare const projectRoot: string;
@@ -0,0 +1,103 @@
1
+ import { Given, When, Then } from 'quickpickle';
2
+ import path from 'node:path';
3
+ import url from 'node:url';
4
+
5
+ const projectRoot = path.resolve(path.dirname(url.fileURLToPath(import.meta.url)), '..');
6
+ Given('I am on {string}', async function (world, path) {
7
+ let url = new URL(path, 'http://localhost:5173');
8
+ await world.page.goto(url.href);
9
+ await world.page.waitForTimeout(80);
10
+ });
11
+ When(`I visit {string}`, async function (world, path) {
12
+ let url = new URL(path, 'http://localhost:5173');
13
+ await world.page.goto(url.href);
14
+ await world.page.waitForTimeout(80);
15
+ });
16
+ When(`I navigate/go to {string}`, async function (world, path) {
17
+ let url = new URL(path, 'http://localhost:5173');
18
+ await world.page.goto(url.href);
19
+ await world.page.waitForTimeout(80);
20
+ });
21
+ When('I click/press/tap/touch (on ){string}', async function (world, identifier) {
22
+ let locator = await world.page.getByText(identifier).or(world.page.locator(identifier));
23
+ await locator.click();
24
+ });
25
+ When('I click/press/tap/touch (on )the {string} {word}', async function (world, identifier, role) {
26
+ let locator = await world.page.getByRole(role, { name: identifier });
27
+ await locator.click();
28
+ });
29
+ When('I focus/select/activate (on ){string}', async function (world, identifier) {
30
+ let locator = await world.page.locator(identifier);
31
+ await locator.focus();
32
+ });
33
+ When('I focus/select/activate (on )the {string} {word}', async function (world, identifier, role) {
34
+ let locator = await world.page.getByRole(role, { name: identifier });
35
+ await locator.focus();
36
+ });
37
+ When("for (the ){string} I enter/fill (in ){string}", async function (world, identifier, text) {
38
+ let locator = await world.page.getByLabel(identifier).or(world.page.getByPlaceholder(identifier)).or(world.page.locator(identifier));
39
+ await locator.fill(text);
40
+ });
41
+ When("for (the ){string} I enter/fill (in )the following( text):", async function (world, identifier, text) {
42
+ let locator = await world.page.getByLabel(identifier).or(await world.page.getByPlaceholder(identifier)).or(await world.page.locator(identifier));
43
+ await locator.fill(text);
44
+ });
45
+ When('I enter/fill (in )the following( fields):', async function (world, table) {
46
+ for (let row of table.raw()) {
47
+ let [identifier, text] = row;
48
+ let locator = await world.page.getByLabel(identifier).or(world.page.getByPlaceholder(identifier)).or(world.page.locator(identifier));
49
+ let tag = await locator.evaluate(e => e.tagName.toLowerCase());
50
+ let type = await locator.getAttribute('type');
51
+ if (tag === 'select') {
52
+ await locator.selectOption(text);
53
+ }
54
+ else if (type === 'checkbox' || type === 'radio') {
55
+ let checked = (['', 'false', 'no', 'unchecked', 'null', 'undefined', '0']).includes(text.toLowerCase()) ? false : true;
56
+ await locator.setChecked(checked);
57
+ }
58
+ else {
59
+ await locator.fill(text);
60
+ }
61
+ }
62
+ });
63
+ When(/^I wait for "([^"]+)" to be (attached|detatched|visible|hidden)$/, async function (world, identifier, state) {
64
+ let locator = await world.page.getByText(identifier).or(world.page.getByLabel(identifier)).or(world.page.locator(identifier));
65
+ await locator.waitFor({ state });
66
+ });
67
+ When(/^I scroll (down|up|left|right)$/, async function (world, direction) {
68
+ let num = 100;
69
+ let horiz = direction.includes('t');
70
+ if (horiz)
71
+ await world.page.mouse.wheel(direction === 'right' ? num : -num, 0);
72
+ await world.page.mouse.wheel(0, direction === 'down' ? num : -num);
73
+ });
74
+ When(/^I scroll (down|up|left|right) (\d*)(?:px| pixels?)$/, async function (world, direction, int) {
75
+ let num = parseInt(int || '100');
76
+ let horiz = direction.includes('t');
77
+ if (horiz)
78
+ await world.page.mouse.wheel(direction === 'right' ? num : -num, 0);
79
+ await world.page.mouse.wheel(0, direction === 'down' ? num : -num);
80
+ });
81
+ When('I type the following keys: {}', async function (world, keys) {
82
+ let keyPresses = keys.split(' ');
83
+ for (let key of keyPresses) {
84
+ await world.page.keyboard.press(key);
85
+ }
86
+ });
87
+ When(/^I go (back|forwards?)$/, async function (world, direction) {
88
+ if (direction === 'back')
89
+ await world.page.goBack();
90
+ else
91
+ await world.page.goForward();
92
+ });
93
+ Then('(I )take (a )screenshot', async function (world, str) {
94
+ await world.page.waitForTimeout(50);
95
+ await world.page.screenshot({ path: `${projectRoot}/screenshots/${world.info.scenario}__${world.info.line}.png`.replace(/\/\//g, '/') });
96
+ });
97
+ Then('(I )take (a )screenshot #{int} in (the folder ){string}', async function (world, dir) {
98
+ await world.page.waitForTimeout(50);
99
+ await world.page.screenshot({ path: `${projectRoot}/${dir}/${world.info.scenario}__${world.info.line}.png`.replace(/\/\//g, '/') });
100
+ });
101
+
102
+ export { projectRoot };
103
+ //# sourceMappingURL=actions.steps.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":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A;AACnC,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,yBAAyB,EAAE,gBAAgB,KAAqB,EAAE,GAAU,EAAA;IAC/E,MAAM,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAA;AACnC,IAAA,MAAM,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,CAAG,EAAA,WAAW,CAAgB,aAAA,EAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAA,EAAA,EAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAM,IAAA,CAAA,CAAC,OAAO,CAAC,OAAO,EAAC,GAAG,CAAC,EAAE,CAAC,CAAA;AACzI,CAAC,CAAC,CAAA;AACF,IAAI,CAAC,yDAAyD,EAAE,gBAAgB,KAAqB,EAAE,GAAU,EAAA;IAC/G,MAAM,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAA;AACnC,IAAA,MAAM,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,CAAA,CAAA,EAAI,GAAG,CAAA,CAAA,EAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAM,IAAA,CAAA,CAAC,OAAO,CAAC,OAAO,EAAC,GAAG,CAAC,EAAE,CAAC,CAAA;AACpI,CAAC,CAAC;;;;"}
@@ -0,0 +1,78 @@
1
+ 'use strict';
2
+
3
+ var quickpickle = require('quickpickle');
4
+ var test = require('@playwright/test');
5
+
6
+ quickpickle.Then('I should see {string}', async function (world, text) {
7
+ await world.page.waitForTimeout(50);
8
+ await test.expect(world.page.getByText(text)).toBeVisible();
9
+ });
10
+ quickpickle.Then('I should not see {string}', async function (world, text) {
11
+ await world.page.waitForTimeout(50);
12
+ await test.expect(world.page.getByText(text)).not.toBeVisible();
13
+ });
14
+ quickpickle.Then('I should see a(n)/the {string} {word}', async function (world, identifier, role) {
15
+ await world.page.waitForTimeout(50);
16
+ if (role === 'element')
17
+ await test.expect(world.page.locator(identifier)).toBeVisible();
18
+ else
19
+ await test.expect(world.page.getByRole(role, { name: identifier })).toBeVisible();
20
+ });
21
+ quickpickle.Then('I should not see a(n)/the {string} {word}', async function (world, identifier, role) {
22
+ await world.page.waitForTimeout(50);
23
+ if (role === 'element')
24
+ await test.expect(world.page.locator(identifier)).not.toBeVisible();
25
+ else
26
+ await test.expect(world.page.getByRole(role, { name: identifier })).not.toBeVisible();
27
+ });
28
+ quickpickle.Then('I should see a(n)/the {string} with the text {string}', async function (world, identifier, text) {
29
+ await world.page.waitForTimeout(50);
30
+ await test.expect(world.page.locator(identifier).filter({ hasText: text })).toBeVisible();
31
+ });
32
+ quickpickle.Then('I should not see a(n)/the {string} with the text {string}', async function (world, identifier, text) {
33
+ await world.page.waitForTimeout(50);
34
+ await test.expect(world.page.locator(identifier).filter({ hasText: text })).not.toBeVisible();
35
+ });
36
+ quickpickle.Then('the (value of ){string} (value )should contain/include/be/equal {string}', async function (world, identifier, val) {
37
+ let exact = world.info.step?.match(/should not (?:be|equal) ["']/) ? true : false;
38
+ await world.page.waitForTimeout(50);
39
+ let value = await (await world.page.locator(identifier)).inputValue();
40
+ if (exact)
41
+ await test.expect(value).toEqual(val);
42
+ else
43
+ await test.expect(value).toContain(val);
44
+ });
45
+ quickpickle.Then('the (value of ){string} (value )should not contain/include/be/equal {string}', async function (world, identifier, val) {
46
+ let exact = world.info.step?.match(/should not (?:be|equal) ["']/) ? true : false;
47
+ await world.page.waitForTimeout(50);
48
+ let value = await (await world.page.locator(identifier)).inputValue();
49
+ if (exact)
50
+ await test.expect(value).not.toEqual(val);
51
+ else
52
+ await test.expect(value).not.toContain(val);
53
+ });
54
+ quickpickle.Then(/^the metatag for "([^"]+)" should (be|equal|contain) "(.*)"$/, async function (world, name, eq, value) {
55
+ await world.page.waitForTimeout(50);
56
+ let val;
57
+ if (name === 'title')
58
+ val = await world.page.title();
59
+ else
60
+ val = await (await world.page.locator(`meta[name="${name}"]`)).getAttribute('content');
61
+ if (value === "")
62
+ await test.expect(val).toBeNull();
63
+ else if (eq === 'contain')
64
+ await test.expect(val).toContain(value);
65
+ else
66
+ await test.expect(val).toBe(value);
67
+ });
68
+ quickpickle.Then('the active element should be {string}', async function (world, identifier) {
69
+ await world.page.waitForTimeout(50);
70
+ let locator = await world.page.locator(identifier);
71
+ await test.expect(locator).toBeFocused();
72
+ });
73
+ quickpickle.Then('the active element should be the {string} {word}', async function (world, identifier, role) {
74
+ await world.page.waitForTimeout(50);
75
+ let locator = await world.page.getByRole(role, { name: identifier });
76
+ await test.expect(locator).toBeFocused();
77
+ });
78
+ //# 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":";;;;;AAIAA,gBAAI,CAAC,uBAAuB,EAAE,gBAAgB,KAAqB,EAAE,IAAI,EAAA;IACvE,MAAM,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAA;AACnC,IAAA,MAAMC,WAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA;AACxD,CAAC,CAAC,CAAA;AACFD,gBAAI,CAAC,2BAA2B,EAAE,gBAAgB,KAAqB,EAAE,IAAI,EAAA;IAC3E,MAAM,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAA;AACnC,IAAA,MAAMC,WAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,CAAA;AAC5D,CAAC,CAAC,CAAA;AAEFD,gBAAI,CAAC,uCAAuC,EAAE,gBAAgB,KAAqB,EAAE,UAAU,EAAE,IAAI,EAAA;IACnG,MAAM,KAAK,CAAC,IAAI,CAAC,cAAc,CAA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AAA;AAEFD,gBAAI,CAAC,kDAAkD,EAAE,gBAAgB,KAAqB,EAAE,UAAU,EAAE,IAAI,EAAA;IAC9G,MAAM,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAA;AACnC,IAAA,IAAI,OAAO,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAA;AACpE,IAAA,MAAMC,WAAM,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAA;AACrC,CAAC,CAAC;;"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,76 @@
1
+ import { Then } from 'quickpickle';
2
+ import { expect } from '@playwright/test';
3
+
4
+ Then('I should see {string}', async function (world, text) {
5
+ await world.page.waitForTimeout(50);
6
+ await expect(world.page.getByText(text)).toBeVisible();
7
+ });
8
+ Then('I should not see {string}', async function (world, text) {
9
+ await world.page.waitForTimeout(50);
10
+ await expect(world.page.getByText(text)).not.toBeVisible();
11
+ });
12
+ Then('I should see a(n)/the {string} {word}', async function (world, identifier, role) {
13
+ await world.page.waitForTimeout(50);
14
+ if (role === 'element')
15
+ await expect(world.page.locator(identifier)).toBeVisible();
16
+ else
17
+ await expect(world.page.getByRole(role, { name: identifier })).toBeVisible();
18
+ });
19
+ Then('I should not see a(n)/the {string} {word}', async function (world, identifier, role) {
20
+ await world.page.waitForTimeout(50);
21
+ if (role === 'element')
22
+ await expect(world.page.locator(identifier)).not.toBeVisible();
23
+ else
24
+ await expect(world.page.getByRole(role, { name: identifier })).not.toBeVisible();
25
+ });
26
+ Then('I should see a(n)/the {string} with the text {string}', async function (world, identifier, text) {
27
+ await world.page.waitForTimeout(50);
28
+ await expect(world.page.locator(identifier).filter({ hasText: text })).toBeVisible();
29
+ });
30
+ Then('I should not see a(n)/the {string} with the text {string}', async function (world, identifier, text) {
31
+ await world.page.waitForTimeout(50);
32
+ await expect(world.page.locator(identifier).filter({ hasText: text })).not.toBeVisible();
33
+ });
34
+ Then('the (value of ){string} (value )should contain/include/be/equal {string}', async function (world, identifier, val) {
35
+ let exact = world.info.step?.match(/should not (?:be|equal) ["']/) ? true : false;
36
+ await world.page.waitForTimeout(50);
37
+ let value = await (await world.page.locator(identifier)).inputValue();
38
+ if (exact)
39
+ await expect(value).toEqual(val);
40
+ else
41
+ await expect(value).toContain(val);
42
+ });
43
+ Then('the (value of ){string} (value )should not contain/include/be/equal {string}', async function (world, identifier, val) {
44
+ let exact = world.info.step?.match(/should not (?:be|equal) ["']/) ? true : false;
45
+ await world.page.waitForTimeout(50);
46
+ let value = await (await world.page.locator(identifier)).inputValue();
47
+ if (exact)
48
+ await expect(value).not.toEqual(val);
49
+ else
50
+ await expect(value).not.toContain(val);
51
+ });
52
+ Then(/^the metatag for "([^"]+)" should (be|equal|contain) "(.*)"$/, async function (world, name, eq, value) {
53
+ await world.page.waitForTimeout(50);
54
+ let val;
55
+ if (name === 'title')
56
+ val = await world.page.title();
57
+ else
58
+ val = await (await world.page.locator(`meta[name="${name}"]`)).getAttribute('content');
59
+ if (value === "")
60
+ await expect(val).toBeNull();
61
+ else if (eq === 'contain')
62
+ await expect(val).toContain(value);
63
+ else
64
+ await expect(val).toBe(value);
65
+ });
66
+ Then('the active element should be {string}', async function (world, identifier) {
67
+ await world.page.waitForTimeout(50);
68
+ let locator = await world.page.locator(identifier);
69
+ await expect(locator).toBeFocused();
70
+ });
71
+ Then('the active element should be the {string} {word}', async function (world, identifier, role) {
72
+ await world.page.waitForTimeout(50);
73
+ let locator = await world.page.getByRole(role, { name: identifier });
74
+ await expect(locator).toBeFocused();
75
+ });
76
+ //# sourceMappingURL=outcomes.steps.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outcomes.steps.esm.js","sources":["../src/outcomes.steps.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAIA,IAAI,CAAC,uBAAuB,EAAE,gBAAgB,KAAqB,EAAE,IAAI,EAAA;IACvE,M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,MAAM,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAA;SACzC,IAAI,EAAE,KAAK,SAAS;QAAE,MAAM,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;;QACxD,MAAM,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AACpC,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,uCAAuC,EAAE,gBAAgB,KAAqB,EAAE,UAAU,EAAA;IAC7F,MAAM,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAA;IACnC,IAAI,OAAO,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;AAClD,IAAA,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAA;AACrC,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,kDAAkD,EAAE,gBAAgB,KAAqB,EAAE,UAAU,EAAE,IAAI,EAAA;IAC9G,MAAM,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAA;AACnC,IAAA,IAAI,OAAO,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAA;AACpE,IAAA,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAA;AACrC,CAAC,CAAC"}
package/dist/world.cjs ADDED
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var quickpickle = require('quickpickle');
4
+ var PlaywrightWorld = require('./PlaywrightWorld.cjs');
5
+ require('playwright');
6
+ require('lodash-es');
7
+
8
+ quickpickle.setWorldConstructor(PlaywrightWorld.PlaywrightWorld);
9
+ //# sourceMappingURL=world.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"world.cjs","sources":["../src/world.ts"],"sourcesContent":[null],"names":["setWorldConstructor","PlaywrightWorld"],"mappings":";;;;;;;AAGAA,+BAAmB,CAACC,+BAAe,CAAC;;"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import { setWorldConstructor } from 'quickpickle';
2
+ import { PlaywrightWorld } from './PlaywrightWorld.esm.js';
3
+ import 'playwright';
4
+ import 'lodash-es';
5
+
6
+ setWorldConstructor(PlaywrightWorld);
7
+ //# sourceMappingURL=world.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"world.esm.js","sources":["../src/world.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAGA,mBAAmB,CAAC,eAAe,CAAC"}
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "@quickpickle/playwright",
3
+ "version": "0.9.1",
4
+ "description": "Support files for running tests with Playwright using QuickPickle (Gherkin in Vitest).",
5
+ "keywords": [
6
+ "BDD",
7
+ "testing",
8
+ "behavioral",
9
+ "cucumber",
10
+ "gherkin",
11
+ "vitest",
12
+ "playwright",
13
+ "react",
14
+ "svelte",
15
+ "vue",
16
+ "angular"
17
+ ],
18
+ "homepage": "https://github.com/dnotes/quickpickle#readme",
19
+ "bugs": {
20
+ "url": "https://github.com/dnotes/quickpickle/issues"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://github.com/dnotes/quickpickle.git"
25
+ },
26
+ "license": "MIT",
27
+ "type": "module",
28
+ "main": "./dist/PlaywrightWorld.cjs",
29
+ "module": "./dist/PlaywrightWorld.esm.js",
30
+ "types": "./dist/PlaywrightWorld.d.ts",
31
+ "exports": {
32
+ ".": {
33
+ "require": "./dist/world.cjs",
34
+ "import": "./dist/world.esm.js",
35
+ "types": "./dist/world.d.ts"
36
+ },
37
+ "./actions": {
38
+ "require": "./dist/actions.steps.cjs",
39
+ "import": "./dist/actions.steps.esm.js",
40
+ "types": "./dist/actions.steps.d.ts"
41
+ },
42
+ "./outcomes": {
43
+ "require": "./dist/outcomes.steps.cjs",
44
+ "import": "./dist/outcomes.steps.esm.js",
45
+ "types": "./dist/outcomes.steps.d.ts"
46
+ }
47
+ },
48
+ "files": [
49
+ "dist"
50
+ ],
51
+ "author": "David Hunt",
52
+ "dependencies": {
53
+ "@playwright/test": "^1.48.0",
54
+ "lodash-es": "^4.17.21",
55
+ "playwright": "^1.48.0",
56
+ "vite": "^5.0.11",
57
+ "quickpickle": "^1.2.0"
58
+ },
59
+ "devDependencies": {
60
+ "@rollup/plugin-replace": "^6.0.1",
61
+ "@rollup/plugin-typescript": "^12.1.0",
62
+ "@types/lodash-es": "^4.17.12",
63
+ "fast-glob": "^3.3.2",
64
+ "rollup": "^3.20.7",
65
+ "typescript": "^5.6.2",
66
+ "vitest": "^2.1.2"
67
+ },
68
+ "scripts": {
69
+ "build": "rollup -c",
70
+ "type-check": "tsc --noEmit",
71
+ "test:watch": "vitest",
72
+ "test": "vitest --run"
73
+ }
74
+ }