@@ -10,6 +10,7 @@ const {
1010 getDriver,
1111 getLogs,
1212 loadUri,
13+ notExistsByXpath,
1314 rightClickText,
1415 scope
1516} = new SeleniumHelper ( ) ;
@@ -29,6 +30,7 @@ describe('Working with sprites', () => {
2930
3031 test ( 'Adding a sprite through the library' , async ( ) => {
3132 await loadUri ( uri ) ;
33+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
3234 await clickText ( 'Costumes' ) ;
3335 await clickXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
3436 await clickText ( 'Apple' , scope . modal ) ; // Closes modal
@@ -51,6 +53,7 @@ describe('Working with sprites', () => {
5153
5254 test ( 'Adding a sprite by paint button' , async ( ) => {
5355 await loadUri ( uri ) ;
56+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
5457 const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
5558 await driver . actions ( ) . mouseMove ( el )
5659 . perform ( ) ;
@@ -63,6 +66,7 @@ describe('Working with sprites', () => {
6366
6467 test ( 'Deleting only sprite does not crash' , async ( ) => {
6568 await loadUri ( uri ) ;
69+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
6670 await new Promise ( resolve => setTimeout ( resolve , 1000 ) ) ; // Wait for scroll animation
6771 await rightClickText ( 'Sprite1' , scope . spriteTile ) ;
6872 await clickText ( 'delete' , scope . spriteTile ) ;
@@ -74,6 +78,7 @@ describe('Working with sprites', () => {
7478
7579 test ( 'Deleting by x button on sprite tile' , async ( ) => {
7680 await loadUri ( uri ) ;
81+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
7782 await new Promise ( resolve => setTimeout ( resolve , 1000 ) ) ; // Wait for scroll animation
7883 await clickXpath ( '//*[@aria-label="Delete"]' ) ; // Only visible close button is on the sprite
7984 // Confirm that the stage has been switched to
@@ -84,6 +89,7 @@ describe('Working with sprites', () => {
8489
8590 test ( 'Adding a sprite by uploading a png' , async ( ) => {
8691 await loadUri ( uri ) ;
92+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
8793 const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
8894 await driver . actions ( ) . mouseMove ( el )
8995 . perform ( ) ;
@@ -99,6 +105,7 @@ describe('Working with sprites', () => {
99105 // Enable when this is fixed issues/3608
100106 test ( 'Adding a sprite by uploading an svg (gh-3608)' , async ( ) => {
101107 await loadUri ( uri ) ;
108+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
102109 const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
103110 await driver . actions ( ) . mouseMove ( el )
104111 . perform ( ) ;
@@ -117,6 +124,7 @@ describe('Working with sprites', () => {
117124
118125 test ( 'Adding a sprite by uploading a gif' , async ( ) => {
119126 await loadUri ( uri ) ;
127+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
120128 const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
121129 await driver . actions ( ) . mouseMove ( el )
122130 . perform ( ) ;
@@ -139,6 +147,7 @@ describe('Working with sprites', () => {
139147
140148 test ( 'Adding a letter sprite through the Letters filter in the library' , async ( ) => {
141149 await loadUri ( uri ) ;
150+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
142151 await driver . manage ( )
143152 . window ( )
144153 . setSize ( 1244 , 768 ) ; // Letters filter not visible at 1024 width
@@ -154,6 +163,7 @@ describe('Working with sprites', () => {
154163 test ( 'Use browser back button to close library' , async ( ) => {
155164 await driver . get ( 'https://www.google.com' ) ;
156165 await loadUri ( uri ) ;
166+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
157167 await clickText ( 'Costumes' ) ;
158168 await clickXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
159169 const abbyElement = await findByText ( 'Abby' ) ; // Should show editor for new costume
@@ -178,6 +188,7 @@ describe('Working with sprites', () => {
178188 path . resolve ( __dirname , '../fixtures/100-100.svg' )
179189 ] ;
180190 await loadUri ( uri ) ;
191+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
181192 const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
182193 await driver . actions ( ) . mouseMove ( el )
183194 . perform ( ) ;
@@ -194,6 +205,7 @@ describe('Working with sprites', () => {
194205
195206 test ( 'Load a sprite3 with a missing svg costume' , async ( ) => {
196207 await loadUri ( uri ) ;
208+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
197209 const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
198210 await driver . actions ( ) . mouseMove ( el )
199211 . perform ( ) ;
@@ -207,6 +219,7 @@ describe('Working with sprites', () => {
207219
208220 test ( 'Load a sprite3 with a currupt svg costume' , async ( ) => {
209221 await loadUri ( uri ) ;
222+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
210223 const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
211224 await driver . actions ( ) . mouseMove ( el )
212225 . perform ( ) ;
@@ -220,6 +233,7 @@ describe('Working with sprites', () => {
220233
221234 test ( 'Load a scratch3 corrupt svg as a sprite' , async ( ) => {
222235 await loadUri ( uri ) ;
236+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
223237 const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
224238 await driver . actions ( ) . mouseMove ( el )
225239 . perform ( ) ;
@@ -233,6 +247,7 @@ describe('Working with sprites', () => {
233247
234248 test ( 'Load a sprite2 with a missing svg costume' , async ( ) => {
235249 await loadUri ( uri ) ;
250+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
236251 const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
237252 await driver . actions ( ) . mouseMove ( el )
238253 . perform ( ) ;
@@ -246,6 +261,7 @@ describe('Working with sprites', () => {
246261
247262 test ( 'Load a sprite2 with a currupt svg costume' , async ( ) => {
248263 await loadUri ( uri ) ;
264+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
249265 const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
250266 await driver . actions ( ) . mouseMove ( el )
251267 . perform ( ) ;
@@ -259,6 +275,7 @@ describe('Working with sprites', () => {
259275
260276 test ( 'Load a corrupt scratch2 svg as a sprite' , async ( ) => {
261277 await loadUri ( uri ) ;
278+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
262279 const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
263280 await driver . actions ( ) . mouseMove ( el )
264281 . perform ( ) ;
@@ -272,6 +289,7 @@ describe('Working with sprites', () => {
272289
273290 test ( 'Load a sprite3 with a missing bmp costume' , async ( ) => {
274291 await loadUri ( uri ) ;
292+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
275293 const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
276294 await driver . actions ( ) . mouseMove ( el )
277295 . perform ( ) ;
@@ -285,6 +303,7 @@ describe('Working with sprites', () => {
285303
286304 test ( 'Load a sprite3 with a currupt bmp costume' , async ( ) => {
287305 await loadUri ( uri ) ;
306+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
288307 const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
289308 await driver . actions ( ) . mouseMove ( el )
290309 . perform ( ) ;
0 commit comments