chore: split context.ts into files (#284)

This commit is contained in:
Pavel Feldman 2025-04-28 16:14:16 -07:00 committed by GitHub
parent 26779ceb20
commit 6e76d5e550
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 344 additions and 289 deletions

View file

@ -20,11 +20,10 @@ import os from 'os';
import { z } from 'zod';
import { sanitizeForFilePath } from './utils';
import { generateLocator } from '../context';
import { defineTool } from './tool';
import * as javascript from '../javascript';
import type * as playwright from 'playwright';
import { defineTool } from './tool';
const snapshot = defineTool({
capability: 'core',
@ -268,6 +267,9 @@ const screenshot = defineTool({
}
});
export async function generateLocator(locator: playwright.Locator): Promise<string> {
return (locator as any)._generateLocatorString();
}
export default [
snapshot,