@@ -1044,6 +1044,25 @@ test.describe('Kernel Switching', () => {
10441044} ) ;
10451045
10461046test ( 'Should switch to R kernel and run R code' , async ( { page } ) => {
1047+ const consoleMessages : string [ ] = [ ] ;
1048+ const pageErrors : string [ ] = [ ] ;
1049+
1050+ page . on ( 'console' , msg => {
1051+ const text = `[${ msg . type ( ) } ] ${ msg . text ( ) } ` ;
1052+ consoleMessages . push ( text ) ;
1053+ console . log ( text ) ;
1054+ } ) ;
1055+
1056+ page . on ( 'pageerror' , error => {
1057+ const errorText = `Page error: ${ error . message } \n${ error . stack } ` ;
1058+ pageErrors . push ( errorText ) ;
1059+ console . error ( errorText ) ;
1060+ } ) ;
1061+
1062+ page . on ( 'crash' , ( ) => {
1063+ console . error ( 'PAGE CRASHED!' ) ;
1064+ } ) ;
1065+
10471066 await page . goto ( 'lab/index.html' ) ;
10481067 await page . waitForSelector ( '.jp-NotebookPanel' ) ;
10491068
@@ -1073,6 +1092,25 @@ test.describe('Kernel networking', () => {
10731092 const expectedContent = 'col1' ;
10741093
10751094 test ( 'R kernel should be able to fetch from a remote URL' , async ( { page } ) => {
1095+ const consoleMessages : string [ ] = [ ] ;
1096+ const pageErrors : string [ ] = [ ] ;
1097+
1098+ page . on ( 'console' , msg => {
1099+ const text = `[${ msg . type ( ) } ] ${ msg . text ( ) } ` ;
1100+ consoleMessages . push ( text ) ;
1101+ console . log ( text ) ;
1102+ } ) ;
1103+
1104+ page . on ( 'pageerror' , error => {
1105+ const errorText = `Page error: ${ error . message } \n${ error . stack } ` ;
1106+ pageErrors . push ( errorText ) ;
1107+ console . error ( errorText ) ;
1108+ } ) ;
1109+
1110+ page . on ( 'crash' , ( ) => {
1111+ console . error ( 'PAGE CRASHED!' ) ;
1112+ } ) ;
1113+
10761114 await page . goto ( 'lab/index.html?kernel=r' ) ;
10771115 await page . waitForSelector ( '.jp-NotebookPanel' ) ;
10781116
0 commit comments