Skip to content

Commit

Permalink
Replaced Firefox with Chromium for Selenium tests
Browse files Browse the repository at this point in the history
  • Loading branch information
clintonb committed Aug 11, 2024
1 parent 10776b4 commit 440d1e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,10 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3

- name: Install Selenium dependencies
run: |
sudo apt-get -qq update
sudo apt-get -y install firefox xvfb
- uses: browser-actions/setup-chrome@v1
with:
install-chromedriver: true
install-dependencies: true

- name: Install python dependencies
run: |
Expand Down
7 changes: 4 additions & 3 deletions test_project/qunit-runner.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import os
import time

from selenium import webdriver # pylint:disable=no-name-in-module
from selenium import webdriver
from selenium.webdriver.common.by import By

ROOT = os.path.abspath(os.path.dirname(__file__))
URL = "file://" + ROOT + "/qunit.html"
TIMEOUT = 5

driver = webdriver.Firefox()
driver = webdriver.Chrome()
driver.set_page_load_timeout(TIMEOUT)
driver.get(URL)

time.sleep(TIMEOUT)

xpath = '//div[@id="qunit-testresult-display"]/span[@class="failed"]'
element = driver.find_element_by_xpath(xpath)
element = driver.find_element(by=By.XPATH, value=xpath)
count = int(element.text)
assert count == 0
driver.close()
Expand Down

0 comments on commit 440d1e8

Please sign in to comment.