File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,6 +33,30 @@ describe('McpContext', () => {
3333 } ) ;
3434 } ) ;
3535
36+ it ( 'should include the value of an option in the text snapshot' , async ( ) => {
37+ await withBrowser ( async ( _response , context ) => {
38+ const page = context . getSelectedPage ( ) ;
39+ await page . setContent ( `
40+ <!DOCTYPE html>
41+ <select>
42+ <option value="1">One</option>
43+ <option value="2">Two</option>
44+ </select>
45+ ` ) ;
46+ await context . createTextSnapshot ( ) ;
47+ const snapshot = context . getTextSnapshot ( ) ;
48+ assert . ok ( snapshot ) ;
49+
50+ const option1 = snapshot . root . children [ 0 ] ?. children [ 0 ] ;
51+ assert . strictEqual ( option1 ?. role , 'option' ) ;
52+ assert . strictEqual ( option1 ?. value , '1' ) ;
53+
54+ const option2 = snapshot . root . children [ 0 ] ?. children [ 1 ] ;
55+ assert . strictEqual ( option2 ?. role , 'option' ) ;
56+ assert . strictEqual ( option2 ?. value , '2' ) ;
57+ } ) ;
58+ } ) ;
59+
3660 it ( 'can store and retrieve performance traces' , async ( ) => {
3761 await withBrowser ( async ( _response , context ) => {
3862 const fakeTrace1 = { } as unknown as TraceResult ;
You can’t perform that action at this time.
0 commit comments