@agimon-ai/browse-tool 0.2.0 → 0.2.2

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.
@@ -1,111 +0,0 @@
1
- import { Browser, BrowserContext, Page } from "playwright";
2
- import * as playwright_test0 from "playwright/test";
3
-
4
- //#region src/stubs/playwright-test.d.ts
5
-
6
- declare const playwrightExpect: playwright_test0.Expect<{}>;
7
- /**
8
- * Fixtures passed to test functions.
9
- * Compatible with Playwright's test fixture pattern.
10
- * Browser is optional for extension mode which uses persistent context.
11
- */
12
- interface TestFixtures {
13
- page: Page;
14
- context: BrowserContext;
15
- browser?: Browser;
16
- /** Extended fixtures added via test.extend() */
17
- [key: string]: unknown;
18
- }
19
- /**
20
- * A single test block collected from the spec file.
21
- */
22
- interface TestBlock {
23
- /** Test title */
24
- title: string;
25
- /** Test function to execute */
26
- fn: (fixtures: TestFixtures) => Promise<void>;
27
- /** Full path including describe blocks */
28
- fullTitle: string;
29
- /** Whether test is marked with test.only() */
30
- only: boolean;
31
- /** Whether test is marked with test.skip() */
32
- skip: boolean;
33
- }
34
- /**
35
- * A describe block containing tests and hooks.
36
- */
37
- interface DescribeBlock {
38
- /** Describe block title */
39
- title: string;
40
- /** Tests within this describe */
41
- tests: TestBlock[];
42
- /** beforeEach hooks */
43
- beforeEachHooks: Array<(fixtures: TestFixtures) => Promise<void>>;
44
- /** afterEach hooks */
45
- afterEachHooks: Array<(fixtures: TestFixtures) => Promise<void>>;
46
- /** Nested describe blocks */
47
- children: DescribeBlock[];
48
- /** Parent describe block (null for root) */
49
- parent: DescribeBlock | null;
50
- }
51
- /**
52
- * Complete test suite collected from a spec file.
53
- */
54
- interface TestSuite {
55
- /** Spec file path or identifier */
56
- specPath: string;
57
- /** Root describe block (unnamed) */
58
- root: DescribeBlock;
59
- /** Flattened list of all tests in execution order */
60
- allTests: TestBlock[];
61
- /** Total test count */
62
- testCount: number;
63
- }
64
- /**
65
- * Test function type that matches Playwright's test() signature.
66
- */
67
- type TestFunction = (fixtures: TestFixtures) => Promise<void>;
68
- /**
69
- * Proxy test function that collects tests instead of executing them.
70
- * Exported directly with methods attached to match Playwright's API surface.
71
- */
72
- declare function test(title: string, fn: TestFunction): void;
73
- declare namespace test {
74
- var describe: (title: string, fn: () => void) => void;
75
- var beforeEach: (fn: TestFunction) => void;
76
- var afterEach: (fn: TestFunction) => void;
77
- var only: typeof testOnly;
78
- var skip: typeof testSkip;
79
- var extend: (fixtures: Record<string, unknown>) => typeof test;
80
- }
81
- declare function testOnly(title: string, fn: TestFunction): void;
82
- declare function testSkip(title: string, fn: TestFunction): void;
83
- /**
84
- * Initializes the collector for a new spec file.
85
- * Call this before loading a spec file.
86
- */
87
- declare function initCollector(specPath: string): void;
88
- /**
89
- * Retrieves the collected test suite and resets the collector.
90
- * Call this after loading a spec file.
91
- */
92
- declare function getCollectedSuite(): TestSuite;
93
- /**
94
- * Peeks at the current collected test suite without resetting.
95
- */
96
- declare function peekCollectedSuite(): TestSuite;
97
- /**
98
- * Resets the collector without retrieving.
99
- * Useful for cleanup on error.
100
- */
101
- declare function resetCollector(): void;
102
- /**
103
- * Wrapper around Playwright's expect that detects proxy objects
104
- * and routes assertions through extension-mode DOM evaluation.
105
- * Falls back to real Playwright expect for non-proxy targets.
106
- * Typed as `typeof playwrightExpect` to preserve Playwright's overloaded signatures.
107
- */
108
- declare const expect: typeof playwrightExpect;
109
- //#endregion
110
- export { DescribeBlock, TestBlock, TestFixtures, TestSuite, expect, getCollectedSuite, initCollector, peekCollectedSuite, resetCollector, test };
111
- //# sourceMappingURL=playwright-test.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"playwright-test.d.mts","names":[],"sources":["../../src/stubs/playwright-test.ts"],"sourcesContent":[],"mappings":";;;;;cA2DgB,gBAiDN,EA/CT,gBAAA,CAF+B,MAiDtB,CAAA,CAAA,CAAA,CAAA;;AAMV;AASC;AAsSD;;AAkBwB,UA9WP,YAAA,CA8WO;EAID,IAAA,EAjXf,IAiXe;WAhXZ;YACC;EA8X4B;EAAiC,CAAA,GAAA,EAAA,MAAA,CAAA,EAAA,OAAA;;;AAjCxB;AAyCjD;AASgB,UAvYC,SAAA,CAuYgB;EAOjB;EAQA,KAAA,EAAA,MAAA;EAUH;iBA5ZI,iBAAiB;;;;;;;;;;;UAYjB,aAAA;;;;SAIR;;mBAEU,iBAAiB,iBAAiB;;kBAEnC,iBAAiB,iBAAiB;;YAExC;;UAEF;;;;;UAMO,SAAA;;;;QAIT;;YAEI;;;;;;;KAoMP,YAAA,cAA0B,iBAAiB;;;;;iBAqGhC,IAAA,oBAAwB;kBAAxB,IAAA;;uBAkBQ;sBAID;;;yBAeiB,mCAAiC;;iBAjChE,QAAA,oBAA4B;iBAI5B,QAAA,oBAA4B;;;;;iBAqCrB,aAAA;;;;;iBASA,iBAAA,CAAA,GAAqB;;;;iBAOrB,kBAAA,CAAA,GAAsB;;;;;iBAQtB,cAAA,CAAA;;;;;;;cAUH,eAAe"}