Commit 9f0b389
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.
@
(cherry picked from commit 4c81444)1 parent a798e89 commit 9f0b389
2 files changed
Lines changed: 32 additions & 4 deletions
Lines changed: 21 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
319 | 320 | | |
320 | 321 | | |
321 | 322 | | |
322 | | - | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
323 | 330 | | |
324 | 331 | | |
325 | 332 | | |
| |||
338 | 345 | | |
339 | 346 | | |
340 | 347 | | |
341 | | - | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
342 | 354 | | |
343 | 355 | | |
344 | 356 | | |
| |||
365 | 377 | | |
366 | 378 | | |
367 | 379 | | |
| 380 | + | |
368 | 381 | | |
369 | 382 | | |
370 | 383 | | |
371 | 384 | | |
372 | 385 | | |
373 | 386 | | |
374 | 387 | | |
375 | | - | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
376 | 394 | | |
377 | 395 | | |
378 | 396 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
161 | 162 | | |
162 | 163 | | |
163 | 164 | | |
164 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
165 | 175 | | |
166 | 176 | | |
167 | 177 | | |
| |||
0 commit comments