Commit 4c81444
committed
@
Restore InnerBrowser navigation state for Codeception runs (#231)
The 3.9.0 audit decoupled amOnRoute/amOnAction, seePageIsAvailable,
seePageRedirectsTo and submitSymfonyForm from codeception/lib-innerbrowser
so they can also run from plain PHPUnit test cases. They now drive the
BrowserKit client directly (request()/submit()) and discard the returned
Crawler.
Under Codeception that broke downstream DOM assertions: only
InnerBrowser::_loadPage() writes the Crawler back into the cached $crawler
(and resets $baseUrl/$forms), so see(), click() and the form helpers ended
up operating on a null or stale Crawler after those methods.
Keep the decoupling but branch per runner inside each method: when the
module is an InnerBrowser (Codeception) navigation/submission is delegated
to amOnPage()/submitForm() so the cached state stays in sync; otherwise
(PHPUnit) it keeps driving the client directly.
A matching functional test still needs to land in
Codeception/symfony-module-tests per CONTRIBUTING.md.
@1 parent bed4de2 commit 4c81444
2 files changed
Lines changed: 37 additions & 8 deletions
Lines changed: 26 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | | - | |
322 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
323 | 330 | | |
324 | 331 | | |
325 | 332 | | |
| |||
337 | 344 | | |
338 | 345 | | |
339 | 346 | | |
340 | | - | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
341 | 353 | | |
342 | 354 | | |
343 | 355 | | |
| |||
364 | 376 | | |
365 | 377 | | |
366 | 378 | | |
| 379 | + | |
367 | 380 | | |
368 | 381 | | |
369 | 382 | | |
370 | 383 | | |
371 | 384 | | |
372 | 385 | | |
373 | 386 | | |
374 | | - | |
375 | | - | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
376 | 395 | | |
377 | | - | |
| 396 | + | |
378 | 397 | | |
379 | 398 | | |
380 | 399 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
157 | 158 | | |
158 | 159 | | |
159 | 160 | | |
160 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
161 | 171 | | |
162 | 172 | | |
163 | 173 | | |
| |||
0 commit comments