Skip to content

Commit

Permalink
Fix flaky mobile UI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpio committed Feb 26, 2024
1 parent f2ee4ba commit 42d57bb
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions ui-tests/test/mobile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,29 @@ test.describe('Mobile', () => {

test('The layout should be more compact on the notebook page', async ({
page,
tmpPath,
browserName,
}) => {
const notebook = 'empty.ipynb';
await page.contents.uploadFile(
path.resolve(__dirname, `./notebooks/${notebook}`),
`${tmpPath}/${notebook}`
);
await page.goto(`notebooks/${tmpPath}/${notebook}`);
// Create a new notebook
const [notebook] = await Promise.all([
page.waitForEvent('popup'),

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

View workflow job for this annotation

GitHub Actions / ui-tests (firefox)

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

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

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

View workflow job for this annotation

GitHub Actions / ui-tests (firefox)

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

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

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

View workflow job for this annotation

GitHub Actions / ui-tests (firefox)

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

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

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

View workflow job for this annotation

GitHub Actions / ui-tests (firefox)

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

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

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

View workflow job for this annotation

GitHub Actions / ui-tests (chromium)

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

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

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

View workflow job for this annotation

GitHub Actions / ui-tests (chromium)

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

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

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

View workflow job for this annotation

GitHub Actions / ui-tests (chromium)

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

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

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

View workflow job for this annotation

GitHub Actions / ui-tests (chromium)

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

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

0 comments on commit 42d57bb

Please sign in to comment.