Skip to content

Commit 6008d6c

Browse files
authored
Merge pull request #1861 from emanlove/update-atests-with-preconfigured-webdriver
Update atests with preconfigured webdriver
2 parents 036771b + a3846e2 commit 6008d6c

File tree

7 files changed

+36
-22
lines changed

7 files changed

+36
-22
lines changed

atest/acceptance/2-event_firing_webdriver/event_firing_webdriver.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Open Browser To Start Page
1515
... LOG 1:20 DEBUG Wrapping driver to event_firing_webdriver.
1616
... LOG 1:22 INFO Got driver also from SeleniumLibrary.
1717
Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL}
18-
... desired_capabilities=${DESIRED_CAPABILITIES}
18+
... executable_path=%{WEBDRIVERPATH}
1919

2020
Event Firing Webdriver Go To (WebDriver)
2121
[Tags] NoGrid

atest/acceptance/create_webdriver.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Library Collections
77
Create Webdriver Creates Functioning WebDriver
88
[Documentation]
99
... LOG 1:1 INFO REGEXP: Creating an instance of the \\w+ WebDriver.
10-
... LOG 1:8 DEBUG REGEXP: Created \\w+ WebDriver instance with session id (\\w|-)+.
10+
... LOG 1:25 DEBUG REGEXP: Created \\w+ WebDriver instance with session id (\\w|-)+.
1111
[Tags] Known Issue Internet Explorer Known Issue Safari
1212
[Setup] Set Driver Variables
1313
Create Webdriver ${DRIVER_NAME} kwargs=${KWARGS}

atest/acceptance/keywords/cookies.robot

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Suite Setup Go To Page "cookies.html"
44
Suite Teardown Delete All Cookies
55
Test Setup Add Cookies
66
Resource ../resource.robot
7+
Library DateTime
78

89
*** Test Cases ***
910
Get Cookies
@@ -13,7 +14,7 @@ Get Cookies
1314

1415
Get Cookies As Dict
1516
${cookies}= Get Cookies as_dict=True
16-
${expected_cookies}= Create Dictionary test=seleniumlibrary another=value
17+
${expected_cookies}= Create Dictionary test=seleniumlibrary another=value far_future=timemachine
1718
Dictionaries Should Be Equal ${expected_cookies} ${cookies}
1819

1920
App Sees Cookie Set By Selenium
@@ -35,21 +36,21 @@ Add Cookie When Secure Is False
3536
Should Be Equal ${cookie.secure} ${False}
3637

3738
Add Cookie When Expiry Is Epoch
38-
Add Cookie Cookie1 value1 expiry=1698601011
39+
Add Cookie Cookie1 value1 expiry=1730205247
3940
${cookie} = Get Cookie Cookie1
40-
${expiry} = Convert Date ${1698601011} exclude_millis=True
41+
${expiry} = Convert Date ${1730205247} exclude_millis=True
4142
Should Be Equal As Strings ${cookie.expiry} ${expiry}
4243

4344
Add Cookie When Expiry Is Human Readable Data&Time
44-
Add Cookie Cookie12 value12 expiry=2023-10-29 19:36:51
45+
Add Cookie Cookie12 value12 expiry=2024-10-29 19:36:51
4546
${cookie} = Get Cookie Cookie12
46-
Should Be Equal As Strings ${cookie.expiry} 2023-10-29 19:36:51
47+
Should Be Equal As Strings ${cookie.expiry} 2024-10-29 19:36:51
4748

4849
Delete Cookie
4950
[Tags] Known Issue Safari
5051
Delete Cookie test
5152
${cookies} = Get Cookies
52-
Should Be Equal ${cookies} another=value
53+
Should Be Equal ${cookies} far_future=timemachine; another=value
5354

5455
Non-existent Cookie
5556
Run Keyword And Expect Error
@@ -71,12 +72,12 @@ Get Cookies As Dict When There Are None
7172

7273
Test Get Cookie Object Expiry
7374
${cookie} = Get Cookie another
74-
Should Be Equal As Integers ${cookie.expiry.year} 2023
75-
Should Be Equal As Integers ${cookie.expiry.month} 10
76-
Should Be Equal As Integers ${cookie.expiry.day} 29
77-
Should Be Equal As Integers ${cookie.expiry.hour} 19
78-
Should Be Equal As Integers ${cookie.expiry.minute} 36
79-
Should Be Equal As Integers ${cookie.expiry.second} 51
75+
Should Be Equal As Integers ${cookie.expiry.year} ${tomorrow_thistime_datetime.year}
76+
Should Be Equal As Integers ${cookie.expiry.month} ${tomorrow_thistime_datetime.month}
77+
Should Be Equal As Integers ${cookie.expiry.day} ${tomorrow_thistime_datetime.day}
78+
Should Be Equal As Integers ${cookie.expiry.hour} ${tomorrow_thistime_datetime.hour}
79+
Should Be Equal As Integers ${cookie.expiry.minute} ${tomorrow_thistime_datetime.minute}
80+
Should Be Equal As Integers ${cookie.expiry.second} ${tomorrow_thistime_datetime.second}
8081
Should Be Equal As Integers ${cookie.expiry.microsecond} 0
8182

8283
Test Get Cookie Object Domain
@@ -106,18 +107,23 @@ Test Get Cookie Object Value
106107
Test Get Cookie Keyword Logging
107108
[Tags] NoGrid Known Issue Firefox
108109
[Documentation]
109-
... LOG 1:5 ${cookie} = name=another
110-
... value=value
110+
... LOG 1:5 ${cookie} = name=far_future
111+
... value=timemachine
111112
... path=/
112113
... domain=localhost
113114
... secure=False
114115
... httpOnly=False
115-
... expiry=2023-10-29 19:36:51
116+
... expiry=2024-09-15 11:22:33
116117
... extra={'sameSite': 'Lax'}
117-
${cookie} = Get Cookie another
118+
${cookie} = Get Cookie far_future
118119

119120
*** Keyword ***
120121
Add Cookies
121122
Delete All Cookies
122123
Add Cookie test seleniumlibrary
123-
Add Cookie another value expiry=2023-10-29 19:36:51
124+
${now} = Get Current Date
125+
${tomorrow_thistime} = Add Time To Date ${now} 1 day
126+
${tomorrow_thistime_datetime} = Convert Date ${tomorrow_thistime} datetime
127+
Set Suite Variable ${tomorrow_thistime_datetime}
128+
Add Cookie another value expiry=${tomorrow_thistime}
129+
Add Cookie far_future timemachine expiry=1726399353 # 2024-09-15 11:22:33

atest/acceptance/keywords/page_load_timeout.robot

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ Test Teardown Close Browser And Reset Page Load Timeout
77
*** Test Cases ***
88
Should Open Browser With Default Page Load Timeout
99
[Documentation] Verify that 'Open Browser' changes the page load timeout.
10-
... LOG 1.1.1:16 DEBUG REGEXP: POST http://localhost:\\d{2,5}/session/[a-f0-9-]+/timeouts {"pageLoad": 300000}
11-
... LOG 1.1.1:18 DEBUG STARTS: Remote response: status=200
10+
... LOG 1.1.1:33 DEBUG REGEXP: POST http://localhost:\\d{2,5}/session/[a-f0-9-]+/timeouts {"pageLoad": 300000}
11+
... LOG 1.1.1:35 DEBUG STARTS: Remote response: status=200
12+
# ... LOG 1.1.1:16 DEBUG REGEXP: POST http://localhost:\\d{2,5}/session/[a-f0-9-]+/timeouts {"pageLoad": 300000}
13+
# ... LOG 1.1.1:18 DEBUG STARTS: Remote response: status=200
1214
Open Browser To Start Page
1315

1416
Should Run Into Timeout Exception

atest/acceptance/multiple_browsers_options.robot

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Chrome Browser With Selenium Options As String
1313
... LOG 1:3 DEBUG GLOB: *args": ["--disable-dev-shm-usage"?*
1414
Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL}
1515
... desired_capabilities=${DESIRED_CAPABILITIES} options=add_argument("--disable-dev-shm-usage")
16+
... executable_path=%{WEBDRIVERPATH}
1617

1718
Chrome Browser With Selenium Options As String With Attirbute As True
1819
[Documentation]
@@ -21,6 +22,7 @@ Chrome Browser With Selenium Options As String With Attirbute As True
2122
... LOG 1:3 DEBUG GLOB: *"--headless"*
2223
Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL}
2324
... desired_capabilities=${DESIRED_CAPABILITIES} options=add_argument ( "--disable-dev-shm-usage" ) ; headless = True
25+
... executable_path=%{WEBDRIVERPATH}
2426

2527
Chrome Browser With Selenium Options With Complex Object
2628
[Tags] NoGrid
@@ -30,6 +32,7 @@ Chrome Browser With Selenium Options With Complex Object
3032
... LOG 1:3 DEBUG GLOB: *args": ["--disable-dev-shm-usage"?*
3133
Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL}
3234
... desired_capabilities=${DESIRED_CAPABILITIES} options=add_argument ( "--disable-dev-shm-usage" ) ; add_experimental_option( "mobileEmulation" , { 'deviceName' : 'Galaxy S5'})
35+
... executable_path=%{WEBDRIVERPATH}
3336

3437
Chrome Browser With Selenium Options Object
3538
[Documentation]
@@ -38,11 +41,13 @@ Chrome Browser With Selenium Options Object
3841
${options} = Get Chrome Options
3942
Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL}
4043
... desired_capabilities=${DESIRED_CAPABILITIES} options=${options}
44+
... executable_path=%{WEBDRIVERPATH}
4145

4246
Chrome Browser With Selenium Options Invalid Method
4347
Run Keyword And Expect Error AttributeError: 'Options' object has no attribute 'not_here_method'
4448
... Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL}
4549
... desired_capabilities=${DESIRED_CAPABILITIES} options=not_here_method("arg1")
50+
... executable_path=%{WEBDRIVERPATH}
4651

4752

4853
Chrome Browser With Selenium Options Argument With Semicolon
@@ -51,3 +56,4 @@ Chrome Browser With Selenium Options Argument With Semicolon
5156
... LOG 1:3 DEBUG GLOB: *["has;semicolon"*
5257
Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL}
5358
... desired_capabilities=${DESIRED_CAPABILITIES} options=add_argument("has;semicolon")
59+
... executable_path=%{WEBDRIVERPATH}

atest/acceptance/open_and_close.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Browser Open With Not Well-Formed URL Should Close
2020
... LOG 1.1:24 DEBUG REGEXP: .*but failed to open url.*
2121
... LOG 2:2 DEBUG STARTS: DELETE
2222
... LOG 2:5 DEBUG STARTS: Finished Request
23-
Run Keyword And Expect Error * Open Browser bad.url.bad ${BROWSER}
23+
Run Keyword And Expect Error * Open Browser bad.url.bad ${BROWSER} executable_path=%{WEBDRIVERPATH}
2424
Close All Browsers
2525

2626
Switch to closed browser is possible

0 commit comments

Comments
 (0)