@@ -23,23 +23,9 @@ const sections = [
23
23
}
24
24
} ,
25
25
26
- // Node View: Click tab, wait for table rows, capture nodes tab content
27
- { name : '02-node-view' ,
28
- screenshotTarget : '#nodes' ,
29
- action : async ( page ) => {
30
- console . log ( ' Action: Clicking Nodes tab' ) ;
31
- await page . locator ( '[data-tab="nodes"]' ) . click ( ) ;
32
- console . log ( ' Action: Waiting for nodes table to be visible' ) ;
33
- await page . locator ( '#nodes #nodes-table' ) . waitFor ( { state : 'visible' , timeout : 10000 } ) ;
34
- console . log ( ' Action: Nodes table visible' ) ;
35
- // Optional: wait for rows as well, though table visibility might be enough
36
- // await page.locator('#nodes-table-body tr').first().waitFor({ state: 'visible', timeout: 10000 });
37
- }
38
- } ,
39
-
40
26
// VM View: Click main tab, click VM filter, wait, capture main content
41
- { name : '03 -vm-container-view' , // Renaming slightly as it shows filtered list
42
- screenshotTarget : '#main' ,
27
+ { name : '02 -vm-container-view' , // Renumbered from 03
28
+ screenshotTarget : '#nested-tab-dashboard' , // Changed from #main
43
29
action : async ( page ) => {
44
30
console . log ( ' Action: Clicking Main tab (if not already active)' ) ;
45
31
// Ensure main tab is active first
@@ -59,11 +45,20 @@ const sections = [
59
45
await vmFilterLabel . click ( ) ; // Click the label
60
46
await page . waitForTimeout ( 1000 ) ;
61
47
console . log ( ' Action: VM filter applied' ) ;
48
+
49
+ // Hide node summary cards
50
+ console . log ( ' Action: Hiding node summary cards' ) ;
51
+ await page . locator ( '#node-summary-cards-container' ) . evaluate ( element => element . style . display = 'none' ) ;
52
+ } ,
53
+ // Add a postAction to make the cards visible again
54
+ postAction : async ( page ) => {
55
+ console . log ( ' Action: Showing node summary cards' ) ;
56
+ await page . locator ( '#node-summary-cards-container' ) . evaluate ( element => element . style . display = '' ) ; // Reset display
62
57
}
63
58
} ,
64
59
65
60
// PBS View: Click tab, wait for PBS container content, capture PBS tab content
66
- { name : '04 -pbs-view' ,
61
+ { name : '03 -pbs-view' , // Renumbered from 04
67
62
screenshotTarget : '#pbs' ,
68
63
action : async ( page ) => {
69
64
console . log ( ' Action: Clicking PBS tab' ) ;
@@ -78,7 +73,7 @@ const sections = [
78
73
} ,
79
74
80
75
// Backups View: Click tab, wait for table content, capture backups tab content
81
- { name : '05 -backups-view' , // Added new section
76
+ { name : '04 -backups-view' , // Renumbered from 05
82
77
screenshotTarget : '#backups' ,
83
78
action : async ( page ) => {
84
79
console . log ( ' Action: Clicking Backups tab' ) ;
@@ -91,8 +86,8 @@ const sections = [
91
86
} ,
92
87
93
88
// Threshold & Logging View: Toggle thresholds, set one, start log, capture main area
94
- { name : '06 -thresholds-logging' , // New section
95
- screenshotTarget : '#main ' , // Capture the main dashboard/ log area
89
+ { name : '05 -thresholds-logging' , // Renumbered from 06
90
+ screenshotTarget : '#log-session-area ' , // Changed to capture the log entries area
96
91
action : async ( page ) => {
97
92
console . log ( ' Action: Ensuring Main tab is active' ) ;
98
93
const mainTabIsActive = await page . locator ( '[data-tab="main"].active' ) . isVisible ( ) ;
@@ -121,12 +116,16 @@ const sections = [
121
116
console . log ( ' Action: Clicking Start Log button' ) ;
122
117
await page . locator ( '#start-log-button' ) . click ( ) ;
123
118
console . log ( ' Action: Waiting for Log tab and content to appear' ) ;
119
+ // Ensure the log session area itself is made visible by the button click.
120
+ await page . locator ( '#log-session-area:not(.hidden)' ) . waitFor ( { state : 'visible' , timeout : 10000 } ) ;
124
121
await page . locator ( '.nested-tab[data-nested-tab^="log-session-"]' ) . waitFor ( { state : 'visible' , timeout : 10000 } ) ;
125
122
await page . locator ( '.log-session-panel' ) . waitFor ( { state : 'visible' , timeout : 10000 } ) ;
126
123
console . log ( ' Action: Log session started and visible' ) ;
127
124
console . log ( ' Action: Waiting 8 seconds for potential log entries...' ) ;
128
125
await page . waitForTimeout ( 8000 ) ; // Increase pause to 8 seconds
126
+ // Node summary cards are not part of the log view, so no need to hide/show them here.
129
127
}
128
+ // No postAction needed here as we are not modifying shared elements like node-summary-cards for this specific screenshot
130
129
} ,
131
130
132
131
// { name: '06-task-view', url: '/#tasks', screenshotTarget: '#task-list-element', action: async (page) => { /* Navigate to task view if separate */ } }, // Uncomment and adjust if needed
@@ -250,6 +249,15 @@ async function takeScreenshots() {
250
249
251
250
console . log ( ` Successfully captured ${ section . name } ` ) ;
252
251
252
+ // Perform post-action if defined (e.g., to restore UI state)
253
+ if ( section . postAction ) {
254
+ console . log ( ` Performing post-action for ${ section . name } ...` ) ;
255
+ await section . postAction ( page ) ;
256
+ // Optionally wait for UI to settle after post-action
257
+ await page . waitForLoadState ( 'networkidle' , { timeout : 5000 } ) ;
258
+ console . log ( ' Post-action completed and network idle.' ) ;
259
+ }
260
+
253
261
} catch ( error ) {
254
262
console . error ( ` Failed to capture section ${ section . name } : ${ error . message } ` ) ;
255
263
// Optionally, decide if you want to continue or stop on error
0 commit comments