Skip to content

Commit 65ec827

Browse files
committed
chore: Expand results tab
1 parent 812e2a9 commit 65ec827

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

tests/suites/tenant/TenantPage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {Locator, Page} from '@playwright/test';
33
import {PageModel} from '../../models/PageModel';
44
import {tenantPage} from '../../utils/constants';
55

6-
export const VISIBILITY_TIMEOUT = 10000;
6+
export const VISIBILITY_TIMEOUT = 5000;
77

88
export enum NavigationTabs {
99
Query = 'Query',

tests/suites/tenant/queryEditor/models/QueryEditor.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

tests/suites/tenant/queryEditor/queryEditor.test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff 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
});

0 commit comments

Comments
 (0)