Skip to content

Commit 7a4680d

Browse files
author
Lingxi Chen
committed
added more cypress tests for wlm details
Signed-off-by: Lingxi Chen <[email protected]>
1 parent 948b1a5 commit 7a4680d

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

cypress/e2e/6_WLM_details.cy.js

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44
*/
55

66
describe('WLM Details Page', () => {
7-
const groupName = `test_group_${Date.now()}`; // Unique name for each run
7+
const groupName = `test_group_${Date.now()}`;
88

99
before(() => {
10-
const groupName = `test_group_${Date.now()}`;
1110
Cypress.env('groupName', groupName);
1211

1312
// Clean up existing non-default groups
@@ -59,11 +58,12 @@ describe('WLM Details Page', () => {
5958
});
6059

6160
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();
6363
cy.contains('Workload group settings').should('exist');
6464

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();
6767
cy.contains('Node ID').should('exist');
6868
});
6969

@@ -75,6 +75,11 @@ describe('WLM Details Page', () => {
7575
it('should allow modifying and saving settings', () => {
7676
cy.get('.euiTab').contains('Settings').click();
7777

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+
7883
// Modify CPU and memory thresholds
7984
cy.get('input[type="number"]').first().clear().type('0.5');
8085
cy.get('input[type="number"]').last().clear().type('0.6');
@@ -97,9 +102,9 @@ describe('WLM Details Page', () => {
97102
});
98103

99104
it('should delete the workload group successfully', () => {
100-
cy.contains('Delete').click();
105+
cy.contains('Delete').click(); // opens modal
101106
cy.get('input[placeholder="delete"]').type('delete');
102-
cy.get('button').contains('Delete').click();
107+
cy.get('.euiModalFooter button').contains('Delete').click();
103108

104109
// Confirm redirected back to WLM main page
105110
cy.url().should('include', '/workloadManagement');
@@ -108,3 +113,12 @@ describe('WLM Details Page', () => {
108113
cy.contains(`Deleted workload group "${groupName}"`).should('exist');
109114
});
110115
});
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

Comments
 (0)