Skip to content

Commit 7b6b9cb

Browse files
committed
test(37943): fix tests
1 parent 9802f94 commit 7b6b9cb

File tree

5 files changed

+86
-4
lines changed

5 files changed

+86
-4
lines changed

hivemq-edge-frontend/cypress/e2e/workspace/workspace-layout-accessibility.spec.cy.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ describe('Workspace Layout - Accessibility & Visual Regression', { tags: ['@perc
5151
it('should have accessible layout controls', () => {
5252
cy.injectAxe()
5353

54+
// Expand toolbar to access layout controls
55+
workspacePage.canvasToolbar.expandButton.click()
56+
5457
// Check accessibility of layout controls panel
5558
workspacePage.layoutControls.panel.should('be.visible')
5659

@@ -65,6 +68,9 @@ describe('Workspace Layout - Accessibility & Visual Regression', { tags: ['@perc
6568
it('should have accessible presets menu', () => {
6669
cy.injectAxe()
6770

71+
// Expand toolbar to access layout controls
72+
workspacePage.canvasToolbar.expandButton.click()
73+
6874
// Open presets menu
6975
workspacePage.layoutControls.presetsButton.click()
7076

@@ -80,6 +86,9 @@ describe('Workspace Layout - Accessibility & Visual Regression', { tags: ['@perc
8086
it('should have accessible options drawer', () => {
8187
cy.injectAxe()
8288

89+
// Expand toolbar to access layout controls
90+
workspacePage.canvasToolbar.expandButton.click()
91+
8392
// Select algorithm and open drawer
8493
workspacePage.layoutControls.algorithmSelector.select('DAGRE_TB')
8594
workspacePage.layoutControls.optionsButton.click()
@@ -94,6 +103,9 @@ describe('Workspace Layout - Accessibility & Visual Regression', { tags: ['@perc
94103
})
95104

96105
it('should support keyboard navigation', () => {
106+
// Expand toolbar to access layout controls
107+
workspacePage.canvasToolbar.expandButton.click()
108+
97109
// Focus on workspace to start keyboard navigation
98110
workspacePage.canvas.click()
99111

@@ -109,13 +121,19 @@ describe('Workspace Layout - Accessibility & Visual Regression', { tags: ['@perc
109121
it('should take Percy snapshot of layout controls', () => {
110122
workspacePage.toolbox.fit.click()
111123

124+
// Expand toolbar to access layout controls
125+
workspacePage.canvasToolbar.expandButton.click()
126+
112127
// Snapshot with layout controls visible
113128
cy.percySnapshot('Workspace - Layout Controls Panel')
114129
})
115130

116131
it('should take Percy snapshot of options drawer', () => {
117132
workspacePage.toolbox.fit.click()
118133

134+
// Expand toolbar to access layout controls
135+
workspacePage.canvasToolbar.expandButton.click()
136+
119137
// Open options drawer
120138
workspacePage.layoutControls.algorithmSelector.select('DAGRE_TB')
121139
workspacePage.layoutControls.optionsButton.click()
@@ -128,6 +146,9 @@ describe('Workspace Layout - Accessibility & Visual Regression', { tags: ['@perc
128146
})
129147

130148
it('should take Percy snapshot of presets menu', () => {
149+
// Expand toolbar to access layout controls
150+
workspacePage.canvasToolbar.expandButton.click()
151+
131152
// Save a preset first
132153
workspacePage.layoutControls.algorithmSelector.select('DAGRE_TB')
133154
workspacePage.layoutControls.applyButton.click()
@@ -149,6 +170,9 @@ describe('Workspace Layout - Accessibility & Visual Regression', { tags: ['@perc
149170
it('should take Percy snapshot of workspace after layout', () => {
150171
workspacePage.toolbox.fit.click()
151172

173+
// Expand toolbar to access layout controls
174+
workspacePage.canvasToolbar.expandButton.click()
175+
152176
// Apply layout
153177
workspacePage.layoutControls.algorithmSelector.select('DAGRE_TB')
154178
workspacePage.layoutControls.applyButton.click()
@@ -168,6 +192,9 @@ describe('Workspace Layout - Accessibility & Visual Regression', { tags: ['@perc
168192
})
169193

170194
it('should have proper ARIA labels', () => {
195+
// Expand toolbar to access layout controls
196+
workspacePage.canvasToolbar.expandButton.click()
197+
171198
// Check layout selector has proper label
172199
workspacePage.layoutControls.algorithmSelector.should('have.attr', 'data-testid')
173200

@@ -196,6 +223,7 @@ describe('Workspace Layout - Accessibility & Visual Regression', { tags: ['@perc
196223
overwrite: true,
197224
})
198225

226+
workspacePage.canvasToolbar.expandButton.click()
199227
// Select Radial Hub layout algorithm (provides best visual results)
200228
workspacePage.layoutControls.algorithmSelector.select('RADIAL_HUB')
201229
workspacePage.layoutControls.algorithmSelector.should('have.value', 'RADIAL_HUB')

hivemq-edge-frontend/cypress/e2e/workspace/workspace-layout-basic.spec.cy.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ describe('Workspace Layout - Basic', () => {
4949
})
5050

5151
it('should display layout controls in workspace', () => {
52+
// Expand toolbar to access layout controls
53+
workspacePage.canvasToolbar.expandButton.click()
54+
5255
// Layout controls panel should be visible
5356
workspacePage.layoutControls.panel.should('be.visible')
5457

@@ -60,6 +63,9 @@ describe('Workspace Layout - Basic', () => {
6063
})
6164

6265
it('should allow selecting different layout algorithms', () => {
66+
// Expand toolbar to access layout controls
67+
workspacePage.canvasToolbar.expandButton.click()
68+
6369
// Select Vertical Tree Layout (Dagre TB)
6470
workspacePage.layoutControls.algorithmSelector.select('DAGRE_TB')
6571
workspacePage.layoutControls.algorithmSelector.should('have.value', 'DAGRE_TB')
@@ -74,6 +80,9 @@ describe('Workspace Layout - Basic', () => {
7480
})
7581

7682
it('should apply layout when button clicked', () => {
83+
// Expand toolbar to access layout controls
84+
workspacePage.canvasToolbar.expandButton.click()
85+
7786
// Get initial positions of nodes
7887
let initialEdgePosition: { x: number; y: number }
7988
let initialBridgePosition: { x: number; y: number }
@@ -126,6 +135,9 @@ describe('Workspace Layout - Basic', () => {
126135
})
127136

128137
it('should apply multiple layouts in sequence', () => {
138+
// Expand toolbar to access layout controls
139+
workspacePage.canvasToolbar.expandButton.click()
140+
129141
// Apply first layout
130142
workspacePage.layoutControls.algorithmSelector.select('DAGRE_TB')
131143
workspacePage.layoutControls.applyButton.click()
@@ -146,6 +158,9 @@ describe('Workspace Layout - Basic', () => {
146158
})
147159

148160
it('should persist selected algorithm across interactions', () => {
161+
// Expand toolbar to access layout controls
162+
workspacePage.canvasToolbar.expandButton.click()
163+
149164
// Select an algorithm
150165
workspacePage.layoutControls.algorithmSelector.select('COLA_FORCE')
151166

hivemq-edge-frontend/cypress/e2e/workspace/workspace-layout-options.spec.cy.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ describe('Workspace Layout - Options', () => {
4949
})
5050

5151
it('should open layout options drawer', () => {
52+
// Expand toolbar to access layout controls
53+
workspacePage.canvasToolbar.expandButton.click()
54+
5255
// Click options button
5356
workspacePage.layoutControls.optionsButton.click()
5457

@@ -58,6 +61,9 @@ describe('Workspace Layout - Options', () => {
5861
})
5962

6063
it('should show different options for different algorithms', () => {
64+
// Expand toolbar to access layout controls
65+
workspacePage.canvasToolbar.expandButton.click()
66+
6167
// Select Dagre algorithm
6268
workspacePage.layoutControls.algorithmSelector.select('DAGRE_TB')
6369
workspacePage.layoutControls.optionsButton.click()
@@ -81,6 +87,9 @@ describe('Workspace Layout - Options', () => {
8187
})
8288

8389
it('should close drawer on cancel', () => {
90+
// Expand toolbar to access layout controls
91+
workspacePage.canvasToolbar.expandButton.click()
92+
8493
// Open drawer
8594
workspacePage.layoutControls.algorithmSelector.select('DAGRE_TB')
8695
workspacePage.layoutControls.optionsButton.click()
@@ -94,6 +103,9 @@ describe('Workspace Layout - Options', () => {
94103
})
95104

96105
it('should apply layout with modified options', () => {
106+
// Expand toolbar to access layout controls
107+
workspacePage.canvasToolbar.expandButton.click()
108+
97109
// Select algorithm and open options
98110
workspacePage.layoutControls.algorithmSelector.select('DAGRE_TB')
99111
workspacePage.layoutControls.optionsButton.click()
@@ -108,9 +120,6 @@ describe('Workspace Layout - Options', () => {
108120
// Apply options (this will also apply layout)
109121
workspacePage.layoutControls.optionsDrawer.applyButton.click()
110122

111-
// Wait for layout to apply
112-
cy.wait(1000)
113-
114123
// Drawer should close
115124
workspacePage.layoutControls.optionsDrawer.drawer.should('not.exist')
116125

@@ -119,6 +128,7 @@ describe('Workspace Layout - Options', () => {
119128
})
120129

121130
it('should show no options for null algorithm selection', () => {
131+
workspacePage.canvasToolbar.expandButton.click()
122132
// Open options drawer without selecting algorithm (if possible)
123133
// Or with MANUAL selected
124134
workspacePage.layoutControls.optionsButton.click()

hivemq-edge-frontend/cypress/e2e/workspace/workspace-layout-presets.spec.cy.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ describe('Workspace Layout - Presets', () => {
4949
})
5050

5151
it('should show no saved presets initially', () => {
52+
// Expand toolbar to access layout controls
53+
workspacePage.canvasToolbar.expandButton.click()
54+
5255
// Open presets menu
5356
workspacePage.layoutControls.presetsButton.click()
5457

@@ -57,6 +60,9 @@ describe('Workspace Layout - Presets', () => {
5760
})
5861

5962
it('should open save preset modal', () => {
63+
// Expand toolbar to access layout controls
64+
workspacePage.canvasToolbar.expandButton.click()
65+
6066
// Open presets menu
6167
workspacePage.layoutControls.presetsButton.click()
6268

@@ -69,6 +75,9 @@ describe('Workspace Layout - Presets', () => {
6975
})
7076

7177
it('should require preset name', () => {
78+
// Expand toolbar to access layout controls
79+
workspacePage.canvasToolbar.expandButton.click()
80+
7281
// Open save modal
7382
workspacePage.layoutControls.presetsButton.click()
7483
workspacePage.layoutControls.presetsMenu.saveOption.click()
@@ -82,6 +91,9 @@ describe('Workspace Layout - Presets', () => {
8291
})
8392

8493
it('should save a preset with valid name', () => {
94+
// Expand toolbar to access layout controls
95+
workspacePage.canvasToolbar.expandButton.click()
96+
8597
// Apply a layout first
8698
workspacePage.layoutControls.algorithmSelector.select('DAGRE_TB')
8799
workspacePage.layoutControls.applyButton.click()
@@ -108,6 +120,9 @@ describe('Workspace Layout - Presets', () => {
108120
})
109121

110122
it('should load a saved preset', () => {
123+
// Expand toolbar to access layout controls
124+
workspacePage.canvasToolbar.expandButton.click()
125+
111126
// First, save a preset
112127
workspacePage.layoutControls.algorithmSelector.select('DAGRE_TB')
113128
workspacePage.layoutControls.applyButton.click()
@@ -133,6 +148,7 @@ describe('Workspace Layout - Presets', () => {
133148
})
134149

135150
it('should delete a preset', () => {
151+
workspacePage.canvasToolbar.expandButton.click()
136152
// Save a preset
137153
workspacePage.layoutControls.algorithmSelector.select('DAGRE_TB')
138154
workspacePage.layoutControls.applyButton.click()
@@ -157,6 +173,7 @@ describe('Workspace Layout - Presets', () => {
157173
})
158174

159175
it('should persist presets across page reloads', () => {
176+
workspacePage.canvasToolbar.expandButton.click()
160177
// Save a preset
161178
workspacePage.layoutControls.algorithmSelector.select('DAGRE_TB')
162179
workspacePage.layoutControls.applyButton.click()
@@ -177,7 +194,7 @@ describe('Workspace Layout - Presets', () => {
177194
cy.wait('@getBridges')
178195
workspacePage.toolbox.fit.click()
179196

180-
// Check preset still exists
197+
workspacePage.canvasToolbar.expandButton.click()
181198
workspacePage.layoutControls.presetsButton.click()
182199
cy.get('[role="menu"]').should('contain.text', 'Persistent Test')
183200
})

hivemq-edge-frontend/cypress/e2e/workspace/workspace-layout-shortcuts.spec.cy.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ describe('Workspace Layout - Keyboard Shortcuts', () => {
4949
})
5050

5151
it('should apply layout with Cmd+L shortcut on Mac', () => {
52+
// Expand toolbar to access layout controls
53+
workspacePage.canvasToolbar.expandButton.click()
54+
5255
// Select an algorithm
5356
workspacePage.layoutControls.algorithmSelector.select('DAGRE_TB')
5457

@@ -64,6 +67,9 @@ describe('Workspace Layout - Keyboard Shortcuts', () => {
6467
})
6568

6669
it('should apply layout with Ctrl+L shortcut', () => {
70+
// Expand toolbar to access layout controls
71+
workspacePage.canvasToolbar.expandButton.click()
72+
6773
// Select an algorithm
6874
workspacePage.layoutControls.algorithmSelector.select('DAGRE_LR')
6975

@@ -78,6 +84,9 @@ describe('Workspace Layout - Keyboard Shortcuts', () => {
7884
})
7985

8086
it('should work with different algorithms', () => {
87+
// Expand toolbar to access layout controls
88+
workspacePage.canvasToolbar.expandButton.click()
89+
8190
// Test with Radial Hub layout
8291
workspacePage.layoutControls.algorithmSelector.select('RADIAL_HUB')
8392
workspacePage.canvas.click()
@@ -92,6 +101,9 @@ describe('Workspace Layout - Keyboard Shortcuts', () => {
92101
})
93102

94103
it('should work after interacting with nodes', () => {
104+
// Expand toolbar to access layout controls
105+
workspacePage.canvasToolbar.expandButton.click()
106+
95107
// Select algorithm
96108
workspacePage.layoutControls.algorithmSelector.select('DAGRE_TB')
97109

0 commit comments

Comments
 (0)