@@ -269,9 +269,10 @@ function populateEntry(entry, onDone = flushClockAndSave) {
269269 for ( const key of keys ) {
270270 const value = entry [ key ] ;
271271 if ( key === 'body' ) {
272- cy . getMarkdownEditor ( ) . first ( ) . click ( ) ;
273- cy . getMarkdownEditor ( ) . first ( ) . clear ( { force : true } ) ;
274- cy . getMarkdownEditor ( ) . first ( ) . type ( value , { force : true } ) ;
272+ cy . getMarkdownEditor ( ) . first ( ) . as ( 'bodyEditor' ) ;
273+ cy . get ( '@bodyEditor' ) . click ( ) ;
274+ cy . get ( '@bodyEditor' ) . clear ( { force : true } ) ;
275+ cy . get ( '@bodyEditor' ) . type ( value , { force : true } ) ;
275276 } else {
276277 cy . get ( `[id^="${ key } -field"]` )
277278 . first ( )
@@ -464,15 +465,16 @@ function validateNestedObjectFields({ limit, author }) {
464465 cy . focused ( ) . type ( author ) ;
465466 cy . contains ( 'button' , 'Save' ) . click ( ) ;
466467 assertNotification ( notifications . error . missingField ) ;
467- cy . get ( 'input[type=number]' ) . type ( limit + 1 ) ;
468+ cy . get ( 'input[type=number]' ) . as ( 'limitInput' ) ;
469+ cy . get ( '@limitInput' ) . type ( limit + 1 ) ;
468470 cy . contains ( 'button' , 'Save' ) . click ( ) ;
469471 assertFieldValidationError ( notifications . validation . range ) ;
470- cy . get ( 'input[type=number] ' ) . clear ( ) ;
471- cy . get ( 'input[type=number] ' ) . type ( - 1 ) ;
472+ cy . get ( '@limitInput ' ) . clear ( ) ;
473+ cy . get ( '@limitInput ' ) . type ( - 1 ) ;
472474 cy . contains ( 'button' , 'Save' ) . click ( ) ;
473475 assertFieldValidationError ( notifications . validation . range ) ;
474- cy . get ( 'input[type=number] ' ) . clear ( ) ;
475- cy . get ( 'input[type=number] ' ) . type ( limit ) ;
476+ cy . get ( '@limitInput ' ) . clear ( ) ;
477+ cy . get ( '@limitInput ' ) . type ( limit ) ;
476478 cy . contains ( 'button' , 'Save' ) . click ( ) ;
477479 assertNotification ( notifications . saved ) ;
478480}
0 commit comments