Skip to content
New issue

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

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

Already on GitHub? # to your account

Remove viewport workaround in the UI tests #6887

Merged
merged 5 commits into from
Dec 13, 2023
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
10 changes: 1 addition & 9 deletions ui-tests/test/mobile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { test } from './fixtures';

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

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

test.describe('Mobile', () => {
test('The layout should be more compact on the file browser page', async ({
Expand All @@ -18,10 +18,6 @@ test.describe('Mobile', () => {
}) => {
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 @@ -42,10 +38,6 @@ test.describe('Mobile', () => {
// 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
4 changes: 3 additions & 1 deletion ui-tests/test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export async function waitForKernelReady(
}, true);
return finished;
});
await page.waitForSelector('.jp-DebuggerBugButton[aria-disabled="false"]');
if (page.viewportSize()?.width > 600) {
await page.waitForSelector('.jp-DebuggerBugButton[aria-disabled="false"]');
}
}

/**
Expand Down