@@ -31,13 +31,13 @@ describe('pages', () => {
3131 describe ( 'new_page' , ( ) => {
3232 it ( 'create a page' , async ( ) => {
3333 await withBrowser ( async ( response , context ) => {
34- assert . strictEqual ( context . getSelectedPageIdx ( ) , 0 ) ;
34+ assert . strictEqual ( context . getPageByIdx ( 0 ) , context . getSelectedPage ( ) ) ;
3535 await newPage . handler (
3636 { params : { url : 'about:blank' } } ,
3737 response ,
3838 context ,
3939 ) ;
40- assert . strictEqual ( context . getSelectedPageIdx ( ) , 1 ) ;
40+ assert . strictEqual ( context . getPageByIdx ( 1 ) , context . getSelectedPage ( ) ) ;
4141 assert . ok ( response . includePages ) ;
4242 } ) ;
4343 } ) ;
@@ -46,7 +46,7 @@ describe('pages', () => {
4646 it ( 'closes a page' , async ( ) => {
4747 await withBrowser ( async ( response , context ) => {
4848 const page = await context . newPage ( ) ;
49- assert . strictEqual ( context . getSelectedPageIdx ( ) , 1 ) ;
49+ assert . strictEqual ( context . getPageByIdx ( 1 ) , context . getSelectedPage ( ) ) ;
5050 assert . strictEqual ( context . getPageByIdx ( 1 ) , page ) ;
5151 await closePage . handler ( { params : { pageIdx : 1 } } , response , context ) ;
5252 assert . ok ( page . isClosed ( ) ) ;
@@ -70,9 +70,9 @@ describe('pages', () => {
7070 it ( 'selects a page' , async ( ) => {
7171 await withBrowser ( async ( response , context ) => {
7272 await context . newPage ( ) ;
73- assert . strictEqual ( context . getSelectedPageIdx ( ) , 1 ) ;
73+ assert . strictEqual ( context . getPageByIdx ( 1 ) , context . getSelectedPage ( ) ) ;
7474 await selectPage . handler ( { params : { pageIdx : 0 } } , response , context ) ;
75- assert . strictEqual ( context . getSelectedPageIdx ( ) , 0 ) ;
75+ assert . strictEqual ( context . getPageByIdx ( 0 ) , context . getSelectedPage ( ) ) ;
7676 assert . ok ( response . includePages ) ;
7777 } ) ;
7878 } ) ;
@@ -97,7 +97,7 @@ describe('pages', () => {
9797 it ( 'throws an error if the page was closed not by the MCP server' , async ( ) => {
9898 await withBrowser ( async ( response , context ) => {
9999 const page = await context . newPage ( ) ;
100- assert . strictEqual ( context . getSelectedPageIdx ( ) , 1 ) ;
100+ assert . strictEqual ( context . getPageByIdx ( 1 ) , context . getSelectedPage ( ) ) ;
101101 assert . strictEqual ( context . getPageByIdx ( 1 ) , page ) ;
102102
103103 await page . close ( ) ;
@@ -197,7 +197,6 @@ describe('pages', () => {
197197 describe ( 'resize' , ( ) => {
198198 it ( 'create a page' , async ( ) => {
199199 await withBrowser ( async ( response , context ) => {
200- assert . strictEqual ( context . getSelectedPageIdx ( ) , 0 ) ;
201200 const page = context . getSelectedPage ( ) ;
202201 const resizePromise = page . evaluate ( ( ) => {
203202 return new Promise ( resolve => {
0 commit comments