4
4
*/
5
5
6
6
describe ( 'WLM Details Page' , ( ) => {
7
- const groupName = `test_group_${ Date . now ( ) } ` ; // Unique name for each run
7
+ const groupName = `test_group_${ Date . now ( ) } ` ;
8
8
9
9
before ( ( ) => {
10
- const groupName = `test_group_${ Date . now ( ) } ` ;
11
10
Cypress . env ( 'groupName' , groupName ) ;
12
11
13
12
// Clean up existing non-default groups
@@ -59,11 +58,12 @@ describe('WLM Details Page', () => {
59
58
} ) ;
60
59
61
60
it ( 'should switch between tabs' , ( ) => {
62
- cy . get ( '.euiTab' ) . contains ( 'Settings' ) . click ( ) ;
61
+ // Switch to Settings tab
62
+ cy . get ( '[data-testid="wlm-tab-settings"]' ) . click ( ) ;
63
63
cy . contains ( 'Workload group settings' ) . should ( 'exist' ) ;
64
64
65
- // Scroll into view and click Resources tab (force to bypass overlap)
66
- cy . get ( '.euiTab ' ) . contains ( 'Resources' ) . scrollIntoView ( ) . click ( { force : true } ) ;
65
+ // Switch to Resources tab
66
+ cy . get ( '[data-testid="wlm-tab-resources"] ' ) . click ( ) ;
67
67
cy . contains ( 'Node ID' ) . should ( 'exist' ) ;
68
68
} ) ;
69
69
@@ -75,6 +75,11 @@ describe('WLM Details Page', () => {
75
75
it ( 'should allow modifying and saving settings' , ( ) => {
76
76
cy . get ( '.euiTab' ) . contains ( 'Settings' ) . click ( ) ;
77
77
78
+ cy . get ( 'input[type="number"]' ) . first ( ) . clear ( ) . type ( '150' ) ;
79
+ cy . get ( 'input[type="number"]' ) . last ( ) . clear ( ) . type ( '-5' ) ;
80
+
81
+ cy . contains ( 'Value must be between 0 and 100' ) . should ( 'exist' ) ;
82
+
78
83
// Modify CPU and memory thresholds
79
84
cy . get ( 'input[type="number"]' ) . first ( ) . clear ( ) . type ( '0.5' ) ;
80
85
cy . get ( 'input[type="number"]' ) . last ( ) . clear ( ) . type ( '0.6' ) ;
@@ -97,9 +102,9 @@ describe('WLM Details Page', () => {
97
102
} ) ;
98
103
99
104
it ( 'should delete the workload group successfully' , ( ) => {
100
- cy . contains ( 'Delete' ) . click ( ) ;
105
+ cy . contains ( 'Delete' ) . click ( ) ; // opens modal
101
106
cy . get ( 'input[placeholder="delete"]' ) . type ( 'delete' ) ;
102
- cy . get ( 'button' ) . contains ( 'Delete' ) . click ( ) ;
107
+ cy . get ( '.euiModalFooter button' ) . contains ( 'Delete' ) . click ( ) ;
103
108
104
109
// Confirm redirected back to WLM main page
105
110
cy . url ( ) . should ( 'include' , '/workloadManagement' ) ;
@@ -108,3 +113,12 @@ describe('WLM Details Page', () => {
108
113
cy . contains ( `Deleted workload group "${ groupName } "` ) . should ( 'exist' ) ;
109
114
} ) ;
110
115
} ) ;
116
+
117
+ describe ( 'WLM Details – DEFAULT_WORKLOAD_GROUP' , ( ) => {
118
+ it ( 'should disable settings tab for DEFAULT_WORKLOAD_GROUP' , ( ) => {
119
+ cy . visit ( '/app/workload-management#/wlm-details?name=DEFAULT_WORKLOAD_GROUP' ) ;
120
+ cy . get ( '[data-testid="wlm-tab-settings"]' ) . click ( ) ;
121
+ cy . contains ( 'Settings are not available for the DEFAULT_WORKLOAD_GROUP' ) . should ( 'exist' ) ;
122
+ } ) ;
123
+ } ) ;
124
+
0 commit comments