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
2 changes: 1 addition & 1 deletion lite/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
jupyterlite==0.7.0
jupyterlite-pyodide-kernel==0.7
jupyterlite-xeus==4.2.0
jupyterlite-xeus==4.3.4
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,16 +1044,37 @@
});

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();
await cell.getByRole('textbox').fill(code);

Check failure on line 1077 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.fill: Target crashed Call log: - waiting for locator('.jp-Cell').last().getByRole('textbox') 1075 | const code = 'lm(mpg ~ wt + hp + disp + cyl, data=mtcars)'; 1076 | const cell = page.locator('.jp-Cell').last(); > 1077 | await cell.getByRole('textbox').fill(code); | ^ 1078 | 1079 | await runCommand(page, 'notebook:run-cell'); 1080 | at /home/runner/work/jupyterlite-extension/jupyterlite-extension/ui-tests/tests/jupytereverywhere.spec.ts:1077:35

await runCommand(page, 'notebook:run-cell');

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 All @@ -1084,7 +1124,7 @@
await runCommand(page, 'notebook:run-cell');

const output = cell.locator('.jp-Cell-outputArea');
await expect(output).toBeVisible({

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

View workflow job for this annotation

GitHub Actions / Integration tests

[chromium] › tests/jupytereverywhere.spec.ts:1097:7 › Kernel networking › R kernel should be able to fetch from a remote URL

2) [chromium] › tests/jupytereverywhere.spec.ts:1097:7 › Kernel networking › R kernel should be able to fetch from a remote URL Error: expect(locator).toBeVisible() failed Locator: locator('.jp-Cell').last().locator('.jp-Cell-outputArea') Expected: visible Received: hidden Timeout: 20000ms Call log: - Expect "toBeVisible" with timeout 20000ms - waiting for locator('.jp-Cell').last().locator('.jp-Cell-outputArea') 7 × locator resolved to <div class="lm-Widget jp-OutputArea jp-Cell-outputArea">…</div> - unexpected value "hidden" 1125 | 1126 | const output = cell.locator('.jp-Cell-outputArea'); > 1127 | await expect(output).toBeVisible({ | ^ 1128 | timeout: 20000 // shouldn't take too long to run but just to be safe 1129 | }); 1130 | at /home/runner/work/jupyterlite-extension/jupyterlite-extension/ui-tests/tests/jupytereverywhere.spec.ts:1127:26
timeout: 20000 // shouldn't take too long to run but just to be safe
});

Expand Down
Loading