@@ -30,6 +30,7 @@ async function run() {
3030 const dashboardPage = await context . newPage ( ) ;
3131 await dashboardPage . goto ( dashboardUrl , { waitUntil : "domcontentloaded" } ) ;
3232 const dashboardFaviconHref = await dashboardPage . getAttribute ( 'link[rel="icon"]' , "href" ) ;
33+ const dashboardThemeInitial = await dashboardPage . getAttribute ( "body" , "data-theme" ) ;
3334
3435 const heading = await dashboardPage . textContent ( "h1" ) ;
3536 const activityListCount = await dashboardPage . locator ( "#activity-list" ) . count ( ) ;
@@ -44,6 +45,7 @@ async function run() {
4445 const panelPage = await context . newPage ( ) ;
4546 await panelPage . goto ( panelUrl , { waitUntil : "domcontentloaded" } ) ;
4647 const panelViewCount = await panelPage . locator ( '[data-view]' ) . count ( ) ;
48+ const panelThemeInitial = await panelPage . getAttribute ( "body" , "data-theme" ) ;
4749 const initialPageCount = context . pages ( ) . length ;
4850
4951 await dashboardPage . click ( "#open-side-panel" ) ;
@@ -55,6 +57,8 @@ async function run() {
5557 await dashboardPage . click ( "#theme-toggle" ) ;
5658 await dashboardPage . waitForTimeout ( 250 ) ;
5759 const dashboardThemeAfterToggle = await dashboardPage . getAttribute ( "body" , "data-theme" ) ;
60+ await panelPage . waitForFunction ( ( ) => document . body ?. dataset ?. theme === "light" , null , { timeout : 5_000 } ) ;
61+ const panelThemeAfterDashboardToggle = await panelPage . getAttribute ( "body" , "data-theme" ) ;
5862
5963 await dashboardPage . click ( "#open-settings" ) ;
6064 await dashboardPage . waitForURL ( ( url ) => url . toString ( ) . endsWith ( "/ui/settings.html" ) , { timeout : 5_000 } ) ;
@@ -74,12 +78,18 @@ async function run() {
7478 const dashboardOpenedInCurrentTab = dashboardPage . url ( ) . endsWith ( "/ui/dashboard.html" ) ;
7579 const pageCountAfterBackToDashboard = context . pages ( ) . length ;
7680
81+ await panelPage . click ( "#theme-toggle" ) ;
82+ await panelPage . waitForTimeout ( 250 ) ;
83+ const panelThemeAfterPanelToggle = await panelPage . getAttribute ( "body" , "data-theme" ) ;
84+ await dashboardPage . waitForFunction ( ( ) => document . body ?. dataset ?. theme === "dark" , null , { timeout : 5_000 } ) ;
85+ const dashboardThemeAfterPanelToggle = await dashboardPage . getAttribute ( "body" , "data-theme" ) ;
86+
7787 await dashboardPage . click ( "#open-settings" ) ;
7888 await dashboardPage . waitForURL ( ( url ) => url . toString ( ) . endsWith ( "/ui/settings.html" ) , { timeout : 5_000 } ) ;
7989 await dashboardPage . waitForFunction (
8090 ( ) =>
81- document . body ?. dataset ?. theme === "light " &&
82- document . querySelector ( "#theme" ) ?. value === "light " ,
91+ document . body ?. dataset ?. theme === "dark " &&
92+ document . querySelector ( "#theme" ) ?. value === "dark " ,
8393 null ,
8494 { timeout : 5_000 }
8595 ) ;
@@ -133,6 +143,11 @@ async function run() {
133143 paused : status ?. paused ,
134144 sidePanelApiAvailable : status ?. sidePanelApiAvailable ,
135145 openPanelOnActionClick : status ?. openPanelOnActionClick ,
146+ dashboardThemeInitial,
147+ panelThemeInitial,
148+ panelThemeAfterDashboardToggle,
149+ panelThemeAfterPanelToggle,
150+ dashboardThemeAfterPanelToggle,
136151 runtimeAfterDashboardSidePanel,
137152 runtimeAfterSettingsSidePanel,
138153 dashboardFaviconHref,
@@ -171,9 +186,14 @@ async function run() {
171186 result . settingsOpenedInCurrentTab !== true ||
172187 result . dashboardOpenedInCurrentTab !== true ||
173188 result . pageCountUnchangedOnSettingsRoundTrip !== true ||
189+ result . dashboardThemeInitial !== "dark" ||
190+ result . panelThemeInitial !== "dark" ||
174191 result . dashboardThemeAfterToggle !== "light" ||
175- result . settingsTheme !== "light" ||
176- result . settingsThemeValue !== "light" ||
192+ result . panelThemeAfterDashboardToggle !== "light" ||
193+ result . panelThemeAfterPanelToggle !== "dark" ||
194+ result . dashboardThemeAfterPanelToggle !== "dark" ||
195+ result . settingsTheme !== "dark" ||
196+ result . settingsThemeValue !== "dark" ||
177197 Number ( result . themeSelectContrast || 0 ) < 4.5 ||
178198 result . settingsHeading !== "Settings"
179199 ) {
0 commit comments