From 01027ccd89c17f3237452e0880ca622651d4c3c4 Mon Sep 17 00:00:00 2001 From: Eugenio Lacuesta Date: Fri, 18 Dec 2020 23:35:48 -0300 Subject: [PATCH] Small styling adjustment --- tests/test_playwright_requests.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/test_playwright_requests.py b/tests/test_playwright_requests.py index 9659bf02..436cc8b6 100644 --- a/tests/test_playwright_requests.py +++ b/tests/test_playwright_requests.py @@ -9,7 +9,7 @@ from scrapy.utils.test import get_crawler from scrapy_playwright.handler import ScrapyPlaywrightDownloadHandler -from scrapy_playwright.page import PageCoroutine +from scrapy_playwright.page import PageCoroutine as PageCoro from tests.mockserver import PostMockServer, StaticMockServer @@ -82,7 +82,7 @@ async def test_page_coroutine_navigation(self): url=server.urljoin("/index.html"), meta={ "playwright": True, - "playwright_page_coroutines": [PageCoroutine("click", "a.lorem_ipsum")], + "playwright_page_coroutines": [PageCoro("click", "a.lorem_ipsum")], }, ) resp = await handler._download_request(req, Spider("foo")) @@ -111,11 +111,11 @@ async def test_page_coroutine_infinite_scroll(self): meta={ "playwright": True, "playwright_page_coroutines": [ - PageCoroutine("waitForSelector", selector="div.quote"), - PageCoroutine("evaluate", expression="window.scrollBy(0, document.body.scrollHeight)"), - PageCoroutine("waitForSelector", selector="div.quote:nth-child(11)"), - PageCoroutine("evaluate", expression="window.scrollBy(0, document.body.scrollHeight)"), - PageCoroutine("waitForSelector", selector="div.quote:nth-child(21)"), + PageCoro("waitForSelector", selector="div.quote"), + PageCoro("evaluate", "window.scrollBy(0, document.body.scrollHeight)"), + PageCoro("waitForSelector", selector="div.quote:nth-child(11)"), + PageCoro("evaluate", "window.scrollBy(0, document.body.scrollHeight)"), + PageCoro("waitForSelector", selector="div.quote:nth-child(21)"), ], }, ) @@ -144,7 +144,7 @@ async def test_page_coroutine_screenshot(self): meta={ "playwright": True, "playwright_page_coroutines": { - "png": PageCoroutine("screenshot", path=png_file.name, type="png"), + "png": PageCoro("screenshot", path=png_file.name, type="png"), }, }, ) @@ -176,7 +176,7 @@ async def test_page_coroutine_pdf(self): meta={ "playwright": True, "playwright_page_coroutines": { - "pdf": PageCoroutine("pdf", path=pdf_file.name), + "pdf": PageCoro("pdf", path=pdf_file.name), }, }, )