@@ -95,12 +95,12 @@ describe('generateCode - tool mappings', () => {
9595
9696 it ( 'click_element → $().click()' , ( ) => {
9797 const code = generateCode ( makeHistory ( [ { tool : 'click_element' , params : { selector : '#btn' } } ] ) ) ;
98- expect ( code ) . toContain ( "await $('#btn').click();" ) ;
98+ expect ( code ) . toContain ( "await browser. $('#btn').click();" ) ;
9999 } ) ;
100100
101101 it ( 'set_value → $().setValue()' , ( ) => {
102102 const code = generateCode ( makeHistory ( [ { tool : 'set_value' , params : { selector : '#input' , value : 'hello' } } ] ) ) ;
103- expect ( code ) . toContain ( "await $('#input').setValue('hello');" ) ;
103+ expect ( code ) . toContain ( "await browser. $('#input').setValue('hello');" ) ;
104104 } ) ;
105105
106106 it ( 'scroll down → positive scrollBy' , ( ) => {
@@ -115,7 +115,7 @@ describe('generateCode - tool mappings', () => {
115115
116116 it ( 'tap_element (selector form) → $().click()' , ( ) => {
117117 const code = generateCode ( makeHistory ( [ { tool : 'tap_element' , params : { selector : '~btn' } } ] ) ) ;
118- expect ( code ) . toContain ( "await $('~btn').click();" ) ;
118+ expect ( code ) . toContain ( "await browser. $('~btn').click();" ) ;
119119 } ) ;
120120
121121 it ( 'tap_element (coordinate form) → browser.tap()' , ( ) => {
@@ -133,15 +133,15 @@ describe('generateCode - tool mappings', () => {
133133 tool : 'drag_and_drop' ,
134134 params : { sourceSelector : '#from' , targetSelector : '#to' } ,
135135 } ] ) ) ;
136- expect ( code ) . toContain ( "await $('#from').dragAndDrop($('#to'));" ) ;
136+ expect ( code ) . toContain ( "await browser. $('#from').dragAndDrop(browser. $('#to'));" ) ;
137137 } ) ;
138138
139139 it ( 'drag_and_drop (coordinate form) → $().dragAndDrop({ x, y })' , ( ) => {
140140 const code = generateCode ( makeHistory ( [ {
141141 tool : 'drag_and_drop' ,
142142 params : { sourceSelector : '#from' , x : 50 , y : 75 } ,
143143 } ] ) ) ;
144- expect ( code ) . toContain ( "await $('#from').dragAndDrop({ x: 50, y: 75 });" ) ;
144+ expect ( code ) . toContain ( "await browser. $('#from').dragAndDrop({ x: 50, y: 75 });" ) ;
145145 } ) ;
146146} ) ;
147147
0 commit comments