@@ -10,6 +10,7 @@ const {
10
10
getDriver,
11
11
getLogs,
12
12
loadUri,
13
+ notExistsByXpath,
13
14
rightClickText,
14
15
scope
15
16
} = new SeleniumHelper ( ) ;
@@ -29,6 +30,7 @@ describe('Working with sprites', () => {
29
30
30
31
test ( 'Adding a sprite through the library' , async ( ) => {
31
32
await loadUri ( uri ) ;
33
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
32
34
await clickText ( 'Costumes' ) ;
33
35
await clickXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
34
36
await clickText ( 'Apple' , scope . modal ) ; // Closes modal
@@ -51,6 +53,7 @@ describe('Working with sprites', () => {
51
53
52
54
test ( 'Adding a sprite by paint button' , async ( ) => {
53
55
await loadUri ( uri ) ;
56
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
54
57
const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
55
58
await driver . actions ( ) . mouseMove ( el )
56
59
. perform ( ) ;
@@ -63,6 +66,7 @@ describe('Working with sprites', () => {
63
66
64
67
test ( 'Deleting only sprite does not crash' , async ( ) => {
65
68
await loadUri ( uri ) ;
69
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
66
70
await new Promise ( resolve => setTimeout ( resolve , 1000 ) ) ; // Wait for scroll animation
67
71
await rightClickText ( 'Sprite1' , scope . spriteTile ) ;
68
72
await clickText ( 'delete' , scope . spriteTile ) ;
@@ -74,6 +78,7 @@ describe('Working with sprites', () => {
74
78
75
79
test ( 'Deleting by x button on sprite tile' , async ( ) => {
76
80
await loadUri ( uri ) ;
81
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
77
82
await new Promise ( resolve => setTimeout ( resolve , 1000 ) ) ; // Wait for scroll animation
78
83
await clickXpath ( '//*[@aria-label="Delete"]' ) ; // Only visible close button is on the sprite
79
84
// Confirm that the stage has been switched to
@@ -84,6 +89,7 @@ describe('Working with sprites', () => {
84
89
85
90
test ( 'Adding a sprite by uploading a png' , async ( ) => {
86
91
await loadUri ( uri ) ;
92
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
87
93
const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
88
94
await driver . actions ( ) . mouseMove ( el )
89
95
. perform ( ) ;
@@ -99,6 +105,7 @@ describe('Working with sprites', () => {
99
105
// Enable when this is fixed issues/3608
100
106
test ( 'Adding a sprite by uploading an svg (gh-3608)' , async ( ) => {
101
107
await loadUri ( uri ) ;
108
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
102
109
const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
103
110
await driver . actions ( ) . mouseMove ( el )
104
111
. perform ( ) ;
@@ -117,6 +124,7 @@ describe('Working with sprites', () => {
117
124
118
125
test ( 'Adding a sprite by uploading a gif' , async ( ) => {
119
126
await loadUri ( uri ) ;
127
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
120
128
const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
121
129
await driver . actions ( ) . mouseMove ( el )
122
130
. perform ( ) ;
@@ -139,6 +147,7 @@ describe('Working with sprites', () => {
139
147
140
148
test ( 'Adding a letter sprite through the Letters filter in the library' , async ( ) => {
141
149
await loadUri ( uri ) ;
150
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
142
151
await driver . manage ( )
143
152
. window ( )
144
153
. setSize ( 1244 , 768 ) ; // Letters filter not visible at 1024 width
@@ -154,6 +163,7 @@ describe('Working with sprites', () => {
154
163
test ( 'Use browser back button to close library' , async ( ) => {
155
164
await driver . get ( 'https://www.google.com' ) ;
156
165
await loadUri ( uri ) ;
166
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
157
167
await clickText ( 'Costumes' ) ;
158
168
await clickXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
159
169
const abbyElement = await findByText ( 'Abby' ) ; // Should show editor for new costume
@@ -178,6 +188,7 @@ describe('Working with sprites', () => {
178
188
path . resolve ( __dirname , '../fixtures/100-100.svg' )
179
189
] ;
180
190
await loadUri ( uri ) ;
191
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
181
192
const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
182
193
await driver . actions ( ) . mouseMove ( el )
183
194
. perform ( ) ;
@@ -194,6 +205,7 @@ describe('Working with sprites', () => {
194
205
195
206
test ( 'Load a sprite3 with a missing svg costume' , async ( ) => {
196
207
await loadUri ( uri ) ;
208
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
197
209
const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
198
210
await driver . actions ( ) . mouseMove ( el )
199
211
. perform ( ) ;
@@ -207,6 +219,7 @@ describe('Working with sprites', () => {
207
219
208
220
test ( 'Load a sprite3 with a currupt svg costume' , async ( ) => {
209
221
await loadUri ( uri ) ;
222
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
210
223
const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
211
224
await driver . actions ( ) . mouseMove ( el )
212
225
. perform ( ) ;
@@ -220,6 +233,7 @@ describe('Working with sprites', () => {
220
233
221
234
test ( 'Load a scratch3 corrupt svg as a sprite' , async ( ) => {
222
235
await loadUri ( uri ) ;
236
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
223
237
const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
224
238
await driver . actions ( ) . mouseMove ( el )
225
239
. perform ( ) ;
@@ -233,6 +247,7 @@ describe('Working with sprites', () => {
233
247
234
248
test ( 'Load a sprite2 with a missing svg costume' , async ( ) => {
235
249
await loadUri ( uri ) ;
250
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
236
251
const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
237
252
await driver . actions ( ) . mouseMove ( el )
238
253
. perform ( ) ;
@@ -246,6 +261,7 @@ describe('Working with sprites', () => {
246
261
247
262
test ( 'Load a sprite2 with a currupt svg costume' , async ( ) => {
248
263
await loadUri ( uri ) ;
264
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
249
265
const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
250
266
await driver . actions ( ) . mouseMove ( el )
251
267
. perform ( ) ;
@@ -259,6 +275,7 @@ describe('Working with sprites', () => {
259
275
260
276
test ( 'Load a corrupt scratch2 svg as a sprite' , async ( ) => {
261
277
await loadUri ( uri ) ;
278
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
262
279
const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
263
280
await driver . actions ( ) . mouseMove ( el )
264
281
. perform ( ) ;
@@ -272,6 +289,7 @@ describe('Working with sprites', () => {
272
289
273
290
test ( 'Load a sprite3 with a missing bmp costume' , async ( ) => {
274
291
await loadUri ( uri ) ;
292
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
275
293
const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
276
294
await driver . actions ( ) . mouseMove ( el )
277
295
. perform ( ) ;
@@ -285,6 +303,7 @@ describe('Working with sprites', () => {
285
303
286
304
test ( 'Load a sprite3 with a currupt bmp costume' , async ( ) => {
287
305
await loadUri ( uri ) ;
306
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
288
307
const el = await findByXpath ( '//button[@aria-label="Choose a Sprite"]' ) ;
289
308
await driver . actions ( ) . mouseMove ( el )
290
309
. perform ( ) ;
0 commit comments