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

Fix flaky mobile UI tests #7278

Merged
merged 5 commits into from
Feb 26, 2024
Merged
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
25 changes: 13 additions & 12 deletions ui-tests/test/mobile.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// 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 (chromium)

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

2) [chromium] › test/mobile.spec.ts:24: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:24:7 › Mobile › The layout should be more compact on the notebook page

2) [chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page Pending operations: - proxy.click at test/mobile.spec.ts:35:12
// Distributed under the terms of the Modified BSD License.

import path from 'path';

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

import { test } from './fixtures';
Expand All @@ -28,26 +26,29 @@
tmpPath,
browserName,
}) => {
const notebook = 'empty.ipynb';
await page.contents.uploadFile(
path.resolve(__dirname, `./notebooks/${notebook}`),
`${tmpPath}/${notebook}`
);
await page.goto(`notebooks/${tmpPath}/${notebook}`);
await page.goto(`tree/${tmpPath}`);

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

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

View workflow job for this annotation

GitHub Actions / ui-tests (chromium)

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

2) [chromium] › test/mobile.spec.ts:24:7 › Mobile › The layout should be more compact on the notebook page Error: proxy.waitForEvent: Page closed =========================== logs =========================== waiting for event "popup" ============================================================ 31 | // Create a new notebook 32 | const [notebook] = await Promise.all([ > 33 | page.waitForEvent('popup'), | ^ 34 | page.click('text="New"'), 35 | page.click('text="Python 3 (ipykernel)"'), 36 | ]); at /home/runner/work/notebook/notebook/ui-tests/test/mobile.spec.ts:33:12
page.click('text="New"'),
page.click('text="Python 3 (ipykernel)"'),
]);

// wait for the kernel status animations to be finished
await waitForKernelReady(page);
await waitForKernelReady(notebook);

// force switching back to command mode to avoid capturing the cursor in the screenshot
await page.evaluate(async () => {
await notebook.evaluate(async () => {
await window.jupyterapp.commands.execute('notebook:enter-command-mode');
});

// TODO: remove
if (browserName === 'firefox') {
await hideAddCellButton(page);
await hideAddCellButton(notebook);
}

expect(await page.screenshot()).toMatchSnapshot('notebook.png');
expect(await notebook.screenshot()).toMatchSnapshot('notebook.png');
await notebook.close();
});
});
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