shiplightai 0.1.76 → 0.1.78
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/cjs/debugger-pw.cjs +80 -80
- package/dist/cjs/fixture.cjs +88 -88
- package/dist/cjs/index.cjs +75 -75
- package/dist/cjs/reporter.cjs +2 -2
- package/dist/cli.js +6 -6
- package/dist/debugger-pw.js +80 -80
- package/dist/fixture.d.ts +12 -7
- package/dist/fixture.js +88 -88
- package/dist/index.js +75 -75
- package/dist/reporter.js +2 -2
- package/package.json +4 -4
package/dist/fixture.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as _playwright_test from '@playwright/test';
|
|
2
|
+
import { Browser } from '@playwright/test';
|
|
2
3
|
export { expect } from '@playwright/test';
|
|
3
4
|
import { VariableStore } from './VariableStore.js';
|
|
4
5
|
import { WebAgent } from './agent/webAgent.js';
|
|
@@ -9,8 +10,9 @@ import './config.js';
|
|
|
9
10
|
/**
|
|
10
11
|
* Per-test auth: path to a login script + optional args passed to the login function.
|
|
11
12
|
* The auth path is resolved relative to process.cwd() (the project root where `playwright test` runs).
|
|
12
|
-
* The login module must export a login(args) function that
|
|
13
|
-
*
|
|
13
|
+
* The login module must export a login(args, browser?) function that performs the
|
|
14
|
+
* login flow, caches the storageState, and returns the file path. The fixture passes
|
|
15
|
+
* its shared browser instance — the login function must NOT close it, only its context.
|
|
14
16
|
*
|
|
15
17
|
* Usage in playwright.config.ts:
|
|
16
18
|
* use: {
|
|
@@ -23,15 +25,18 @@ interface AuthSpec {
|
|
|
23
25
|
args?: Record<string, unknown>;
|
|
24
26
|
}
|
|
25
27
|
/**
|
|
26
|
-
* Calls the auth module's login(args) function.
|
|
27
|
-
* The login function is responsible for
|
|
28
|
-
*
|
|
29
|
-
*
|
|
28
|
+
* Calls the auth module's login(args, browser) function.
|
|
29
|
+
* The login function is responsible for performing the login flow,
|
|
30
|
+
* caching/expiring storageState, and returning the path to a storageState JSON file.
|
|
31
|
+
*
|
|
32
|
+
* The browser instance is passed so the login script can create a context on the
|
|
33
|
+
* shared browser process instead of launching its own — cheaper when many accounts
|
|
34
|
+
* log in concurrently. The login script must NOT close the browser, only its context.
|
|
30
35
|
*
|
|
31
36
|
* The module is cached by Node's module system after the first import,
|
|
32
37
|
* so multiple tests sharing the same auth path reuse the same instance.
|
|
33
38
|
*/
|
|
34
|
-
declare function resolveAuthState(spec: AuthSpec): Promise<string>;
|
|
39
|
+
declare function resolveAuthState(spec: AuthSpec, browser?: Browser): Promise<string>;
|
|
35
40
|
/**
|
|
36
41
|
* Standard Playwright context-option `use:` keys whose resolved (per-test aware)
|
|
37
42
|
* values we overlay onto `testInfo.project.use`. Must stay identical to the
|