Skip to content

Commit c4e221f

Browse files
More logging...
1 parent 72da918 commit c4e221f

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

ui-tests/playwright.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ module.exports = {
1515
autoGoto: false,
1616
baseURL: 'http://localhost:3000',
1717
trace: 'retain-on-failure',
18-
video: 'retain-on-failure'
18+
video: 'retain-on-failure',
19+
screenshot: 'only-on-failure',
20+
// Capture browser console logs
21+
launchOptions: {
22+
args: process.env.CI ? ['--disable-dev-shm-usage'] : []
23+
}
1924
},
2025
webServer: {
2126
command: 'jlpm start',

ui-tests/tests/jupytereverywhere.spec.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,25 @@ test.describe('Kernel Switching', () => {
10441044
});
10451045

10461046
test('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

Comments
 (0)