Skip to content

Commit afa6115

Browse files
committed
Merge branch 'master' into add-get-css-property-value-keyword
2 parents 4a8d2b8 + 423ebb8 commit afa6115

7 files changed

Lines changed: 111 additions & 16 deletions

File tree

.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: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,21 @@ Add Cookie When Secure Is False
3636
Should Be Equal ${cookie.secure} ${False}
3737

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

4450
Add Cookie When Expiry Is Human Readable Data&Time
45-
Add Cookie Cookie12 value12 expiry=2025-10-29 12:25:00
51+
Add Cookie Cookie12 value12 expiry=2026-10-29 12:25:00
4652
${cookie} = Get Cookie Cookie12
47-
Should Be Equal As Strings ${cookie.expiry} 2025-10-29 12:25:00
53+
Should Be Equal As Strings ${cookie.expiry} 2026-10-29 12:25:00
4854

4955
Delete Cookie
5056
[Tags] Known Issue Safari
@@ -114,20 +120,20 @@ Test Get Cookie Keyword Logging
114120
... domain=localhost
115121
... secure=False
116122
... httpOnly=False
117-
... expiry=2025-09-01 *:25:00
123+
... expiry=2026-09-01 *:25:00
118124
... extra={'sameSite': 'Lax'}
119125
${cookie} = Get Cookie far_future
120126

121127
*** Keywords ***
122128
Add Cookies
123129
# To update time each September (as Chrome limits cookies to one year expiry date) use
124130
# import datetime
125-
# print (datetime.datetime.strptime("2025-09-01 12:25:00", "%Y-%m-%d %I:%M:%S").timestamp())
131+
# print (datetime.datetime.strptime("2027-09-01 12:25:00", "%Y-%m-%d %I:%M:%S").timestamp())
126132
Delete All Cookies
127133
Add Cookie test seleniumlibrary
128134
${now} = Get Current Date
129135
${tomorrow_thistime} = Add Time To Date ${now} 1 day
130136
${tomorrow_thistime_datetime} = Convert Date ${tomorrow_thistime} datetime
131137
Set Suite Variable ${tomorrow_thistime_datetime}
132138
Add Cookie another value expiry=${tomorrow_thistime}
133-
Add Cookie far_future timemachine expiry=1756700700 # 2025-09-01 12:25:00
139+
Add Cookie far_future timemachine expiry=1788236700 # 2026-09-01 12:25:00

docs/SeleniumLibrary.html

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

src/SeleniumLibrary/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,14 @@ class SeleniumLibrary(DynamicCore):
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)