Skip to content

Commit b5cc6eb

Browse files
committed
fix: tests
1 parent 5b1e397 commit b5cc6eb

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

tests/suites/tenant/diagnostics/tabs/queries.test.ts

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {expect, test} from '@playwright/test';
22

33
import {tenantName} from '../../../../utils/constants';
44
import {NavigationTabs, TenantPage} from '../../TenantPage';
5-
import {longRunningQuery} from '../../constants';
5+
import {longRunningQuery, longTableSelect, simpleQuery} from '../../constants';
66
import {QueryEditor} from '../../queryEditor/models/QueryEditor';
77
import {
88
Diagnostics,
@@ -14,7 +14,7 @@ import {
1414
} from '../Diagnostics';
1515
import {setupTopQueriesMock} from '../mocks';
1616

17-
test.describe('Diagnostics Queries tab', async () => {
17+
test.describe.only('Diagnostics Queries tab', async () => {
1818
test('No runnning queries in Queries if no queries are running', async ({page}) => {
1919
const pageQueryParams = {
2020
schema: tenantName,
@@ -98,13 +98,36 @@ test.describe('Diagnostics Queries tab', async () => {
9898
});
9999

100100
test('Query tab first row has values for all columns in Top mode', async ({page}) => {
101+
// First, navigate to query page and run some queries to populate the Top queries data
102+
const queryPageParams = {
103+
schema: tenantName,
104+
database: tenantName,
105+
tenantPage: 'query',
106+
};
107+
const tenantPage = new TenantPage(page);
108+
await tenantPage.goto(queryPageParams);
109+
110+
const queryEditor = new QueryEditor(page);
111+
112+
const queries = [simpleQuery, longTableSelect(10)];
113+
114+
for (const query of queries) {
115+
await queryEditor.setQuery(query);
116+
await queryEditor.clickRunButton();
117+
// Wait for query to complete
118+
await queryEditor.waitForStatus('Completed');
119+
}
120+
121+
// Wait for query statistics to be collected
122+
await page.waitForTimeout(2000);
123+
124+
// Now navigate to diagnostics to check the top queries
101125
const pageQueryParams = {
102126
schema: tenantName,
103127
database: tenantName,
104128
tenantPage: 'diagnostics',
105129
diagnosticsTab: 'topQueries',
106130
};
107-
const tenantPage = new TenantPage(page);
108131
await tenantPage.goto(pageQueryParams);
109132

110133
const diagnostics = new Diagnostics(page);

0 commit comments

Comments
 (0)