From 2a8f089d8f097c6d8177cdc43459737e9c27f96a Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Sat, 6 Aug 2022 21:26:37 +0800 Subject: [PATCH 1/2] Fix typos Found using command below: codespell . -S *.js,*.ts,./playwright,./driver,./.eggs -L complies,datas,keypair --- playwright/_impl/_connection.py | 2 +- playwright/async_api/_generated.py | 12 ++++++------ playwright/sync_api/_generated.py | 12 ++++++------ playwright/sync_api/_py37ThreadedChildWatcher.py | 2 +- tests/assets/download-blob.html | 2 +- tests/async/test_defaultbrowsercontext.py | 2 +- tests/async/test_focus.py | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/playwright/_impl/_connection.py b/playwright/_impl/_connection.py index 7bdf999e9..fd0b6ac7d 100644 --- a/playwright/_impl/_connection.py +++ b/playwright/_impl/_connection.py @@ -327,7 +327,7 @@ def dispatch(self, msg: ParsedMessagePayload) -> None: else: object._channel.emit(method, self._replace_guids_with_channels(params)) except BaseException as exc: - print("Error occured in event listener", file=sys.stderr) + print("Error occurred in event listener", file=sys.stderr) traceback.print_exc() self._error = exc diff --git a/playwright/async_api/_generated.py b/playwright/async_api/_generated.py index fda9d9808..4b4ec66d7 100644 --- a/playwright/async_api/_generated.py +++ b/playwright/async_api/_generated.py @@ -427,7 +427,7 @@ def headers(self) -> typing.Dict[str, str]: def from_service_worker(self) -> bool: """Response.from_service_worker - Indicates whether this Response was fullfilled by a Service Worker's Fetch Handler (i.e. via + Indicates whether this Response was fulfilled by a Service Worker's Fetch Handler (i.e. via [FetchEvent.respondWith](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/respondWith)). Returns @@ -2528,7 +2528,7 @@ async def screenshot( Defaults to `"device"`. mask : Union[List[Locator], NoneType] - Specify locators that should be masked when the screenshot is taken. Masked elements will be overlayed with a pink box + Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box `#FF00FF` that completely covers its bounding box. Returns @@ -7995,7 +7995,7 @@ async def screenshot( Defaults to `"device"`. mask : Union[List[Locator], NoneType] - Specify locators that should be masked when the screenshot is taken. Masked elements will be overlayed with a pink box + Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box `#FF00FF` that completely covers its bounding box. Returns @@ -9263,7 +9263,7 @@ async def pause(self) -> NoneType: User can inspect selectors or perform manual steps while paused. Resume will continue running the original script from the place it was paused. - > NOTE: This method requires Playwright to be started in a headed mode, with a falsy `headless` value in the + > NOTE: This method requires Playwright to be started in a headed mode, with a falsely `headless` value in the `browser_type.launch()`. """ @@ -11047,7 +11047,7 @@ async def new_context( Creates a new browser context. It won't share cookies/cache with other browser contexts. - > NOTE: If directly using this method to create `BrowserContext`s, it is best practice to explicilty close the returned + > NOTE: If directly using this method to create `BrowserContext`s, it is best practice to explicitly close the returned context via `browser_context.close()` when your code is done with the `BrowserContext`, and before calling `browser.close()`. This will ensure the `context` is closed gracefully and any artifacts—like HARs and videos—are fully flushed and saved. @@ -13317,7 +13317,7 @@ async def screenshot( Defaults to `"device"`. mask : Union[List[Locator], NoneType] - Specify locators that should be masked when the screenshot is taken. Masked elements will be overlayed with a pink box + Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box `#FF00FF` that completely covers its bounding box. Returns diff --git a/playwright/sync_api/_generated.py b/playwright/sync_api/_generated.py index b6462a36f..2d6fd707f 100644 --- a/playwright/sync_api/_generated.py +++ b/playwright/sync_api/_generated.py @@ -429,7 +429,7 @@ def headers(self) -> typing.Dict[str, str]: def from_service_worker(self) -> bool: """Response.from_service_worker - Indicates whether this Response was fullfilled by a Service Worker's Fetch Handler (i.e. via + Indicates whether this Response was fulfilled by a Service Worker's Fetch Handler (i.e. via [FetchEvent.respondWith](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/respondWith)). Returns @@ -2554,7 +2554,7 @@ def screenshot( Defaults to `"device"`. mask : Union[List[Locator], NoneType] - Specify locators that should be masked when the screenshot is taken. Masked elements will be overlayed with a pink box + Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box `#FF00FF` that completely covers its bounding box. Returns @@ -8031,7 +8031,7 @@ def screenshot( Defaults to `"device"`. mask : Union[List[Locator], NoneType] - Specify locators that should be masked when the screenshot is taken. Masked elements will be overlayed with a pink box + Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box `#FF00FF` that completely covers its bounding box. Returns @@ -9332,7 +9332,7 @@ def pause(self) -> NoneType: User can inspect selectors or perform manual steps while paused. Resume will continue running the original script from the place it was paused. - > NOTE: This method requires Playwright to be started in a headed mode, with a falsy `headless` value in the + > NOTE: This method requires Playwright to be started in a headed mode, with a falsely `headless` value in the `browser_type.launch()`. """ @@ -11081,7 +11081,7 @@ def new_context( Creates a new browser context. It won't share cookies/cache with other browser contexts. - > NOTE: If directly using this method to create `BrowserContext`s, it is best practice to explicilty close the returned + > NOTE: If directly using this method to create `BrowserContext`s, it is best practice to explicitly close the returned context via `browser_context.close()` when your code is done with the `BrowserContext`, and before calling `browser.close()`. This will ensure the `context` is closed gracefully and any artifacts—like HARs and videos—are fully flushed and saved. @@ -13404,7 +13404,7 @@ def screenshot( Defaults to `"device"`. mask : Union[List[Locator], NoneType] - Specify locators that should be masked when the screenshot is taken. Masked elements will be overlayed with a pink box + Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box `#FF00FF` that completely covers its bounding box. Returns diff --git a/playwright/sync_api/_py37ThreadedChildWatcher.py b/playwright/sync_api/_py37ThreadedChildWatcher.py index 9fb57f33e..cd121267f 100644 --- a/playwright/sync_api/_py37ThreadedChildWatcher.py +++ b/playwright/sync_api/_py37ThreadedChildWatcher.py @@ -118,7 +118,7 @@ def add_child_handler(self, pid, callback, *args): def remove_child_handler(self, pid): # asyncio never calls remove_child_handler() !!! # The method is no-op but is implemented because - # abstract base classe requires it + # abstract base classes requires it return True def attach_loop(self, loop): diff --git a/tests/assets/download-blob.html b/tests/assets/download-blob.html index 02a08893b..3c4a3d813 100644 --- a/tests/assets/download-blob.html +++ b/tests/assets/download-blob.html @@ -24,6 +24,6 @@ download("Hello world", "example.txt"); } - Download + Download diff --git a/tests/async/test_defaultbrowsercontext.py b/tests/async/test_defaultbrowsercontext.py index e47c4f8b0..07c183a27 100644 --- a/tests/async/test_defaultbrowsercontext.py +++ b/tests/async/test_defaultbrowsercontext.py @@ -28,7 +28,7 @@ async def launch_persistent(tmpdir, launch_arguments, browser_type): async def _launch(**options): nonlocal context if context: - raise ValueError("can only launch one persitent context") + raise ValueError("can only launch one persistent context") context = await browser_type.launch_persistent_context( str(tmpdir), **{**launch_arguments, **options} ) diff --git a/tests/async/test_focus.py b/tests/async/test_focus.py index 33ec971d0..3728521c4 100644 --- a/tests/async/test_focus.py +++ b/tests/async/test_focus.py @@ -83,7 +83,7 @@ async def test_should_traverse_only_form_elements(page): await page.set_content( """ - + link """ From 11bd092eff88000c295c1d2a7ecf00e56d47e214 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Thu, 11 Aug 2022 09:21:33 +0200 Subject: [PATCH 2/2] Apply suggestions from code review --- playwright/async_api/_generated.py | 2 +- playwright/sync_api/_generated.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/playwright/async_api/_generated.py b/playwright/async_api/_generated.py index b775eb756..1b364aca9 100644 --- a/playwright/async_api/_generated.py +++ b/playwright/async_api/_generated.py @@ -9263,7 +9263,7 @@ async def pause(self) -> NoneType: User can inspect selectors or perform manual steps while paused. Resume will continue running the original script from the place it was paused. - > NOTE: This method requires Playwright to be started in a headed mode, with a falsely `headless` value in the + > NOTE: This method requires Playwright to be started in a headed mode, with a falsy `headless` value in the `browser_type.launch()`. """ diff --git a/playwright/sync_api/_generated.py b/playwright/sync_api/_generated.py index eb966c8f0..b949c7d77 100644 --- a/playwright/sync_api/_generated.py +++ b/playwright/sync_api/_generated.py @@ -9332,7 +9332,7 @@ def pause(self) -> NoneType: User can inspect selectors or perform manual steps while paused. Resume will continue running the original script from the place it was paused. - > NOTE: This method requires Playwright to be started in a headed mode, with a falsely `headless` value in the + > NOTE: This method requires Playwright to be started in a headed mode, with a falsy `headless` value in the `browser_type.launch()`. """