From c05b984733b8511fabfa30faf8e311c4b4a53d54 Mon Sep 17 00:00:00 2001 From: Simon Benzer Date: Tue, 15 Oct 2024 12:59:32 -0400 Subject: [PATCH 1/3] Added Python Examples for PrintOptions() --- .../tests/interactions/test_print_options.py | 58 +++++++++++++++++++ .../webdriver/interactions/print_page.en.md | 56 +++++++++--------- .../webdriver/interactions/print_page.ja.md | 56 +++++++++--------- .../interactions/print_page.pt-br.md | 56 +++++++++--------- .../interactions/print_page.zh-cn.md | 56 +++++++++--------- 5 files changed, 170 insertions(+), 112 deletions(-) create mode 100644 examples/python/tests/interactions/test_print_options.py diff --git a/examples/python/tests/interactions/test_print_options.py b/examples/python/tests/interactions/test_print_options.py new file mode 100644 index 000000000000..8d2d9d722daa --- /dev/null +++ b/examples/python/tests/interactions/test_print_options.py @@ -0,0 +1,58 @@ +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_orientation(driver): + driver.get("https://www.selenium.dev/") + print_options = PrintOptions() + print_options.orientation = "landscape" ## landscape or portrait + assert print_options.orientation == "landscape" + +def test_range(driver): + driver.get("https://www.selenium.dev/") + print_options = PrintOptions() + print_options.page_ranges = ["1-3"] ## ["1", "2", "3"] or ["1-3"] + assert print_options.page_ranges == ["1", "2", "3"] + +def test_size(driver): + driver.get("https://www.selenium.dev/") + print_options = PrintOptions() + print_options.scale = 0.5 ## 0.1 to 2.0`` + assert print_options.scale == 0.5 + +def test_margin(driver): + driver.get("https://www.selenium.dev/") + print_options = PrintOptions() + print_options.margin_top = 10 + print_options.margin_bottom = 10 + print_options.margin_left = 10 + print_options.margin_right = 10 + assert print_options.margin_top == 10 + assert print_options.margin_bottom == 10 + assert print_options.margin_left == 10 + assert print_options.margin_right == 10 + +def test_scale(driver): + driver.get("https://www.selenium.dev/") + print_options = PrintOptions() + print_options.scale = 0.5 ## 0.1 to 2.0 + current_scale = print_options.scale + assert current_scale == 0.5 + +def test_background(driver): + driver.get("https://www.selenium.dev/") + print_options = PrintOptions() + print_options.background = True ## True or False + assert print_options.background is True + +def test_shrink_to_fit(driver): + driver.get("https://www.selenium.dev/") + print_options = PrintOptions() + print_options.shrink_to_fit = True ## True or False + assert print_options.shrink_to_fit is True \ No newline at end of file diff --git a/website_and_docs/content/documentation/webdriver/interactions/print_page.en.md b/website_and_docs/content/documentation/webdriver/interactions/print_page.en.md index 149627d341a8..dc9c5801b647 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/print_page.en.md +++ b/website_and_docs/content/documentation/webdriver/interactions/print_page.en.md @@ -22,16 +22,16 @@ Using the `getOrientation()` and `setOrientation()` methods, you can get/set the {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L12-L19" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L11-L15" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -46,16 +46,16 @@ Using the `getPageRanges()` and `setPageRanges()` methods, you can get/set the r {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L22-L29" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L17-L21" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -70,16 +70,16 @@ Using the `getPaperSize()` and `setPaperSize()` methods, you can get/set the pap {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L32-L38" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L23-L27" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -94,16 +94,16 @@ Using the `getPageMargin()` and `setPageMargin()` methods, you can set the margi {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L51-L57" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L29-L39" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -118,16 +118,16 @@ Using `getScale()` and `setScale()` methods, you can get/set the scale of the pa {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L61-L68" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L41-L46" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -142,16 +142,16 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether b {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L41-L48" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L48-L52" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -166,15 +166,15 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether t {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L71-L78" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L54-L58" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} \ No newline at end of file diff --git a/website_and_docs/content/documentation/webdriver/interactions/print_page.ja.md b/website_and_docs/content/documentation/webdriver/interactions/print_page.ja.md index 876ab368085a..160454f41238 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/print_page.ja.md +++ b/website_and_docs/content/documentation/webdriver/interactions/print_page.ja.md @@ -22,16 +22,16 @@ Using the `getOrientation()` and `setOrientation()` methods, you can get/set the {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L12-L19" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L11-L15" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -46,16 +46,16 @@ Using the `getPageRanges()` and `setPageRanges()` methods, you can get/set the r {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L22-L29" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L17-L21" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -70,16 +70,16 @@ Using the `getPaperSize()` and `setPaperSize()` methods, you can get/set the pap {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L32-L38" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L23-L27" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -94,16 +94,16 @@ Using the `getPageMargin()` and `setPageMargin()` methods, you can set the margi {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L51-L57" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L29-L39" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -118,16 +118,16 @@ Using `getScale()` and `setScale()` methods, you can get/set the scale of the pa {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L61-L68" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L41-L46" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -142,16 +142,16 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether b {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L41-L48" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L48-L52" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -166,15 +166,15 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether t {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L71-L78" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L54-L58" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} \ No newline at end of file diff --git a/website_and_docs/content/documentation/webdriver/interactions/print_page.pt-br.md b/website_and_docs/content/documentation/webdriver/interactions/print_page.pt-br.md index 2f1651ab532e..eef81cc999aa 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/print_page.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/interactions/print_page.pt-br.md @@ -22,16 +22,16 @@ Using the `getOrientation()` and `setOrientation()` methods, you can get/set the {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L12-L19" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L11-L15" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -46,16 +46,16 @@ Using the `getPageRanges()` and `setPageRanges()` methods, you can get/set the r {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L22-L29" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L17-L21" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -70,16 +70,16 @@ Using the `getPaperSize()` and `setPaperSize()` methods, you can get/set the pap {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L32-L38" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L23-L27" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -94,16 +94,16 @@ Using the `getPageMargin()` and `setPageMargin()` methods, you can set the margi {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L51-L57" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L29-L39" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -118,16 +118,16 @@ Using `getScale()` and `setScale()` methods, you can get/set the scale of the pa {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L61-L68" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L41-L46" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -142,16 +142,16 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether b {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L41-L48" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L48-L52" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -166,15 +166,15 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether t {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L71-L78" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L54-L58" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} \ No newline at end of file diff --git a/website_and_docs/content/documentation/webdriver/interactions/print_page.zh-cn.md b/website_and_docs/content/documentation/webdriver/interactions/print_page.zh-cn.md index 7d256c468b5c..8265d8292318 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/print_page.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/interactions/print_page.zh-cn.md @@ -22,16 +22,16 @@ Using the `getOrientation()` and `setOrientation()` methods, you can get/set the {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L12-L19" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L11-L15" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -46,16 +46,16 @@ Using the `getPageRanges()` and `setPageRanges()` methods, you can get/set the r {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L22-L29" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L17-L21" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -70,16 +70,16 @@ Using the `getPaperSize()` and `setPaperSize()` methods, you can get/set the pap {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L32-L38" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L23-L27" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -94,16 +94,16 @@ Using the `getPageMargin()` and `setPageMargin()` methods, you can set the margi {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L51-L57" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L29-L39" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -118,16 +118,16 @@ Using `getScale()` and `setScale()` methods, you can get/set the scale of the pa {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L61-L68" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L41-L46" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -142,16 +142,16 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether b {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L41-L48" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L48-L52" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} @@ -166,15 +166,15 @@ Using `getBackground()` and `setBackground()` methods, you can get/set whether t {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L71-L78" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-code >}} +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L54-L58" >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< tab header="Kotlin" >}} -{{< badge-code >}} +{{< badge-implementation >}} {{< /tab >}} {{< /tabpane >}} \ No newline at end of file From 89b8c225146d4f23d84636b386a0d6d69ce81ec5 Mon Sep 17 00:00:00 2001 From: Simon Benzer <69980130+shbenzer@users.noreply.github.com> Date: Tue, 15 Oct 2024 14:06:45 -0400 Subject: [PATCH 2/3] fixed assertion error --- examples/python/tests/interactions/test_print_options.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/python/tests/interactions/test_print_options.py b/examples/python/tests/interactions/test_print_options.py index 8d2d9d722daa..5aa910b34eba 100644 --- a/examples/python/tests/interactions/test_print_options.py +++ b/examples/python/tests/interactions/test_print_options.py @@ -17,7 +17,7 @@ def test_orientation(driver): def test_range(driver): driver.get("https://www.selenium.dev/") print_options = PrintOptions() - print_options.page_ranges = ["1-3"] ## ["1", "2", "3"] or ["1-3"] + print_options.page_ranges = ["1, 2, 3"] ## ["1", "2", "3"] or ["1-3"] assert print_options.page_ranges == ["1", "2", "3"] def test_size(driver): @@ -55,4 +55,4 @@ def test_shrink_to_fit(driver): driver.get("https://www.selenium.dev/") print_options = PrintOptions() print_options.shrink_to_fit = True ## True or False - assert print_options.shrink_to_fit is True \ No newline at end of file + assert print_options.shrink_to_fit is True From 0461fc8af998a32e9f101cf532ec1960d047ca4f Mon Sep 17 00:00:00 2001 From: Simon Benzer <69980130+shbenzer@users.noreply.github.com> Date: Wed, 16 Oct 2024 12:29:17 -0400 Subject: [PATCH 3/3] now the assertion error is fixed --- examples/python/tests/interactions/test_print_options.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/python/tests/interactions/test_print_options.py b/examples/python/tests/interactions/test_print_options.py index 5aa910b34eba..8027e1a23525 100644 --- a/examples/python/tests/interactions/test_print_options.py +++ b/examples/python/tests/interactions/test_print_options.py @@ -18,7 +18,7 @@ def test_range(driver): driver.get("https://www.selenium.dev/") print_options = PrintOptions() print_options.page_ranges = ["1, 2, 3"] ## ["1", "2", "3"] or ["1-3"] - assert print_options.page_ranges == ["1", "2", "3"] + assert print_options.page_ranges == ["1, 2, 3"] def test_size(driver): driver.get("https://www.selenium.dev/")