Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update @jupyterlab/galata #7361

Merged
merged 18 commits into from
May 14, 2024
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
rev: 'v2.2.6'
hooks:
- id: codespell
args: ['-L', 'hart,noteable']
args: ['-L', 'hart,noteable', '--skip', "*.spec.ts"]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like afterAll makes the pre-commit check fail: https://results.pre-commit.ci/run/github/33653601/1715676598.F47qygP7RKuJagZupcWLmA

image

Adding afterAll to the list of ignored words (via -L) does not seem to help, but skipping all .spec.ts files does. Might be worth investigating more in a separate issue or PR.

exclude: |
(?x)^(
yarn.lock|
Expand Down
4 changes: 2 additions & 2 deletions ui-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"test:update": "playwright test --update-snapshots"
},
"dependencies": {
"@jupyterlab/galata": "~5.2.0-rc.0",
"@playwright/test": "^1.33.0",
"@jupyterlab/galata": "~5.2.0",
"@playwright/test": "^1.44.0",
"rimraf": "^3.0.2"
}
}
2 changes: 1 addition & 1 deletion ui-tests/test/editor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import path from 'path';

import { test } from './fixtures';

import { expect } from '@playwright/test';
import { expect } from '@jupyterlab/galata';

const FILE = 'environment.yml';

Expand Down
2 changes: 1 addition & 1 deletion ui-tests/test/filebrowser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import path from 'path';

import { expect } from '@playwright/test';
import { expect } from '@jupyterlab/galata';

import { test } from './fixtures';

Expand Down Expand Up @@ -36,7 +36,7 @@
const toolbar = page.getByRole('toolbar');

['Rename', 'Delete', 'Open', 'Download', 'Delete'].forEach(async (text) => {
expect(toolbar.getByText(text)).toBeVisible();

Check failure on line 39 in ui-tests/test/filebrowser.spec.ts

View workflow job for this annotation

GitHub Actions / ui-tests (firefox)

[firefox] › test/filebrowser.spec.ts:31:7 › File Browser › Select one file

1) [firefox] › test/filebrowser.spec.ts:31:7 › File Browser › Select one file ──────────────────── Error: expect(locator).toBeVisible() Locator: getByRole('toolbar').getByText('Delete') Expected: visible Received: hidden Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByRole('toolbar').getByText('Delete') 37 | 38 | ['Rename', 'Delete', 'Open', 'Download', 'Delete'].forEach(async (text) => { > 39 | expect(toolbar.getByText(text)).toBeVisible(); | ^ 40 | }); 41 | }); 42 | at forEach (/home/runner/work/notebook/notebook/ui-tests/test/filebrowser.spec.ts:39:39) at /home/runner/work/notebook/notebook/ui-tests/test/filebrowser.spec.ts:38:56
});
});

Expand Down
2 changes: 1 addition & 1 deletion ui-tests/test/general.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import path from 'path';

import { expect } from '@playwright/test';
import { expect } from '@jupyterlab/galata';

import { test } from './fixtures';

Expand Down
2 changes: 1 addition & 1 deletion ui-tests/test/layout.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import path from 'path';

import { expect } from '@playwright/test';
import { expect } from '@jupyterlab/galata';

import { galata } from '@jupyterlab/galata';

Expand Down
2 changes: 1 addition & 1 deletion ui-tests/test/links.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import path from 'path';

import { expect } from '@playwright/test';
import { expect } from '@jupyterlab/galata';

import { test } from './fixtures';

Expand Down
2 changes: 1 addition & 1 deletion ui-tests/test/menus.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import path from 'path';

import { test } from './fixtures';

import { expect } from '@playwright/test';
import { expect } from '@jupyterlab/galata';
import { waitForKernelReady } from './utils';

const NOTEBOOK = 'empty.ipynb';
Expand Down
21 changes: 18 additions & 3 deletions ui-tests/test/mobile.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
// Copyright (c) Jupyter Development Team.

Check failure on line 1 in ui-tests/test/mobile.spec.ts

View workflow job for this annotation

GitHub Actions / ui-tests (firefox)

[firefox] › test/mobile.spec.ts:39:7 › Mobile › The layout should be more compact on the notebook page

2) [firefox] › test/mobile.spec.ts:39:7 › Mobile › The layout should be more compact on the notebook page Test timeout of 60000ms exceeded.

Check failure on line 1 in ui-tests/test/mobile.spec.ts

View workflow job for this annotation

GitHub Actions / ui-tests (chromium)

[chromium] › test/mobile.spec.ts:39:7 › Mobile › The layout should be more compact on the notebook page

1) [chromium] › test/mobile.spec.ts:39:7 › Mobile › The layout should be more compact on the notebook page Test timeout of 60000ms exceeded.
// Distributed under the terms of the Modified BSD License.

import { expect } from '@playwright/test';
import { expect, galata } from '@jupyterlab/galata';

import { test } from './fixtures';

import { hideAddCellButton, waitForKernelReady } from './utils';

test.use({ autoGoto: false, viewport: { width: 524, height: 800 } });
test.use({
autoGoto: false,
viewport: { width: 524, height: 800 },
tmpPath: 'mobile-layout',
});

test.describe('Mobile', () => {
// manually create the test directory since tmpPath is set to a fixed value
test.beforeAll(async ({ request, tmpPath }) => {
const contents = galata.newContentsHelper(request);
await contents.createDirectory(tmpPath);
});

test.afterAll(async ({ request, tmpPath }) => {
const contents = galata.newContentsHelper(request);
await contents.deleteDirectory(tmpPath);
});

test('The layout should be more compact on the file browser page', async ({
page,
tmpPath,
Expand All @@ -29,9 +44,9 @@
await page.goto(`tree/${tmpPath}`);

// Create a new notebook
await page.click('text="New"');
const [notebook] = await Promise.all([
page.waitForEvent('popup'),

Check failure on line 49 in ui-tests/test/mobile.spec.ts

View workflow job for this annotation

GitHub Actions / ui-tests (firefox)

[firefox] › test/mobile.spec.ts:39:7 › Mobile › The layout should be more compact on the notebook page

2) [firefox] › test/mobile.spec.ts:39:7 › Mobile › The layout should be more compact on the notebook page Error: proxy.waitForEvent: Test timeout of 60000ms exceeded. =========================== logs =========================== waiting for event "popup" ============================================================ 47 | await page.click('text="New"'); 48 | const [notebook] = await Promise.all([ > 49 | page.waitForEvent('popup'), | ^ 50 | page.click('text="Python 3 (ipykernel)"'), 51 | ]); 52 | at /home/runner/work/notebook/notebook/ui-tests/test/mobile.spec.ts:49:12

Check failure on line 49 in ui-tests/test/mobile.spec.ts

View workflow job for this annotation

GitHub Actions / ui-tests (chromium)

[chromium] › test/mobile.spec.ts:39:7 › Mobile › The layout should be more compact on the notebook page

1) [chromium] › test/mobile.spec.ts:39:7 › Mobile › The layout should be more compact on the notebook page Error: proxy.waitForEvent: Test timeout of 60000ms exceeded. =========================== logs =========================== waiting for event "popup" ============================================================ 47 | await page.click('text="New"'); 48 | const [notebook] = await Promise.all([ > 49 | page.waitForEvent('popup'), | ^ 50 | page.click('text="Python 3 (ipykernel)"'), 51 | ]); 52 | at /home/runner/work/notebook/notebook/ui-tests/test/mobile.spec.ts:49:12
page.click('text="New"'),
page.click('text="Python 3 (ipykernel)"'),
]);

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/test/mobile.spec.ts-snapshots/tree-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ui-tests/test/mobile.spec.ts-snapshots/tree-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion ui-tests/test/notebook.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import path from 'path';

import { expect } from '@playwright/test';
import { expect } from '@jupyterlab/galata';

import { test } from './fixtures';

Expand Down
14 changes: 12 additions & 2 deletions ui-tests/test/settings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@

import { test } from './fixtures';

import { expect } from '@playwright/test';
import { expect, galata } from '@jupyterlab/galata';

test.use({ autoGoto: false });
test.use({ autoGoto: false, tmpPath: 'settings' });

test.describe('Settings', () => {
test.beforeAll(async ({ request, tmpPath }) => {
const contents = galata.newContentsHelper(request);
await contents.createDirectory(tmpPath);
});

test.afterAll(async ({ request, tmpPath }) => {
const contents = galata.newContentsHelper(request);
await contents.deleteDirectory(tmpPath);
});

test('Should be persisted after reloading the page', async ({
page,
tmpPath,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions ui-tests/test/smoke.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from '@playwright/test';
import { expect } from '@jupyterlab/galata';

import { test } from './fixtures';

Expand All @@ -24,9 +24,9 @@ test.describe('Smoke', () => {
await console.waitForSelector('.jp-CodeConsole');

// Create a new notebook
await page.click('text="New"');
const [notebook] = await Promise.all([
page.waitForEvent('popup'),
page.click('text="New"'),
page.click('text="Python 3 (ipykernel)"'),
]);

Expand Down
2 changes: 1 addition & 1 deletion ui-tests/test/tree.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { test } from './fixtures';

import { expect } from '@playwright/test';
import { expect } from '@jupyterlab/galata';

const SUBFOLDER = 'subfolder';

Expand Down
Loading
Loading