@@ -42,23 +42,28 @@ async function generateNotebookHtml(browser: Browser, url: string) {
4242 hidden : true ,
4343 } ) ;
4444 logger . info ( "Spinner disappeared." ) ;
45- // const previewButton = await page.waitForSelector("[id='preview-button']", {
46- // timeout: LONG_TIMEOUT_MS,
47- // });
45+ const previewButton = await page . waitForSelector ( "[id='preview-button']" , {
46+ timeout : LONG_TIMEOUT_MS ,
47+ } ) ;
4848
49- // await previewButton?.click();
49+ await previewButton ?. click ( ) ;
5050
51- // logger.info("Clicked preview button, waiting for interrupt button...");
51+ logger . info ( "Clicked preview button, waiting for interrupt button..." ) ;
5252 // Wait for the interrupt button to have the inactive-button class for at least 10 seconds
5353 await page . waitForFunction (
5454 ( ) => {
5555 const spinner = document . querySelector (
5656 "[data-testid='loading-indicator']" ,
5757 ) ;
58- const button = document . querySelector ( '[data-testid="interrupt-button"]' ) ;
59- const hasInactiveClass = button ?. classList . contains ( "inactive-button" ) ;
58+ const interruptButton = document . querySelector (
59+ '[data-testid="interrupt-button"]' ,
60+ ) ;
61+ const runButton = document . querySelector ( '[data-testid="run-button"]' ) ;
62+ const needsToRun = runButton ?. classList . contains ( "yellow" ) ;
63+ const hasInactiveClass =
64+ interruptButton ?. classList . contains ( "inactive-button" ) ;
6065
61- if ( ! hasInactiveClass || spinner ) {
66+ if ( ! hasInactiveClass || spinner || needsToRun ) {
6267 window . stableStart = undefined ;
6368 return false ;
6469 } else {
0 commit comments