From ba3982f3c0242394673f63e6602200eec48eb2f1 Mon Sep 17 00:00:00 2001 From: jannek76 Date: Tue, 26 Oct 2021 10:55:27 +0300 Subject: [PATCH 01/11] add strip_spaces and collapse_spaces --- .../keywords/content_assertions.robot | 16 +++++ src/SeleniumLibrary/__init__.pyi | 4 ++ src/SeleniumLibrary/keywords/element.py | 60 ++++++++++++++++++- .../test_keyword_arguments_element.py | 12 ++++ 4 files changed, 90 insertions(+), 2 deletions(-) diff --git a/atest/acceptance/keywords/content_assertions.robot b/atest/acceptance/keywords/content_assertions.robot index e39a52ad6..ff91a3f0c 100644 --- a/atest/acceptance/keywords/content_assertions.robot +++ b/atest/acceptance/keywords/content_assertions.robot @@ -162,14 +162,24 @@ Element Should Not Contain Element Text Should Be Element Text Should Be some_id This text is inside an identified element Element Text Should Be some_id This TEXT IS INSIDE AN IDENTIFIED ELEMENT ignore_case=True + Element Text Should Be some_id This text is inside an identified element${SPACE} strip_spaces=True + Element Text Should Be some_id This${SPACE}${SPACE} text is inside an identified element collapse_spaces=True Run Keyword And Expect Error ... The text of element 'some_id' should have been 'inside' but it was 'This text is inside an identified element'. ... Element Text Should Be some_id inside + Run Keyword And Expect Error + ... The text of element 'some_id' should have been 'This text is inside an identified element ' but it was 'This text is inside an identified element'. + ... Element Text Should Be some_id This text is inside an identified element${SPACE} strip_spaces=False + Run Keyword And Expect Error + ... The text of element 'some_id' should have been 'This${SPACE}${SPACE} text is inside an identified element' but it was 'This text is inside an identified element'. + ... Element Text Should Be some_id This${SPACE}${SPACE} text is inside an identified element collapse_spaces=False Element Text Should Not Be Element Text Should Not Be some_id Foo This text is inside an identified element Element Text Should Not Be some_id This TEXT IS INSIDE AN IDENTIFIED ELEMENT ignore_case=False Element Text Should Not Be some_id FOO This text is inside an identified element ignore_case=True + Element Text Should Not Be some_id This text is inside an identified element${SPACE} strip_spaces=False + Element Text Should Not Be some_id This text${SPACE}${SPACE} is inside an identified element collapse_spaces=False Run Keyword And Expect Error ... The text of element 'some_id' was not supposed to be 'This text is inside an identified element'. ... Element Text Should Not Be some_id This text is inside an identified element @@ -179,6 +189,12 @@ Element Text Should Not Be Run Keyword And Expect Error ... The text of element 'some_id' was not supposed to be 'THIS TEXT is inside an identified element'. ... Element Text Should Not Be some_id THIS TEXT is inside an identified element ignore_case=True + Run Keyword And Expect Error + ... The text of element 'some_id' was not supposed to be 'This text is inside an identified element '. + ... Element Text Should Not Be some_id This text is inside an identified element${SPACE} strip_spaces=True + Run Keyword And Expect Error + ... The text of element 'some_id' was not supposed to be 'This text${SPACE}${SPACE} is inside an identified element'. + ... Element Text Should Not Be some_id This text${SPACE}${SPACE} is inside an identified element collapse_spaces=True Get Text ${str} = Get Text some_id diff --git a/src/SeleniumLibrary/__init__.pyi b/src/SeleniumLibrary/__init__.pyi index 9ab35f752..5ddc711d3 100644 --- a/src/SeleniumLibrary/__init__.pyi +++ b/src/SeleniumLibrary/__init__.pyi @@ -163,6 +163,8 @@ class SeleniumLibrary: expected: Union[None, str], message: Optional[str] = None, ignore_case: bool = False, + strip_spaces: bool = False, + collapse_spaces: bool = False, ): ... def element_text_should_not_be( self, @@ -170,6 +172,8 @@ class SeleniumLibrary: not_expected: Union[None, str], message: Optional[str] = None, ignore_case: bool = False, + strip_spaces: bool = False, + collapse_spaces: bool = False, ): ... def execute_async_javascript( self, *code: Union[selenium.webdriver.remote.webelement.WebElement, str] diff --git a/src/SeleniumLibrary/keywords/element.py b/src/SeleniumLibrary/keywords/element.py index 51e3710cc..e19a569e8 100644 --- a/src/SeleniumLibrary/keywords/element.py +++ b/src/SeleniumLibrary/keywords/element.py @@ -13,12 +13,14 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +import re + from collections import namedtuple from typing import List, Optional, Tuple, Union from SeleniumLibrary.utils import is_noney from SeleniumLibrary.utils.events.event import _unwrap_eventfiring_element -from robot.utils import plural_or_not, is_truthy +from robot.utils import plural_or_not, is_truthy, is_string from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.keys import Keys from selenium.webdriver.remote.webelement import WebElement @@ -329,6 +331,8 @@ def element_text_should_be( expected: Union[None, str], message: Optional[str] = None, ignore_case: bool = False, + strip_spaces: bool = False, + collapse_spaces: bool = False, ): """Verifies that element ``locator`` contains exact the text ``expected``. @@ -341,7 +345,19 @@ def element_text_should_be( The ``ignore_case`` argument can be set to True to compare case insensitive, default is False. + If ``strip_spaces`` is given a true value (see `Boolean arguments`) + and both arguments are strings, the comparison is done without leading + and trailing spaces. If ``strip_spaces`` is given a string value + ``LEADING`` or ``TRAILING`` (case-insensitive), the comparison is done + without leading or trailing spaces, respectively. + + If ``collapse_spaces`` is given a true value (see `Boolean arguments`) and both + arguments are strings, the comparison is done with all white spaces replaced by + a single space character. + ``ignore_case`` argument is new in SeleniumLibrary 3.1. + ``strip_spaces`` is new in SeleniumLibrary 5.x.x and + ``collapse_spaces`` is new in SeleniumLibrary 5.x.x. Use `Element Should Contain` if a substring match is desired. """ @@ -350,6 +366,12 @@ def element_text_should_be( if ignore_case: text = text.lower() expected = expected.lower() + if strip_spaces: + text = self._strip_spaces(text, strip_spaces) + expected = self._strip_spaces(expected, strip_spaces) + if collapse_spaces: + text = self._collapse_spaces(text) + expected = self._collapse_spaces(expected) if text != expected: if message is None: message = ( @@ -365,6 +387,8 @@ def element_text_should_not_be( not_expected: Union[None, str], message: Optional[str] = None, ignore_case: bool = False, + strip_spaces: bool = False, + collapse_spaces: bool = False, ): """Verifies that element ``locator`` does not contain exact the text ``not_expected``. @@ -377,7 +401,19 @@ def element_text_should_not_be( The ``ignore_case`` argument can be set to True to compare case insensitive, default is False. - New in SeleniumLibrary 3.1.1 + If ``strip_spaces`` is given a true value (see `Boolean arguments`) + and both arguments are strings, the comparison is done without leading + and trailing spaces. If ``strip_spaces`` is given a string value + ``LEADING`` or ``TRAILING`` (case-insensitive), the comparison is done + without leading or trailing spaces, respectively. + + If ``collapse_spaces`` is given a true value (see `Boolean arguments`) and both + arguments are strings, the comparison is done with all white spaces replaced by + a single space character. + + ``ignore_case`` is new in SeleniumLibrary 3.1.1 + ``strip_spaces`` is new in SeleniumLibrary 5.x.x and + ``collapse_spaces`` is new in SeleniumLibrary 5.x.x. """ self.info( f"Verifying element '{locator}' does not contain exact text '{not_expected}'." @@ -387,11 +423,31 @@ def element_text_should_not_be( if ignore_case: text = text.lower() not_expected = not_expected.lower() + if strip_spaces: + text = self._strip_spaces(text, strip_spaces) + not_expected = self._strip_spaces(not_expected, strip_spaces) + if collapse_spaces: + text = self._collapse_spaces(text) + not_expected = self._collapse_spaces(not_expected) if text == not_expected: if message is None: message = f"The text of element '{locator}' was not supposed to be '{before_not_expected}'." raise AssertionError(message) + def _strip_spaces(self, value, strip_spaces): + if not is_string(value): + return value + if not is_string(strip_spaces): + return value.strip() if strip_spaces else value + if strip_spaces.upper() == 'LEADING': + return value.lstrip() + if strip_spaces.upper() == 'TRAILING': + return value.rstrip() + return value.strip() if is_truthy(strip_spaces) else value + + def _collapse_spaces(self, value): + return re.sub(r'\s+', ' ', value) if is_string(value) else value + @keyword def get_element_attribute( self, locator: Union[WebElement, str], attribute: str diff --git a/utest/test/keywords/test_keyword_arguments_element.py b/utest/test/keywords/test_keyword_arguments_element.py index c5223afd1..a655a1f7c 100644 --- a/utest/test/keywords/test_keyword_arguments_element.py +++ b/utest/test/keywords/test_keyword_arguments_element.py @@ -27,3 +27,15 @@ def test_element_text_should_be(element): with pytest.raises(AssertionError) as error: element.element_text_should_be(locator, "not text", "foobar") assert "foobar" in str(error.value) + + webelement.text = "text " + when(element).find_element(locator).thenReturn(webelement) + with pytest.raises(AssertionError) as error: + element.element_text_should_be(locator, "text", strip_spaces=False) + assert "should have been" in str(error.value) + + webelement.text = "testing is cool" + when(element).find_element(locator).thenReturn(webelement) + with pytest.raises(AssertionError) as error: + element.element_text_should_be(locator, "testing is cool", collapse_spaces=False) + assert "should have been" in str(error.value) From 8a79b7d9cb051359495445730adceec0c739d795 Mon Sep 17 00:00:00 2001 From: jannek76 Date: Tue, 26 Oct 2021 16:46:45 +0300 Subject: [PATCH 02/11] Fixed argument definition --- atest/acceptance/keywords/content_assertions.robot | 2 ++ src/SeleniumLibrary/__init__.pyi | 4 ++-- src/SeleniumLibrary/keywords/element.py | 4 ++-- utest/test/keywords/test_keyword_arguments_element.py | 10 ++++++++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/atest/acceptance/keywords/content_assertions.robot b/atest/acceptance/keywords/content_assertions.robot index ff91a3f0c..cf2c55506 100644 --- a/atest/acceptance/keywords/content_assertions.robot +++ b/atest/acceptance/keywords/content_assertions.robot @@ -163,6 +163,8 @@ Element Text Should Be Element Text Should Be some_id This text is inside an identified element Element Text Should Be some_id This TEXT IS INSIDE AN IDENTIFIED ELEMENT ignore_case=True Element Text Should Be some_id This text is inside an identified element${SPACE} strip_spaces=True + Element Text Should Be some_id ${SPACE}This text is inside an identified element strip_spaces=LEADING + Element Text Should Be some_id This text is inside an identified element${SPACE} strip_spaces=TRAILING Element Text Should Be some_id This${SPACE}${SPACE} text is inside an identified element collapse_spaces=True Run Keyword And Expect Error ... The text of element 'some_id' should have been 'inside' but it was 'This text is inside an identified element'. diff --git a/src/SeleniumLibrary/__init__.pyi b/src/SeleniumLibrary/__init__.pyi index 5ddc711d3..64b1bd50f 100644 --- a/src/SeleniumLibrary/__init__.pyi +++ b/src/SeleniumLibrary/__init__.pyi @@ -163,7 +163,7 @@ class SeleniumLibrary: expected: Union[None, str], message: Optional[str] = None, ignore_case: bool = False, - strip_spaces: bool = False, + strip_spaces: Union[bool, str] = False, collapse_spaces: bool = False, ): ... def element_text_should_not_be( @@ -172,7 +172,7 @@ class SeleniumLibrary: not_expected: Union[None, str], message: Optional[str] = None, ignore_case: bool = False, - strip_spaces: bool = False, + strip_spaces: Union[bool, str] = False, collapse_spaces: bool = False, ): ... def execute_async_javascript( diff --git a/src/SeleniumLibrary/keywords/element.py b/src/SeleniumLibrary/keywords/element.py index e19a569e8..6901b06bc 100644 --- a/src/SeleniumLibrary/keywords/element.py +++ b/src/SeleniumLibrary/keywords/element.py @@ -331,7 +331,7 @@ def element_text_should_be( expected: Union[None, str], message: Optional[str] = None, ignore_case: bool = False, - strip_spaces: bool = False, + strip_spaces: Union[bool, str] = False, collapse_spaces: bool = False, ): """Verifies that element ``locator`` contains exact the text ``expected``. @@ -387,7 +387,7 @@ def element_text_should_not_be( not_expected: Union[None, str], message: Optional[str] = None, ignore_case: bool = False, - strip_spaces: bool = False, + strip_spaces: Union[bool, str] = False, collapse_spaces: bool = False, ): """Verifies that element ``locator`` does not contain exact the text ``not_expected``. diff --git a/utest/test/keywords/test_keyword_arguments_element.py b/utest/test/keywords/test_keyword_arguments_element.py index a655a1f7c..874b02b3f 100644 --- a/utest/test/keywords/test_keyword_arguments_element.py +++ b/utest/test/keywords/test_keyword_arguments_element.py @@ -34,6 +34,16 @@ def test_element_text_should_be(element): element.element_text_should_be(locator, "text", strip_spaces=False) assert "should have been" in str(error.value) + with pytest.raises(AssertionError) as error: + element.element_text_should_be(locator, "text", strip_spaces="LEADING") + assert "should have been" in str(error.value) + + webelement.text = " text" + when(element).find_element(locator).thenReturn(webelement) + with pytest.raises(AssertionError) as error: + element.element_text_should_be(locator, "text", strip_spaces="TRAILING") + assert "should have been" in str(error.value) + webelement.text = "testing is cool" when(element).find_element(locator).thenReturn(webelement) with pytest.raises(AssertionError) as error: From 242809bbf36a592a2c7bf82288296ec82730f4db Mon Sep 17 00:00:00 2001 From: Ed Manlove Date: Sun, 18 Jan 2026 11:38:55 -0500 Subject: [PATCH 03/11] Updating CI test versions and latest test execution --- .github/workflows/CI.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1ba18d3db..a54d54158 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -9,10 +9,10 @@ jobs: continue-on-error: true strategy: matrix: - python-version: [3.9.23, 3.13.5, 3.14.0-rc.3] # pypy-3.9 + python-version: [3.9.23, 3.13.10, 3.14.1] # pypy-3.9 # python-version: [{earliest: 3.9}, {latest: 3.13.0}] # pypy-3.9 - rf-version: [6.1.1, 7.3.2] - selenium-version: [4.28.1, 4.29.0, 4.30.0, 4.31.0, 4.32.0, 4.33.0, 4.34.2] + rf-version: [6.1.1, 7.3.2, 7.4.1] + selenium-version: [4.34.2, 4.35.0, 4.36.0, 4.37.0, 4.38.0, 4.39.0] browser: [chrome] # firefox, chrome, headlesschrome, edge steps: @@ -84,7 +84,7 @@ jobs: # xvfb-run --auto-servernum python atest/run.py --zip ${{ matrix.browser }} - name: Run tests with latest python and latest robot framework - if: matrix.python-version == '3.13.0' && matrix.rf-version == '7.2.2' + if: matrix.python-version == '3.14.1' && matrix.rf-version == '7.4.1' run: | xvfb-run --auto-servernum python atest/run.py --zip ${{ matrix.browser }} From 89c3e0c1f68aeeb56900f0d6df2d5ea8cc819a06 Mon Sep 17 00:00:00 2001 From: Ed Manlove Date: Sun, 18 Jan 2026 11:49:39 -0500 Subject: [PATCH 04/11] (Temporarily) Removed Python v3.9 from ci test matrix --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a54d54158..4a7e7ac8e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -9,7 +9,7 @@ jobs: continue-on-error: true strategy: matrix: - python-version: [3.9.23, 3.13.10, 3.14.1] # pypy-3.9 + python-version: [3.13.10, 3.14.1] # 3.9.23, pypy-3.9 # python-version: [{earliest: 3.9}, {latest: 3.13.0}] # pypy-3.9 rf-version: [6.1.1, 7.3.2, 7.4.1] selenium-version: [4.34.2, 4.35.0, 4.36.0, 4.37.0, 4.38.0, 4.39.0] From af448a3e669646f9b4d3cd1d89bf931c619b8d12 Mon Sep 17 00:00:00 2001 From: Ed Manlove Date: Sun, 18 Jan 2026 13:13:10 -0500 Subject: [PATCH 05/11] Testing out new CI workflow Trying to see if there is another way to descrip the matrix and run a select portion of the test matrix of selenium, python, browser .. --- .github/workflows/Select.yml | 80 ++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/workflows/Select.yml diff --git a/.github/workflows/Select.yml b/.github/workflows/Select.yml new file mode 100644 index 000000000..468cac733 --- /dev/null +++ b/.github/workflows/Select.yml @@ -0,0 +1,80 @@ +name: Select Configurations + +on: workflow_dispatch + +jobs: + test_config: + runs-on: ubuntu-latest + strategy: + matrix: + config: + - description: latest + python-version: 3.13.10 + rf-version: 7.4.1 + selenium-version: 4.39.0 + browser: chrome + - description: previous + python-version: 3.12.12 + rf-version: 7.3.2 + selenium-version: 4.38.0 + browser: firefox + + steps: + - uses: actions/checkout@v4 + - name: Configuration Description + run: | + echo "${{ matrix.config.description }} configuration" + echo "Testing with RF v${{ matrix.config.rf-version }}, Selenium v${{ matrix.config.selenium-version}}, Python v${{ matrix.config.python-version }} under ${{ matrix.config.browser }}" + - name: Set up Python ${{ matrix.config.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.config.python-version }} + - name: Setup ${{ matrix.config.browser }} browser + uses: browser-actions/setup-chrome@v1 + with: + chrome-version: 138 + install-dependencies: true + install-chromedriver: true + id: setup-chrome + - run: | + echo Installed chromium version: ${{ steps.setup-chrome.outputs.chrome-version }} + ${{ steps.setup-chrome.outputs.chrome-path }} --version + - name: Setup firefox + id: setup-firefox + uses: browser-actions/setup-firefox@v1 + with: + firefox-version: latest + - run: | + echo Installed firefox versions: ${{ steps.setup-firefox.outputs.firefox-version }} + ${{ steps.setup-firefox.outputs.firefox-path }} --version + - name: Start xvfb + run: | + export DISPLAY=:99.0 + Xvfb -ac :99 -screen 0 1280x1024x16 > /dev/null 2>&1 & + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements-dev.txt + - name: Install Seleninum v${{ matrix.config.selenium-version }} + run: | + pip install --upgrade selenium==${{ matrix.config.selenium-version }} + - name: Install RF ${{ matrix.config.rf-version }} + run: | + pip install -U --pre robotframework==${{ matrix.config.rf-version }} + - name: Install drivers via selenium-manager + run: | + SELENIUM_MANAGER_EXE=$(python -c 'from selenium.webdriver.common.selenium_manager import SeleniumManager; sm=SeleniumManager(); print(f"{str(sm._get_binary())}")') + echo "$SELENIUM_MANAGER_EXE" + echo "WEBDRIVERPATH=$($SELENIUM_MANAGER_EXE --browser chrome --debug | awk '/INFO[[:space:]]Driver path:/ {print $NF;exit}')" >> "$GITHUB_ENV" + echo "$WEBDRIVERPATH" + + - name: Run tests under specified config + run: | + xvfb-run --auto-servernum python atest/run.py --zip ${{ matrix.browser }} + + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: sl_$${{ matrix.config.python-version }}_$${{ matrix.config.rf-version }}_$${{ matrix.config.selenium-version }}_$${{ matrix.config.browser }} + path: atest/zip_results + overwrite: true \ No newline at end of file From 01e2001c1c6169848ee085b4349cbc4a5414ca36 Mon Sep 17 00:00:00 2001 From: Ed Manlove Date: Sun, 18 Jan 2026 16:30:26 -0500 Subject: [PATCH 06/11] Made a few changes to the select ci workflow - Added continuie on error - switched browser on "previous" config to chrome - change setup chrome version to latest --- .github/workflows/Select.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Select.yml b/.github/workflows/Select.yml index dcc02d7f4..8269134f3 100644 --- a/.github/workflows/Select.yml +++ b/.github/workflows/Select.yml @@ -5,6 +5,7 @@ on: workflow_dispatch jobs: test_config: runs-on: ubuntu-latest + continue-on-error: true strategy: matrix: config: @@ -17,7 +18,7 @@ jobs: python-version: 3.12.12 rf-version: 7.3.2 selenium-version: 4.38.0 - browser: firefox + browser: chrome steps: - uses: actions/checkout@v4 @@ -32,7 +33,7 @@ jobs: - name: Setup ${{ matrix.config.browser }} browser uses: browser-actions/setup-chrome@v1 with: - chrome-version: 138 + chrome-version: latest install-dependencies: true install-chromedriver: true id: setup-chrome From 9da83d39298902e4a521ed18e4bae023988d98db Mon Sep 17 00:00:00 2001 From: Ed Manlove Date: Sun, 18 Jan 2026 16:55:02 -0500 Subject: [PATCH 07/11] Removed install drivers step .. --- .github/workflows/Select.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/Select.yml b/.github/workflows/Select.yml index 8269134f3..04cc63ecd 100644 --- a/.github/workflows/Select.yml +++ b/.github/workflows/Select.yml @@ -62,12 +62,6 @@ jobs: - name: Install RF ${{ matrix.config.rf-version }} run: | pip install -U --pre robotframework==${{ matrix.config.rf-version }} - - name: Install drivers via selenium-manager - run: | - SELENIUM_MANAGER_EXE=$(python -c 'from selenium.webdriver.common.selenium_manager import SeleniumManager; sm=SeleniumManager(); print(f"{str(sm._get_binary())}")') - echo "$SELENIUM_MANAGER_EXE" - echo "WEBDRIVERPATH=$($SELENIUM_MANAGER_EXE --browser chrome --debug | awk '/INFO[[:space:]]Driver path:/ {print $NF;exit}')" >> "$GITHUB_ENV" - echo "$WEBDRIVERPATH" - name: Run tests under specified config run: | From 85770182cc72935f309603983c31edb965da5004 Mon Sep 17 00:00:00 2001 From: Ed Manlove Date: Sun, 18 Jan 2026 17:17:45 -0500 Subject: [PATCH 08/11] Removed install chromedriver flag on setup chrome --- .github/workflows/Select.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/Select.yml b/.github/workflows/Select.yml index 04cc63ecd..071eeb749 100644 --- a/.github/workflows/Select.yml +++ b/.github/workflows/Select.yml @@ -35,7 +35,6 @@ jobs: with: chrome-version: latest install-dependencies: true - install-chromedriver: true id: setup-chrome - run: | echo Installed chromium version: ${{ steps.setup-chrome.outputs.chrome-version }} From d43c0fb42f33150147496e833be19adeb7da2f2b Mon Sep 17 00:00:00 2001 From: Ed Manlove Date: Sun, 18 Jan 2026 18:12:29 -0500 Subject: [PATCH 09/11] Yearly update of cookies --- atest/acceptance/keywords/cookies.robot | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/atest/acceptance/keywords/cookies.robot b/atest/acceptance/keywords/cookies.robot index 2349bc68d..29c581ae9 100644 --- a/atest/acceptance/keywords/cookies.robot +++ b/atest/acceptance/keywords/cookies.robot @@ -36,15 +36,21 @@ Add Cookie When Secure Is False Should Be Equal ${cookie.secure} ${False} Add Cookie When Expiry Is Epoch - Add Cookie Cookie1 value1 expiry=1761755100 + # To convert epoch to formatted string + # from time import strftime, localtime + # strftime('%Y-%m-%d %H:%M:%S', localtime(1793247900)) + # To update time each September (as Chrome limits cookies to one year expiry date) use + # import datetime + # print (datetime.datetime.strptime("2027-10-29 12:25:00", "%Y-%m-%d %I:%M:%S").timestamp()) + Add Cookie Cookie1 value1 expiry=1793247900 ${cookie} = Get Cookie Cookie1 ${expiry} = Convert Date ${1761755100} exclude_millis=True Should Be Equal As Strings ${cookie.expiry} ${expiry} Add Cookie When Expiry Is Human Readable Data&Time - Add Cookie Cookie12 value12 expiry=2025-10-29 12:25:00 + Add Cookie Cookie12 value12 expiry=2026-10-29 12:25:00 ${cookie} = Get Cookie Cookie12 - Should Be Equal As Strings ${cookie.expiry} 2025-10-29 12:25:00 + Should Be Equal As Strings ${cookie.expiry} 2026-10-29 12:25:00 Delete Cookie [Tags] Known Issue Safari @@ -122,7 +128,7 @@ Test Get Cookie Keyword Logging Add Cookies # To update time each September (as Chrome limits cookies to one year expiry date) use # import datetime - # print (datetime.datetime.strptime("2025-09-01 12:25:00", "%Y-%m-%d %I:%M:%S").timestamp()) + # print (datetime.datetime.strptime("2027-09-01 12:25:00", "%Y-%m-%d %I:%M:%S").timestamp()) Delete All Cookies Add Cookie test seleniumlibrary ${now} = Get Current Date @@ -130,4 +136,4 @@ Add Cookies ${tomorrow_thistime_datetime} = Convert Date ${tomorrow_thistime} datetime Set Suite Variable ${tomorrow_thistime_datetime} Add Cookie another value expiry=${tomorrow_thistime} - Add Cookie far_future timemachine expiry=1756700700 # 2025-09-01 12:25:00 + Add Cookie far_future timemachine expiry=1788236700 # 2026-09-01 12:25:00 From 36b553a03201c42f695a5be04cbc45dbbe61d5e7 Mon Sep 17 00:00:00 2001 From: Ed Manlove Date: Sun, 18 Jan 2026 19:01:57 -0500 Subject: [PATCH 10/11] Update couple more cookie tests for the new year --- atest/acceptance/keywords/cookies.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atest/acceptance/keywords/cookies.robot b/atest/acceptance/keywords/cookies.robot index 29c581ae9..04b355e6a 100644 --- a/atest/acceptance/keywords/cookies.robot +++ b/atest/acceptance/keywords/cookies.robot @@ -44,7 +44,7 @@ Add Cookie When Expiry Is Epoch # print (datetime.datetime.strptime("2027-10-29 12:25:00", "%Y-%m-%d %I:%M:%S").timestamp()) Add Cookie Cookie1 value1 expiry=1793247900 ${cookie} = Get Cookie Cookie1 - ${expiry} = Convert Date ${1761755100} exclude_millis=True + ${expiry} = Convert Date ${1793247900} exclude_millis=True Should Be Equal As Strings ${cookie.expiry} ${expiry} Add Cookie When Expiry Is Human Readable Data&Time @@ -120,7 +120,7 @@ Test Get Cookie Keyword Logging ... domain=localhost ... secure=False ... httpOnly=False - ... expiry=2025-09-01 *:25:00 + ... expiry=2026-09-01 *:25:00 ... extra={'sameSite': 'Lax'} ${cookie} = Get Cookie far_future From de6932f0a27b262dba7bc2bca23910e7d63cfaf0 Mon Sep 17 00:00:00 2001 From: Ed Manlove Date: Sun, 18 Jan 2026 19:31:53 -0500 Subject: [PATCH 11/11] Update GitHub Action Workflows - Switched over to select.yml for pull request and pushes - Renamed the select workflow - Added an older rf version configuration to the test matrix --- .github/workflows/CI.yml | 2 +- .github/workflows/Select.yml | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1ba18d3db..3a44bbd07 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,6 +1,6 @@ name: SeleniumLibrary CI -on: [push, pull_request] +on: workflow_dispatch jobs: build: diff --git a/.github/workflows/Select.yml b/.github/workflows/Select.yml index 071eeb749..dcb89c7e4 100644 --- a/.github/workflows/Select.yml +++ b/.github/workflows/Select.yml @@ -1,6 +1,6 @@ -name: Select Configurations +name: Selected Test Configuration Matrix -on: workflow_dispatch +on: [push, pull_request] jobs: test_config: @@ -19,6 +19,11 @@ jobs: rf-version: 7.3.2 selenium-version: 4.38.0 browser: chrome + - description: older_rf_version + python-version: 3.11.14 + rf-version: 6.1.1 + selenium-version: 4.37.0 + browser: chrome steps: - uses: actions/checkout@v4