@@ -349,42 +349,51 @@ TEST_CASE("Test Kindle multi-page fetching with short pages visual", "[.][kindle
349349 // Take initial screenshot of main menu
350350 // First screen renders twice
351351 WAIT_FOR_DRAW (display);
352- ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest00-MainMenu" , true );
352+ WAIT_FOR_DRAW (display, false );
353+ ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest00-MainMenu" );
353354
354355 // Navigate to Kindle section
355356 SendRemoteCommand (RIGHT);
356357 WAIT_FOR_DRAW (display);
357- ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest01-KindleSection" , true );
358+ WAIT_FOR_DRAW (display, false );
359+ ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest01-KindleSection" );
358360
359361 // Go to the last book in the list
360362 SendRemoteCommand (UP);
361363 WAIT_FOR_DRAW (display);
362- ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest02-ShortPagesBookSelected" , true );
364+ WAIT_FOR_DRAW (display, false );
365+ ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest02-ShortPagesBookSelected" );
363366
364367 // Open the book - this should load then trigger the first last-read dialog from /open-book
365368 SendRemoteCommand (ENTER);
366- ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest03-Connecting" , true );
369+ WAIT_FOR_DRAW (display, false );
370+ ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest03-Connecting" );
367371
368372 auto screen = UIGetCurrentScreen ();
369373 auto kindleScreen = std::dynamic_pointer_cast<KindleReadableScreen>(screen);
370374 REQUIRE (kindleScreen != nullptr );
371375
372- ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest04-Opening" , true );
376+ WAIT_FOR_DRAW (display, false );
377+ ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest04-Opening" );
373378
374379 // Wait for the last-read dialog to be shown
375380 WAIT_FOR_DRAW (display);
376- ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest05-FirstLastReadDialog" , true );
381+ WAIT_FOR_DRAW (display, false );
382+ ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest05-FirstLastReadDialog" );
377383
378384 // Accept the first dialog - should go to Chapter 42
379385 SendRemoteCommand (ENTER);
380386
381387 // Wait for the "Sync to last read page" message
382- ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest06-SyncingToLastRead" , true );
388+ WAIT_FOR_DRAW (display, false );
389+ ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest06-SyncingToLastRead" );
383390 // TODO: Unknown why message page renders twice
384- ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest06.5-SyncingToLastRead" , true );
391+ WAIT_FOR_DRAW (display, false );
392+ ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest06.5-SyncingToLastRead" );
385393
386394 // Wait for content to render - this will be Chapter 42
387- ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest07-Chapter42Initial" , true );
395+ WAIT_FOR_DRAW (display, false );
396+ ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest07-Chapter42Initial" );
388397
389398 // Wait for POST to complete via mock server
390399 REQUIRE (waitForLastReadPostCount (1 ));
@@ -393,27 +402,33 @@ TEST_CASE("Test Kindle multi-page fetching with short pages visual", "[.][kindle
393402 log_i (" TEST: Paging forward through Chapter 42" );
394403 for (int i = 0 ; i < 3 ; i++) {
395404 SendRemoteCommand (RIGHT);
396- ASSERT_VIEW_UNCHANGED (
397- display, " ShortPagesTest09-Chapter42Forward" + std::to_string (i + 1 ), true );
405+ WAIT_FOR_DRAW (display, false );
406+ ASSERT_VIEW_UNCHANGED (display,
407+ " ShortPagesTest09-Chapter42Forward" + std::to_string (i + 1 ));
398408 }
399409
400410 // Navigate to page 4 - should trigger second last-read dialog
401411 SendRemoteCommand (RIGHT);
402412
403413 // Three: one to render the page, then two to render the menu
404- ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest10-BeforeSecondLastReadDialog" , true );
414+ WAIT_FOR_DRAW (display, false );
415+ ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest10-BeforeSecondLastReadDialog" );
405416 WAIT_FOR_DRAW (display);
406- ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest12-SecondLastReadDialog" , true );
417+ WAIT_FOR_DRAW (display, false );
418+ ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest12-SecondLastReadDialog" );
407419
408420 SendRemoteCommand (ENTER);
409421
410422 // Wait for the "Sync to last read page" message
411- ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest13-SyncingToPage10" , true );
423+ WAIT_FOR_DRAW (display, false );
424+ ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest13-SyncingToPage10" );
412425 // TODO: Unknown why message page renders twice
413- ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest13.5-SyncingToPage10" , true );
426+ WAIT_FOR_DRAW (display, false );
427+ ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest13.5-SyncingToPage10" );
414428
415429 // Wait for content to render - this will be Page 10
416- ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest14-Page10Initial" , true );
430+ WAIT_FOR_DRAW (display, false );
431+ ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest14-Page10Initial" );
417432
418433 // Wait for POST to complete via mock server
419434 REQUIRE (waitForLastReadPostCount (2 ));
@@ -426,22 +441,25 @@ TEST_CASE("Test Kindle multi-page fetching with short pages visual", "[.][kindle
426441
427442 // First RIGHT press - should move to PAGE 11
428443 SendRemoteCommand (RIGHT);
429- ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest16-ForwardFrom10-1" , true );
444+ WAIT_FOR_DRAW (display, false );
445+ ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest16-ForwardFrom10-1" );
430446
431447 // Second RIGHT press - should move to PAGE 12
432448 SendRemoteCommand (RIGHT);
433- ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest16-ForwardFrom10-2" , true );
449+ WAIT_FOR_DRAW (display, false );
450+ ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest16-ForwardFrom10-2" );
434451
435452 // Third RIGHT press - should move to PAGE 13
436453 SendRemoteCommand (RIGHT);
437- ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest16-ForwardFrom10-3" , true );
454+ WAIT_FOR_DRAW (display, false );
455+ ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest16-ForwardFrom10-3" );
438456
439457 // Page backward to verify backward navigation works
440458 log_i (" TEST: Paging backward to verify backward navigation" );
441459 for (int i = 0 ; i < 2 ; i++) {
442460 SendRemoteCommand (LEFT);
443- ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest19-Backward " + std::to_string (i + 1 ),
444- true );
461+ WAIT_FOR_DRAW (display, false );
462+ ASSERT_VIEW_UNCHANGED (display, " ShortPagesTest19-Backward " + std::to_string (i + 1 ) );
445463 }
446464 }
447465
0 commit comments