@@ -9,69 +9,70 @@ function item(name: string) {
9
9
return `.jp-DirListing-item[title^="Name: ${ name } "]` ;
10
10
}
11
11
12
+ test . describe . serial ( 'jupyterlab-unfold' , ( ) => {
13
+ test ( 'should unfold' , async ( { page } ) => {
14
+ await page . goto ( `${ TARGET_URL } /lab` ) ;
15
+ await page . waitForSelector ( '#jupyterlab-splash' , { state : 'detached' } ) ;
16
+ await page . waitForSelector ( 'div[role="main"] >> text=Launcher' ) ;
12
17
13
- test ( 'should unfold' , async ( { page } ) => {
14
- await page . goto ( `${ TARGET_URL } /lab` ) ;
15
- await page . waitForSelector ( '#jupyterlab-splash' , { state : 'detached' } ) ;
16
- await page . waitForSelector ( 'div[role="main"] >> text=Launcher' ) ;
18
+ // Let time for JupyterLab to finish rendering
19
+ await page . waitForTimeout ( 2000 ) ;
17
20
18
- // Let time for JupyterLab to finish rendering
19
- await page . waitForTimeout ( 2000 ) ;
21
+ expect (
22
+ await page . locator ( TREE_LOCATOR ) . screenshot ( )
23
+ ) . toMatchSnapshot ( 'first-render.png' ) ;
20
24
21
- expect (
22
- await page . locator ( TREE_LOCATOR ) . screenshot ( )
23
- ) . toMatchSnapshot ( 'first-render.png' ) ;
25
+ await page . click ( item ( 'dir1' ) ) ;
26
+ await page . waitForSelector ( item ( 'dir2' ) ) ;
24
27
25
- await page . click ( item ( 'dir1' ) ) ;
26
- await page . waitForSelector ( item ( 'dir2' ) ) ;
28
+ expect (
29
+ await page . locator ( TREE_LOCATOR ) . screenshot ( )
30
+ ) . toMatchSnapshot ( 'unfold-dir1.png' ) ;
27
31
28
- expect (
29
- await page . locator ( TREE_LOCATOR ) . screenshot ( )
30
- ) . toMatchSnapshot ( 'unfold-dir1.png' ) ;
32
+ await page . click ( item ( 'dir2' ) ) ;
33
+ await page . waitForSelector ( item ( 'dir3' ) ) ;
31
34
32
- await page . click ( item ( 'dir2' ) ) ;
33
- await page . waitForSelector ( item ( 'dir3' ) ) ;
35
+ expect (
36
+ await page . locator ( TREE_LOCATOR ) . screenshot ( )
37
+ ) . toMatchSnapshot ( 'unfold-dir2.png' ) ;
34
38
35
- expect (
36
- await page . locator ( TREE_LOCATOR ) . screenshot ( )
37
- ) . toMatchSnapshot ( 'unfold-dir2.png' ) ;
39
+ await page . click ( item ( 'dir3' ) ) ;
40
+ await page . waitForSelector ( item ( 'file211.txt' ) ) ;
38
41
39
- await page . click ( item ( 'dir3' ) ) ;
40
- await page . waitForSelector ( item ( 'file211.txt' ) ) ;
42
+ expect (
43
+ await page . locator ( TREE_LOCATOR ) . screenshot ( )
44
+ ) . toMatchSnapshot ( 'unfold-dir3.png' ) ;
41
45
42
- expect (
43
- await page . locator ( TREE_LOCATOR ) . screenshot ( )
44
- ) . toMatchSnapshot ( 'unfold-dir3.png' ) ;
46
+ await page . click ( item ( 'dir2' ) ) ;
47
+ await page . waitForSelector ( item ( 'dir3' ) , { state : 'detached' } ) ;
45
48
46
- await page . click ( item ( 'dir2' ) ) ;
47
- await page . waitForSelector ( item ( 'dir3' ) , { state : 'detached' } ) ;
49
+ expect (
50
+ await page . locator ( TREE_LOCATOR ) . screenshot ( )
51
+ ) . toMatchSnapshot ( 'fold-dir2.png' ) ;
48
52
49
- expect (
50
- await page . locator ( TREE_LOCATOR ) . screenshot ( )
51
- ) . toMatchSnapshot ( 'fold-dir2.png' ) ;
53
+ await page . click ( item ( 'dir2' ) ) ;
54
+ await page . waitForSelector ( item ( 'dir3' ) ) ;
52
55
53
- await page . click ( item ( 'dir2' ) ) ;
54
- await page . waitForSelector ( item ( 'dir3' ) ) ;
55
-
56
- expect (
57
- await page . locator ( TREE_LOCATOR ) . screenshot ( )
58
- ) . toMatchSnapshot ( 'unfold-dir2-2.png' ) ;
59
- } ) ;
56
+ expect (
57
+ await page . locator ( TREE_LOCATOR ) . screenshot ( )
58
+ ) . toMatchSnapshot ( 'unfold-dir2-2.png' ) ;
59
+ } ) ;
60
60
61
61
62
- test ( 'should open file' , async ( { page } ) => {
63
- await page . goto ( `${ TARGET_URL } /lab` ) ;
64
- await page . waitForSelector ( '#jupyterlab-splash' , { state : 'detached' } ) ;
65
- await page . waitForSelector ( 'div[role="main"] >> text=Launcher' ) ;
62
+ test ( 'should open file' , async ( { page } ) => {
63
+ await page . goto ( `${ TARGET_URL } /lab` ) ;
64
+ await page . waitForSelector ( '#jupyterlab-splash' , { state : 'detached' } ) ;
65
+ await page . waitForSelector ( 'div[role="main"] >> text=Launcher' ) ;
66
66
67
- // Let time for JupyterLab to finish rendering
68
- await page . waitForTimeout ( 2000 ) ;
67
+ // Let time for JupyterLab to finish rendering
68
+ await page . waitForTimeout ( 2000 ) ;
69
69
70
- await page . dblclick ( item ( 'file211.txt' ) ) ;
71
- // TODO Use something more reliable
72
- await page . waitForTimeout ( 1000 ) ;
70
+ await page . dblclick ( item ( 'file211.txt' ) ) ;
71
+ // TODO Use something more reliable
72
+ await page . waitForTimeout ( 1000 ) ;
73
73
74
- expect (
75
- await page . locator ( TABS_LOCATOR ) . screenshot ( )
76
- ) . toMatchSnapshot ( 'open-file211.png' ) ;
74
+ expect (
75
+ await page . locator ( TABS_LOCATOR ) . screenshot ( )
76
+ ) . toMatchSnapshot ( 'open-file211.png' ) ;
77
+ } ) ;
77
78
} ) ;
0 commit comments