@@ -46,7 +46,7 @@ instructions:
46
46
2. After the mapping and description phase, you'll be provided a spec that
47
47
you wrote to focus on specifically, one at a time. You'll begin a loop
48
48
executing actions in order to fulfill the spec. On each turn, you'll be
49
- provided a screenshot, a DOM snapshot in JSON format , and the current
49
+ provided a screenshot, a HTML dump , and the current
50
50
mouse cursor position and other metadata.
51
51
52
52
- Your goal is to interact only with the elements necessary to fulfill
@@ -69,11 +69,12 @@ instructions:
69
69
- You always adjust your mouse position to the correct location before
70
70
clicking or proceeding with interactions if it seems like your mouse
71
71
position is off.
72
- - You are always provided with a screenshot AND chrome developer tools
73
- protocol-generated DOM snapshot in JSON format, which includes offset
74
- rectangles to allow you to locate elements on the page.
75
- - You always make up appropriate cssSelectors based on the DOM
76
- snapshot, by relating the DOM snapshot to the screenshot you are
72
+ - You are always provided with a screenshot AND a copy of the current
73
+ rendered HTML of the page. You can use the HTML to cross-reference
74
+ with the screenshot to make sure you are interacting with the correct
75
+ elements.
76
+ - You always make up appropriate cssSelectors based on the HTML
77
+ snapshot, by relating the HTML snapshot to the screenshot you are
77
78
provided, and then coming up with a valid css selector that you can
78
79
use to interact with the element in question. You always use the nth
79
80
property to disambiguate between multiple elements that match the same
@@ -400,17 +401,6 @@ async function runTestSpec({ page, runId, spec, client, maxIterations = 10 }) {
400
401
url : screenshotImageUrl ,
401
402
} ,
402
403
} ,
403
- {
404
- type : "text" ,
405
- text : `
406
- Here is the DOM snapshot in JSON format:
407
- \`\`\`
408
- ${ fs . readFileSync (
409
- `./trajectories/${ runId } /screenshot-${ k } .json` ,
410
- ) }
411
- \`\`\`
412
- ` ,
413
- } ,
414
404
{
415
405
type : "text" ,
416
406
text : `
@@ -570,17 +560,6 @@ async function executeAction({
570
560
}
571
561
572
562
async function saveScreenshotWithCursor ( { page, path, client } ) {
573
- // Capture DOM snapshot
574
- const domSnapshot = await client . send ( "DOMSnapshot.captureSnapshot" , {
575
- computedStyles : [ ] ,
576
- includeDOMRects : true ,
577
- includePaintOrder : true ,
578
- } ) ;
579
-
580
- // Save DOM snapshot to file
581
- const snapshotPath = path . replace ( ".png" , ".json" ) ;
582
- fs . writeFileSync ( snapshotPath , JSON . stringify ( domSnapshot , null , 2 ) ) ;
583
-
584
563
// Capture the HTML snapshot
585
564
const html = await page . content ( ) ;
586
565
fs . writeFileSync ( path . replace ( ".png" , ".html" ) , html ) ;
0 commit comments