@@ -13,6 +13,7 @@ const {
13
13
getLogs,
14
14
Key,
15
15
loadUri,
16
+ notExistsByXpath,
16
17
rightClickText,
17
18
scope
18
19
} = new SeleniumHelper ( ) ;
@@ -35,16 +36,18 @@ describe('Working with the blocks', () => {
35
36
36
37
test ( 'Blocks report when clicked in the toolbox' , async ( ) => {
37
38
await loadUri ( uri ) ;
39
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
38
40
await clickText ( 'Code' ) ;
39
41
await clickBlocksCategory ( 'Operators' ) ;
40
42
await clickText ( 'join' , scope . blocksTab ) ; // Click "join <hello> <world>" block
41
43
await findByText ( 'apple banana' , scope . reportedValue ) ; // Tooltip with result
42
44
const logs = await getLogs ( ) ;
43
45
await expect ( logs ) . toEqual ( [ ] ) ;
44
- } , 60 * 1000 ) ;
46
+ } ) ;
45
47
46
48
test ( 'Switching sprites updates the block menus' , async ( ) => {
47
49
await loadUri ( uri ) ;
50
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
48
51
await clickBlocksCategory ( 'Sound' ) ;
49
52
// "Meow" sound block should be visible
50
53
await findByText ( 'Meow' , scope . blocksTab ) ;
@@ -56,10 +59,11 @@ describe('Working with the blocks', () => {
56
59
57
60
const logs = await getLogs ( ) ;
58
61
await expect ( logs ) . toEqual ( [ ] ) ;
59
- } , 60 * 1000 ) ;
62
+ } ) ;
60
63
61
64
test ( 'Creating variables' , async ( ) => {
62
65
await loadUri ( uri ) ;
66
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
63
67
await clickText ( 'Code' ) ;
64
68
await clickBlocksCategory ( 'Variables' ) ;
65
69
@@ -103,10 +107,11 @@ describe('Working with the blocks', () => {
103
107
104
108
const logs = await getLogs ( ) ;
105
109
await expect ( logs ) . toEqual ( [ ] ) ;
106
- } , 60 * 1000 ) ;
110
+ } ) ;
107
111
108
112
test ( 'Creating a list' , async ( ) => {
109
113
await loadUri ( uri ) ;
114
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
110
115
await clickText ( 'Code' ) ;
111
116
await clickBlocksCategory ( 'Variables' ) ;
112
117
@@ -143,10 +148,11 @@ describe('Working with the blocks', () => {
143
148
144
149
const logs = await getLogs ( ) ;
145
150
await expect ( logs ) . toEqual ( [ ] ) ;
146
- } , 60 * 1000 ) ;
151
+ } ) ;
147
152
148
153
test ( 'Custom procedures' , async ( ) => {
149
154
await loadUri ( uri ) ;
155
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
150
156
await clickBlocksCategory ( 'My Blocks' ) ;
151
157
await clickText ( 'Make a Block' ) ;
152
158
// Click on the "add an input" buttons
@@ -160,10 +166,11 @@ describe('Working with the blocks', () => {
160
166
161
167
const logs = await getLogs ( ) ;
162
168
await expect ( logs ) . toEqual ( [ ] ) ;
163
- } , 60 * 1000 ) ;
169
+ } ) ;
164
170
165
171
test ( 'Adding an extension' , async ( ) => {
166
172
await loadUri ( uri ) ;
173
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
167
174
await clickXpath ( '//button[@title="Add Extension"]' ) ;
168
175
169
176
await clickText ( 'Pen' ) ;
@@ -173,10 +180,11 @@ describe('Working with the blocks', () => {
173
180
174
181
const logs = await getLogs ( ) ;
175
182
await expect ( logs ) . toEqual ( [ ] ) ;
176
- } , 60 * 1000 ) ;
183
+ } ) ;
177
184
178
185
test ( 'Record option from sound block menu opens sound recorder' , async ( ) => {
179
186
await loadUri ( uri ) ;
187
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
180
188
await clickText ( 'Code' ) ;
181
189
await clickBlocksCategory ( 'Sound' ) ;
182
190
await clickText ( 'Meow' , scope . blocksTab ) ; // Click "play sound <Meow> until done" block
@@ -192,6 +200,7 @@ describe('Working with the blocks', () => {
192
200
193
201
test ( 'Renaming costume changes the default costume name in the toolbox' , async ( ) => {
194
202
await loadUri ( uri ) ;
203
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
195
204
196
205
// Rename the costume
197
206
await clickText ( 'Costumes' ) ;
@@ -207,10 +216,11 @@ describe('Working with the blocks', () => {
207
216
await clickText ( 'Code' ) ;
208
217
await clickBlocksCategory ( 'Looks' ) ;
209
218
await clickText ( 'newname' , scope . blocksTab ) ;
210
- } , 60 * 1000 ) ;
219
+ } ) ;
211
220
212
- test . skip ( 'Renaming costume with a special character should not break toolbox' , async ( ) => {
221
+ test ( 'Renaming costume with a special character should not break toolbox' , async ( ) => {
213
222
await loadUri ( uri ) ;
223
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
214
224
215
225
// Rename the costume
216
226
await clickText ( 'Costumes' ) ;
@@ -228,10 +238,11 @@ describe('Working with the blocks', () => {
228
238
await clickText ( '<NewCostume>' , scope . blocksTab ) ;
229
239
230
240
await clickBlocksCategory ( 'Sound' ) ;
231
- } , 60 * 1000 ) ;
241
+ } ) ;
232
242
233
243
test ( 'Adding costumes DOES update the default costume name in the toolbox' , async ( ) => {
234
244
await loadUri ( uri ) ;
245
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
235
246
236
247
// By default, costume2 is in the costume tab
237
248
await clickBlocksCategory ( 'Looks' ) ;
@@ -251,11 +262,12 @@ describe('Working with the blocks', () => {
251
262
// Check that the menu has been updated
252
263
await clickText ( 'Code' ) ;
253
264
await clickText ( 'costume2' , scope . blocksTab ) ;
254
- } , 60 * 1000 ) ;
265
+ } ) ;
255
266
256
267
// Skipped because it was flakey on travis, but seems to run locally ok
257
268
test ( 'Adding a sound DOES update the default sound name in the toolbox' , async ( ) => {
258
269
await loadUri ( uri ) ;
270
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
259
271
await clickText ( 'Sounds' ) ;
260
272
await clickXpath ( '//button[@aria-label="Choose a Sound"]' ) ;
261
273
await clickText ( 'A Bass' , scope . modal ) ; // Should close the modal
@@ -265,12 +277,13 @@ describe('Working with the blocks', () => {
265
277
await clickText ( 'Code' ) ;
266
278
await clickBlocksCategory ( 'Sound' ) ;
267
279
await clickText ( 'A\u00A0Bass' , scope . blocksTab ) ; // Need for block text
268
- } , 60 * 1000 ) ;
280
+ } ) ;
269
281
270
282
// Regression test for switching between editor/player causing toolbox to stop updating
271
283
test ( '"See inside" after being on project page re-initializing variables' , async ( ) => {
272
284
const playerUri = path . resolve ( __dirname , '../../build/player.html' ) ;
273
285
await loadUri ( playerUri ) ;
286
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
274
287
await clickText ( 'See inside' ) ;
275
288
await clickBlocksCategory ( 'Variables' ) ;
276
289
await clickText ( 'my\u00A0variable' ) ;
@@ -280,11 +293,12 @@ describe('Working with the blocks', () => {
280
293
281
294
await clickBlocksCategory ( 'Variables' ) ;
282
295
await clickText ( 'my\u00A0variable' ) ;
283
- } , 60 * 1000 ) ;
296
+ } ) ;
284
297
285
298
// Regression test for switching editor tabs causing toolbox to stop updating
286
299
test ( 'Creating variables after adding extensions updates the toolbox' , async ( ) => {
287
300
await loadUri ( uri ) ;
301
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
288
302
await clickText ( 'Costumes' ) ;
289
303
await clickText ( 'Code' ) ;
290
304
await clickBlocksCategory ( 'Variables' ) ;
@@ -293,13 +307,14 @@ describe('Working with the blocks', () => {
293
307
await el . sendKeys ( 'list1' ) ;
294
308
await clickButton ( 'OK' ) ;
295
309
await clickText ( 'list1' , scope . blocksTab ) ;
296
- } , 60 * 1000 ) ;
310
+ } ) ;
297
311
298
312
test ( 'Use variable blocks after switching languages' , async ( ) => {
299
313
const myVariable = 'my\u00A0variable' ;
300
314
const changeVariableByScope = "*[@data-id='data_changevariableby']" ;
301
315
302
316
await loadUri ( uri ) ;
317
+ await notExistsByXpath ( '//*[div[contains(@class, "loader_background")]]' ) ;
303
318
304
319
await clickText ( 'Code' ) ;
305
320
await clickBlocksCategory ( 'Variables' ) ;
@@ -335,5 +350,5 @@ describe('Working with the blocks', () => {
335
350
// check it is turned up to 11
336
351
await clickText ( myVariable ) ;
337
352
await findByText ( '11' , scope . reportedValue ) ;
338
- } , 60 * 1000 ) ;
353
+ } ) ;
339
354
} ) ;
0 commit comments