Skip to content

Commit f973f96

Browse files
committed
test: wait to show start
1 parent 4495cfc commit f973f96

File tree

1 file changed

+29
-14
lines changed

1 file changed

+29
-14
lines changed

test/integration/blocks.test.js

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const {
1313
getLogs,
1414
Key,
1515
loadUri,
16+
notExistsByXpath,
1617
rightClickText,
1718
scope
1819
} = new SeleniumHelper();
@@ -35,16 +36,18 @@ describe('Working with the blocks', () => {
3536

3637
test('Blocks report when clicked in the toolbox', async () => {
3738
await loadUri(uri);
39+
await notExistsByXpath('//*[div[contains(@class, "loader_background")]]');
3840
await clickText('Code');
3941
await clickBlocksCategory('Operators');
4042
await clickText('join', scope.blocksTab); // Click "join <hello> <world>" block
4143
await findByText('apple banana', scope.reportedValue); // Tooltip with result
4244
const logs = await getLogs();
4345
await expect(logs).toEqual([]);
44-
}, 60 * 1000);
46+
});
4547

4648
test('Switching sprites updates the block menus', async () => {
4749
await loadUri(uri);
50+
await notExistsByXpath('//*[div[contains(@class, "loader_background")]]');
4851
await clickBlocksCategory('Sound');
4952
// "Meow" sound block should be visible
5053
await findByText('Meow', scope.blocksTab);
@@ -56,10 +59,11 @@ describe('Working with the blocks', () => {
5659

5760
const logs = await getLogs();
5861
await expect(logs).toEqual([]);
59-
}, 60 * 1000);
62+
});
6063

6164
test('Creating variables', async () => {
6265
await loadUri(uri);
66+
await notExistsByXpath('//*[div[contains(@class, "loader_background")]]');
6367
await clickText('Code');
6468
await clickBlocksCategory('Variables');
6569

@@ -103,10 +107,11 @@ describe('Working with the blocks', () => {
103107

104108
const logs = await getLogs();
105109
await expect(logs).toEqual([]);
106-
}, 60 * 1000);
110+
});
107111

108112
test('Creating a list', async () => {
109113
await loadUri(uri);
114+
await notExistsByXpath('//*[div[contains(@class, "loader_background")]]');
110115
await clickText('Code');
111116
await clickBlocksCategory('Variables');
112117

@@ -143,10 +148,11 @@ describe('Working with the blocks', () => {
143148

144149
const logs = await getLogs();
145150
await expect(logs).toEqual([]);
146-
}, 60 * 1000);
151+
});
147152

148153
test('Custom procedures', async () => {
149154
await loadUri(uri);
155+
await notExistsByXpath('//*[div[contains(@class, "loader_background")]]');
150156
await clickBlocksCategory('My Blocks');
151157
await clickText('Make a Block');
152158
// Click on the "add an input" buttons
@@ -160,10 +166,11 @@ describe('Working with the blocks', () => {
160166

161167
const logs = await getLogs();
162168
await expect(logs).toEqual([]);
163-
}, 60 * 1000);
169+
});
164170

165171
test('Adding an extension', async () => {
166172
await loadUri(uri);
173+
await notExistsByXpath('//*[div[contains(@class, "loader_background")]]');
167174
await clickXpath('//button[@title="Add Extension"]');
168175

169176
await clickText('Pen');
@@ -173,10 +180,11 @@ describe('Working with the blocks', () => {
173180

174181
const logs = await getLogs();
175182
await expect(logs).toEqual([]);
176-
}, 60 * 1000);
183+
});
177184

178185
test('Record option from sound block menu opens sound recorder', async () => {
179186
await loadUri(uri);
187+
await notExistsByXpath('//*[div[contains(@class, "loader_background")]]');
180188
await clickText('Code');
181189
await clickBlocksCategory('Sound');
182190
await clickText('Meow', scope.blocksTab); // Click "play sound <Meow> until done" block
@@ -192,6 +200,7 @@ describe('Working with the blocks', () => {
192200

193201
test('Renaming costume changes the default costume name in the toolbox', async () => {
194202
await loadUri(uri);
203+
await notExistsByXpath('//*[div[contains(@class, "loader_background")]]');
195204

196205
// Rename the costume
197206
await clickText('Costumes');
@@ -207,10 +216,11 @@ describe('Working with the blocks', () => {
207216
await clickText('Code');
208217
await clickBlocksCategory('Looks');
209218
await clickText('newname', scope.blocksTab);
210-
}, 60 * 1000);
219+
});
211220

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 () => {
213222
await loadUri(uri);
223+
await notExistsByXpath('//*[div[contains(@class, "loader_background")]]');
214224

215225
// Rename the costume
216226
await clickText('Costumes');
@@ -228,10 +238,11 @@ describe('Working with the blocks', () => {
228238
await clickText('<NewCostume>', scope.blocksTab);
229239

230240
await clickBlocksCategory('Sound');
231-
}, 60 * 1000);
241+
});
232242

233243
test('Adding costumes DOES update the default costume name in the toolbox', async () => {
234244
await loadUri(uri);
245+
await notExistsByXpath('//*[div[contains(@class, "loader_background")]]');
235246

236247
// By default, costume2 is in the costume tab
237248
await clickBlocksCategory('Looks');
@@ -251,11 +262,12 @@ describe('Working with the blocks', () => {
251262
// Check that the menu has been updated
252263
await clickText('Code');
253264
await clickText('costume2', scope.blocksTab);
254-
}, 60 * 1000);
265+
});
255266

256267
// Skipped because it was flakey on travis, but seems to run locally ok
257268
test('Adding a sound DOES update the default sound name in the toolbox', async () => {
258269
await loadUri(uri);
270+
await notExistsByXpath('//*[div[contains(@class, "loader_background")]]');
259271
await clickText('Sounds');
260272
await clickXpath('//button[@aria-label="Choose a Sound"]');
261273
await clickText('A Bass', scope.modal); // Should close the modal
@@ -265,12 +277,13 @@ describe('Working with the blocks', () => {
265277
await clickText('Code');
266278
await clickBlocksCategory('Sound');
267279
await clickText('A\u00A0Bass', scope.blocksTab); // Need &nbsp; for block text
268-
}, 60 * 1000);
280+
});
269281

270282
// Regression test for switching between editor/player causing toolbox to stop updating
271283
test('"See inside" after being on project page re-initializing variables', async () => {
272284
const playerUri = path.resolve(__dirname, '../../build/player.html');
273285
await loadUri(playerUri);
286+
await notExistsByXpath('//*[div[contains(@class, "loader_background")]]');
274287
await clickText('See inside');
275288
await clickBlocksCategory('Variables');
276289
await clickText('my\u00A0variable');
@@ -280,11 +293,12 @@ describe('Working with the blocks', () => {
280293

281294
await clickBlocksCategory('Variables');
282295
await clickText('my\u00A0variable');
283-
}, 60 * 1000);
296+
});
284297

285298
// Regression test for switching editor tabs causing toolbox to stop updating
286299
test('Creating variables after adding extensions updates the toolbox', async () => {
287300
await loadUri(uri);
301+
await notExistsByXpath('//*[div[contains(@class, "loader_background")]]');
288302
await clickText('Costumes');
289303
await clickText('Code');
290304
await clickBlocksCategory('Variables');
@@ -293,13 +307,14 @@ describe('Working with the blocks', () => {
293307
await el.sendKeys('list1');
294308
await clickButton('OK');
295309
await clickText('list1', scope.blocksTab);
296-
}, 60 * 1000);
310+
});
297311

298312
test('Use variable blocks after switching languages', async () => {
299313
const myVariable = 'my\u00A0variable';
300314
const changeVariableByScope = "*[@data-id='data_changevariableby']";
301315

302316
await loadUri(uri);
317+
await notExistsByXpath('//*[div[contains(@class, "loader_background")]]');
303318

304319
await clickText('Code');
305320
await clickBlocksCategory('Variables');
@@ -335,5 +350,5 @@ describe('Working with the blocks', () => {
335350
// check it is turned up to 11
336351
await clickText(myVariable);
337352
await findByText('11', scope.reportedValue);
338-
}, 60 * 1000);
353+
});
339354
});

0 commit comments

Comments
 (0)