Update npm packages (73 packages including @jqhtml 2.3.36)
Update npm registry domain from privatenpm.hanson.xyz to npm.internal.hanson.xyz 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
62
node_modules/playwright/lib/index.js
generated
vendored
62
node_modules/playwright/lib/index.js
generated
vendored
@@ -138,6 +138,7 @@ const playwrightFixtures = {
|
||||
}, { option: true, box: true }],
|
||||
serviceWorkers: [({ contextOptions }, use) => use(contextOptions.serviceWorkers ?? "allow"), { option: true, box: true }],
|
||||
contextOptions: [{}, { option: true, box: true }],
|
||||
agentOptions: [void 0, { option: true, box: true }],
|
||||
_combinedContextOptions: [async ({
|
||||
acceptDownloads,
|
||||
bypassCSP,
|
||||
@@ -162,7 +163,7 @@ const playwrightFixtures = {
|
||||
baseURL,
|
||||
contextOptions,
|
||||
serviceWorkers
|
||||
}, use) => {
|
||||
}, use, testInfo) => {
|
||||
const options = {};
|
||||
if (acceptDownloads !== void 0)
|
||||
options.acceptDownloads = acceptDownloads;
|
||||
@@ -213,21 +214,19 @@ const playwrightFixtures = {
|
||||
...options
|
||||
});
|
||||
}, { box: true }],
|
||||
_setupContextOptions: [async ({ playwright, _combinedContextOptions, actionTimeout, navigationTimeout, testIdAttribute }, use, testInfo) => {
|
||||
_setupContextOptions: [async ({ playwright, actionTimeout, navigationTimeout, testIdAttribute }, use, testInfo) => {
|
||||
if (testIdAttribute)
|
||||
playwrightLibrary.selectors.setTestIdAttribute(testIdAttribute);
|
||||
testInfo.snapshotSuffix = process.platform;
|
||||
if ((0, import_utils.debugMode)() === "inspector")
|
||||
testInfo._setDebugMode();
|
||||
playwright._defaultContextOptions = _combinedContextOptions;
|
||||
playwright._defaultContextTimeout = actionTimeout || 0;
|
||||
playwright._defaultContextNavigationTimeout = navigationTimeout || 0;
|
||||
await use();
|
||||
playwright._defaultContextOptions = void 0;
|
||||
playwright._defaultContextTimeout = void 0;
|
||||
playwright._defaultContextNavigationTimeout = void 0;
|
||||
}, { auto: "all-hooks-included", title: "context configuration", box: true }],
|
||||
_setupArtifacts: [async ({ playwright, screenshot }, use, testInfo) => {
|
||||
_setupArtifacts: [async ({ playwright, screenshot, _combinedContextOptions }, use, testInfo) => {
|
||||
testInfo.setTimeout(testInfo.project.timeout);
|
||||
const artifactsRecorder = new ArtifactsRecorder(playwright, tracing().artifactsDir(), screenshot);
|
||||
await artifactsRecorder.willStartTest(testInfo);
|
||||
@@ -275,20 +274,32 @@ const playwrightFixtures = {
|
||||
if (!keepTestTimeout)
|
||||
(0, import_globals.currentTestInfo)()?._setDebugMode();
|
||||
},
|
||||
runBeforeCreateBrowserContext: async (options) => {
|
||||
for (const [key, value] of Object.entries(_combinedContextOptions)) {
|
||||
if (!(key in options))
|
||||
options[key] = value;
|
||||
}
|
||||
},
|
||||
runBeforeCreateRequestContext: async (options) => {
|
||||
for (const [key, value] of Object.entries(_combinedContextOptions)) {
|
||||
if (!(key in options))
|
||||
options[key] = value;
|
||||
}
|
||||
},
|
||||
runAfterCreateBrowserContext: async (context) => {
|
||||
await artifactsRecorder?.didCreateBrowserContext(context);
|
||||
await artifactsRecorder.didCreateBrowserContext(context);
|
||||
const testInfo2 = (0, import_globals.currentTestInfo)();
|
||||
if (testInfo2)
|
||||
attachConnectedHeaderIfNeeded(testInfo2, context.browser());
|
||||
},
|
||||
runAfterCreateRequestContext: async (context) => {
|
||||
await artifactsRecorder?.didCreateRequestContext(context);
|
||||
await artifactsRecorder.didCreateRequestContext(context);
|
||||
},
|
||||
runBeforeCloseBrowserContext: async (context) => {
|
||||
await artifactsRecorder?.willCloseBrowserContext(context);
|
||||
await artifactsRecorder.willCloseBrowserContext(context);
|
||||
},
|
||||
runBeforeCloseRequestContext: async (context) => {
|
||||
await artifactsRecorder?.willCloseRequestContext(context);
|
||||
await artifactsRecorder.willCloseRequestContext(context);
|
||||
}
|
||||
};
|
||||
const clientInstrumentation = playwright._instrumentation;
|
||||
@@ -401,6 +412,39 @@ const playwrightFixtures = {
|
||||
page = await context.newPage();
|
||||
await use(page);
|
||||
},
|
||||
agent: async ({ page, agentOptions }, use, testInfo) => {
|
||||
const testInfoImpl = testInfo;
|
||||
const cachePathTemplate = agentOptions?.cachePathTemplate ?? "{testDir}/{testFilePath}-cache.json";
|
||||
const resolvedCacheFile = testInfoImpl._applyPathTemplate(cachePathTemplate, "", ".json");
|
||||
const cacheFile = testInfoImpl.config.runAgents === "all" ? void 0 : await testInfoImpl._cloneStorage(resolvedCacheFile);
|
||||
const cacheOutFile = import_path.default.join(testInfoImpl.artifactsDir(), "agent-cache-" + (0, import_utils.createGuid)() + ".json");
|
||||
const provider = agentOptions?.provider && testInfo.config.runAgents !== "none" ? agentOptions.provider : void 0;
|
||||
if (provider)
|
||||
testInfo.setTimeout(0);
|
||||
const cache = {
|
||||
cacheFile,
|
||||
cacheOutFile
|
||||
};
|
||||
const agent = await page.agent({
|
||||
provider,
|
||||
cache,
|
||||
limits: agentOptions?.limits,
|
||||
secrets: agentOptions?.secrets,
|
||||
systemPrompt: agentOptions?.systemPrompt,
|
||||
expect: {
|
||||
timeout: testInfoImpl._projectInternal.expect?.timeout
|
||||
}
|
||||
});
|
||||
await use(agent);
|
||||
const usage = await agent.usage();
|
||||
if (usage.turns > 0)
|
||||
await testInfoImpl.attach("agent-usage", { contentType: "application/json", body: Buffer.from(JSON.stringify(usage, null, 2)) });
|
||||
if (!resolvedCacheFile || !cacheOutFile)
|
||||
return;
|
||||
if (testInfo.status !== "passed")
|
||||
return;
|
||||
await testInfoImpl._upstreamStorage(resolvedCacheFile, cacheOutFile);
|
||||
},
|
||||
request: async ({ playwright }, use) => {
|
||||
const request = await playwright.request.newContext();
|
||||
await use(request);
|
||||
|
||||
Reference in New Issue
Block a user