| 196 | @pytest.mark.render |
| 197 | @pytest.mark.asyncio |
| 198 | async def test_async_render(async_get): |
| 199 | r = await async_get() |
| 200 | script = """ |
| 201 | () => { |
| 202 | return { |
| 203 | width: document.documentElement.clientWidth, |
| 204 | height: document.documentElement.clientHeight, |
| 205 | deviceScaleFactor: window.devicePixelRatio, |
| 206 | } |
| 207 | } |
| 208 | """ |
| 209 | val = await r.html.arender(script=script) |
| 210 | for value in ('width', 'height', 'deviceScaleFactor'): |
| 211 | assert value in val |
| 212 | |
| 213 | about = r.html.find('#about', first=True) |
| 214 | assert len(about.links) == 6 |
| 215 | await r.html.browser.close() |
| 216 | |
| 217 | |
| 218 | @pytest.mark.render |