(page)
| 322 | |
| 323 | @pytest.mark.asyncio |
| 324 | async def test_expose_binding(page): |
| 325 | binding_source = [] |
| 326 | |
| 327 | def binding(source, a, b): |
| 328 | binding_source.append(source) |
| 329 | return a + b |
| 330 | |
| 331 | await page.expose_binding("add", lambda source, a, b: binding(source, a, b)) |
| 332 | |
| 333 | result = await page.evaluate("add(5, 6)") |
| 334 | |
| 335 | assert binding_source[0]["context"] == page.context |
| 336 | assert binding_source[0]["page"] == page |
| 337 | assert binding_source[0]["frame"] == page.main_frame |
| 338 | assert result == 11 |
| 339 | |
| 340 | |
| 341 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected