File tree Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import type {Locator, Page} from '@playwright/test';
33import { PageModel } from '../../models/PageModel' ;
44import { tenantPage } from '../../utils/constants' ;
55
6- export const VISIBILITY_TIMEOUT = 10000 ;
6+ export const VISIBILITY_TIMEOUT = 5000 ;
77
88export enum NavigationTabs {
99 Query = 'Query' ,
Original file line number Diff line number Diff line change @@ -240,6 +240,28 @@ export class QueryEditor {
240240 return true ;
241241 }
242242
243+ async collapseResultsControls ( ) {
244+ const collapseButton = this . resultsControls . locator ( 'button[title="Collapse"]' ) ;
245+ await collapseButton . waitFor ( { state : 'visible' , timeout : VISIBILITY_TIMEOUT } ) ;
246+ await collapseButton . click ( ) ;
247+ }
248+
249+ async expandResultsControls ( ) {
250+ const expandButton = this . resultsControls . locator ( 'button[title="Expand"]' ) ;
251+ await expandButton . waitFor ( { state : 'visible' , timeout : VISIBILITY_TIMEOUT } ) ;
252+ await expandButton . click ( ) ;
253+ }
254+
255+ async isResultsControlsCollapsed ( ) {
256+ const expandButton = this . resultsControls . locator ( 'button[title="Expand"]' ) ;
257+ try {
258+ await expandButton . waitFor ( { state : 'visible' , timeout : VISIBILITY_TIMEOUT } ) ;
259+ return true ;
260+ } catch {
261+ return false ;
262+ }
263+ }
264+
243265 async isRunButtonEnabled ( ) {
244266 return this . runButton . isEnabled ( { timeout : VISIBILITY_TIMEOUT } ) ;
245267 }
Original file line number Diff line number Diff line change @@ -296,4 +296,25 @@ test.describe('Test Query Editor', async () => {
296296 await expect ( queryEditor . resultTable . hasMultipleResultTabs ( ) ) . resolves . toBe ( false ) ;
297297 await expect ( queryEditor . resultTable . getResultHeadText ( ) ) . resolves . toBe ( 'Result(1)' ) ;
298298 } ) ;
299+
300+ test ( 'Results controls collapse and expand functionality' , async ( { page} ) => {
301+ const queryEditor = new QueryEditor ( page ) ;
302+
303+ // Run a query to show results
304+ await queryEditor . setQuery ( 'SELECT 1;' ) ;
305+ await queryEditor . clickRunButton ( ) ;
306+ await queryEditor . waitForStatus ( 'Completed' ) ;
307+
308+ // Verify controls are initially visible
309+ await expect ( queryEditor . isResultsControlsVisible ( ) ) . resolves . toBe ( true ) ;
310+ await expect ( queryEditor . isResultsControlsCollapsed ( ) ) . resolves . toBe ( false ) ;
311+
312+ // Test collapse
313+ await queryEditor . collapseResultsControls ( ) ;
314+ await expect ( queryEditor . isResultsControlsCollapsed ( ) ) . resolves . toBe ( true ) ;
315+
316+ // Test expand
317+ await queryEditor . expandResultsControls ( ) ;
318+ await expect ( queryEditor . isResultsControlsCollapsed ( ) ) . resolves . toBe ( false ) ;
319+ } ) ;
299320} ) ;
You can’t perform that action at this time.
0 commit comments