16
16
*/
17
17
18
18
describe ( 'Workspace view and component/widget' , ( ) => {
19
+ beforeEach ( ( ) => {
20
+ cy . visit ( '/#/workspace/one' )
21
+ } )
22
+
19
23
afterEach ( ( ) => {
20
24
cy
21
25
. get ( '.v-alert' )
22
26
. should ( 'not.exist' )
23
27
} )
24
28
25
29
it ( 'Should display the Lumino component in the Workspace view, with a Tree widget' , ( ) => {
26
- cy . visit ( '/#/workspace/one' )
27
30
cy . get ( '.lm-TabBar-tabLabel' ) . should ( 'have.length' , 1 )
28
31
29
32
// The skeleton loader should stop existing
@@ -40,22 +43,18 @@ describe('Workspace view and component/widget', () => {
40
43
} )
41
44
42
45
it ( 'Should remove the default widget and leave no more widgets' , ( ) => {
43
- cy . visit ( '/#/workspace/one' )
44
46
cy . get ( '.lm-TabBar-tabCloseIcon' ) . click ( )
45
47
cy . get ( '.lm-TabBar-tabLabel' ) . should ( 'not.exist' )
46
48
} )
47
49
48
50
it ( 'Should be able to add two widgets of the same type' , ( ) => {
49
- cy . visit ( '/#/workspace/one' )
50
51
cy . get ( '.lm-TabBar-tabLabel' ) . should ( 'have.length' , 1 )
51
52
cy . get ( 'a.add-view' ) . click ( )
52
53
cy . get ( '#toolbar-add-Tree-view' ) . click ( )
53
54
cy . get ( '.lm-TabBar-tabLabel' ) . should ( 'have.length' , 2 )
54
55
} )
55
56
56
57
it ( 'Should be able to add two widgets of different types' , ( ) => {
57
- cy . visit ( '/#/workspace/one' )
58
-
59
58
// there should be one widget open by default (tree)
60
59
cy . get ( '.lm-TabBar-tabLabel' )
61
60
// there should be a tab representing the widget
@@ -80,21 +79,21 @@ describe('Workspace view and component/widget', () => {
80
79
} )
81
80
82
81
it ( 'Should remove widgets added successfully' , ( ) => {
83
- cy . visit ( '/#/workspace/one' )
84
82
cy . get ( '.lm-TabBar-tabLabel' ) . should ( 'have.length' , 1 )
85
83
// add a tree view
86
84
cy . get ( 'a.add-view' ) . click ( )
87
85
cy . get ( '#toolbar-add-Tree-view' ) . click ( )
88
86
// ensure we have 2 widgets now
89
87
cy . get ( '.lm-TabBar-tabLabel' ) . should ( 'have.length' , 2 )
90
88
// close all widgets
91
- cy . get ( '.lm-TabBar-tabCloseIcon' ) . click ( { multiple : true } )
89
+ cy . get ( '.lm-TabBar-tabCloseIcon' ) . each ( ( $el ) => {
90
+ cy . wrap ( $el ) . click ( )
91
+ } )
92
92
// ensure we have no widgets now
93
93
cy . get ( '.lm-TabBar-tabLabel' ) . should ( 'not.exist' )
94
94
} )
95
95
96
96
it ( 'Should remove widgets when leaving the Workspace view' , ( ) => {
97
- cy . visit ( '/#/workspace/one' )
98
97
cy . get ( '.lm-TabBar-tabLabel' ) . should ( 'have.length' , 1 )
99
98
// add a tree view
100
99
cy . get ( 'a.add-view' ) . click ( )
@@ -107,7 +106,6 @@ describe('Workspace view and component/widget', () => {
107
106
} )
108
107
109
108
it ( 'Should remove widgets when updating the Workspace view' , ( ) => {
110
- cy . visit ( '/#/workspace/one' )
111
109
cy . get ( '.lm-TabBar-tabLabel' ) . should ( 'have.length' , 1 )
112
110
// add a tree view
113
111
cy . get ( 'a.add-view' ) . click ( )
0 commit comments