File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,6 +109,30 @@ <h2>Usefull snippets</h2>
109109 // in docker this might throw Error: locator.check: Clicking the checkbox did not change its state
110110 // use .click() better in that case
111111 await page . locator ( "#loading-sel-1" ) . uncheck ( ) ;
112+
113+ const style = await page . evaluate ( async ( ) => {
114+ const timeout = 5000 ;
115+ const start = Date . now ( ) ;
116+
117+ while ( Date . now ( ) - start < timeout ) {
118+ const el = document . querySelector ( "monaco-diff" ) as any ;
119+
120+ if ( el ?. shadowRoot ) {
121+ await el . whenReady ( ) ;
122+
123+ const target = el . shadowRoot . querySelector ( ".original-in-monaco-diff-editor" ) ;
124+
125+ if ( target ) {
126+ return window . getComputedStyle ( target ) . backgroundColor ;
127+ }
128+ }
129+
130+ await new Promise ( ( r ) => setTimeout ( r , 200 ) ) ;
131+ }
132+
133+ throw new Error ( "Timeout waiting for monaco-diff style" ) ;
134+ } ) ;
135+
112136 </ script >
113137
114138 < h2 > Custom image ultimate test</ h2 >
You can’t perform that action at this time.
0 commit comments