@@ -5,60 +5,38 @@ test.describe("Settings Screenshots", () => {
55 test ( "should take screenshots of all settings tabs" , async ( { workbox : page , takeScreenshot } : TestFixtures ) => {
66 await verifyExtensionInstalled ( page )
77
8- // Configure API to ensure settings are accessible
98 await upsertApiConfiguration ( page )
109
11- // Open the settings by clicking the settings button in the activity bar
12- const settingsButton = page . locator ( '[aria-label*="Settings"], [title*="Settings"]' ) . first ( )
13- if ( await settingsButton . isVisible ( ) ) {
14- await settingsButton . click ( )
15- } else {
16- // Alternative: Use keyboard shortcut to open command palette and run settings command
17- const modifier = process . platform === "darwin" ? "Meta" : "Control"
18- await page . keyboard . press ( `${ modifier } +Shift+P` )
19- await page . keyboard . type ( "Kilo Code: Settings" )
20- await page . keyboard . press ( "Enter" )
21- }
10+ // Open the settings
11+ page . locator ( '[aria-label*="Settings"], [title*="Settings"]' ) . first ( ) . click ( )
12+ await page . mouse . move ( 0 , 0 ) // Move the mouse to (0, 0) to avoid triggering the tooltip!
2213
23- // Wait for the webview to load
2414 const webviewFrame = await findWebview ( page )
25-
26- // Wait for settings view to be visible by checking for the tablist role
2715 await expect ( webviewFrame . locator ( '[role="tablist"]' ) ) . toBeVisible ( { timeout : 10000 } )
2816 console . log ( "✅ Settings view loaded" )
2917
30- // Wait for the tab list to be visible
3118 await expect ( webviewFrame . locator ( '[data-testid="settings-tab-list"]' ) ) . toBeVisible ( )
3219 console . log ( "✅ Settings tab list visible" )
3320
34- // Find all tab buttons with role="tab"
3521 const tabButtons = webviewFrame . locator ( '[role="tab"]' )
3622 const tabCount = await tabButtons . count ( )
3723 console . log ( `✅ Found ${ tabCount } settings tabs` )
3824
39- // Take screenshot of each tab
40- for ( let i = 0 ; i < tabCount ; i ++ ) {
25+ // Take screenshot of each tab (except for the last two)
26+ // MCP settings page is flakey and the info page has the version which changes
27+ for ( let i = 0 ; i < tabCount - 2 ; i ++ ) {
4128 const tabButton = tabButtons . nth ( i )
29+ await tabButton . click ( )
30+ await page . waitForTimeout ( 500 )
4231
43- // Get the tab name from the text content
4432 const tabText = await tabButton . textContent ( )
4533 const tabName = tabText ?. trim ( ) || `tab-${ i } `
4634
47- // Get the data-testid attribute to get the section ID
4835 const testId = await tabButton . getAttribute ( "data-testid" )
4936 const sectionId = testId ?. replace ( "tab-" , "" ) || `section-${ i } `
5037
5138 console . log ( `📸 Taking screenshot of tab: ${ tabName } (${ sectionId } )` )
52-
53- // Click the tab to activate it
54- await tabButton . click ( )
55-
56- // Wait a moment for the content to load
57- await page . waitForTimeout ( 500 )
58-
59- // Take screenshot with descriptive name
60- const screenshotName = `settings-${ sectionId } -${ tabName . toLowerCase ( ) . replace ( / \s + / g, "-" ) } `
61- await takeScreenshot ( screenshotName )
39+ await takeScreenshot ( `settings-${ sectionId } -${ tabName . toLowerCase ( ) . replace ( / \s + / g, "-" ) } ` )
6240 }
6341
6442 console . log ( "✅ All settings tabs screenshots completed" )
0 commit comments