@@ -43,6 +43,7 @@ import {
4343 unselectEditor ,
4444 waitForAnnotationEditorLayer ,
4545 waitForAnnotationModeChanged ,
46+ waitForBrowserTrip ,
4647 waitForEntryInStorage ,
4748 waitForPageRendered ,
4849 waitForSelectedEditor ,
@@ -84,14 +85,6 @@ const copyImage = async (page, imagePath, selector) => {
8485 await waitForImage ( page , selector ) ;
8586} ;
8687
87- async function waitForTranslation ( page ) {
88- return page . evaluate ( async ( ) => {
89- await new Promise ( resolve => {
90- window . requestAnimationFrame ( resolve ) ;
91- } ) ;
92- } ) ;
93- }
94-
9588const switchToStamp = switchToEditor . bind ( null , "Stamp" ) ;
9689
9790describe ( "Stamp Editor" , ( ) => {
@@ -1007,7 +1000,7 @@ describe("Stamp Editor", () => {
10071000 const buttonSelector = `${ editorSelector } button.altText.new` ;
10081001 await page . waitForSelector ( buttonSelector , { visible : true } ) ;
10091002
1010- await waitForTranslation ( page ) ;
1003+ await waitForBrowserTrip ( page ) ;
10111004 // Check the text in the button.
10121005 let text = await page . evaluate (
10131006 sel => document . querySelector ( sel ) . textContent ,
@@ -1056,7 +1049,7 @@ describe("Stamp Editor", () => {
10561049 await waitForSelectedEditor ( page , editorSelector ) ;
10571050 await page . waitForSelector ( buttonSelector , { visible : true } ) ;
10581051
1059- await waitForTranslation ( page ) ;
1052+ await waitForBrowserTrip ( page ) ;
10601053 // Check the text in the button.
10611054 text = await page . evaluate (
10621055 sel => document . querySelector ( sel ) . textContent ,
@@ -1098,7 +1091,7 @@ describe("Stamp Editor", () => {
10981091 await page . click ( "#newAltTextSave" ) ;
10991092 await page . waitForSelector ( "#newAltTextDialog" , { visible : false } ) ;
11001093
1101- await waitForTranslation ( page ) ;
1094+ await waitForBrowserTrip ( page ) ;
11021095 // Check the text in the button.
11031096 text = await page . evaluate (
11041097 sel => document . querySelector ( sel ) . firstChild . textContent ,
0 commit comments