Skip to content

Commit a868f70

Browse files
authored
Merge pull request #1955 from emanlove/master
Added new GitHub Actions workflow and performed yearly update on cookie test suite
2 parents 1bc10b1 + de6932f commit a868f70

File tree

3 files changed

+24
-19
lines changed

3 files changed

+24
-19
lines changed

.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: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
name: Select Configurations
1+
name: Selected Test Configuration Matrix
22

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

55
jobs:
66
test_config:
77
runs-on: ubuntu-latest
8+
continue-on-error: true
89
strategy:
910
matrix:
1011
config:
@@ -17,7 +18,12 @@ jobs:
1718
python-version: 3.12.12
1819
rf-version: 7.3.2
1920
selenium-version: 4.38.0
20-
browser: firefox
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
2127

2228
steps:
2329
- uses: actions/checkout@v4
@@ -32,9 +38,8 @@ jobs:
3238
- name: Setup ${{ matrix.config.browser }} browser
3339
uses: browser-actions/setup-chrome@v1
3440
with:
35-
chrome-version: 138
41+
chrome-version: latest
3642
install-dependencies: true
37-
install-chromedriver: true
3843
id: setup-chrome
3944
- run: |
4045
echo Installed chromium version: ${{ steps.setup-chrome.outputs.chrome-version }}
@@ -61,12 +66,6 @@ jobs:
6166
- name: Install RF ${{ matrix.config.rf-version }}
6267
run: |
6368
pip install -U --pre robotframework==${{ matrix.config.rf-version }}
64-
- name: Install drivers via selenium-manager
65-
run: |
66-
SELENIUM_MANAGER_EXE=$(python -c 'from selenium.webdriver.common.selenium_manager import SeleniumManager; sm=SeleniumManager(); print(f"{str(sm._get_binary())}")')
67-
echo "$SELENIUM_MANAGER_EXE"
68-
echo "WEBDRIVERPATH=$($SELENIUM_MANAGER_EXE --browser chrome --debug | awk '/INFO[[:space:]]Driver path:/ {print $NF;exit}')" >> "$GITHUB_ENV"
69-
echo "$WEBDRIVERPATH"
7069
7170
- name: Run tests under specified config
7271
run: |

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

0 commit comments

Comments
 (0)