Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion ui-tests/playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ module.exports = {
autoGoto: false,
baseURL: 'http://localhost:3000',
trace: 'retain-on-failure',
video: 'retain-on-failure'
video: 'retain-on-failure',
screenshot: 'only-on-failure',
// Capture browser console logs
launchOptions: {
args: process.env.CI ? ['--disable-dev-shm-usage'] : []
}
},
webServer: {
command: 'jlpm start',
Expand Down
44 changes: 42 additions & 2 deletions ui-tests/tests/jupytereverywhere.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { test, expect, Page } from '@playwright/test';
import path from 'path';
import fs from 'fs';
Expand Down Expand Up @@ -1044,12 +1044,33 @@
});

test('Should switch to R kernel and run R code', async ({ page }) => {
const consoleMessages: string[] = [];
const pageErrors: string[] = [];

page.on('console', msg => {
const text = `[${msg.type()}] ${msg.text()}`;
consoleMessages.push(text);
console.log(text);
});

page.on('pageerror', error => {
const errorText = `Page error: ${error.message}\n${error.stack}`;
pageErrors.push(errorText);
console.error(errorText);
});

page.on('crash', () => {
console.error('PAGE CRASHED!');
});

await page.goto('lab/index.html');
await page.waitForSelector('.jp-NotebookPanel');

// Wait for Python kernel to fully initialise
await page.waitForTimeout(30000);

await runCommand(page, 'jupytereverywhere:switch-kernel', { kernel: 'xr' });
await page.waitForTimeout(10000);
await runCommand(page, 'notebook:insert-cell-below');
await page.waitForTimeout(30000);

const code = 'lm(mpg ~ wt + hp + disp + cyl, data=mtcars)';
const cell = page.locator('.jp-Cell').last();
Expand All @@ -1065,7 +1086,7 @@
const text = await output.textContent();
expect(text).toContain('Call');
// Add a snapshot of the output area
expect(await output.screenshot()).toMatchSnapshot('r-output.png');

Check failure on line 1089 in ui-tests/tests/jupytereverywhere.spec.ts

View workflow job for this annotation

GitHub Actions / Integration tests

[chromium] › tests/jupytereverywhere.spec.ts:1046:5 › Should switch to R kernel and run R code

1) [chromium] › tests/jupytereverywhere.spec.ts:1046:5 › Should switch to R kernel and run R code Error: locator.screenshot: Test timeout of 60000ms exceeded. Call log: - taking element screenshot - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable 1087 | expect(text).toContain('Call'); 1088 | // Add a snapshot of the output area > 1089 | expect(await output.screenshot()).toMatchSnapshot('r-output.png'); | ^ 1090 | }); 1091 | 1092 | test.describe('Kernel networking', () => { at /home/runner/work/jupyterlite-extension/jupyterlite-extension/ui-tests/tests/jupytereverywhere.spec.ts:1089:23
});

test.describe('Kernel networking', () => {
Expand All @@ -1074,6 +1095,25 @@
const expectedContent = 'col1';

test('R kernel should be able to fetch from a remote URL', async ({ page }) => {
const consoleMessages: string[] = [];
const pageErrors: string[] = [];

page.on('console', msg => {
const text = `[${msg.type()}] ${msg.text()}`;
consoleMessages.push(text);
console.log(text);
});

page.on('pageerror', error => {
const errorText = `Page error: ${error.message}\n${error.stack}`;
pageErrors.push(errorText);
console.error(errorText);
});

page.on('crash', () => {
console.error('PAGE CRASHED!');
});

await page.goto('lab/index.html?kernel=r');
await page.waitForSelector('.jp-NotebookPanel');

Expand Down
Loading