Skip to content

Commit

Permalink
Added Python Example to PrintPage Documentation (#2009)[deploy site]
Browse files Browse the repository at this point in the history
Co-authored-by: Sri Harsha <12621691+harsha509@users.noreply.github.com>
  • Loading branch information
shbenzer and harsha509 authored Oct 27, 2024
1 parent 43aa019 commit 430587a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 8 deletions.
15 changes: 15 additions & 0 deletions examples/python/tests/interactions/test_prints_page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import pytest
from selenium import webdriver
from selenium.webdriver.common.print_page_options import PrintOptions

pytest.fixture()
def driver():
driver = webdriver.Chrome()
yield driver
driver.quit()

def test_prints_page(driver):
driver.get("https://www.selenium.dev/")
print_options = PrintOptions()
pdf = driver.print_page(print_options)
assert len(pdf) > 0
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,9 @@ Note: `BrowsingContext()` is part of Selenium's BiDi implementation. To enable B
{{< tab header="Ruby" >}}
{{< badge-implementation >}}
{{< /tab >}}
{{< tab header="Python" >}}
{{< badge-code >}}
{{% tab header="Python" %}}
**print_page()**
{{< gh-codeblock path="examples/python/tests/interactions/test_prints_page.py#L11-L15" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-implementation >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,9 @@ Note: `BrowsingContext()` is part of Selenium's BiDi implementation. To enable B
{{< tab header="Ruby" >}}
{{< badge-implementation >}}
{{< /tab >}}
{{< tab header="Python" >}}
{{< badge-code >}}
{{% tab header="Python" %}}
**print_page()**
{{< gh-codeblock path="examples/python/tests/interactions/test_prints_page.py#L11-L15" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-implementation >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,9 @@ Note: `BrowsingContext()` is part of Selenium's BiDi implementation. To enable B
{{< tab header="Ruby" >}}
{{< badge-implementation >}}
{{< /tab >}}
{{< tab header="Python" >}}
{{< badge-code >}}
{{% tab header="Python" %}}
**print_page()**
{{< gh-codeblock path="examples/python/tests/interactions/test_prints_page.py#L11-L15" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-implementation >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,9 @@ Note: `BrowsingContext()` is part of Selenium's BiDi implementation. To enable B
{{< tab header="Ruby" >}}
{{< badge-implementation >}}
{{< /tab >}}
{{< tab header="Python" >}}
{{< badge-code >}}
{{% tab header="Python" %}}
**print_page()**
{{< gh-codeblock path="examples/python/tests/interactions/test_prints_page.py#L11-L15" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
{{< badge-implementation >}}
Expand Down

0 comments on commit 430587a

Please sign in to comment.