@@ -55,9 +55,15 @@ test('browser_fill_form - basic text inputs', async ({ client, server }) => {
55
55
} ,
56
56
} ) ;
57
57
58
- expect ( response . response . code ) . toContain ( `fill('john_doe')` ) ;
59
- expect ( response . response . code ) . toContain ( `fill('[email protected] ')` ) ;
60
- expect ( response . response . code ) . toContain ( 'Form filling completed: 2/2 successful' ) ;
58
+ expect ( response ) . toHaveResponse ( {
59
+ code : expect . stringContaining ( `fill('john_doe')` ) ,
60
+ } ) ;
61
+ expect ( response ) . toHaveResponse ( {
62
+ code :
expect . stringContaining ( `fill('[email protected] ')` ) ,
63
+ } ) ;
64
+ expect ( response ) . toHaveResponse ( {
65
+ code : expect . stringContaining ( 'Form filling completed: 2/2 successful' ) ,
66
+ } ) ;
61
67
} ) ;
62
68
63
69
test ( 'browser_fill_form - checkboxes' , async ( { client, server } ) => {
@@ -111,9 +117,15 @@ test('browser_fill_form - checkboxes', async ({ client, server }) => {
111
117
} ,
112
118
} ) ;
113
119
114
- expect ( response . response . code ) . toContain ( `.check()` ) ;
115
- expect ( response . response . code ) . toContain ( `.uncheck()` ) ;
116
- expect ( response . response . code ) . toContain ( 'Form filling completed: 2/2 successful' ) ;
120
+ expect ( response ) . toHaveResponse ( {
121
+ code : expect . stringContaining ( `.check()` ) ,
122
+ } ) ;
123
+ expect ( response ) . toHaveResponse ( {
124
+ code : expect . stringContaining ( `.uncheck()` ) ,
125
+ } ) ;
126
+ expect ( response ) . toHaveResponse ( {
127
+ code : expect . stringContaining ( 'Form filling completed: 2/2 successful' ) ,
128
+ } ) ;
117
129
} ) ;
118
130
119
131
test ( 'browser_fill_form - dropdowns' , async ( { client, server } ) => {
@@ -158,8 +170,12 @@ test('browser_fill_form - dropdowns', async ({ client, server }) => {
158
170
} ,
159
171
} ) ;
160
172
161
- expect ( response . response . code ) . toContain ( `selectOption('us')` ) ;
162
- expect ( response . response . code ) . toContain ( 'Form filling completed: 1/1 successful' ) ;
173
+ expect ( response ) . toHaveResponse ( {
174
+ code : expect . stringContaining ( `selectOption({ value: 'us' })` ) ,
175
+ } ) ;
176
+ expect ( response ) . toHaveResponse ( {
177
+ code : expect . stringContaining ( 'Form filling completed: 1/1 successful' ) ,
178
+ } ) ;
163
179
} ) ;
164
180
165
181
test ( 'browser_fill_form - mixed legacy and action formats' , async ( { client, server } ) => {
@@ -210,9 +226,15 @@ test('browser_fill_form - mixed legacy and action formats', async ({ client, ser
210
226
} ,
211
227
} ) ;
212
228
213
- expect ( response . response . code ) . toContain ( `fill('John Smith')` ) ;
214
- expect ( response . response . code ) . toContain ( `selectOption('admin')` ) ;
215
- expect ( response . response . code ) . toContain ( 'Form filling completed: 2/2 successful' ) ;
229
+ expect ( response ) . toHaveResponse ( {
230
+ code : expect . stringContaining ( `fill('John Smith')` ) ,
231
+ } ) ;
232
+ expect ( response ) . toHaveResponse ( {
233
+ code : expect . stringContaining ( `selectOption({ value: 'admin' })` ) ,
234
+ } ) ;
235
+ expect ( response ) . toHaveResponse ( {
236
+ code : expect . stringContaining ( 'Form filling completed: 2/2 successful' ) ,
237
+ } ) ;
216
238
} ) ;
217
239
218
240
test ( 'browser_fill_form - error handling' , async ( { client, server } ) => {
@@ -253,6 +275,10 @@ test('browser_fill_form - error handling', async ({ client, server }) => {
253
275
} ,
254
276
} ) ;
255
277
256
- expect ( response . response . code ) . toContain ( `fill('Valid input')` ) ;
257
- expect ( response . response . code ) . toContain ( '1 fields failed' ) ;
278
+ expect ( response ) . toHaveResponse ( {
279
+ code : expect . stringContaining ( `fill('Valid input')` ) ,
280
+ } ) ;
281
+ expect ( response ) . toHaveResponse ( {
282
+ code : expect . stringContaining ( '1 fields failed' ) ,
283
+ } ) ;
258
284
} ) ;
0 commit comments