From d834e318056fa780fe9f10bdb4ab48bfc6b0b38f Mon Sep 17 00:00:00 2001 From: Yuri Verweij Date: Tue, 7 Apr 2026 18:46:55 +0200 Subject: [PATCH 1/3] Fix deprecation warnings in unit tests and improve logging for approval tests --- utest/test/api/test_plugin_documentation.py | 6 +++++- utest/test/keywords/test_browsermanagement.py | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/utest/test/api/test_plugin_documentation.py b/utest/test/api/test_plugin_documentation.py index 3e1c273f2..b03a18fe4 100644 --- a/utest/test/api/test_plugin_documentation.py +++ b/utest/test/api/test_plugin_documentation.py @@ -2,9 +2,11 @@ import unittest from approvaltests.approvals import verify +from approvaltests.reporters.first_working_reporter import FirstWorkingReporter from approvaltests.reporters.generic_diff_reporter_factory import ( GenericDiffReporterFactory, ) +from approvaltests.reporters.python_native_reporter import PythonNativeReporter from robot.utils import WINDOWS from SeleniumLibrary import SeleniumLibrary @@ -24,7 +26,9 @@ def setUp(self): ) factory = GenericDiffReporterFactory() factory.load(reporter_json) - self.reporter = factory.get_first_working() + self.reporter = FirstWorkingReporter( + factory.get_first_working(), PythonNativeReporter() + ) @unittest.skipIf(WINDOWS, reason="ApprovalTest do not support different line feeds") def test_many_plugins(self): diff --git a/utest/test/keywords/test_browsermanagement.py b/utest/test/keywords/test_browsermanagement.py index 9fcce8eb8..74ab7e822 100644 --- a/utest/test/keywords/test_browsermanagement.py +++ b/utest/test/keywords/test_browsermanagement.py @@ -1,5 +1,5 @@ import pytest -from mockito import when, mock, verify, verifyNoMoreInteractions, ANY +from mockito import when, mock, verify, ensureNoUnverifiedInteractions, ANY from selenium import webdriver from selenium.webdriver.chrome.service import Service as ChromeService from selenium.webdriver.chrome.service import Service @@ -21,8 +21,8 @@ def test_set_selenium_timeout_only_affects_open_browsers(): verify(second_browser).set_script_timeout(10.0) ctx._drivers.active_drivers = [] bm.set_selenium_timeout("20 seconds") - verifyNoMoreInteractions(first_browser) - verifyNoMoreInteractions(second_browser) + ensureNoUnverifiedInteractions(first_browser) + ensureNoUnverifiedInteractions(second_browser) def test_action_chain_delay_default(): From 10a27b89711a7a1a5b17b781ae2c1322effc3bc6 Mon Sep 17 00:00:00 2001 From: Yuri Verweij Date: Tue, 7 Apr 2026 18:55:11 +0200 Subject: [PATCH 2/3] Fix formatting issues in locator examples in PluginDocumentation --- ...luginDocumentation.test_many_plugins.approved.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/utest/test/api/approved_files/PluginDocumentation.test_many_plugins.approved.txt b/utest/test/api/approved_files/PluginDocumentation.test_many_plugins.approved.txt index 1a204d3bb..6168369be 100644 --- a/utest/test/api/approved_files/PluginDocumentation.test_many_plugins.approved.txt +++ b/utest/test/api/approved_files/PluginDocumentation.test_many_plugins.approved.txt @@ -148,14 +148,14 @@ and not for the element found be the previous locator. Chaining is supported by are based on Selenium API, like `xpath` or `css`, but example chaining is not supported by `sizzle` or `jquery Examples: -| `Click Element` | css:.bar >> xpath://a | # To find a link which is present after an element with class "bar" | +| `Click Element` | css:.bar >> xpath: //a | # To find a link which is present after an element with class "bar" | List examples: -| ${locator_list} = | `Create List` | css:div#div_id | xpath://*[text(), " >> "] | -| `Page Should Contain Element` | ${locator_list} | | | -| ${element} = | Get WebElement | xpath://*[text(), " >> "] | | -| ${locator_list} = | `Create List` | css:div#div_id | ${element} | -| `Page Should Contain Element` | ${locator_list} | | | +| ${locator_list} = | `Create List` | css:div#div_id | xpath: //*[text(), " >> "] | +| `Page Should Contain Element` | ${locator_list} | | | +| ${element} = | Get WebElement | xpath: //*[text(), " >> "] | | +| ${locator_list} = | `Create List` | css:div#div_id | ${element} | +| `Page Should Contain Element` | ${locator_list} | | | Chaining locators in new in SeleniumLibrary 5.0 From dc169696c721407dade8abf2aa15af033bcc5267 Mon Sep 17 00:00:00 2001 From: Yuri Verweij Date: Tue, 7 Apr 2026 18:57:21 +0200 Subject: [PATCH 3/3] Fix formatting issue in locator list creation in SeleniumLibrary --- src/SeleniumLibrary/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SeleniumLibrary/__init__.py b/src/SeleniumLibrary/__init__.py index eebfe65b4..45c7ee716 100644 --- a/src/SeleniumLibrary/__init__.py +++ b/src/SeleniumLibrary/__init__.py @@ -214,7 +214,7 @@ class SeleniumLibrary(DynamicCore): | ${locator_list} = | `Create List` | css:div#div_id | xpath: //*[text(), " >> "] | | `Page Should Contain Element` | ${locator_list} | | | | ${element} = | Get WebElement | xpath: //*[text(), " >> "] | | - | ${locator_list} = | `Create List` | css:div#div_id | ${element } | + | ${locator_list} = | `Create List` | css:div#div_id | ${element} | | `Page Should Contain Element` | ${locator_list} | | | Chaining locators in new in SeleniumLibrary 5.0