@@ -37,18 +37,20 @@ test.describe('Test Plan to SVG functionality', async () => {
3737 expect ( status ) . toBe ( 'Completed' ) ;
3838 } ) . toPass ( ) ;
3939
40- // 4. Check if Execution Plan button appears and click it to open dropdown
41- const executionPlanButton = page . locator ( 'button:has-text("Execution plan") ' ) ;
42- await expect ( executionPlanButton ) . toBeVisible ( ) ;
43- await executionPlanButton . click ( ) ;
40+ // 4. Check if dropdown button appears and click it to open menu
41+ const dropdownButton = page . locator ( '.query-info-switcher-wrapper ' ) ;
42+ await expect ( dropdownButton ) . toBeVisible ( ) ;
43+ await dropdownButton . click ( ) ;
4444
4545 // 5. Verify dropdown menu items are visible
46- const openInNewTabOption = page . locator ( 'text="Open in new tab"' ) ;
47- const downloadOption = page . locator ( 'text="Download"' ) ;
46+ const openInNewTabOption = page . locator ( 'text="Open Execution Plan"' ) ;
47+ const downloadPlanOption = page . locator ( 'text="Download Execution Plan"' ) ;
48+ const downloadDiagnosticsOption = page . locator ( 'text="Download Diagnostics"' ) ;
4849 await expect ( openInNewTabOption ) . toBeVisible ( ) ;
49- await expect ( downloadOption ) . toBeVisible ( ) ;
50+ await expect ( downloadPlanOption ) . toBeVisible ( ) ;
51+ await expect ( downloadDiagnosticsOption ) . toBeVisible ( ) ;
5052
51- // 6. Click "Open in new tab " option
53+ // 6. Click "Open Execution Plan " option
5254 await openInNewTabOption . click ( ) ;
5355 await page . waitForTimeout ( 1000 ) ; // Wait for new tab to open
5456
@@ -73,16 +75,16 @@ test.describe('Test Plan to SVG functionality', async () => {
7375 expect ( status ) . toBe ( 'Completed' ) ;
7476 } ) . toPass ( ) ;
7577
76- // 4. Click execution plan button to open dropdown
77- const executionPlanButton = page . locator ( 'button:has-text("Execution plan") ' ) ;
78- await executionPlanButton . click ( ) ;
78+ // 4. Click dropdown button to open menu
79+ const dropdownButton = page . locator ( '.query-info-switcher-wrapper ' ) ;
80+ await dropdownButton . click ( ) ;
7981
8082 // 5. Setup download listener before clicking download
8183 const downloadPromise = page . waitForEvent ( 'download' ) ;
8284
83- // 6. Click download option
84- const downloadOption = page . locator ( 'text="Download"' ) ;
85- await downloadOption . click ( ) ;
85+ // 6. Click download execution plan option
86+ const downloadPlanOption = page . locator ( 'text="Download Execution Plan "' ) ;
87+ await downloadPlanOption . click ( ) ;
8688
8789 // 7. Wait for download to start and verify filename
8890 const download = await downloadPromise ;
@@ -114,32 +116,33 @@ test.describe('Test Plan to SVG functionality', async () => {
114116 } ) ;
115117 } ) ;
116118
117- // 5. Click execution plan button to open dropdown
118- const executionPlanButton = page . locator ( 'button:has-text("Execution plan") ' ) ;
119- await executionPlanButton . click ( ) ;
119+ // 5. Click dropdown button to open menu
120+ const dropdownButton = page . locator ( '.query-info-switcher-wrapper ' ) ;
121+ await dropdownButton . click ( ) ;
120122
121- // 6. Click "Open in new tab " option and wait for error state
122- const openInNewTabOption = page . locator ( 'text="Open in new tab "' ) ;
123- await openInNewTabOption . click ( ) ;
123+ // 6. Click "Open Execution Plan " option and wait for error state
124+ const openExecutionPlanOption = page . locator ( 'text="Open Execution Plan "' ) ;
125+ await openExecutionPlanOption . click ( ) ;
124126 await page . waitForTimeout ( 1000 ) ; // Wait for error to be processed
125127
126128 // 7. Close the dropdown
127129 await page . keyboard . press ( 'Escape' ) ;
128130
129131 // 8. Verify error state
130- await expect ( executionPlanButton ) . toHaveClass ( / f l a t - d a n g e r / ) ;
132+ await expect ( dropdownButton ) . toHaveClass ( / f l a t - d a n g e r / ) ;
131133
132134 // 9. Verify error tooltip
133- await executionPlanButton . hover ( ) ;
135+ await dropdownButton . hover ( ) ;
134136 await page . waitForTimeout ( 500 ) ; // Wait for tooltip animation
135137 const tooltipText = await page . textContent ( '.g-tooltip' ) ;
136138 expect ( tooltipText ) . toContain ( 'Error' ) ;
137139 expect ( tooltipText ) . toContain ( 'Failed to generate SVG' ) ;
138140
139141 // 10. Verify dropdown is disabled after error
140- await executionPlanButton . click ( ) ;
141- await expect ( openInNewTabOption ) . not . toBeVisible ( ) ;
142- await expect ( page . locator ( 'text="Download"' ) ) . not . toBeVisible ( ) ;
142+ await dropdownButton . click ( ) ;
143+ await expect ( openExecutionPlanOption ) . not . toBeVisible ( ) ;
144+ await expect ( page . locator ( 'text="Download Execution Plan"' ) ) . not . toBeVisible ( ) ;
145+ await expect ( page . locator ( 'text="Download Diagnostics"' ) ) . not . toBeVisible ( ) ;
143146 } ) ;
144147
145148 test ( 'Statistics setting becomes disabled when execution plan experiment is enabled' , async ( {
0 commit comments