Skip to content

Commit 844fd7a

Browse files
CopilotRaubzeug
andcommitted
Changes before error encountered
Co-authored-by: Raubzeug <[email protected]>
1 parent 349f6ff commit 844fd7a

File tree

2 files changed

+37
-10
lines changed

2 files changed

+37
-10
lines changed

tests/suites/nodes/NodePage.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,36 @@ export class NodePage extends PageModel {
1919

2020
async waitForNodePageLoad() {
2121
// Wait for the page to load and tabs to be visible
22-
await this.tabs.waitFor({state: 'visible'});
22+
try {
23+
await this.tabs.waitFor({state: 'visible', timeout: 10000});
24+
console.log('Node page tabs loaded successfully');
25+
} catch (error) {
26+
console.error('Failed to load node page tabs:', error);
27+
throw error;
28+
}
2329
}
2430

2531
async isThreadsTabVisible() {
32+
const threadsTab = this.tabs.locator('.g-tab:has-text("Threads")');
2633
try {
27-
await this.threadsTab.waitFor({state: 'visible', timeout: 1000});
34+
await threadsTab.waitFor({state: 'visible', timeout: 2000});
35+
console.log('Threads tab is visible');
2836
return true;
2937
} catch {
38+
console.log('Threads tab is not visible');
3039
return false;
3140
}
3241
}
3342

3443
async clickThreadsTab() {
35-
await this.threadsTab.click();
44+
const threadsTab = this.tabs.locator('.g-tab:has-text("Threads")');
45+
console.log('Clicking threads tab');
46+
await threadsTab.click();
3647
}
3748

3849
async getAllTabNames() {
39-
const tabs = await this.tabs.locator('.g-tabs__item').allTextContents();
50+
const tabs = await this.tabs.locator('.g-tab').allTextContents();
51+
console.log('Available tabs:', tabs);
4052
return tabs;
4153
}
4254
}

tests/suites/nodes/nodes.test.ts

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,13 @@ test.describe('Test Node Page Threads Tab', async () => {
199199
test('Threads tab is hidden when node has no thread data', async ({page}) => {
200200
// Mock the node API to return no thread data
201201
await page.route(`${backend}/viewer/json/sysinfo?*`, async (route) => {
202+
const url = route.request().url();
203+
console.log('Intercepted sysinfo request:', url);
204+
202205
await route.fulfill({
203-
json: {
206+
status: 200,
207+
contentType: 'application/json',
208+
body: JSON.stringify({
204209
SystemStateInfo: [
205210
{
206211
Host: 'localhost',
@@ -210,7 +215,7 @@ test.describe('Test Node Page Threads Tab', async () => {
210215
},
211216
],
212217
// No Threads property
213-
},
218+
}),
214219
});
215220
});
216221

@@ -232,8 +237,13 @@ test.describe('Test Node Page Threads Tab', async () => {
232237
test('Threads tab is visible when node has thread data', async ({page}) => {
233238
// Mock the node API to return thread data
234239
await page.route(`${backend}/viewer/json/sysinfo?*`, async (route) => {
240+
const url = route.request().url();
241+
console.log('Intercepted sysinfo request:', url);
242+
235243
await route.fulfill({
236-
json: {
244+
status: 200,
245+
contentType: 'application/json',
246+
body: JSON.stringify({
237247
SystemStateInfo: [
238248
{
239249
Host: 'localhost',
@@ -248,7 +258,7 @@ test.describe('Test Node Page Threads Tab', async () => {
248258
Threads: 4,
249259
},
250260
],
251-
},
261+
}),
252262
});
253263
});
254264

@@ -274,8 +284,13 @@ test.describe('Test Node Page Threads Tab', async () => {
274284
test('Threads tab is hidden when node has empty thread array', async ({page}) => {
275285
// Mock the node API to return empty thread data
276286
await page.route(`${backend}/viewer/json/sysinfo?*`, async (route) => {
287+
const url = route.request().url();
288+
console.log('Intercepted sysinfo request:', url);
289+
277290
await route.fulfill({
278-
json: {
291+
status: 200,
292+
contentType: 'application/json',
293+
body: JSON.stringify({
279294
SystemStateInfo: [
280295
{
281296
Host: 'localhost',
@@ -285,7 +300,7 @@ test.describe('Test Node Page Threads Tab', async () => {
285300
},
286301
],
287302
Threads: [], // Empty array
288-
},
303+
}),
289304
});
290305
});
291306

0 commit comments

Comments
 (0)