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
1 change: 1 addition & 0 deletions lite/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
geopandas
jupyterlite==0.7.0a4
jupyterlite-pyodide-kernel==0.7.0a1
jupyterlite-xeus==4.2.0
54 changes: 36 additions & 18 deletions ui-tests/tests/jupytereverywhere.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,31 +529,49 @@
await page.locator('.je-KernelSwitcherDropdownButton-menu').screenshot()
).toMatchSnapshot('kernel-switcher-menu.png');
});
});

test('Should switch to R kernel and run R code', async ({ page }) => {
await page.goto('lab/index.html');
await page.waitForSelector('.jp-NotebookPanel');
test('Should switch to R kernel and run R code', async ({ page }) => {
await page.goto('lab/index.html');
await page.waitForSelector('.jp-NotebookPanel');

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

await runCommand(page, 'jupytereverywhere:switch-kernel', { kernel: 'xr' });
await page.waitForTimeout(10000);
await runCommand(page, 'notebook:insert-cell-below');
const code = 'lm(mpg ~ wt + hp + disp + cyl, data=mtcars)';
const cell = page.locator('.jp-Cell').last();
await cell.getByRole('textbox').fill(code);

const code = 'lm(mpg ~ wt + hp + disp + cyl, data=mtcars)';
const cell = page.locator('.jp-Cell').last();
await cell.getByRole('textbox').fill(code);
await runCommand(page, 'notebook:run-cell');

await runCommand(page, 'notebook:run-cell');
const output = cell.locator('.jp-Cell-outputArea');
await expect(output).toBeVisible({
timeout: 20000 // shouldn't take too long to run but just to be safe
});

const output = cell.locator('.jp-Cell-outputArea');
await expect(output).toBeVisible({
timeout: 20000 // shouldn't take too long to run but just to be safe
const text = await output.textContent();
expect(text).toContain('Call');
// Add a snapshot of the output area
expect(await output.screenshot()).toMatchSnapshot('r-output.png');
});
});

test.describe('Default (Python) kernel environment', () => {
test('Should be able to import geopandas', async ({ page }) => {
await page.waitForSelector('.jp-NotebookPanel');

const code = 'import geopandas; geopandas.GeoSeries()';
const cell = page.locator('.jp-Cell').first();
await cell.getByRole('textbox').fill(code);

const text = await output.textContent();
expect(text).toContain('Call');
// Add a snapshot of the output area
expect(await output.screenshot()).toMatchSnapshot('r-output.png');
await runCommand(page, 'notebook:run-cell');

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

const text = await output.textContent();
expect(text).toContain('dtype: geometry');
});
});

test.describe('Kernel networking', () => {
Expand All @@ -579,7 +597,7 @@
expect(text).toContain('col1');
});
});

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

View workflow job for this annotation

GitHub Actions / Integration tests

[chromium] › tests/jupytereverywhere.spec.ts:587:7 › Default (Python) kernel environment › Should be able to import geopandas

1) [chromium] › tests/jupytereverywhere.spec.ts:587:7 › Default (Python) kernel environment › Should be able to import geopandas Error: expect(received).toContain(expected) // indexOf Expected substring: "dtype: geometry" Received string: "--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[1], line 1 ----> 1 import geopandas; geopandas.GeoSeries()· ModuleNotFoundError: No module named 'geopandas'" 598 | 599 | const text = await output.textContent(); > 600 | expect(text).toContain('dtype: geometry'); | ^ 601 | }); 602 | }); 603 | at /home/runner/work/jupyterlite-extension/jupyterlite-extension/ui-tests/tests/jupytereverywhere.spec.ts:600:18
test.describe('Leave confirmation', () => {
test('Leave confirmation snapshot', async ({ page }) => {
await mockTokenRoute(page);
Expand Down
Loading