Skip to content

Commit 948b1a5

Browse files
author
Lingxi Chen
committed
updated main cypress tests
Signed-off-by: Lingxi Chen <[email protected]>
1 parent 045ca6f commit 948b1a5

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

cypress/e2e/5_WLM_main.cy.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,15 @@ describe('WLM Main Page', () => {
2323
});
2424

2525
it('should refresh stats on clicking the refresh button', () => {
26-
cy.get('button').contains('Refresh').click();
27-
cy.wait(3000);
28-
cy.get('.euiTableRow').should('have.length.greaterThan', 0);
26+
cy.get('.euiTableRow').then(($initialRows) => {
27+
const initialRowCount = $initialRows.length;
28+
29+
cy.get('button').contains('Refresh').click();
30+
31+
cy.get('.euiTableRow', { timeout: 10000 }).should(($newRows) => {
32+
expect($newRows.length).to.be.greaterThan(0);
33+
});
34+
});
2935
});
3036

3137
it('should switch between nodes using dropdown', () => {
@@ -78,8 +84,11 @@ describe('WLM Main Page', () => {
7884
});
7985

8086
it('should filter workload groups by name in search', () => {
81-
cy.get('.euiFieldSearch').type('DEFAULT_QUERY_GROUP');
82-
cy.get('.euiTableRow').should('contain.text', 'DEFAULT_QUERY_GROUP');
87+
cy.get('.euiFieldSearch').type('DEFAULT_WORKLOAD_GROUP');
88+
cy.get('.euiTableRow').should('contain.text', 'DEFAULT_WORKLOAD_GROUP');
89+
90+
cy.get('.euiFieldSearch').clear().type('nonexistent_group_12345');
91+
cy.get('.euiTableRow').should('contain.text', 'No items found');
8392
});
8493

8594
it('should route to workload group detail page when clicking a group name', () => {

cypress/e2e/6_WLM_details.cy.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ describe('WLM Details Page', () => {
1313
// Clean up existing non-default groups
1414
cy.request({
1515
method: 'GET',
16-
url: '/api/_wlm/query_group',
16+
url: '/api/_wlm/workload_group',
1717
headers: { 'osd-xsrf': 'true' },
1818
}).then((res) => {
19-
const groups = res.body?.query_groups ?? [];
19+
const groups = res.body?.workload_groups ?? [];
2020
groups.forEach((g) => {
21-
if (g.name !== 'DEFAULT_QUERY_GROUP') {
21+
if (g.name !== 'DEFAUL_WORKLOAD_GROUP') {
2222
cy.request({
2323
method: 'DELETE',
24-
url: `/api/_wlm/query_group/${g.name}`,
24+
url: `/api/_wlm/workload_group/${g.name}`,
2525
headers: { 'osd-xsrf': 'true' },
2626
failOnStatusCode: false,
2727
});
@@ -31,7 +31,7 @@ describe('WLM Details Page', () => {
3131

3232
cy.request({
3333
method: 'PUT',
34-
url: '/api/_wlm/query_group',
34+
url: '/api/_wlm/workload_group',
3535
headers: { 'osd-xsrf': 'true' },
3636
body: {
3737
name: groupName,

0 commit comments

Comments
 (0)