Skip to content

Commit c2ca209

Browse files
authored
Remove viewport workaround in the UI tests (#6887)
* Remove viewport workaround in the UI tests * Update viewport * Fix handling of kernel ready * Bump to 600 * Update ui-tests/test/mobile.spec.ts
1 parent 728807f commit c2ca209

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

ui-tests/test/mobile.spec.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { test } from './fixtures';
99

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

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

1414
test.describe('Mobile', () => {
1515
test('The layout should be more compact on the file browser page', async ({
@@ -18,10 +18,6 @@ test.describe('Mobile', () => {
1818
}) => {
1919
await page.goto(`tree/${tmpPath}`);
2020

21-
// temporary workaround to trigger a toolbar resize
22-
// TODO: investigate in https://github.com/jupyter/notebook/issues/6553
23-
await page.setViewportSize({ width: 524, height: 800 });
24-
2521
await page.waitForSelector('#top-panel-wrapper', { state: 'hidden' });
2622

2723
expect(await page.screenshot()).toMatchSnapshot('tree.png');
@@ -42,10 +38,6 @@ test.describe('Mobile', () => {
4238
// wait for the kernel status animations to be finished
4339
await waitForKernelReady(page);
4440

45-
// temporary workaround to trigger a toolbar resize
46-
// TODO: investigate in https://github.com/jupyter/notebook/issues/6553
47-
await page.setViewportSize({ width: 524, height: 800 });
48-
4941
// force switching back to command mode to avoid capturing the cursor in the screenshot
5042
await page.evaluate(async () => {
5143
await window.jupyterapp.commands.execute('notebook:enter-command-mode');

ui-tests/test/utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ export async function waitForKernelReady(
3232
}, true);
3333
return finished;
3434
});
35-
await page.waitForSelector('.jp-DebuggerBugButton[aria-disabled="false"]');
35+
if (page.viewportSize()?.width > 600) {
36+
await page.waitForSelector('.jp-DebuggerBugButton[aria-disabled="false"]');
37+
}
3638
}
3739

3840
/**

0 commit comments

Comments
 (0)