@molecule/app-e2e-playwright 1.0.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/LICENSE +115 -0
- package/README.md +26 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/provider.d.ts +14 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +54 -0
- package/dist/provider.js.map +1 -0
- package/dist/types.d.ts +19 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/package.json +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work.
|
|
38
|
+
|
|
39
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
40
|
+
form, that is based on (or derived from) the Work and for which the
|
|
41
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
42
|
+
represent, as a whole, an original work of authorship.
|
|
43
|
+
|
|
44
|
+
"Contribution" shall mean any work of authorship, including the
|
|
45
|
+
original version of the Work and any modifications or additions
|
|
46
|
+
to that Work, that is intentionally submitted to the Licensor for
|
|
47
|
+
inclusion in the Work by the copyright owner or by an individual or
|
|
48
|
+
Legal Entity authorized to submit on behalf of the copyright owner.
|
|
49
|
+
|
|
50
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
51
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
52
|
+
subsequently incorporated within the Work.
|
|
53
|
+
|
|
54
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
55
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
56
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
57
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
58
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
59
|
+
Work and such Derivative Works in Source or Object form.
|
|
60
|
+
|
|
61
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
62
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
63
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
64
|
+
patent license to make, have made, use, offer to sell, sell, import,
|
|
65
|
+
and otherwise transfer the Work.
|
|
66
|
+
|
|
67
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
68
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
69
|
+
modifications, and in Source or Object form, provided that You
|
|
70
|
+
meet the following conditions:
|
|
71
|
+
|
|
72
|
+
(a) You must give any other recipients of the Work or
|
|
73
|
+
Derivative Works a copy of this License; and
|
|
74
|
+
|
|
75
|
+
(b) You must cause any modified files to carry prominent notices
|
|
76
|
+
stating that You changed the files; and
|
|
77
|
+
|
|
78
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
79
|
+
that You distribute, all copyright, patent, trademark, and
|
|
80
|
+
attribution notices from the Source form of the Work,
|
|
81
|
+
excluding those notices that do not pertain to any part of
|
|
82
|
+
the Derivative Works; and
|
|
83
|
+
|
|
84
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
85
|
+
distribution, then any Derivative Works that You distribute must
|
|
86
|
+
include a readable copy of the attribution notices contained
|
|
87
|
+
within such NOTICE file.
|
|
88
|
+
|
|
89
|
+
5. Submission of Contributions.
|
|
90
|
+
|
|
91
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
92
|
+
names, trademarks, service marks, or product names of the Licensor.
|
|
93
|
+
|
|
94
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
95
|
+
agreed to in writing, Licensor provides the Work on an "AS IS" BASIS,
|
|
96
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND.
|
|
97
|
+
|
|
98
|
+
8. Limitation of Liability. In no event and under no legal theory shall
|
|
99
|
+
any Contributor be liable to You for damages.
|
|
100
|
+
|
|
101
|
+
9. Accepting Warranty or Additional Liability.
|
|
102
|
+
|
|
103
|
+
Copyright 2026 Molecule Dev, Inc.
|
|
104
|
+
|
|
105
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
106
|
+
you may not use this file except in compliance with the License.
|
|
107
|
+
You may obtain a copy of the License at
|
|
108
|
+
|
|
109
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
110
|
+
|
|
111
|
+
Unless required by applicable law or agreed to in writing, software
|
|
112
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
113
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
114
|
+
See the License for the specific language governing permissions and
|
|
115
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# @molecule/app-e2e-playwright
|
|
2
|
+
|
|
3
|
+
Real Playwright browsers for the e2e bond — the user's machine and CI
|
|
4
|
+
|
|
5
|
+
## Type
|
|
6
|
+
|
|
7
|
+
`provider`
|
|
8
|
+
|
|
9
|
+
## Implements
|
|
10
|
+
|
|
11
|
+
`@molecule/app-e2e`
|
|
12
|
+
|
|
13
|
+
## Injection Notes
|
|
14
|
+
|
|
15
|
+
### Requirements
|
|
16
|
+
|
|
17
|
+
- None
|
|
18
|
+
|
|
19
|
+
### Post-Injection Steps
|
|
20
|
+
|
|
21
|
+
- Run `npm install` to install dependencies
|
|
22
|
+
- Run `npm run build` to compile
|
|
23
|
+
|
|
24
|
+
### Known Limitations
|
|
25
|
+
|
|
26
|
+
- None yet
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* E2E bond that opens real Playwright browsers. Inside a molecule sandbox the
|
|
3
|
+
* same specs drive the live preview through `@molecule/app-e2e-preview`; on
|
|
4
|
+
* your own machine and in CI this bond gives them Chromium, Firefox or WebKit
|
|
5
|
+
* with everything Playwright offers — screenshots, traces, videos, network
|
|
6
|
+
* interception.
|
|
7
|
+
*
|
|
8
|
+
* When the test runner picks the `playwright` provider, `@molecule/app-e2e`'s
|
|
9
|
+
* `test` IS Playwright's `test`, so this bond is only reached by scripts that
|
|
10
|
+
* call `connect()` themselves (a measurement script, a smoke check outside the
|
|
11
|
+
* runner). Under `npx playwright test`, Playwright's own fixtures launch the
|
|
12
|
+
* browser as usual.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* // e2e/bonds.ts (scaffolded)
|
|
17
|
+
* import { resolveE2EProviderName, setProvider } from '@molecule/app-e2e'
|
|
18
|
+
* import { provider as playwright } from '@molecule/app-e2e-playwright'
|
|
19
|
+
* import { provider as preview } from '@molecule/app-e2e-preview'
|
|
20
|
+
*
|
|
21
|
+
* setProvider(resolveE2EProviderName() === 'preview' ? preview : playwright)
|
|
22
|
+
*
|
|
23
|
+
* // a script
|
|
24
|
+
* import { connectPlaywright } from '@molecule/app-e2e-playwright'
|
|
25
|
+
* const page = await connectPlaywright({ baseURL: 'http://localhost:3000', viewport: { width: 390, height: 844 } })
|
|
26
|
+
* await page.goto('/')
|
|
27
|
+
* await page.screenshot({ path: 'home-phone.png' })
|
|
28
|
+
* await page.close() // closes the context and the browser too
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* - Browsers are installed once with `npx playwright install chromium`
|
|
33
|
+
* (`@playwright/test` never downloads them on `npm install`). The launch
|
|
34
|
+
* error says so when they are missing.
|
|
35
|
+
* - `MOL_E2E_BROWSER=firefox|webkit` picks the engine; `MOL_E2E_HEADED=1`
|
|
36
|
+
* shows the window.
|
|
37
|
+
* - Do not use this bond inside a molecule sandbox: there is no browser there
|
|
38
|
+
* by design, and the preview bond is the one that works.
|
|
39
|
+
*
|
|
40
|
+
* @module
|
|
41
|
+
*/
|
|
42
|
+
export { connectPlaywright, provider } from './provider.js';
|
|
43
|
+
export * from './types.js';
|
|
44
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC3D,cAAc,YAAY,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* E2E bond that opens real Playwright browsers. Inside a molecule sandbox the
|
|
3
|
+
* same specs drive the live preview through `@molecule/app-e2e-preview`; on
|
|
4
|
+
* your own machine and in CI this bond gives them Chromium, Firefox or WebKit
|
|
5
|
+
* with everything Playwright offers — screenshots, traces, videos, network
|
|
6
|
+
* interception.
|
|
7
|
+
*
|
|
8
|
+
* When the test runner picks the `playwright` provider, `@molecule/app-e2e`'s
|
|
9
|
+
* `test` IS Playwright's `test`, so this bond is only reached by scripts that
|
|
10
|
+
* call `connect()` themselves (a measurement script, a smoke check outside the
|
|
11
|
+
* runner). Under `npx playwright test`, Playwright's own fixtures launch the
|
|
12
|
+
* browser as usual.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* // e2e/bonds.ts (scaffolded)
|
|
17
|
+
* import { resolveE2EProviderName, setProvider } from '@molecule/app-e2e'
|
|
18
|
+
* import { provider as playwright } from '@molecule/app-e2e-playwright'
|
|
19
|
+
* import { provider as preview } from '@molecule/app-e2e-preview'
|
|
20
|
+
*
|
|
21
|
+
* setProvider(resolveE2EProviderName() === 'preview' ? preview : playwright)
|
|
22
|
+
*
|
|
23
|
+
* // a script
|
|
24
|
+
* import { connectPlaywright } from '@molecule/app-e2e-playwright'
|
|
25
|
+
* const page = await connectPlaywright({ baseURL: 'http://localhost:3000', viewport: { width: 390, height: 844 } })
|
|
26
|
+
* await page.goto('/')
|
|
27
|
+
* await page.screenshot({ path: 'home-phone.png' })
|
|
28
|
+
* await page.close() // closes the context and the browser too
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* - Browsers are installed once with `npx playwright install chromium`
|
|
33
|
+
* (`@playwright/test` never downloads them on `npm install`). The launch
|
|
34
|
+
* error says so when they are missing.
|
|
35
|
+
* - `MOL_E2E_BROWSER=firefox|webkit` picks the engine; `MOL_E2E_HEADED=1`
|
|
36
|
+
* shows the window.
|
|
37
|
+
* - Do not use this bond inside a molecule sandbox: there is no browser there
|
|
38
|
+
* by design, and the preview bond is the one that works.
|
|
39
|
+
*
|
|
40
|
+
* @module
|
|
41
|
+
*/
|
|
42
|
+
export { connectPlaywright, provider } from './provider.js';
|
|
43
|
+
export * from './types.js';
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC3D,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bond: launches a real browser and returns its `Page`. Closing that page
|
|
3
|
+
* also closes the context and the browser opened for it.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import { type Page } from '@playwright/test';
|
|
8
|
+
import type { E2EProvider } from '@molecule/app-e2e';
|
|
9
|
+
import type { PlaywrightConnectOptions } from './types.js';
|
|
10
|
+
/** The bond: `setProvider(provider)` in your `e2e/bonds.ts`. */
|
|
11
|
+
export declare const provider: E2EProvider;
|
|
12
|
+
/** Open a real browser page from any script. */
|
|
13
|
+
export declare const connectPlaywright: (options?: PlaywrightConnectOptions) => Promise<Page>;
|
|
14
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAqB,KAAK,IAAI,EAAU,MAAM,kBAAkB,CAAA;AAEvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEpD,OAAO,KAAK,EAAyB,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAcjF,gEAAgE;AAChE,eAAO,MAAM,QAAQ,EAAE,WAgCtB,CAAA;AAED,gDAAgD;AAChD,eAAO,MAAM,iBAAiB,GAAI,UAAS,wBAA6B,KAAG,OAAO,CAAC,IAAI,CAC5D,CAAA"}
|
package/dist/provider.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bond: launches a real browser and returns its `Page`. Closing that page
|
|
3
|
+
* also closes the context and the browser opened for it.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import process from 'node:process';
|
|
8
|
+
import { chromium, firefox, webkit } from '@playwright/test';
|
|
9
|
+
const BROWSERS = { chromium, firefox, webkit };
|
|
10
|
+
const browserName = (options) => {
|
|
11
|
+
const name = options.browser ??
|
|
12
|
+
process.env['MOL_E2E_BROWSER'] ??
|
|
13
|
+
'chromium';
|
|
14
|
+
if (!(name in BROWSERS))
|
|
15
|
+
throw new Error(`unknown browser "${name}" — use chromium, firefox or webkit`);
|
|
16
|
+
return name;
|
|
17
|
+
};
|
|
18
|
+
/** The bond: `setProvider(provider)` in your `e2e/bonds.ts`. */
|
|
19
|
+
export const provider = {
|
|
20
|
+
name: 'playwright',
|
|
21
|
+
async connect(options = {}) {
|
|
22
|
+
const headless = !(options.headed ?? process.env['MOL_E2E_HEADED'] === '1');
|
|
23
|
+
let browser;
|
|
24
|
+
try {
|
|
25
|
+
browser = await BROWSERS[browserName(options)].launch({ headless, ...options.launchOptions });
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
const message = String(error.message ?? error);
|
|
29
|
+
if (/Executable doesn't exist|browserType\.launch/.test(message)) {
|
|
30
|
+
throw new Error(`${message}\n\nInstall the browsers once with: npx playwright install ${browserName(options)}\n(inside a molecule sandbox use @molecule/app-e2e-preview instead — it drives the live preview and needs no browser).`, { cause: error });
|
|
31
|
+
}
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
const context = await browser.newContext({
|
|
35
|
+
...(options.baseURL ? { baseURL: options.baseURL } : {}),
|
|
36
|
+
...(options.viewport === undefined ? {} : { viewport: options.viewport }),
|
|
37
|
+
});
|
|
38
|
+
if (options.timeout)
|
|
39
|
+
context.setDefaultTimeout(options.timeout);
|
|
40
|
+
if (options.navigationTimeout)
|
|
41
|
+
context.setDefaultNavigationTimeout(options.navigationTimeout);
|
|
42
|
+
const page = await context.newPage();
|
|
43
|
+
const closePage = page.close.bind(page);
|
|
44
|
+
page.close = async (closeOptions) => {
|
|
45
|
+
await closePage(closeOptions).catch(() => undefined);
|
|
46
|
+
await context.close().catch(() => undefined);
|
|
47
|
+
await browser.close().catch(() => undefined);
|
|
48
|
+
};
|
|
49
|
+
return page;
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
/** Open a real browser page from any script. */
|
|
53
|
+
export const connectPlaywright = (options = {}) => provider.connect(options);
|
|
54
|
+
//# sourceMappingURL=provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"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"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for opening a real Playwright browser through the bond.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type { LaunchOptions } from '@playwright/test';
|
|
7
|
+
import type { E2EConnectOptions } from '@molecule/app-e2e';
|
|
8
|
+
/** Which Playwright browser to launch. */
|
|
9
|
+
export type PlaywrightBrowserName = 'chromium' | 'firefox' | 'webkit';
|
|
10
|
+
/** Options for `provider.connect()` beyond the core's. */
|
|
11
|
+
export interface PlaywrightConnectOptions extends E2EConnectOptions {
|
|
12
|
+
/** Browser to launch; default `chromium` (also `MOL_E2E_BROWSER`). */
|
|
13
|
+
browser?: PlaywrightBrowserName;
|
|
14
|
+
/** Show the browser window; default headless (also `MOL_E2E_HEADED=1`). */
|
|
15
|
+
headed?: boolean;
|
|
16
|
+
/** Extra launch options passed through to Playwright. */
|
|
17
|
+
launchOptions?: LaunchOptions;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAErD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE1D,0CAA0C;AAC1C,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAA;AAErE,0DAA0D;AAC1D,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB;IACjE,sEAAsE;IACtE,OAAO,CAAC,EAAE,qBAAqB,CAAA;IAC/B,2EAA2E;IAC3E,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,yDAAyD;IACzD,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@molecule/app-e2e-playwright",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "E2E bond that opens real Playwright browsers — the same specs that drive the live preview inside a molecule sandbox run here on your machine and in CI, with screenshots, traces and network interception.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"test": "vitest run",
|
|
11
|
+
"test:watch": "vitest"
|
|
12
|
+
},
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"README.md"
|
|
22
|
+
],
|
|
23
|
+
"keywords": [
|
|
24
|
+
"molecule",
|
|
25
|
+
"e2e",
|
|
26
|
+
"playwright",
|
|
27
|
+
"browser"
|
|
28
|
+
],
|
|
29
|
+
"license": "Apache-2.0",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/molecule-dev/molecule.git",
|
|
33
|
+
"directory": "packages/app/bonds/e2e/playwright"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://molecule.dev",
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/molecule-dev/molecule/issues"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"@molecule/app-bond": "^1.0.1",
|
|
44
|
+
"@molecule/app-e2e": "^1.0.0",
|
|
45
|
+
"@playwright/test": "^1.40.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@molecule/app-bond": "1.0.1",
|
|
49
|
+
"@molecule/app-e2e": "1.0.0",
|
|
50
|
+
"@playwright/test": "1.62.0",
|
|
51
|
+
"@types/node": "26.1.2",
|
|
52
|
+
"typescript": "6.0.3",
|
|
53
|
+
"vitest": "4.1.11"
|
|
54
|
+
}
|
|
55
|
+
}
|