Skip to content

Commit

Permalink
Try resize workaround in tests for now
Browse files Browse the repository at this point in the history
Fix order of selectors
  • Loading branch information
jtpio committed Oct 6, 2022
1 parent b893cf0 commit 708928b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions ui-tests/test/mobile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,24 @@ import path from 'path';
import { expect } from '@playwright/test';

import { test } from './fixtures';

import { waitForKernelReady } from './utils';

test.use({ autoGoto: false, viewport: { width: 524, height: 800 } });
test.use({ autoGoto: false });

test.describe('Mobile', () => {
test('The layout should be more compact on the file browser page', async ({
page,
tmpPath
}) => {
await page.goto(`tree/${tmpPath}`);

// temporary workaround to trigger a toolbar resize
// TODO: investigate in https://github.com/jupyter/notebook/issues/6553
await page.setViewportSize({ width: 524, height: 800 });

await page.waitForSelector('#top-panel-wrapper', { state: 'hidden' });

expect(await page.screenshot()).toMatchSnapshot('tree.png');
});

Expand All @@ -30,12 +37,14 @@ test.describe('Mobile', () => {
`${tmpPath}/${notebook}`
);
await page.goto(`notebooks/${tmpPath}/${notebook}`);
// TODO: investigate why this does not run the cells in Jupyter Notebook
// await page.notebook.run();

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

// temporary workaround to trigger a toolbar resize
// TODO: investigate in https://github.com/jupyter/notebook/issues/6553
await page.setViewportSize({ width: 524, height: 800 });

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

0 comments on commit 708928b

Please sign in to comment.