Skip to content

Commit f7aa505

Browse files
committed
Merge branch 'master' into add-get-css-property-value-keyword
2 parents 2914d91 + 2141caf commit f7aa505

File tree

19 files changed

+256
-153
lines changed

19 files changed

+256
-153
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "monthly"

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: SeleniumLibrary CI
22

3-
on: [push, pull_request]
3+
on: workflow_dispatch
44

55
jobs:
66
build:

.github/workflows/Select.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Selected Test Configuration Matrix
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test_config:
7+
runs-on: ubuntu-latest
8+
continue-on-error: true
9+
strategy:
10+
matrix:
11+
config:
12+
- description: latest
13+
python-version: 3.13.10
14+
rf-version: 7.4.1
15+
selenium-version: 4.39.0
16+
browser: chrome
17+
- description: previous
18+
python-version: 3.12.12
19+
rf-version: 7.3.2
20+
selenium-version: 4.38.0
21+
browser: chrome
22+
- description: older_rf_version
23+
python-version: 3.11.14
24+
rf-version: 6.1.1
25+
selenium-version: 4.37.0
26+
browser: chrome
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
- name: Configuration Description
31+
run: |
32+
echo "${{ matrix.config.description }} configuration"
33+
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 }}"
34+
- name: Set up Python ${{ matrix.config.python-version }}
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: ${{ matrix.config.python-version }}
38+
- name: Setup ${{ matrix.config.browser }} browser
39+
uses: browser-actions/setup-chrome@v1
40+
with:
41+
chrome-version: latest
42+
install-dependencies: true
43+
id: setup-chrome
44+
- run: |
45+
echo Installed chromium version: ${{ steps.setup-chrome.outputs.chrome-version }}
46+
${{ steps.setup-chrome.outputs.chrome-path }} --version
47+
- name: Setup firefox
48+
id: setup-firefox
49+
uses: browser-actions/setup-firefox@v1
50+
with:
51+
firefox-version: latest
52+
- run: |
53+
echo Installed firefox versions: ${{ steps.setup-firefox.outputs.firefox-version }}
54+
${{ steps.setup-firefox.outputs.firefox-path }} --version
55+
- name: Start xvfb
56+
run: |
57+
export DISPLAY=:99.0
58+
Xvfb -ac :99 -screen 0 1280x1024x16 > /dev/null 2>&1 &
59+
- name: Install dependencies
60+
run: |
61+
python -m pip install --upgrade pip
62+
pip install -r requirements-dev.txt
63+
- name: Install Seleninum v${{ matrix.config.selenium-version }}
64+
run: |
65+
pip install --upgrade selenium==${{ matrix.config.selenium-version }}
66+
- name: Install RF ${{ matrix.config.rf-version }}
67+
run: |
68+
pip install -U --pre robotframework==${{ matrix.config.rf-version }}
69+
70+
- name: Run tests under specified config
71+
run: |
72+
xvfb-run --auto-servernum python atest/run.py --zip ${{ matrix.config.browser }}
73+
74+
- uses: actions/upload-artifact@v4
75+
if: failure()
76+
with:
77+
name: sl_$${{ matrix.config.python-version }}_$${{ matrix.config.rf-version }}_$${{ matrix.config.selenium-version }}_$${{ matrix.config.browser }}
78+
path: atest/zip_results
79+
overwrite: true

atest/acceptance/keywords/cookies.robot

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ Library DateTime
99
*** Test Cases ***
1010
Get Cookies
1111
${cookies}= Get Cookies
12+
Should Contain ${cookies} test=seleniumlibrary
13+
Should Contain ${cookies} another=value
14+
Should Contain ${cookies} far_future=timemachine
1215
Should Match Regexp ${cookies}
13-
... ^(test=seleniumlibrary; another=value)|(another=value; test=seleniumlibrary)$
16+
... ^(?:test=seleniumlibrary|another=value|far_future=timemachine)(?:; (?:test=seleniumlibrary|another=value|far_future=timemachine)){2}$
1417

1518
Get Cookies As Dict
1619
${cookies}= Get Cookies as_dict=True
@@ -36,15 +39,21 @@ Add Cookie When Secure Is False
3639
Should Be Equal ${cookie.secure} ${False}
3740

3841
Add Cookie When Expiry Is Epoch
39-
Add Cookie Cookie1 value1 expiry=1761755100
42+
# To convert epoch to formatted string
43+
# from time import strftime, localtime
44+
# strftime('%Y-%m-%d %H:%M:%S', localtime(1793247900))
45+
# To update time each September (as Chrome limits cookies to one year expiry date) use
46+
# import datetime
47+
# print (datetime.datetime.strptime("2027-10-29 12:25:00", "%Y-%m-%d %I:%M:%S").timestamp())
48+
Add Cookie Cookie1 value1 expiry=1793247900
4049
${cookie} = Get Cookie Cookie1
41-
${expiry} = Convert Date ${1761755100} exclude_millis=True
50+
${expiry} = Convert Date ${1793247900} exclude_millis=True
4251
Should Be Equal As Strings ${cookie.expiry} ${expiry}
4352

4453
Add Cookie When Expiry Is Human Readable Data&Time
45-
Add Cookie Cookie12 value12 expiry=2025-10-29 12:25:00
54+
Add Cookie Cookie12 value12 expiry=2026-10-29 12:25:00
4655
${cookie} = Get Cookie Cookie12
47-
Should Be Equal As Strings ${cookie.expiry} 2025-10-29 12:25:00
56+
Should Be Equal As Strings ${cookie.expiry} 2026-10-29 12:25:00
4857

4958
Delete Cookie
5059
[Tags] Known Issue Safari
@@ -114,20 +123,20 @@ Test Get Cookie Keyword Logging
114123
... domain=localhost
115124
... secure=False
116125
... httpOnly=False
117-
... expiry=2025-09-01 *:25:00
126+
... expiry=2026-09-01 *:25:00
118127
... extra={'sameSite': 'Lax'}
119128
${cookie} = Get Cookie far_future
120129

121130
*** Keywords ***
122131
Add Cookies
123132
# To update time each September (as Chrome limits cookies to one year expiry date) use
124133
# import datetime
125-
# print (datetime.datetime.strptime("2025-09-01 12:25:00", "%Y-%m-%d %I:%M:%S").timestamp())
134+
# print (datetime.datetime.strptime("2027-09-01 12:25:00", "%Y-%m-%d %I:%M:%S").timestamp())
126135
Delete All Cookies
127136
Add Cookie test seleniumlibrary
128137
${now} = Get Current Date
129138
${tomorrow_thistime} = Add Time To Date ${now} 1 day
130139
${tomorrow_thistime_datetime} = Convert Date ${tomorrow_thistime} datetime
131140
Set Suite Variable ${tomorrow_thistime_datetime}
132141
Add Cookie another value expiry=${tomorrow_thistime}
133-
Add Cookie far_future timemachine expiry=1756700700 # 2025-09-01 12:25:00
142+
Add Cookie far_future timemachine expiry=1788240300 # 2026-09-01 12:25:00

docs/SeleniumLibrary.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

setup.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
Operating System :: OS Independent
1414
Programming Language :: Python
1515
Programming Language :: Python :: 3
16-
Programming Language :: Python :: 3.8
17-
Programming Language :: Python :: 3.9
1816
Programming Language :: Python :: 3.10
1917
Programming Language :: Python :: 3.11
2018
Programming Language :: Python :: 3.12

src/SeleniumLibrary/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,20 +202,20 @@ class SeleniumLibrary(DynamicCore):
202202
used to specify multiple locators. This is useful, is some part of locator would match as the locator separator
203203
but it should not. Or if there is need to existing WebElement as locator.
204204
205-
Although all locators support chaining, some locator strategies do not abey the chaining. This is because
205+
Although all locators support chaining, some locator strategies do not obey the chaining. This is because
206206
some locator strategies use JavaScript to find elements and JavaScript is executed for the whole browser context
207207
and not for the element found be the previous locator. Chaining is supported by locator strategies which
208208
are based on Selenium API, like `xpath` or `css`, but example chaining is not supported by `sizzle` or `jquery
209209
210210
Examples:
211-
| `Click Element` | css:.bar >> xpath://a | # To find a link which is present after an element with class "bar" |
211+
| `Click Element` | css:.bar >> xpath: //a | # To find a link which is present after an element with class "bar" |
212212
213213
List examples:
214-
| ${locator_list} = | `Create List` | css:div#div_id | xpath://*[text(), " >> "] |
215-
| `Page Should Contain Element` | ${locator_list} | | |
216-
| ${element} = | Get WebElement | xpath://*[text(), " >> "] | |
217-
| ${locator_list} = | `Create List` | css:div#div_id | ${element} |
218-
| `Page Should Contain Element` | ${locator_list} | | |
214+
| ${locator_list} = | `Create List` | css:div#div_id | xpath: //*[text(), " >> "] |
215+
| `Page Should Contain Element` | ${locator_list} | | |
216+
| ${element} = | Get WebElement | xpath: //*[text(), " >> "] | |
217+
| ${locator_list} = | `Create List` | css:div#div_id | ${element} |
218+
| `Page Should Contain Element` | ${locator_list} | | |
219219
220220
Chaining locators in new in SeleniumLibrary 5.0
221221

src/SeleniumLibrary/keywords/browsermanagement.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def open_browser(
216216
if service_log_path:
217217
self.warn("service_log_path is being deprecated. Please use service to configure log_output or equivalent service attribute.")
218218
if executable_path:
219-
self.warn("exexcutable_path is being deprecated. Please use service to configure the driver's executable_path as per documentation.")
219+
self.warn("executable_path is being deprecated. Please use service to configure the driver's executable_path as per documentation.")
220220
return self._make_new_browser(
221221
url,
222222
browser,

0 commit comments

Comments
 (0)