diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0ee38f2cd..5d59b5c10 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -17,6 +17,14 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - name: Setup Chrome + uses: browser-actions/setup-chrome@latest + with: + chrome-version: latest + id: setup-chrome + - run: | + echo Installed chromium version: ${{ steps.setup-chrome.outputs.chrome-version }} + ${{ steps.setup-chrome.outputs.chrome-path }} --version - name: Start xvfb run: | export DISPLAY=:99.0 @@ -36,6 +44,12 @@ jobs: - name: Install RF ${{ matrix.rf-version }} run: | pip install -U --pre robotframework==${{ matrix.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: Generate stub file for ${{ matrix.python-version }} if: matrix.python-version != 'pypy-3.7' run: | diff --git a/atest/acceptance/2-event_firing_webdriver/event_firing_webdriver.robot b/atest/acceptance/2-event_firing_webdriver/event_firing_webdriver.robot index 1392f2bbf..ea9d633c6 100644 --- a/atest/acceptance/2-event_firing_webdriver/event_firing_webdriver.robot +++ b/atest/acceptance/2-event_firing_webdriver/event_firing_webdriver.robot @@ -2,7 +2,7 @@ Library SeleniumLibrary event_firing_webdriver=${CURDIR}/../../resources/testlibs/MyListener.py Resource resource_event_firing_webdriver.robot Suite Setup Open Browser ${FRONT PAGE} ${BROWSER} alias=event_firing_webdriver -... remote_url=${REMOTE_URL} desired_capabilities=${DESIRED_CAPABILITIES} +... remote_url=${REMOTE_URL} executable_path=%{WEBDRIVERPATH} Suite Teardown Close All Browsers *** Variables *** @@ -15,7 +15,7 @@ Open Browser To Start Page ... LOG 1:20 DEBUG Wrapping driver to event_firing_webdriver. ... LOG 1:22 INFO Got driver also from SeleniumLibrary. Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL} - ... desired_capabilities=${DESIRED_CAPABILITIES} + ... executable_path=%{WEBDRIVERPATH} Event Firing Webdriver Go To (WebDriver) [Tags] NoGrid diff --git a/atest/acceptance/create_webdriver.robot b/atest/acceptance/create_webdriver.robot index 854c63ba0..15aba3d4e 100644 --- a/atest/acceptance/create_webdriver.robot +++ b/atest/acceptance/create_webdriver.robot @@ -7,7 +7,7 @@ Library Collections Create Webdriver Creates Functioning WebDriver [Documentation] ... LOG 1:1 INFO REGEXP: Creating an instance of the \\w+ WebDriver. - ... LOG 1:8 DEBUG REGEXP: Created \\w+ WebDriver instance with session id (\\w|-)+. + ... LOG 1:25 DEBUG REGEXP: Created \\w+ WebDriver instance with session id (\\w|-)+. [Tags] Known Issue Internet Explorer Known Issue Safari [Setup] Set Driver Variables Create Webdriver ${DRIVER_NAME} kwargs=${KWARGS} diff --git a/atest/acceptance/keywords/cookies.robot b/atest/acceptance/keywords/cookies.robot index a457842e5..6ff52ccfb 100644 --- a/atest/acceptance/keywords/cookies.robot +++ b/atest/acceptance/keywords/cookies.robot @@ -4,6 +4,7 @@ Suite Setup Go To Page "cookies.html" Suite Teardown Delete All Cookies Test Setup Add Cookies Resource ../resource.robot +Library DateTime *** Test Cases *** Get Cookies @@ -13,7 +14,7 @@ Get Cookies Get Cookies As Dict ${cookies}= Get Cookies as_dict=True - ${expected_cookies}= Create Dictionary test=seleniumlibrary another=value + ${expected_cookies}= Create Dictionary test=seleniumlibrary another=value far_future=timemachine Dictionaries Should Be Equal ${expected_cookies} ${cookies} App Sees Cookie Set By Selenium @@ -35,21 +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=1698601011 + Add Cookie Cookie1 value1 expiry=1730205247 ${cookie} = Get Cookie Cookie1 - ${expiry} = Convert Date ${1698601011} exclude_millis=True + ${expiry} = Convert Date ${1730205247} 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=2023-10-29 19:36:51 + Add Cookie Cookie12 value12 expiry=2024-10-29 19:36:51 ${cookie} = Get Cookie Cookie12 - Should Be Equal As Strings ${cookie.expiry} 2023-10-29 19:36:51 + Should Be Equal As Strings ${cookie.expiry} 2024-10-29 19:36:51 Delete Cookie [Tags] Known Issue Safari Delete Cookie test ${cookies} = Get Cookies - Should Be Equal ${cookies} another=value + Should Be Equal ${cookies} far_future=timemachine; another=value Non-existent Cookie Run Keyword And Expect Error @@ -71,12 +72,12 @@ Get Cookies As Dict When There Are None Test Get Cookie Object Expiry ${cookie} = Get Cookie another - Should Be Equal As Integers ${cookie.expiry.year} 2023 - Should Be Equal As Integers ${cookie.expiry.month} 10 - Should Be Equal As Integers ${cookie.expiry.day} 29 - Should Be Equal As Integers ${cookie.expiry.hour} 19 - Should Be Equal As Integers ${cookie.expiry.minute} 36 - Should Be Equal As Integers ${cookie.expiry.second} 51 + Should Be Equal As Integers ${cookie.expiry.year} ${tomorrow_thistime_datetime.year} + Should Be Equal As Integers ${cookie.expiry.month} ${tomorrow_thistime_datetime.month} + Should Be Equal As Integers ${cookie.expiry.day} ${tomorrow_thistime_datetime.day} + Should Be Equal As Integers ${cookie.expiry.hour} ${tomorrow_thistime_datetime.hour} + Should Be Equal As Integers ${cookie.expiry.minute} ${tomorrow_thistime_datetime.minute} + Should Be Equal As Integers ${cookie.expiry.second} ${tomorrow_thistime_datetime.second} Should Be Equal As Integers ${cookie.expiry.microsecond} 0 Test Get Cookie Object Domain @@ -106,18 +107,23 @@ Test Get Cookie Object Value Test Get Cookie Keyword Logging [Tags] NoGrid Known Issue Firefox [Documentation] - ... LOG 1:5 ${cookie} = name=another - ... value=value + ... LOG 1:5 ${cookie} = name=far_future + ... value=timemachine ... path=/ ... domain=localhost ... secure=False ... httpOnly=False - ... expiry=2023-10-29 19:36:51 + ... expiry=2024-09-15 11:22:33 ... extra={'sameSite': 'Lax'} - ${cookie} = Get Cookie another + ${cookie} = Get Cookie far_future *** Keyword *** Add Cookies Delete All Cookies Add Cookie test seleniumlibrary - Add Cookie another value expiry=2023-10-29 19:36:51 + ${now} = Get Current Date + ${tomorrow_thistime} = Add Time To Date ${now} 1 day + ${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=1726399353 # 2024-09-15 11:22:33 diff --git a/atest/acceptance/keywords/page_load_timeout.robot b/atest/acceptance/keywords/page_load_timeout.robot index 384eb4410..8113dc84c 100644 --- a/atest/acceptance/keywords/page_load_timeout.robot +++ b/atest/acceptance/keywords/page_load_timeout.robot @@ -7,8 +7,10 @@ Test Teardown Close Browser And Reset Page Load Timeout *** Test Cases *** Should Open Browser With Default Page Load Timeout [Documentation] Verify that 'Open Browser' changes the page load timeout. - ... LOG 1.1.1:16 DEBUG REGEXP: POST http://localhost:\\d{2,5}/session/[a-f0-9-]+/timeouts {"pageLoad": 300000} - ... LOG 1.1.1:18 DEBUG STARTS: Remote response: status=200 + ... LOG 1.1.1:33 DEBUG REGEXP: POST http://localhost:\\d{2,5}/session/[a-f0-9-]+/timeouts {"pageLoad": 300000} + ... LOG 1.1.1:35 DEBUG STARTS: Remote response: status=200 + # ... LOG 1.1.1:16 DEBUG REGEXP: POST http://localhost:\\d{2,5}/session/[a-f0-9-]+/timeouts {"pageLoad": 300000} + # ... LOG 1.1.1:18 DEBUG STARTS: Remote response: status=200 Open Browser To Start Page Should Run Into Timeout Exception diff --git a/atest/acceptance/multiple_browsers_options.robot b/atest/acceptance/multiple_browsers_options.robot index 8899526a3..92631859d 100644 --- a/atest/acceptance/multiple_browsers_options.robot +++ b/atest/acceptance/multiple_browsers_options.robot @@ -13,6 +13,7 @@ Chrome Browser With Selenium Options As String ... LOG 1:3 DEBUG GLOB: *args": ["--disable-dev-shm-usage"?* Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL} ... desired_capabilities=${DESIRED_CAPABILITIES} options=add_argument("--disable-dev-shm-usage") + ... executable_path=%{WEBDRIVERPATH} Chrome Browser With Selenium Options As String With Attirbute As True [Documentation] @@ -21,6 +22,7 @@ Chrome Browser With Selenium Options As String With Attirbute As True ... LOG 1:3 DEBUG GLOB: *"--headless"* Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL} ... desired_capabilities=${DESIRED_CAPABILITIES} options=add_argument ( "--disable-dev-shm-usage" ) ; headless = True + ... executable_path=%{WEBDRIVERPATH} Chrome Browser With Selenium Options With Complex Object [Tags] NoGrid @@ -30,6 +32,7 @@ Chrome Browser With Selenium Options With Complex Object ... LOG 1:3 DEBUG GLOB: *args": ["--disable-dev-shm-usage"?* Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL} ... desired_capabilities=${DESIRED_CAPABILITIES} options=add_argument ( "--disable-dev-shm-usage" ) ; add_experimental_option( "mobileEmulation" , { 'deviceName' : 'Galaxy S5'}) + ... executable_path=%{WEBDRIVERPATH} Chrome Browser With Selenium Options Object [Documentation] @@ -38,11 +41,13 @@ Chrome Browser With Selenium Options Object ${options} = Get Chrome Options Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL} ... desired_capabilities=${DESIRED_CAPABILITIES} options=${options} + ... executable_path=%{WEBDRIVERPATH} Chrome Browser With Selenium Options Invalid Method Run Keyword And Expect Error AttributeError: 'Options' object has no attribute 'not_here_method' ... Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL} ... desired_capabilities=${DESIRED_CAPABILITIES} options=not_here_method("arg1") + ... executable_path=%{WEBDRIVERPATH} Chrome Browser With Selenium Options Argument With Semicolon @@ -51,3 +56,4 @@ Chrome Browser With Selenium Options Argument With Semicolon ... LOG 1:3 DEBUG GLOB: *["has;semicolon"* Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL} ... desired_capabilities=${DESIRED_CAPABILITIES} options=add_argument("has;semicolon") + ... executable_path=%{WEBDRIVERPATH} diff --git a/atest/acceptance/open_and_close.robot b/atest/acceptance/open_and_close.robot index 5efd2d0d2..9bb13c01d 100644 --- a/atest/acceptance/open_and_close.robot +++ b/atest/acceptance/open_and_close.robot @@ -20,7 +20,7 @@ Browser Open With Not Well-Formed URL Should Close ... LOG 1.1:24 DEBUG REGEXP: .*but failed to open url.* ... LOG 2:2 DEBUG STARTS: DELETE ... LOG 2:5 DEBUG STARTS: Finished Request - Run Keyword And Expect Error * Open Browser bad.url.bad ${BROWSER} + Run Keyword And Expect Error * Open Browser bad.url.bad ${BROWSER} executable_path=%{WEBDRIVERPATH} Close All Browsers Switch to closed browser is possible diff --git a/atest/acceptance/remote_browsers.robot b/atest/acceptance/remote_browsers.robot.TRIAGE similarity index 100% rename from atest/acceptance/remote_browsers.robot rename to atest/acceptance/remote_browsers.robot.TRIAGE