c o m m i t   9 f e 1 f e 6 f 1 a 2 a c 9 b 3 b 3 3 c 2 4 8 6 4 f a 7 7 6 c 9 d c 1 a 4 4 5 9 
 
 A u t h o r :   g o o g l e - l a b s - j u l e s [ b o t ]   < 1 6 1 3 6 9 8 7 1 + g o o g l e - l a b s - j u l e s [ b o t ] @ u s e r s . n o r e p l y . g i t h u b . c o m > 
 
 D a t e :       M o n   M a r   2   1 7 : 0 4 : 4 1   2 0 2 6   + 0 0 0 0 
 
 
 
         F i x   s c r o l l _ d o w n   c r a s h   a n d   h a r d e n   i n t e r a c t i o n s   w i t h   e x p l i c i t   u s e r   c o n t r o l 
 
         
 
         -   P r e s e r v e d   f i x   f o r   C o n n e c t i o n . t a r g e t _ i d   r e t u r n i n g   c d p . t a r g e t . T a r g e t I D   t o   r e s o l v e   A t t r i b u t e E r r o r   i n   c d p . b r o w s e r   c a l l s . 
 
         -   I m p l e m e n t e d   o p t i o n a l   r e t r y   l o g i c   f o r   C D P   E r r o r   - 3 2 0 0 0   i n   a p p l y ( ) ,   g e t _ p o s i t i o n ( ) ,   s e n d _ f i l e ( ) ,   a n d   f l a s h ( ) ,   d e f a u l t i n g   t o   F a l s e . 
 
         -   R e f a c t o r e d   c l i c k ( )   t o   u s e   a p p l y ( )   f o r   c e n t r a l i z e d   r e s i l i e n c e   w h e n   r e t r y   i s   e n a b l e d . 
 
         -   R e m o v e d   a u t o m a t i c   c l i c k ( )   f r o m   E l e m e n t . f i l l ( )   t o   e n s u r e   e x p l i c i t   u s e r   c o n t r o l . 
 
         -   R e m o v e d   a u t o m a t i c   f l a s h ( )   f r o m   A c t i o n s M i x i n   m e t h o d s   a n d   m a d e   i t   o p t i o n a l   i n   E l e m e n t . c l i c k ( ) . 
 
         -   A d d e d   c o m p r e h e n s i v e   u n i t   t e s t s   f o r   r e t r y   l o g i c ,   t y p e   c o n s i s t e n c y ,   a n d   m a n u a l   c o n t r o l   v a l i d a t i o n . 
 
         
 
         C o - a u t h o r e d - b y :   T o u f i q Q u r e s h i   < 1 3 9 6 1 2 2 5 6 + T o u f i q Q u r e s h i @ u s e r s . n o r e p l y . g i t h u b . c o m > 
 
 
 
 d i f f   - - g i t   a / c h u s c r a p e r / c o r e / e l e m e n t s / i n t e r a c t i o n . p y   b / c h u s c r a p e r / c o r e / e l e m e n t s / i n t e r a c t i o n . p y 
 
 i n d e x   5 f f 4 b 8 b . . b 2 8 0 2 5 e   1 0 0 6 4 4 
 
 - - -   a / c h u s c r a p e r / c o r e / e l e m e n t s / i n t e r a c t i o n . p y 
 
 + + +   b / c h u s c r a p e r / c o r e / e l e m e n t s / i n t e r a c t i o n . p y 
 
 @ @   - 1 4 6 , 1 6   + 1 4 6 , 2 0   @ @   c l a s s   E l e m e n t I n t e r a c t i o n M i x i n ( E l e m e n t M i x i n ) : 
 
                   m o d e :   L i t e r a l [ " h u m a n " ,   " f a s t " ,   " c d p " ]   =   " h u m a n " ,   
 
                   b u t t o n :   s t r   =   " l e f t " ,   
 
                   c l i c k _ c o u n t :   i n t   =   1 , 
 
 +                 r e t r y :   O p t i o n a l [ b o o l ]   =   N o n e , 
 
 +                 f l a s h :   b o o l   =   F a l s e , 
 
                   * * k w a r g s 
 
           )   - >   N o n e : 
 
 +                 i f   f l a s h : 
 
 +                         a w a i t   s e l f . f l a s h ( 0 . 1 ,   r e t r y = r e t r y ) 
 
 + 
 
                   i f   m o d e   i n   ( " f a s t " ,   " c d p " ) : 
 
 -                         a w a i t   s e l f . f l a s h ( 0 . 1 ) 
 
 -                         a w a i t   s e l f . a p p l y ( " ( e l )   = >   e l . c l i c k ( ) " ,   a w a i t _ p r o m i s e = T r u e ) 
 
 +                         a w a i t   s e l f . a p p l y ( " ( e l )   = >   e l . c l i c k ( ) " ,   a w a i t _ p r o m i s e = T r u e ,   r e t r y = r e t r y ) 
 
                           r e t u r n 
 
   
 
                   #   S c r o l l   i n t o   v i e w   b e f o r e   c l i c k i n g   i f   u s i n g   m o u s e   e v e n t s 
 
                   a w a i t   s e l f . s c r o l l _ i n t o _ v i e w ( ) 
 
 -                 p o s   =   a w a i t   s e l f . g e t _ p o s i t i o n ( ) 
 
 +                 p o s   =   a w a i t   s e l f . g e t _ p o s i t i o n ( r e t r y = r e t r y ) 
 
                   i f   n o t   p o s : 
 
                           #   F a l l b a c k   t o   f a s t   c l i c k   i f   p o s i t i o n   u n k n o w n 
 
                           r e t u r n   a w a i t   s e l f . c l i c k ( m o d e = " f a s t " ) 
 
 @ @   - 1 8 6 , 7   + 1 9 0 , 6   @ @   c l a s s   E l e m e n t I n t e r a c t i o n M i x i n ( E l e m e n t M i x i n ) : 
 
                           ) ) 
 
   
 
           a s y n c   d e f   f i l l ( s e l f ,   t e x t :   s t r )   - >   N o n e : 
 
 -                 a w a i t   s e l f . c l i c k ( m o d e = " c d p " )     #   F o c u s 
 
                   a w a i t   s e l f . c l e a r _ i n p u t ( ) 
 
                   a w a i t   s e l f . s e n d _ k e y s ( t e x t ) 
 
   
 
 @ @   - 2 7 2 , 1 5   + 2 7 5 , 2 8   @ @   c l a s s   E l e m e n t I n t e r a c t i o n M i x i n ( E l e m e n t M i x i n ) : 
 
                           a w a i t _ p r o m i s e = T r u e , 
 
                   ) 
 
   
 
 -         a s y n c   d e f   s e n d _ f i l e ( s e l f ,   * f i l e _ p a t h s :   P a t h L i k e )   - >   N o n e : 
 
 +         a s y n c   d e f   s e n d _ f i l e ( s e l f ,   * f i l e _ p a t h s :   P a t h L i k e ,   r e t r y :   O p t i o n a l [ b o o l ]   =   N o n e )   - >   N o n e : 
 
 +                 i f   r e t r y   i s   N o n e : 
 
 +                         c o n f i g   =   s e l f . t a b . b r o w s e r . c o n f i g   i f   s e l f . t a b . b r o w s e r   e l s e   N o n e 
 
 +                         r e t r y   =   g e t a t t r ( c o n f i g ,   " r e t r y _ e n a b l e d " ,   F a l s e ) 
 
 + 
 
                   f i l e _ p a t h s _ a s _ s t r   =   [ s t r ( p )   f o r   p   i n   f i l e _ p a t h s ] 
 
 -                 a w a i t   s e l f . t a b . s e n d ( 
 
 -                         c d p . d o m . s e t _ f i l e _ i n p u t _ f i l e s ( 
 
 -                                 f i l e s = [ * f i l e _ p a t h s _ a s _ s t r ] , 
 
 -                                 b a c k e n d _ n o d e _ i d = s e l f . b a c k e n d _ n o d e _ i d , 
 
 -                                 o b j e c t _ i d = s e l f . o b j e c t _ i d , 
 
 +                 t r y : 
 
 +                         a w a i t   s e l f . t a b . s e n d ( 
 
 +                                 c d p . d o m . s e t _ f i l e _ i n p u t _ f i l e s ( 
 
 +                                         f i l e s = [ * f i l e _ p a t h s _ a s _ s t r ] , 
 
 +                                         b a c k e n d _ n o d e _ i d = s e l f . b a c k e n d _ n o d e _ i d , 
 
 +                                         o b j e c t _ i d = s e l f . o b j e c t _ i d , 
 
 +                                 ) 
 
                           ) 
 
 -                 ) 
 
 +                 e x c e p t   E x c e p t i o n   a s   e : 
 
 +                         f r o m   . . c o n n e c t i o n   i m p o r t   P r o t o c o l E x c e p t i o n 
 
 +                         i f   r e t r y   a n d   i s i n s t a n c e ( e ,   P r o t o c o l E x c e p t i o n )   a n d   e . c o d e   = =   - 3 2 0 0 0 : 
 
 +                                 l o g g e r . d e b u g ( f " R e t r y i n g   s e n d _ f i l e ( )   o n   { s e l f . n o d e _ n a m e }   a f t e r   s t a l e   o b j e c t _ i d   e r r o r " ) 
 
 +                                 s e t a t t r ( s e l f ,   ' _ r e m o t e _ o b j e c t ' ,   N o n e ) 
 
 +                                 a w a i t   s e l f . u p d a t e ( ) 
 
 +                                 r e t u r n   a w a i t   s e l f . s e n d _ f i l e ( * f i l e _ p a t h s ,   r e t r y = F a l s e ) 
 
 +                         r a i s e   e 
 
   
 
           a s y n c   d e f   f o c u s ( s e l f )   - >   N o n e : 
 
                   a w a i t   s e l f . a p p l y ( " ( e l e m e n t )   = >   e l e m e n t . f o c u s ( ) " ) 
 
 @ @   - 3 5 1 , 8   + 3 6 7 , 1 2   @ @   c l a s s   E l e m e n t I n t e r a c t i o n M i x i n ( E l e m e n t M i x i n ) : 
 
                   r e t u r n _ b y _ v a l u e :   b o o l   =   T r u e , 
 
                   * , 
 
                   a w a i t _ p r o m i s e :   b o o l   =   F a l s e , 
 
 -                 r e t r y :   b o o l   =   T r u e , 
 
 +                 r e t r y :   O p t i o n a l [ b o o l ]   =   N o n e , 
 
           )   - >   t y p i n g . A n y : 
 
 +                 i f   r e t r y   i s   N o n e : 
 
 +                         c o n f i g   =   s e l f . t a b . b r o w s e r . c o n f i g   i f   s e l f . t a b . b r o w s e r   e l s e   N o n e 
 
 +                         r e t r y   =   g e t a t t r ( c o n f i g ,   " r e t r y _ e n a b l e d " ,   F a l s e ) 
 
 + 
 
                   i f   n o t   s e l f . r e m o t e _ o b j e c t : 
 
                             s e t a t t r ( s e l f ,   ' _ r e m o t e _ o b j e c t ' ,   a w a i t   s e l f . t a b . s e n d ( 
 
                                   c d p . d o m . r e s o l v e _ n o d e ( b a c k e n d _ n o d e _ i d = s e l f . b a c k e n d _ n o d e _ i d ) 
 
 @ @   - 3 8 8 , 7   + 4 0 8 , 1 1   @ @   c l a s s   E l e m e n t I n t e r a c t i o n M i x i n ( E l e m e n t M i x i n ) : 
 
                                   r e t u r n   a w a i t   s e l f . a p p l y ( j s _ f u n c t i o n ,   r e t u r n _ b y _ v a l u e ,   a w a i t _ p r o m i s e = a w a i t _ p r o m i s e ,   r e t r y = F a l s e ) 
 
                           r a i s e   e 
 
   
 
 -         a s y n c   d e f   g e t _ p o s i t i o n ( s e l f ,   a b s :   b o o l   =   F a l s e )   - >   P o s i t i o n   |   N o n e : 
 
 +         a s y n c   d e f   g e t _ p o s i t i o n ( s e l f ,   a b s :   b o o l   =   F a l s e ,   r e t r y :   O p t i o n a l [ b o o l ]   =   N o n e )   - >   P o s i t i o n   |   N o n e : 
 
 +                 i f   r e t r y   i s   N o n e : 
 
 +                         c o n f i g   =   s e l f . t a b . b r o w s e r . c o n f i g   i f   s e l f . t a b . b r o w s e r   e l s e   N o n e 
 
 +                         r e t r y   =   g e t a t t r ( c o n f i g ,   " r e t r y _ e n a b l e d " ,   F a l s e ) 
 
 + 
 
                   i f   n o t   s e l f . r e m o t e _ o b j e c t   o r   n o t   s e l f . o b j e c t _ i d : 
 
                             t r y : 
 
                                     s e t a t t r ( s e l f ,   ' _ r e m o t e _ o b j e c t ' ,   a w a i t   s e l f . t a b . s e n d ( 
 
 @ @   - 4 1 2 , 7   + 4 3 6 , 1 3   @ @   c l a s s   E l e m e n t I n t e r a c t i o n M i x i n ( E l e m e n t M i x i n ) : 
 
                                   p o s . a b s _ x   =   a b s _ x 
 
                                   p o s . a b s _ y   =   a b s _ y 
 
                           r e t u r n   p o s 
 
 -                 e x c e p t : 
 
 +                 e x c e p t   E x c e p t i o n   a s   e : 
 
 +                         f r o m   . . c o n n e c t i o n   i m p o r t   P r o t o c o l E x c e p t i o n 
 
 +                         i f   r e t r y   a n d   i s i n s t a n c e ( e ,   P r o t o c o l E x c e p t i o n )   a n d   e . c o d e   = =   - 3 2 0 0 0 : 
 
 +                                 l o g g e r . d e b u g ( f " R e t r y i n g   g e t _ p o s i t i o n ( )   o n   { s e l f . n o d e _ n a m e }   a f t e r   s t a l e   o b j e c t _ i d   e r r o r " ) 
 
 +                                 s e t a t t r ( s e l f ,   ' _ r e m o t e _ o b j e c t ' ,   N o n e ) 
 
 +                                 a w a i t   s e l f . u p d a t e ( ) 
 
 +                                 r e t u r n   a w a i t   s e l f . g e t _ p o s i t i o n ( a b s = a b s ,   r e t r y = F a l s e ) 
 
                           r e t u r n   N o n e 
 
   
 
           a s y n c   d e f   m o u s e _ c l i c k ( 
 
 @ @   - 4 2 2 , 8   + 4 5 2 , 9   @ @   c l a s s   E l e m e n t I n t e r a c t i o n M i x i n ( E l e m e n t M i x i n ) : 
 
                   m o d i f i e r s :   t y p i n g . O p t i o n a l [ i n t ]   =   0 , 
 
                   h o l d :   b o o l   =   F a l s e , 
 
                   _ u n t i l _ e v e n t :   t y p i n g . O p t i o n a l [ t y p e ]   =   N o n e , 
 
 +                 r e t r y :   O p t i o n a l [ b o o l ]   =   N o n e , 
 
           )   - >   N o n e : 
 
 -                 p o s i t i o n   =   a w a i t   s e l f . g e t _ p o s i t i o n ( ) 
 
 +                 p o s i t i o n   =   a w a i t   s e l f . g e t _ p o s i t i o n ( r e t r y = r e t r y ) 
 
                   i f   n o t   p o s i t i o n : 
 
                           l o g g e r . w a r n i n g ( " c o u l d   n o t   f i n d   l o c a t i o n   f o r   % s ,   n o t   c l i c k i n g " ,   s e l f ) 
 
                           r e t u r n 
 
 @ @   - 4 5 4 , 1 3   + 4 8 5 , 8   @ @   c l a s s   E l e m e n t I n t e r a c t i o n M i x i n ( E l e m e n t M i x i n ) : 
 
                                   ) 
 
                           ) , 
 
                   ) 
 
 -                 t r y : 
 
 -                         a w a i t   s e l f . f l a s h ( ) 
 
 -                 e x c e p t :     #   n o q a 
 
 -                         p a s s 
 
 - 
 
 -         a s y n c   d e f   m o u s e _ m o v e ( s e l f )   - >   N o n e : 
 
 -                 p o s i t i o n   =   a w a i t   s e l f . g e t _ p o s i t i o n ( ) 
 
 +         a s y n c   d e f   m o u s e _ m o v e ( s e l f ,   r e t r y :   O p t i o n a l [ b o o l ]   =   N o n e )   - >   N o n e : 
 
 +                 p o s i t i o n   =   a w a i t   s e l f . g e t _ p o s i t i o n ( r e t r y = r e t r y ) 
 
                   i f   n o t   p o s i t i o n : 
 
                           l o g g e r . w a r n i n g ( " c o u l d   n o t   f i n d   l o c a t i o n   f o r   % s ,   n o t   m o v i n g   m o u s e " ,   s e l f ) 
 
                           r e t u r n 
 
 @ @   - 4 7 3 , 1 8   + 4 9 9 , 1 9   @ @   c l a s s   E l e m e n t I n t e r a c t i o n M i x i n ( E l e m e n t M i x i n ) : 
 
                           c d p . i n p u t _ . d i s p a t c h _ m o u s e _ e v e n t ( " m o u s e R e l e a s e d " ,   x = c e n t e r [ 0 ] ,   y = c e n t e r [ 1 ] ) 
 
                   ) 
 
   
 
 -         a s y n c   d e f   h o v e r ( s e l f )   - >   N o n e : 
 
 +         a s y n c   d e f   h o v e r ( s e l f ,   r e t r y :   O p t i o n a l [ b o o l ]   =   N o n e )   - >   N o n e : 
 
                   " " " A l i a s   f o r   m o u s e _ m o v e   t o   h o v e r   c u r s o r   o v e r   t h e   e l e m e n t . " " " 
 
 -                 a w a i t   s e l f . m o u s e _ m o v e ( ) 
 
 +                 a w a i t   s e l f . m o u s e _ m o v e ( r e t r y = r e t r y ) 
 
   
 
           a s y n c   d e f   m o u s e _ d r a g ( 
 
                   s e l f , 
 
                   d e s t i n a t i o n :   t y p i n g . U n i o n [ E l e m e n t ,   t y p i n g . T u p l e [ i n t ,   i n t ] ] , 
 
                   r e l a t i v e :   b o o l   =   F a l s e , 
 
                   s t e p s :   i n t   =   1 , 
 
 +                 r e t r y :   O p t i o n a l [ b o o l ]   =   N o n e , 
 
           )   - >   N o n e : 
 
                   f r o m   . . e l e m e n t   i m p o r t   E l e m e n t   #   l o c a l   i m p o r t 
 
 -                 s t a r t _ p o s i t i o n   =   a w a i t   s e l f . g e t _ p o s i t i o n ( ) 
 
 +                 s t a r t _ p o s i t i o n   =   a w a i t   s e l f . g e t _ p o s i t i o n ( r e t r y = r e t r y ) 
 
                   i f   n o t   s t a r t _ p o s i t i o n : 
 
                           l o g g e r . w a r n i n g ( " c o u l d   n o t   f i n d   l o c a t i o n   f o r   % s ,   n o t   d r a g g i n g " ,   s e l f ) 
 
                           r e t u r n 
 
 d i f f   - - g i t   a / c h u s c r a p e r / c o r e / e l e m e n t s / m e d i a . p y   b / c h u s c r a p e r / c o r e / e l e m e n t s / m e d i a . p y 
 
 i n d e x   6 a b 5 3 3 9 . . 1 7 2 3 c 7 0   1 0 0 6 4 4 
 
 - - -   a / c h u s c r a p e r / c o r e / e l e m e n t s / m e d i a . p y 
 
 + + +   b / c h u s c r a p e r / c o r e / e l e m e n t s / m e d i a . p y 
 
 @ @   - 8 0 , 9   + 8 0 , 1 3   @ @   c l a s s   E l e m e n t M e d i a M i x i n ( E l e m e n t M i x i n ) : 
 
                   p a t h . w r i t e _ b y t e s ( d a t a _ b y t e s ) 
 
                   r e t u r n   s t r ( p a t h ) 
 
   
 
 -         a s y n c   d e f   f l a s h ( s e l f ,   d u r a t i o n :   t y p i n g . U n i o n [ f l o a t ,   i n t ]   =   0 . 5 )   - >   N o n e : 
 
 +         a s y n c   d e f   f l a s h ( s e l f ,   d u r a t i o n :   t y p i n g . U n i o n [ f l o a t ,   i n t ]   =   0 . 5 ,   r e t r y :   O p t i o n a l [ b o o l ]   =   N o n e )   - >   N o n e : 
 
                   f r o m   . . c o n n e c t i o n   i m p o r t   P r o t o c o l E x c e p t i o n 
 
   
 
 +                 i f   r e t r y   i s   N o n e : 
 
 +                         c o n f i g   =   s e l f . t a b . b r o w s e r . c o n f i g   i f   s e l f . t a b . b r o w s e r   e l s e   N o n e 
 
 +                         r e t r y   =   g e t a t t r ( c o n f i g ,   " r e t r y _ e n a b l e d " ,   F a l s e ) 
 
 + 
 
                   i f   n o t   s e l f . r e m o t e _ o b j e c t : 
 
                           t r y : 
 
                                   s e t a t t r ( 
 
 @ @   - 1 4 8 , 1 5   + 1 5 2 , 2 3   @ @   c l a s s   E l e m e n t M e d i a M i x i n ( E l e m e n t M i x i n ) : 
 
                   ) 
 
   
 
                   a r g u m e n t s   =   [ c d p . r u n t i m e . C a l l A r g u m e n t ( o b j e c t _ i d = s e l f . r e m o t e _ o b j e c t . o b j e c t _ i d ) ] 
 
 -                 a w a i t   s e l f . t a b . s e n d ( 
 
 -                         c d p . r u n t i m e . c a l l _ f u n c t i o n _ o n ( 
 
 -                                 s c r i p t , 
 
 -                                 o b j e c t _ i d = s e l f . r e m o t e _ o b j e c t . o b j e c t _ i d , 
 
 -                                 a r g u m e n t s = a r g u m e n t s , 
 
 -                                 a w a i t _ p r o m i s e = T r u e , 
 
 -                                 u s e r _ g e s t u r e = T r u e , 
 
 +                 t r y : 
 
 +                         a w a i t   s e l f . t a b . s e n d ( 
 
 +                                 c d p . r u n t i m e . c a l l _ f u n c t i o n _ o n ( 
 
 +                                         s c r i p t , 
 
 +                                         o b j e c t _ i d = s e l f . r e m o t e _ o b j e c t . o b j e c t _ i d , 
 
 +                                         a r g u m e n t s = a r g u m e n t s , 
 
 +                                         a w a i t _ p r o m i s e = T r u e , 
 
 +                                         u s e r _ g e s t u r e = T r u e , 
 
 +                                 ) 
 
                           ) 
 
 -                 ) 
 
 +                 e x c e p t   E x c e p t i o n   a s   e : 
 
 +                         i f   r e t r y   a n d   i s i n s t a n c e ( e ,   P r o t o c o l E x c e p t i o n )   a n d   e . c o d e   = =   - 3 2 0 0 0 : 
 
 +                                 l o g g e r . d e b u g ( f " R e t r y i n g   f l a s h ( )   o n   { s e l f . n o d e _ n a m e }   a f t e r   s t a l e   o b j e c t _ i d   e r r o r " ) 
 
 +                                 s e t a t t r ( s e l f ,   ' _ r e m o t e _ o b j e c t ' ,   N o n e ) 
 
 +                                 a w a i t   s e l f . u p d a t e ( ) 
 
 +                                 r e t u r n   a w a i t   s e l f . f l a s h ( d u r a t i o n = d u r a t i o n ,   r e t r y = F a l s e ) 
 
 +                         r a i s e   e 
 
   
 
           a s y n c   d e f   h i g h l i g h t _ o v e r l a y ( s e l f )   - >   N o n e : 
 
                   i f   g e t a t t r ( s e l f ,   " _ i s _ h i g h l i g h t e d " ,   F a l s e ) : 
 
 d i f f   - - g i t   a / c h u s c r a p e r / c o r e / t a b s / a c t i o n s . p y   b / c h u s c r a p e r / c o r e / t a b s / a c t i o n s . p y 
 
 i n d e x   2 1 c c 7 3 1 . . b 5 8 3 c 5 f   1 0 0 6 4 4 
 
 - - -   a / c h u s c r a p e r / c o r e / t a b s / a c t i o n s . p y 
 
 + + +   b / c h u s c r a p e r / c o r e / t a b s / a c t i o n s . p y 
 
 @ @   - 8 9 , 7   + 8 9 , 7   @ @   c l a s s   A c t i o n s M i x i n ( T a b M i x i n ) : 
 
                             a w a i t   s e l f . s e n d ( s e l f . c d p . i n p u t _ . d i s p a t c h _ k e y _ e v e n t ( * * c l u s t e r ) ) 
 
   
 
           a s y n c   d e f   m o u s e _ m o v e ( 
 
 -                 s e l f ,   x :   f l o a t ,   y :   f l o a t ,   s t e p s :   i n t   =   1 0 ,   f l a s h :   b o o l   =   F a l s e 
 
 +                 s e l f ,   x :   f l o a t ,   y :   f l o a t ,   s t e p s :   i n t   =   1 0 
 
           )   - >   N o n e : 
 
                   s t e p s   =   1   i f   ( n o t   s t e p s   o r   s t e p s   <   1 )   e l s e   s t e p s 
 
                   #   p r o b a b l y   t h e   w o r s t   w a a y   o f   c a l c u l a t i n g   t h i s .   b u t   c o u l d n ' t   t h i n k   o f   a   b e t t e r   s o l u t i o n   t o d a y . 
 
 @ @   - 9 8 , 8   + 9 8 , 6   @ @   c l a s s   A c t i o n s M i x i n ( T a b M i x i n ) : 
 
                           s t e p _ s i z e _ y   =   y   / /   s t e p s 
 
                           p a t h w a y   =   [ ( s t e p _ s i z e _ x   *   i ,   s t e p _ s i z e _ y   *   i )   f o r   i   i n   r a n g e ( s t e p s   +   1 ) ] 
 
                           f o r   p o i n t   i n   p a t h w a y : 
 
 -                                 i f   f l a s h : 
 
 -                                         a w a i t   s e l f . f l a s h _ p o i n t ( p o i n t [ 0 ] ,   p o i n t [ 1 ] ) 
 
                                   a w a i t   s e l f . s e n d ( 
 
                                           c d p . i n p u t _ . d i s p a t c h _ m o u s e _ e v e n t ( 
 
                                                   " m o u s e M o v e d " ,   x = p o i n t [ 0 ] ,   y = p o i n t [ 1 ] 
 
 @ @   - 1 0 7 , 1 3   + 1 0 5 , 9   @ @   c l a s s   A c t i o n s M i x i n ( T a b M i x i n ) : 
 
                                   ) 
 
                   e l s e : 
 
                           a w a i t   s e l f . s e n d ( c d p . i n p u t _ . d i s p a t c h _ m o u s e _ e v e n t ( " m o u s e M o v e d " ,   x = x ,   y = y ) ) 
 
 -                 i f   f l a s h : 
 
 -                         a w a i t   s e l f . f l a s h _ p o i n t ( x ,   y ) 
 
 -                 e l s e : 
 
 -                         a w a i t   s e l f . t a b . s l e e p ( 0 . 0 5 ) 
 
 + 
 
 +                 a w a i t   s e l f . t a b . s l e e p ( 0 . 0 5 ) 
 
                   a w a i t   s e l f . s e n d ( c d p . i n p u t _ . d i s p a t c h _ m o u s e _ e v e n t ( " m o u s e R e l e a s e d " ,   x = x ,   y = y ) ) 
 
 -                 i f   f l a s h : 
 
 -                         a w a i t   s e l f . f l a s h _ p o i n t ( x ,   y ) 
 
   
 
           a s y n c   d e f   m o u s e _ c l i c k ( 
 
                   s e l f , 
 
 @ @   - 1 2 3 , 7   + 1 1 7 , 6   @ @   c l a s s   A c t i o n s M i x i n ( T a b M i x i n ) : 
 
                   b u t t o n s :   t y p i n g . O p t i o n a l [ i n t ]   =   1 , 
 
                   m o d i f i e r s :   t y p i n g . O p t i o n a l [ i n t ]   =   0 , 
 
                   _ u n t i l _ e v e n t :   t y p i n g . O p t i o n a l [ t y p e ]   =   N o n e , 
 
 -                 f l a s h :   t y p i n g . O p t i o n a l [ b o o l ]   =   F a l s e , 
 
           )   - >   N o n e : 
 
                   " " " n a t i v e   c l i c k   o n   p o s i t i o n   x , y 
 
                   : p a r a m   y : 
 
 @ @   - 1 5 9 , 8   + 1 5 2 , 6   @ @   c l a s s   A c t i o n s M i x i n ( T a b M i x i n ) : 
 
                                   c l i c k _ c o u n t = 1 , 
 
                           ) 
 
                   ) 
 
 -                 i f   f l a s h : 
 
 -                         a w a i t   s e l f . f l a s h _ p o i n t ( x ,   y ) 
 
   
 
           a s y n c   d e f   f l a s h _ p o i n t ( 
 
                   s e l f ,   x :   f l o a t ,   y :   f l o a t ,   d u r a t i o n :   f l o a t   =   0 . 5 ,   s i z e :   i n t   =   1 0 
 
 d i f f   - - g i t   a / t e s t _ f i x e s _ u n i t . p y   b / t e s t _ f i x e s _ u n i t . p y 
 
 i n d e x   0 9 4 e a 5 b . . b 0 7 2 e 6 0   1 0 0 6 4 4 
 
 - - -   a / t e s t _ f i x e s _ u n i t . p y 
 
 + + +   b / t e s t _ f i x e s _ u n i t . p y 
 
 @ @   - 2 5 , 9   + 2 5 , 3 5   @ @   c l a s s   T e s t E l e m e n t I n t e r a c t i o n F i x e s ( u n i t t e s t . I s o l a t e d A s y n c i o T e s t C a s e ) : 
 
                   w i t h   p a t c h ( ' c h u s c r a p e r . c o r e . e l e m e n t . E l e m e n t . _ m a k e _ a t t r s ' ) : 
 
                           s e l f . e l e m   =   E l e m e n t ( n o d e = s e l f . m o c k _ n o d e ,   t a b = s e l f . m o c k _ t a b ) 
 
   
 
 -         a s y n c   d e f   t e s t _ a p p l y _ r e t r i e s _ o n _ s t a l e _ o b j e c t _ i d ( s e l f ) : 
 
 +         a s y n c   d e f   t e s t _ f i l l _ d o e s _ n o t _ c l i c k _ a u t o m a t i c a l l y ( s e l f ) : 
 
 +                 f r o m   c h u s c r a p e r . c o r e . e l e m e n t s . i n t e r a c t i o n   i m p o r t   E l e m e n t I n t e r a c t i o n M i x i n 
 
 + 
 
 +                 #   P a t c h i n g   o n   t h e   c l a s s   b e c a u s e   i n s t a n c e   a t t r i b u t e   p a t c h i n g   f a i l e d 
 
 +                 w i t h   p a t c h . o b j e c t ( E l e m e n t I n t e r a c t i o n M i x i n ,   ' c l i c k ' ,   n e w _ c a l l a b l e = A s y n c M o c k )   a s   m o c k _ c l i c k ,   \ 
 
 +                           p a t c h . o b j e c t ( E l e m e n t I n t e r a c t i o n M i x i n ,   ' c l e a r _ i n p u t ' ,   n e w _ c a l l a b l e = A s y n c M o c k )   a s   m o c k _ c l e a r ,   \ 
 
 +                           p a t c h . o b j e c t ( E l e m e n t I n t e r a c t i o n M i x i n ,   ' s e n d _ k e y s ' ,   n e w _ c a l l a b l e = A s y n c M o c k )   a s   m o c k _ s e n d _ k e y s : 
 
 + 
 
 +                         a w a i t   s e l f . e l e m . f i l l ( " t e s t " ) 
 
 +                         m o c k _ c l i c k . a s s e r t _ n o t _ c a l l e d ( ) 
 
 +                         m o c k _ c l e a r . a s s e r t _ c a l l e d _ o n c e ( ) 
 
 +                         m o c k _ s e n d _ k e y s . a s s e r t _ c a l l e d _ o n c e _ w i t h ( " t e s t " ) 
 
 + 
 
 +         a s y n c   d e f   t e s t _ a p p l y _ n o _ r e t r y _ b y _ d e f a u l t ( s e l f ) : 
 
                   f r o m   c h u s c r a p e r . c o r e . c o n n e c t i o n   i m p o r t   P r o t o c o l E x c e p t i o n 
 
   
 
 +                 s t a l e _ e r r o r   =   P r o t o c o l E x c e p t i o n ( { " c o d e " :   - 3 2 0 0 0 ,   " m e s s a g e " :   " C o u l d   n o t   f i n d   o b j e c t   w i t h   g i v e n   i d " } ) 
 
 +                 s e l f . m o c k _ t a b . s e n d . s i d e _ e f f e c t   =   [ s t a l e _ e r r o r ] 
 
 + 
 
 +                 w i t h   s e l f . a s s e r t R a i s e s ( P r o t o c o l E x c e p t i o n ) : 
 
 +                         a w a i t   s e l f . e l e m . a p p l y ( " ( )   = >   { } " ) 
 
 + 
 
 +                 s e l f . a s s e r t E q u a l ( s e l f . m o c k _ t a b . s e n d . c a l l _ c o u n t ,   1 ) 
 
 + 
 
 +         a s y n c   d e f   t e s t _ a p p l y _ r e t r y _ w h e n _ e x p l i c i t ( s e l f ) : 
 
 +                 f r o m   c h u s c r a p e r . c o r e . c o n n e c t i o n   i m p o r t   P r o t o c o l E x c e p t i o n 
 
 +                 f r o m   c h u s c r a p e r . c o r e . e l e m e n t s . i n t e r a c t i o n   i m p o r t   E l e m e n t I n t e r a c t i o n M i x i n 
 
 + 
 
 +                 #   S e t   i n i t i a l   r e m o t e   o b j e c t   s o   i t   d o e s n ' t   t r y   t o   r e s o l v e   i t   f i r s t 
 
                   o l d _ r e m o t e _ o b j e c t   =   M a g i c M o c k ( s p e c = c d p . r u n t i m e . R e m o t e O b j e c t ) 
 
                   o l d _ r e m o t e _ o b j e c t . o b j e c t _ i d   =   c d p . r u n t i m e . R e m o t e O b j e c t I d ( " o l d - i d " ) 
 
                   s e l f . e l e m . _ r e m o t e _ o b j e c t   =   o l d _ r e m o t e _ o b j e c t 
 
 @ @   - 3 6 , 5 1   + 6 2 , 2 3   @ @   c l a s s   T e s t E l e m e n t I n t e r a c t i o n F i x e s ( u n i t t e s t . I s o l a t e d A s y n c i o T e s t C a s e ) : 
 
                   n e w _ r e m o t e _ o b j e c t   =   M a g i c M o c k ( s p e c = c d p . r u n t i m e . R e m o t e O b j e c t ) 
 
                   n e w _ r e m o t e _ o b j e c t . o b j e c t _ i d   =   c d p . r u n t i m e . R e m o t e O b j e c t I d ( " n e w - i d " ) 
 
                   n e w _ r e m o t e _ o b j e c t . v a l u e   =   " s u c c e s s " 
 
 - 
 
                   s u c c e s s _ r e s u l t   =   ( n e w _ r e m o t e _ o b j e c t ,   " s o m e t h i n g " ) 
 
                   m o c k _ d o c   =   M a g i c M o c k ( s p e c = c d p . d o m . N o d e ) 
 
   
 
                   s e l f . m o c k _ t a b . s e n d . s i d e _ e f f e c t   =   [ 
 
 -                         s t a l e _ e r r o r ,                 #   1 .   a p p l y ( )   c a l l   f a i l s 
 
 -                         N o n e ,                               #   2 .   u p d a t e ( )   - >   c d p . d o m . e n a b l e ( ) 
 
 -                         m o c k _ d o c ,                       #   3 .   u p d a t e ( )   - >   c d p . d o m . g e t _ d o c u m e n t ( ) 
 
 -                         n e w _ r e m o t e _ o b j e c t ,     #   4 .   u p d a t e ( )   - >   c d p . d o m . r e s o l v e _ n o d e ( ) 
 
 -                         s u c c e s s _ r e s u l t             #   5 .   r e t r y   a p p l y ( )   c a l l   s u c c e e d s 
 
 +                         s t a l e _ e r r o r ,                 #   1 .   F i r s t   s e n d ( )   c a l l   i n   a p p l y ( )   f a i l s 
 
 +                         N o n e ,                               #   2 .   u p d a t e ( )   - >   e n a b l e 
 
 +                         m o c k _ d o c ,                       #   3 .   u p d a t e ( )   - >   g e t D o c u m e n t 
 
 +                         n e w _ r e m o t e _ o b j e c t ,     #   4 .   u p d a t e ( )   - >   r e s o l v e N o d e 
 
 +                         s u c c e s s _ r e s u l t             #   5 .   r e t r y   a p p l y ( )   s u c c e e d s 
 
                   ] 
 
   
 
 -                 w i t h   p a t c h ( ' c h u s c r a p e r . c o r e . u t i l . f i l t e r _ r e c u r s e ' ,   r e t u r n _ v a l u e = s e l f . m o c k _ n o d e ) : 
 
 -                         r e s u l t   =   a w a i t   s e l f . e l e m . a p p l y ( " ( )   = >   { } " ) 
 
 +                 w i t h   p a t c h ( ' c h u s c r a p e r . c o r e . u t i l . f i l t e r _ r e c u r s e ' ,   r e t u r n _ v a l u e = s e l f . m o c k _ n o d e ) ,   \ 
 
 +                           p a t c h . o b j e c t ( E l e m e n t I n t e r a c t i o n M i x i n ,   ' u p d a t e ' ,   w r a p s = s e l f . e l e m . u p d a t e )   a s   m o c k _ u p d a t e : 
 
 +                         r e s u l t   =   a w a i t   s e l f . e l e m . a p p l y ( " ( )   = >   { } " ,   r e t r y = T r u e ) 
 
                           s e l f . a s s e r t E q u a l ( r e s u l t ,   " s u c c e s s " ) 
 
                           s e l f . a s s e r t E q u a l ( s e l f . m o c k _ t a b . s e n d . c a l l _ c o u n t ,   5 ) 
 
 - 
 
 -         a s y n c   d e f   t e s t _ c l i c k _ u s e s _ a p p l y _ a n d _ r e t r i e s ( s e l f ) : 
 
 -                 f r o m   c h u s c r a p e r . c o r e . c o n n e c t i o n   i m p o r t   P r o t o c o l E x c e p t i o n 
 
 - 
 
 -                 #   M o c k   f l a s h   o n   t h e   E l e m e n t   c l a s s   t o   a f f e c t   a l l   i n s t a n c e s 
 
 -                 f r o m   c h u s c r a p e r . c o r e . e l e m e n t s . m e d i a   i m p o r t   E l e m e n t M e d i a M i x i n 
 
 -                 w i t h   p a t c h . o b j e c t ( E l e m e n t M e d i a M i x i n ,   ' f l a s h ' ,   n e w _ c a l l a b l e = A s y n c M o c k ) : 
 
 -                         o l d _ r e m o t e _ o b j e c t   =   M a g i c M o c k ( s p e c = c d p . r u n t i m e . R e m o t e O b j e c t ) 
 
 -                         o l d _ r e m o t e _ o b j e c t . o b j e c t _ i d   =   c d p . r u n t i m e . R e m o t e O b j e c t I d ( " o l d - c l i c k - i d " ) 
 
 -                         s e l f . e l e m . _ r e m o t e _ o b j e c t   =   o l d _ r e m o t e _ o b j e c t 
 
 - 
 
 -                         s t a l e _ e r r o r   =   P r o t o c o l E x c e p t i o n ( { " c o d e " :   - 3 2 0 0 0 ,   " m e s s a g e " :   " C o u l d   n o t   f i n d   o b j e c t   w i t h   g i v e n   i d " } ) 
 
 -                         n e w _ r e m o t e _ o b j e c t   =   M a g i c M o c k ( s p e c = c d p . r u n t i m e . R e m o t e O b j e c t ) 
 
 -                         n e w _ r e m o t e _ o b j e c t . o b j e c t _ i d   =   c d p . r u n t i m e . R e m o t e O b j e c t I d ( " n e w - c l i c k - i d " ) 
 
 -                         n e w _ r e m o t e _ o b j e c t . v a l u e   =   N o n e 
 
 -                         s u c c e s s _ r e s u l t   =   ( n e w _ r e m o t e _ o b j e c t ,   " s o m e t h i n g " ) 
 
 -                         m o c k _ d o c   =   M a g i c M o c k ( s p e c = c d p . d o m . N o d e ) 
 
 - 
 
 -                         s e l f . m o c k _ t a b . s e n d . s i d e _ e f f e c t   =   [ 
 
 -                                 s t a l e _ e r r o r ,                 #   1 .   a p p l y ( )   v i a   c l i c k ( )   f a i l s 
 
 -                                 N o n e ,                               #   2 .   u p d a t e ( )   - >   c d p . d o m . e n a b l e ( ) 
 
 -                                 m o c k _ d o c ,                       #   3 .   u p d a t e ( )   - >   c d p . d o m . g e t _ d o c u m e n t ( ) 
 
 -                                 n e w _ r e m o t e _ o b j e c t ,     #   4 .   u p d a t e ( )   - >   c d p . d o m . r e s o l v e _ n o d e ( ) 
 
 -                                 s u c c e s s _ r e s u l t             #   5 .   r e t r y   a p p l y ( )   s u c c e e d s 
 
 -                         ] 
 
 - 
 
 -                         w i t h   p a t c h ( ' c h u s c r a p e r . c o r e . u t i l . f i l t e r _ r e c u r s e ' ,   r e t u r n _ v a l u e = s e l f . m o c k _ n o d e ) : 
 
 -                                 a w a i t   s e l f . e l e m . c l i c k ( m o d e = ' c d p ' ) 
 
 -                                 s e l f . a s s e r t E q u a l ( s e l f . m o c k _ t a b . s e n d . c a l l _ c o u n t ,   5 ) 
 
 +                         m o c k _ u p d a t e . a s s e r t _ c a l l e d _ o n c e ( ) 
 
   
 
   i f   _ _ n a m e _ _   = =   " _ _ m a i n _ _ " : 
 
           u n i t t e s t . m a i n ( ) 
 
 