@@ -6,17 +6,24 @@ import path from 'path';
66import { expect } from '@playwright/test' ;
77
88import { test } from './fixtures' ;
9+
910import { waitForKernelReady } from './utils' ;
1011
11- test . use ( { autoGoto : false , viewport : { width : 524 , height : 800 } } ) ;
12+ test . use ( { autoGoto : false } ) ;
1213
1314test . describe ( 'Mobile' , ( ) => {
1415 test ( 'The layout should be more compact on the file browser page' , async ( {
1516 page,
1617 tmpPath
1718 } ) => {
1819 await page . goto ( `tree/${ tmpPath } ` ) ;
20+
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+
1925 await page . waitForSelector ( '#top-panel-wrapper' , { state : 'hidden' } ) ;
26+
2027 expect ( await page . screenshot ( ) ) . toMatchSnapshot ( 'tree.png' ) ;
2128 } ) ;
2229
@@ -30,12 +37,14 @@ test.describe('Mobile', () => {
3037 `${ tmpPath } /${ notebook } `
3138 ) ;
3239 await page . goto ( `notebooks/${ tmpPath } /${ notebook } ` ) ;
33- // TODO: investigate why this does not run the cells in Jupyter Notebook
34- // await page.notebook.run();
3540
3641 // wait for the kernel status animations to be finished
3742 await waitForKernelReady ( page ) ;
3843
44+ // temporary workaround to trigger a toolbar resize
45+ // TODO: investigate in https://github.com/jupyter/notebook/issues/6553
46+ await page . setViewportSize ( { width : 524 , height : 800 } ) ;
47+
3948 // force switching back to command mode to avoid capturing the cursor in the screenshot
4049 await page . evaluate ( async ( ) => {
4150 await window . jupyterapp . commands . execute ( 'notebook:enter-command-mode' ) ;
0 commit comments