@browserflow-ai/generator 0.0.6
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/config-emit.d.ts +41 -0
- package/dist/config-emit.d.ts.map +1 -0
- package/dist/config-emit.js +191 -0
- package/dist/config-emit.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/locator-emit.d.ts +76 -0
- package/dist/locator-emit.d.ts.map +1 -0
- package/dist/locator-emit.js +239 -0
- package/dist/locator-emit.js.map +1 -0
- package/dist/locator-emit.test.d.ts +6 -0
- package/dist/locator-emit.test.d.ts.map +1 -0
- package/dist/locator-emit.test.js +425 -0
- package/dist/locator-emit.test.js.map +1 -0
- package/dist/playwright-ts.d.ts +97 -0
- package/dist/playwright-ts.d.ts.map +1 -0
- package/dist/playwright-ts.js +373 -0
- package/dist/playwright-ts.js.map +1 -0
- package/dist/playwright-ts.test.d.ts +6 -0
- package/dist/playwright-ts.test.d.ts.map +1 -0
- package/dist/playwright-ts.test.js +548 -0
- package/dist/playwright-ts.test.js.map +1 -0
- package/dist/visual-checks.d.ts +76 -0
- package/dist/visual-checks.d.ts.map +1 -0
- package/dist/visual-checks.js +195 -0
- package/dist/visual-checks.js.map +1 -0
- package/dist/visual-checks.test.d.ts +6 -0
- package/dist/visual-checks.test.d.ts.map +1 -0
- package/dist/visual-checks.test.js +188 -0
- package/dist/visual-checks.test.js.map +1 -0
- package/package.json +34 -0
- package/src/config-emit.ts +253 -0
- package/src/index.ts +57 -0
- package/src/locator-emit.test.ts +533 -0
- package/src/locator-emit.ts +310 -0
- package/src/playwright-ts.test.ts +704 -0
- package/src/playwright-ts.ts +519 -0
- package/src/visual-checks.test.ts +232 -0
- package/src/visual-checks.ts +294 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* config-emit.ts
|
|
3
|
+
* Generates playwright.config.ts content.
|
|
4
|
+
*/
|
|
5
|
+
import type { PlaywrightConfigOptions, GeneratedConfig } from '@browserflow-ai/core';
|
|
6
|
+
/**
|
|
7
|
+
* Configuration for generating playwright.config.ts.
|
|
8
|
+
*/
|
|
9
|
+
export interface ConfigGeneratorOptions {
|
|
10
|
+
/** Base URL for tests */
|
|
11
|
+
baseUrl?: string;
|
|
12
|
+
/** Test directory */
|
|
13
|
+
testDir?: string;
|
|
14
|
+
/** Output directory for results */
|
|
15
|
+
outputDir?: string;
|
|
16
|
+
/** Playwright config options */
|
|
17
|
+
config?: PlaywrightConfigOptions;
|
|
18
|
+
/** Custom Handlebars template */
|
|
19
|
+
template?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Generates a playwright.config.ts file.
|
|
23
|
+
*/
|
|
24
|
+
export declare function generatePlaywrightConfig(options?: ConfigGeneratorOptions): GeneratedConfig;
|
|
25
|
+
/**
|
|
26
|
+
* Generates a minimal playwright.config.ts for a single browser.
|
|
27
|
+
*/
|
|
28
|
+
export declare function generateMinimalConfig(options: {
|
|
29
|
+
baseUrl?: string;
|
|
30
|
+
testDir?: string;
|
|
31
|
+
browser?: 'chromium' | 'firefox' | 'webkit';
|
|
32
|
+
}): GeneratedConfig;
|
|
33
|
+
/**
|
|
34
|
+
* Generates package.json scripts for running Playwright tests.
|
|
35
|
+
*/
|
|
36
|
+
export declare function generatePlaywrightScripts(): Record<string, string>;
|
|
37
|
+
/**
|
|
38
|
+
* Generates the commands needed to set up Playwright in a project.
|
|
39
|
+
*/
|
|
40
|
+
export declare function generateSetupInstructions(): string;
|
|
41
|
+
//# sourceMappingURL=config-emit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-emit.d.ts","sourceRoot":"","sources":["../src/config-emit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,uBAAuB,EAEvB,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAG9B;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,yBAAyB;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qBAAqB;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAwFD;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,GAAE,sBAA2B,GACnC,eAAe,CA8CjB;AAiBD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;CAC7C,GAAG,eAAe,CAmClB;AAED;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQlE;AAED;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAUlD"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* config-emit.ts
|
|
3
|
+
* Generates playwright.config.ts content.
|
|
4
|
+
*/
|
|
5
|
+
import Handlebars from 'handlebars';
|
|
6
|
+
/**
|
|
7
|
+
* Default playwright.config.ts template.
|
|
8
|
+
*/
|
|
9
|
+
const DEFAULT_CONFIG_TEMPLATE = `import { defineConfig, devices } from '@playwright/test';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Playwright configuration for BrowserFlow-generated tests.
|
|
13
|
+
* Generated: {{generatedAt}}
|
|
14
|
+
*/
|
|
15
|
+
export default defineConfig({
|
|
16
|
+
testDir: '{{testDir}}',
|
|
17
|
+
{{#if outputDir}}
|
|
18
|
+
outputDir: '{{outputDir}}',
|
|
19
|
+
{{/if}}
|
|
20
|
+
|
|
21
|
+
/* Run tests in files in parallel */
|
|
22
|
+
fullyParallel: true,
|
|
23
|
+
|
|
24
|
+
/* Fail the build on CI if you accidentally left test.only in the source code */
|
|
25
|
+
forbidOnly: !!process.env.CI,
|
|
26
|
+
|
|
27
|
+
/* Retry on CI only */
|
|
28
|
+
retries: process.env.CI ? {{retries}} : 0,
|
|
29
|
+
|
|
30
|
+
/* Opt out of parallel tests on CI */
|
|
31
|
+
workers: process.env.CI ? 1 : {{workers}},
|
|
32
|
+
|
|
33
|
+
/* Reporter to use */
|
|
34
|
+
reporter: '{{reporter}}',
|
|
35
|
+
|
|
36
|
+
/* Shared settings for all the projects below */
|
|
37
|
+
use: {
|
|
38
|
+
{{#if baseUrl}}
|
|
39
|
+
/* Base URL to use in actions like \`await page.goto('/')\` */
|
|
40
|
+
baseURL: '{{baseUrl}}',
|
|
41
|
+
{{/if}}
|
|
42
|
+
|
|
43
|
+
/* Collect trace when retrying the failed test */
|
|
44
|
+
trace: 'on-first-retry',
|
|
45
|
+
|
|
46
|
+
/* Take screenshot on failure */
|
|
47
|
+
screenshot: 'only-on-failure',
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
/* Test timeout */
|
|
51
|
+
timeout: {{timeout}},
|
|
52
|
+
|
|
53
|
+
/* Configure projects for major browsers */
|
|
54
|
+
projects: [
|
|
55
|
+
{{#each projects}}
|
|
56
|
+
{
|
|
57
|
+
name: '{{name}}',
|
|
58
|
+
use: {
|
|
59
|
+
...devices['{{deviceName}}'],
|
|
60
|
+
{{#if viewport}}
|
|
61
|
+
viewport: { width: {{viewport.width}}, height: {{viewport.height}} },
|
|
62
|
+
{{/if}}
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
{{/each}}
|
|
66
|
+
],
|
|
67
|
+
{{#if webServer}}
|
|
68
|
+
|
|
69
|
+
/* Run your local dev server before starting the tests */
|
|
70
|
+
webServer: {
|
|
71
|
+
command: '{{webServer.command}}',
|
|
72
|
+
url: '{{webServer.url}}',
|
|
73
|
+
reuseExistingServer: !process.env.CI,
|
|
74
|
+
},
|
|
75
|
+
{{/if}}
|
|
76
|
+
});
|
|
77
|
+
`;
|
|
78
|
+
/**
|
|
79
|
+
* Default browser projects configuration.
|
|
80
|
+
*/
|
|
81
|
+
const DEFAULT_PROJECTS = [
|
|
82
|
+
{ name: 'chromium', deviceName: 'Desktop Chrome' },
|
|
83
|
+
{ name: 'firefox', deviceName: 'Desktop Firefox' },
|
|
84
|
+
{ name: 'webkit', deviceName: 'Desktop Safari' },
|
|
85
|
+
];
|
|
86
|
+
/**
|
|
87
|
+
* Generates a playwright.config.ts file.
|
|
88
|
+
*/
|
|
89
|
+
export function generatePlaywrightConfig(options = {}) {
|
|
90
|
+
const { baseUrl, testDir = './tests', outputDir, config = {}, template = DEFAULT_CONFIG_TEMPLATE, } = options;
|
|
91
|
+
const { timeout = 30000, retries = 2, workers = 4, reporter = 'html', projects, webServer, } = config;
|
|
92
|
+
// Build projects data
|
|
93
|
+
const projectsData = projects?.map((p) => ({
|
|
94
|
+
name: p.name,
|
|
95
|
+
deviceName: getDeviceName(p),
|
|
96
|
+
viewport: p.use.viewport,
|
|
97
|
+
})) ?? DEFAULT_PROJECTS;
|
|
98
|
+
// Compile template
|
|
99
|
+
const compiledTemplate = Handlebars.compile(template);
|
|
100
|
+
const content = compiledTemplate({
|
|
101
|
+
generatedAt: new Date().toISOString(),
|
|
102
|
+
testDir,
|
|
103
|
+
outputDir,
|
|
104
|
+
baseUrl,
|
|
105
|
+
timeout,
|
|
106
|
+
retries,
|
|
107
|
+
workers,
|
|
108
|
+
reporter,
|
|
109
|
+
projects: projectsData,
|
|
110
|
+
webServer,
|
|
111
|
+
});
|
|
112
|
+
return {
|
|
113
|
+
path: 'playwright.config.ts',
|
|
114
|
+
content,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Maps a PlaywrightProject to a Playwright device name.
|
|
119
|
+
*/
|
|
120
|
+
function getDeviceName(project) {
|
|
121
|
+
const browserName = project.use.browserName ?? 'chromium';
|
|
122
|
+
const deviceMap = {
|
|
123
|
+
chromium: 'Desktop Chrome',
|
|
124
|
+
firefox: 'Desktop Firefox',
|
|
125
|
+
webkit: 'Desktop Safari',
|
|
126
|
+
};
|
|
127
|
+
return deviceMap[browserName] ?? 'Desktop Chrome';
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Generates a minimal playwright.config.ts for a single browser.
|
|
131
|
+
*/
|
|
132
|
+
export function generateMinimalConfig(options) {
|
|
133
|
+
const { baseUrl, testDir = './tests', browser = 'chromium' } = options;
|
|
134
|
+
const deviceName = {
|
|
135
|
+
chromium: 'Desktop Chrome',
|
|
136
|
+
firefox: 'Desktop Firefox',
|
|
137
|
+
webkit: 'Desktop Safari',
|
|
138
|
+
}[browser];
|
|
139
|
+
const content = `import { defineConfig, devices } from '@playwright/test';
|
|
140
|
+
|
|
141
|
+
export default defineConfig({
|
|
142
|
+
testDir: '${testDir}',
|
|
143
|
+
fullyParallel: true,
|
|
144
|
+
forbidOnly: !!process.env.CI,
|
|
145
|
+
retries: process.env.CI ? 2 : 0,
|
|
146
|
+
workers: process.env.CI ? 1 : undefined,
|
|
147
|
+
reporter: 'html',
|
|
148
|
+
use: {
|
|
149
|
+
${baseUrl ? `baseURL: '${baseUrl}',` : ''}
|
|
150
|
+
trace: 'on-first-retry',
|
|
151
|
+
},
|
|
152
|
+
projects: [
|
|
153
|
+
{
|
|
154
|
+
name: '${browser}',
|
|
155
|
+
use: { ...devices['${deviceName}'] },
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
});
|
|
159
|
+
`;
|
|
160
|
+
return {
|
|
161
|
+
path: 'playwright.config.ts',
|
|
162
|
+
content,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Generates package.json scripts for running Playwright tests.
|
|
167
|
+
*/
|
|
168
|
+
export function generatePlaywrightScripts() {
|
|
169
|
+
return {
|
|
170
|
+
'test:e2e': 'playwright test',
|
|
171
|
+
'test:e2e:headed': 'playwright test --headed',
|
|
172
|
+
'test:e2e:debug': 'playwright test --debug',
|
|
173
|
+
'test:e2e:ui': 'playwright test --ui',
|
|
174
|
+
'test:e2e:update-snapshots': 'playwright test --update-snapshots',
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Generates the commands needed to set up Playwright in a project.
|
|
179
|
+
*/
|
|
180
|
+
export function generateSetupInstructions() {
|
|
181
|
+
return `# Install Playwright
|
|
182
|
+
bun add -D @playwright/test
|
|
183
|
+
|
|
184
|
+
# Install browsers
|
|
185
|
+
bunx playwright install
|
|
186
|
+
|
|
187
|
+
# Run tests
|
|
188
|
+
bun run test:e2e
|
|
189
|
+
`;
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=config-emit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-emit.js","sourceRoot":"","sources":["../src/config-emit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,UAAU,MAAM,YAAY,CAAC;AAkBpC;;GAEG;AACH,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoE/B,CAAC;AAEF;;GAEG;AACH,MAAM,gBAAgB,GAIjB;IACH,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE;IAClD,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAAE;IAClD,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,gBAAgB,EAAE;CACjD,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,wBAAwB,CACtC,UAAkC,EAAE;IAEpC,MAAM,EACJ,OAAO,EACP,OAAO,GAAG,SAAS,EACnB,SAAS,EACT,MAAM,GAAG,EAAE,EACX,QAAQ,GAAG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GAAG,SAAS,EAAE,OAAO,GAAG,UAAU,EAAE,GAAG,OAAO,CAAC;IAEvE,MAAM,UAAU,GAAG;QACjB,QAAQ,EAAE,gBAAgB;QAC1B,OAAO,EAAE,iBAAiB;QAC1B,MAAM,EAAE,gBAAgB;KACzB,CAAC,OAAO,CAAC,CAAC;IAEX,MAAM,OAAO,GAAG;;;cAGJ,OAAO;;;;;;;MAOf,OAAO,CAAC,CAAC,CAAC,aAAa,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE;;;;;eAK9B,OAAO;2BACK,UAAU;;;;CAIpC,CAAC;IAEA,OAAO;QACL,IAAI,EAAE,sBAAsB;QAC5B,OAAO;KACR,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,yBAAyB;IACvC,OAAO;QACL,UAAU,EAAE,iBAAiB;QAC7B,iBAAiB,EAAE,0BAA0B;QAC7C,gBAAgB,EAAE,yBAAyB;QAC3C,aAAa,EAAE,sBAAsB;QACrC,2BAA2B,EAAE,oCAAoC;KAClE,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,yBAAyB;IACvC,OAAO;;;;;;;;CAQR,CAAC;AACF,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @browserflow-ai/generator
|
|
3
|
+
*
|
|
4
|
+
* Playwright test generator for BrowserFlow.
|
|
5
|
+
* Converts exploration lockfiles into deterministic Playwright Test code.
|
|
6
|
+
*/
|
|
7
|
+
export { PlaywrightGenerator, generateTest } from './playwright-ts.js';
|
|
8
|
+
export type { TestGeneratorOptions } from './playwright-ts.js';
|
|
9
|
+
export { generateLocatorCode, resolveLocatorCode, escapeString, selectorToLocator, roleLocator, textLocator, testIdLocator, } from './locator-emit.js';
|
|
10
|
+
export type { LocatorEmitOptions } from './locator-emit.js';
|
|
11
|
+
export { generateScreenshotAssertion, generateElementScreenshotAssertion, generateScreenshotCapture, generateScreenshotCompare, generateVisualImports, generateWaitForAnimations, } from './visual-checks.js';
|
|
12
|
+
export type { ScreenshotOptions, VisualCheckEmitOptions } from './visual-checks.js';
|
|
13
|
+
export { generatePlaywrightConfig, generateMinimalConfig, generatePlaywrightScripts, generateSetupInstructions, } from './config-emit.js';
|
|
14
|
+
export type { ConfigGeneratorOptions } from './config-emit.js';
|
|
15
|
+
export type { ExplorationLockfile, ExplorationStep, GeneratorConfig, GeneratedTest, GeneratedConfig, LocatorObject, LocatorMethod, LocatorArgs, ReviewData, PlaywrightConfigOptions, PlaywrightProject, } from '@browserflow-ai/core';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvE,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAG/D,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,EACL,2BAA2B,EAC3B,kCAAkC,EAClC,yBAAyB,EACzB,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAGpF,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAG/D,YAAY,EACV,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,aAAa,EACb,eAAe,EACf,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @browserflow-ai/generator
|
|
3
|
+
*
|
|
4
|
+
* Playwright test generator for BrowserFlow.
|
|
5
|
+
* Converts exploration lockfiles into deterministic Playwright Test code.
|
|
6
|
+
*/
|
|
7
|
+
// Main generator class
|
|
8
|
+
export { PlaywrightGenerator, generateTest } from './playwright-ts.js';
|
|
9
|
+
// Locator code generation
|
|
10
|
+
export { generateLocatorCode, resolveLocatorCode, escapeString, selectorToLocator, roleLocator, textLocator, testIdLocator, } from './locator-emit.js';
|
|
11
|
+
// Visual check code generation
|
|
12
|
+
export { generateScreenshotAssertion, generateElementScreenshotAssertion, generateScreenshotCapture, generateScreenshotCompare, generateVisualImports, generateWaitForAnimations, } from './visual-checks.js';
|
|
13
|
+
// Config generation
|
|
14
|
+
export { generatePlaywrightConfig, generateMinimalConfig, generatePlaywrightScripts, generateSetupInstructions, } from './config-emit.js';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,uBAAuB;AACvB,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvE,0BAA0B;AAC1B,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,mBAAmB,CAAC;AAG3B,+BAA+B;AAC/B,OAAO,EACL,2BAA2B,EAC3B,kCAAkC,EAClC,yBAAyB,EACzB,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAG5B,oBAAoB;AACpB,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* locator-emit.ts
|
|
3
|
+
* Converts LocatorObject instances to Playwright locator code strings.
|
|
4
|
+
*/
|
|
5
|
+
import type { LegacyLocatorObject } from '@browserflow-ai/core';
|
|
6
|
+
type LocatorObject = LegacyLocatorObject;
|
|
7
|
+
/**
|
|
8
|
+
* Options for code generation.
|
|
9
|
+
*/
|
|
10
|
+
export interface LocatorEmitOptions {
|
|
11
|
+
/** Variable name for the page object (default: "page") */
|
|
12
|
+
pageVar?: string;
|
|
13
|
+
/** Whether to chain .first() for potentially multiple matches */
|
|
14
|
+
chainFirst?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Index-based selection for multiple matches:
|
|
17
|
+
* - 0: .first()
|
|
18
|
+
* - -1: .last()
|
|
19
|
+
* - other: .nth(n)
|
|
20
|
+
* Takes precedence over chainFirst when specified.
|
|
21
|
+
*/
|
|
22
|
+
nth?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Parent locator for scoping. The generated code will be
|
|
25
|
+
* chained from this parent locator.
|
|
26
|
+
* Example: within: { method: 'getByTestId', args: { testId: 'form' } }
|
|
27
|
+
* Results in: page.getByTestId('form').getByRole('button')
|
|
28
|
+
*/
|
|
29
|
+
within?: LocatorObject;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Escapes a string for use in generated TypeScript code.
|
|
33
|
+
*/
|
|
34
|
+
export declare function escapeString(str: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* Generates Playwright locator code from a LocatorObject.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* // getByRole example
|
|
40
|
+
* generateLocatorCode({ method: 'getByRole', args: { role: 'button', name: 'Submit' } })
|
|
41
|
+
* // Returns: "page.getByRole('button', { name: 'Submit' })"
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* // CSS selector example
|
|
45
|
+
* generateLocatorCode({ selector: 'button.primary' })
|
|
46
|
+
* // Returns: "page.locator('button.primary')"
|
|
47
|
+
*/
|
|
48
|
+
export declare function generateLocatorCode(locator: LocatorObject, options?: LocatorEmitOptions): string;
|
|
49
|
+
/**
|
|
50
|
+
* Creates a LocatorObject from a CSS selector string.
|
|
51
|
+
*/
|
|
52
|
+
export declare function selectorToLocator(selector: string): LocatorObject;
|
|
53
|
+
/**
|
|
54
|
+
* Creates a LocatorObject for getByRole.
|
|
55
|
+
*/
|
|
56
|
+
export declare function roleLocator(role: string, options?: {
|
|
57
|
+
name?: string;
|
|
58
|
+
exact?: boolean;
|
|
59
|
+
}): LocatorObject;
|
|
60
|
+
/**
|
|
61
|
+
* Creates a LocatorObject for getByText.
|
|
62
|
+
*/
|
|
63
|
+
export declare function textLocator(text: string, options?: {
|
|
64
|
+
exact?: boolean;
|
|
65
|
+
}): LocatorObject;
|
|
66
|
+
/**
|
|
67
|
+
* Creates a LocatorObject for getByTestId.
|
|
68
|
+
*/
|
|
69
|
+
export declare function testIdLocator(testId: string): LocatorObject;
|
|
70
|
+
/**
|
|
71
|
+
* Resolves the best locator code from an exploration step.
|
|
72
|
+
* Prefers method-based locators over CSS selectors.
|
|
73
|
+
*/
|
|
74
|
+
export declare function resolveLocatorCode(locator: LocatorObject | undefined, fallbackSelector: string | undefined, options?: LocatorEmitOptions): string;
|
|
75
|
+
export {};
|
|
76
|
+
//# sourceMappingURL=locator-emit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locator-emit.d.ts","sourceRoot":"","sources":["../src/locator-emit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAiB,MAAM,sBAAsB,CAAC;AAG/E,KAAK,aAAa,GAAG,mBAAmB,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAOhD;AAqBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,aAAa,EACtB,OAAO,GAAE,kBAAuB,GAC/B,MAAM,CAsCR;AA4HD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa,CAEjE;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAC3C,aAAa,CAKf;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAC5B,aAAa,CAKf;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAK3D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,aAAa,GAAG,SAAS,EAClC,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,OAAO,GAAE,kBAAuB,GAC/B,MAAM,CAcR"}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* locator-emit.ts
|
|
3
|
+
* Converts LocatorObject instances to Playwright locator code strings.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Escapes a string for use in generated TypeScript code.
|
|
7
|
+
*/
|
|
8
|
+
export function escapeString(str) {
|
|
9
|
+
return str
|
|
10
|
+
.replace(/\\/g, '\\\\')
|
|
11
|
+
.replace(/'/g, "\\'")
|
|
12
|
+
.replace(/\n/g, '\\n')
|
|
13
|
+
.replace(/\r/g, '\\r')
|
|
14
|
+
.replace(/\t/g, '\\t');
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Formats a value as a TypeScript literal.
|
|
18
|
+
*/
|
|
19
|
+
function formatValue(value) {
|
|
20
|
+
if (typeof value === 'string') {
|
|
21
|
+
return `'${escapeString(value)}'`;
|
|
22
|
+
}
|
|
23
|
+
if (value instanceof RegExp) {
|
|
24
|
+
return value.toString();
|
|
25
|
+
}
|
|
26
|
+
if (typeof value === 'boolean' || typeof value === 'number') {
|
|
27
|
+
return String(value);
|
|
28
|
+
}
|
|
29
|
+
if (value === null || value === undefined) {
|
|
30
|
+
return 'undefined';
|
|
31
|
+
}
|
|
32
|
+
return JSON.stringify(value);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Generates Playwright locator code from a LocatorObject.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* // getByRole example
|
|
39
|
+
* generateLocatorCode({ method: 'getByRole', args: { role: 'button', name: 'Submit' } })
|
|
40
|
+
* // Returns: "page.getByRole('button', { name: 'Submit' })"
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* // CSS selector example
|
|
44
|
+
* generateLocatorCode({ selector: 'button.primary' })
|
|
45
|
+
* // Returns: "page.locator('button.primary')"
|
|
46
|
+
*/
|
|
47
|
+
export function generateLocatorCode(locator, options = {}) {
|
|
48
|
+
const { pageVar = 'page', chainFirst = false, nth, within } = options;
|
|
49
|
+
// Start with the base variable or parent locator chain
|
|
50
|
+
let baseVar = pageVar;
|
|
51
|
+
if (within) {
|
|
52
|
+
// Generate code for the parent locator (without page var suffix methods)
|
|
53
|
+
baseVar = generateLocatorCode(within, { pageVar });
|
|
54
|
+
}
|
|
55
|
+
let code;
|
|
56
|
+
if (locator.method && locator.args) {
|
|
57
|
+
code = generateMethodLocator(locator.method, locator.args, baseVar);
|
|
58
|
+
}
|
|
59
|
+
else if (locator.selector) {
|
|
60
|
+
code = `${baseVar}.locator('${escapeString(locator.selector)}')`;
|
|
61
|
+
}
|
|
62
|
+
else if (locator.ref) {
|
|
63
|
+
// Element refs need to be resolved - use a placeholder selector
|
|
64
|
+
// In practice, the exploration should have resolved this to a selector
|
|
65
|
+
code = `${baseVar}.locator('[data-ref="${escapeString(locator.ref)}"]')`;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
throw new Error('LocatorObject must have either method+args, selector, or ref');
|
|
69
|
+
}
|
|
70
|
+
// Apply nth handling - takes precedence over chainFirst
|
|
71
|
+
if (nth !== undefined) {
|
|
72
|
+
if (nth === 0) {
|
|
73
|
+
code += '.first()';
|
|
74
|
+
}
|
|
75
|
+
else if (nth === -1) {
|
|
76
|
+
code += '.last()';
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
code += `.nth(${nth})`;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else if (chainFirst) {
|
|
83
|
+
code += '.first()';
|
|
84
|
+
}
|
|
85
|
+
return code;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Generates code for Playwright locator methods (getByRole, getByText, etc.)
|
|
89
|
+
*/
|
|
90
|
+
function generateMethodLocator(method, args, pageVar) {
|
|
91
|
+
switch (method) {
|
|
92
|
+
case 'getByRole': {
|
|
93
|
+
const { role, ...options } = args;
|
|
94
|
+
if (!role) {
|
|
95
|
+
throw new Error('getByRole requires a role argument');
|
|
96
|
+
}
|
|
97
|
+
const escapedRole = escapeString(String(role));
|
|
98
|
+
const optionsStr = formatOptions(options);
|
|
99
|
+
if (optionsStr) {
|
|
100
|
+
return `${pageVar}.getByRole('${escapedRole}', ${optionsStr})`;
|
|
101
|
+
}
|
|
102
|
+
return `${pageVar}.getByRole('${escapedRole}')`;
|
|
103
|
+
}
|
|
104
|
+
case 'getByText': {
|
|
105
|
+
const { text, exact } = args;
|
|
106
|
+
if (text === undefined) {
|
|
107
|
+
throw new Error('getByText requires a text argument');
|
|
108
|
+
}
|
|
109
|
+
const textValue = formatValue(text);
|
|
110
|
+
if (exact !== undefined) {
|
|
111
|
+
return `${pageVar}.getByText(${textValue}, { exact: ${exact} })`;
|
|
112
|
+
}
|
|
113
|
+
return `${pageVar}.getByText(${textValue})`;
|
|
114
|
+
}
|
|
115
|
+
case 'getByLabel': {
|
|
116
|
+
const { text, exact } = args;
|
|
117
|
+
if (text === undefined) {
|
|
118
|
+
throw new Error('getByLabel requires a text argument');
|
|
119
|
+
}
|
|
120
|
+
const textValue = formatValue(text);
|
|
121
|
+
if (exact !== undefined) {
|
|
122
|
+
return `${pageVar}.getByLabel(${textValue}, { exact: ${exact} })`;
|
|
123
|
+
}
|
|
124
|
+
return `${pageVar}.getByLabel(${textValue})`;
|
|
125
|
+
}
|
|
126
|
+
case 'getByPlaceholder': {
|
|
127
|
+
const { text, exact } = args;
|
|
128
|
+
if (text === undefined) {
|
|
129
|
+
throw new Error('getByPlaceholder requires a text argument');
|
|
130
|
+
}
|
|
131
|
+
const textValue = formatValue(text);
|
|
132
|
+
if (exact !== undefined) {
|
|
133
|
+
return `${pageVar}.getByPlaceholder(${textValue}, { exact: ${exact} })`;
|
|
134
|
+
}
|
|
135
|
+
return `${pageVar}.getByPlaceholder(${textValue})`;
|
|
136
|
+
}
|
|
137
|
+
case 'getByTestId': {
|
|
138
|
+
const { testId } = args;
|
|
139
|
+
if (testId === undefined) {
|
|
140
|
+
throw new Error('getByTestId requires a testId argument');
|
|
141
|
+
}
|
|
142
|
+
return `${pageVar}.getByTestId('${escapeString(String(testId))}')`;
|
|
143
|
+
}
|
|
144
|
+
case 'getByAltText': {
|
|
145
|
+
const { text, exact } = args;
|
|
146
|
+
if (text === undefined) {
|
|
147
|
+
throw new Error('getByAltText requires a text argument');
|
|
148
|
+
}
|
|
149
|
+
const textValue = formatValue(text);
|
|
150
|
+
if (exact !== undefined) {
|
|
151
|
+
return `${pageVar}.getByAltText(${textValue}, { exact: ${exact} })`;
|
|
152
|
+
}
|
|
153
|
+
return `${pageVar}.getByAltText(${textValue})`;
|
|
154
|
+
}
|
|
155
|
+
case 'getByTitle': {
|
|
156
|
+
const { text, exact } = args;
|
|
157
|
+
if (text === undefined) {
|
|
158
|
+
throw new Error('getByTitle requires a text argument');
|
|
159
|
+
}
|
|
160
|
+
const textValue = formatValue(text);
|
|
161
|
+
if (exact !== undefined) {
|
|
162
|
+
return `${pageVar}.getByTitle(${textValue}, { exact: ${exact} })`;
|
|
163
|
+
}
|
|
164
|
+
return `${pageVar}.getByTitle(${textValue})`;
|
|
165
|
+
}
|
|
166
|
+
case 'locator': {
|
|
167
|
+
const { selector } = args;
|
|
168
|
+
if (selector === undefined) {
|
|
169
|
+
throw new Error('locator requires a selector argument');
|
|
170
|
+
}
|
|
171
|
+
return `${pageVar}.locator('${escapeString(String(selector))}')`;
|
|
172
|
+
}
|
|
173
|
+
default:
|
|
174
|
+
throw new Error(`Unknown locator method: ${method}`);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Formats an options object for code generation.
|
|
179
|
+
*/
|
|
180
|
+
function formatOptions(options) {
|
|
181
|
+
const entries = Object.entries(options).filter(([_, v]) => v !== undefined && v !== null);
|
|
182
|
+
if (entries.length === 0) {
|
|
183
|
+
return '';
|
|
184
|
+
}
|
|
185
|
+
const parts = entries.map(([key, value]) => {
|
|
186
|
+
return `${key}: ${formatValue(value)}`;
|
|
187
|
+
});
|
|
188
|
+
return `{ ${parts.join(', ')} }`;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Creates a LocatorObject from a CSS selector string.
|
|
192
|
+
*/
|
|
193
|
+
export function selectorToLocator(selector) {
|
|
194
|
+
return { selector };
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Creates a LocatorObject for getByRole.
|
|
198
|
+
*/
|
|
199
|
+
export function roleLocator(role, options) {
|
|
200
|
+
return {
|
|
201
|
+
method: 'getByRole',
|
|
202
|
+
args: { role, ...options },
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Creates a LocatorObject for getByText.
|
|
207
|
+
*/
|
|
208
|
+
export function textLocator(text, options) {
|
|
209
|
+
return {
|
|
210
|
+
method: 'getByText',
|
|
211
|
+
args: { text, ...options },
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Creates a LocatorObject for getByTestId.
|
|
216
|
+
*/
|
|
217
|
+
export function testIdLocator(testId) {
|
|
218
|
+
return {
|
|
219
|
+
method: 'getByTestId',
|
|
220
|
+
args: { testId },
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Resolves the best locator code from an exploration step.
|
|
225
|
+
* Prefers method-based locators over CSS selectors.
|
|
226
|
+
*/
|
|
227
|
+
export function resolveLocatorCode(locator, fallbackSelector, options = {}) {
|
|
228
|
+
if (locator?.method && locator.args) {
|
|
229
|
+
return generateLocatorCode(locator, options);
|
|
230
|
+
}
|
|
231
|
+
if (locator?.selector) {
|
|
232
|
+
return generateLocatorCode(locator, options);
|
|
233
|
+
}
|
|
234
|
+
if (fallbackSelector) {
|
|
235
|
+
return generateLocatorCode({ selector: fallbackSelector }, options);
|
|
236
|
+
}
|
|
237
|
+
throw new Error('No locator or selector available');
|
|
238
|
+
}
|
|
239
|
+
//# sourceMappingURL=locator-emit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locator-emit.js","sourceRoot":"","sources":["../src/locator-emit.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgCH;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,OAAO,GAAG;SACP,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,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