9
9
findByXpath,
10
10
getDriver,
11
11
getLogs,
12
+ Key,
12
13
loadUri,
13
14
rightClickText,
14
15
scope
@@ -185,6 +186,10 @@ describe('Working with the blocks', () => {
185
186
await clickText ( 'costume2' , scope . costumesTab ) ;
186
187
const el = await findByXpath ( "//input[@value='costume2']" ) ;
187
188
await el . sendKeys ( 'newname' ) ;
189
+ await el . sendKeys ( Key . ENTER ) ;
190
+ // wait until the updated costume appears in costume item list panel
191
+ await findByXpath ( "//div[contains(@class,'sprite-selector-item_is-selected_')]" +
192
+ "//div[contains(text(), 'newname')]" ) ;
188
193
189
194
// Make sure it is updated in the block menu
190
195
await clickText ( 'Code' ) ;
@@ -193,14 +198,18 @@ describe('Working with the blocks', () => {
193
198
await clickText ( 'newname' , scope . blocksTab ) ;
194
199
} ) ;
195
200
196
- test . skip ( 'Renaming costume with a special character should not break toolbox' , async ( ) => {
201
+ test ( 'Renaming costume with a special character should not break toolbox' , async ( ) => {
197
202
await loadUri ( uri ) ;
198
203
199
204
// Rename the costume
200
205
await clickText ( 'Costumes' ) ;
201
206
await clickText ( 'costume2' , scope . costumesTab ) ;
202
207
const el = await findByXpath ( "//input[@value='costume2']" ) ;
203
208
await el . sendKeys ( '<NewCostume>' ) ;
209
+ await el . sendKeys ( Key . ENTER ) ;
210
+ // wait until the updated costume appears in costume item list panel
211
+ await findByXpath ( "//div[contains(@class,'sprite-selector-item_is-selected_')]" +
212
+ "//div[contains(text(), '<NewCostume>')]" ) ;
204
213
205
214
// Make sure it is updated in the block menu
206
215
await clickText ( 'Code' ) ;
@@ -226,18 +235,24 @@ describe('Working with the blocks', () => {
226
235
. perform ( ) ;
227
236
await driver . sleep ( 500 ) ; // Wait for thermometer menu to come up
228
237
await clickXpath ( '//button[@aria-label="Paint"]' ) ;
238
+ // wait until the new costume appears in costume item list panel
239
+ await findByXpath ( "//div[contains(@class,'sprite-selector-item_is-selected_')]" +
240
+ "//div[contains(text(), 'costume3')]" ) ;
229
241
await clickText ( 'costume3' , scope . costumesTab ) ;
230
242
// Check that the menu has been updated
231
243
await clickText ( 'Code' ) ;
232
244
await clickText ( 'costume3' , scope . blocksTab ) ;
233
245
} ) ;
234
246
235
247
// Skipped because it was flakey on travis, but seems to run locally ok
236
- test . skip ( 'Adding a sound DOES update the default sound name in the toolbox' , async ( ) => {
248
+ test ( 'Adding a sound DOES update the default sound name in the toolbox' , async ( ) => {
237
249
await loadUri ( uri ) ;
238
250
await clickText ( 'Sounds' ) ;
239
251
await clickXpath ( '//button[@aria-label="Choose a Sound"]' ) ;
240
252
await clickText ( 'A Bass' , scope . modal ) ; // Should close the modal
253
+ // wait until the selected sound appears in sounds item list panel
254
+ await findByXpath ( "//div[contains(@class,'sprite-selector-item_is-selected_')]" +
255
+ "//div[contains(text(), 'A Bass')]" ) ;
241
256
await clickText ( 'Code' ) ;
242
257
await clickText ( 'Sound' , scope . blocksTab ) ;
243
258
await driver . sleep ( 500 ) ; // Wait for scroll to finish
0 commit comments