Skip to content

Commit

Permalink
Merge pull request #733 from python-eel/update-workflow-branch
Browse files Browse the repository at this point in the history
Update workflow branch
  • Loading branch information
samuelhwilliams authored Jul 11, 2024
2 parents 7e88610 + b01e6f9 commit a589ad0
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: "CodeQL"

on:
push:
branches: [master]
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
branches: [main]
schedule:
- cron: '0 11 * * 0'

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Test Eel

on:
push:
branches: [ master ]
branches: [ main ]
pull_request:

jobs:
Expand All @@ -14,6 +14,9 @@ jobs:
matrix:
os: [ubuntu-20.04, windows-latest, macos-latest]
python-version: [3.7, 3.8, 3.9, "3.10"]
exclude:
- os: macos-latest
python-version: 3.7

steps:
- name: Checkout repository
Expand Down
5 changes: 1 addition & 4 deletions .python-version
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
3.7.14
3.8.14
3.9.13
3.10.8
3.10
4 changes: 2 additions & 2 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
psutil==5.9.2
pytest==7.0.1
pytest-timeout==2.1.0
selenium==3.141.0
webdriver_manager==3.7.1
selenium>=4.0.0,<5.0.0
webdriver_manager>=4.0.0,<5.0.0
mypy==0.971
pyinstaller==4.10
types-setuptools==67.2.0.1
11 changes: 4 additions & 7 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pytest
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
from selenium.webdriver.chrome.service import Service as ChromeService
from webdriver_manager.chrome import ChromeDriverManager


Expand All @@ -14,18 +14,15 @@ def driver():

if TEST_BROWSER == "chrome":
options = webdriver.ChromeOptions()
options.headless = True
capabilities = DesiredCapabilities.CHROME
capabilities["goog:loggingPrefs"] = {"browser": "ALL"}
options.add_argument('--headless=new')
options.set_capability("goog:loggingPrefs", {"browser": "ALL"})

if platform.system() == "Windows":
options.binary_location = "C:/Program Files/Google/Chrome/Application/chrome.exe"

driver = webdriver.Chrome(
ChromeDriverManager().install(),
service=ChromeService(ChromeDriverManager().install()),
options=options,
desired_capabilities=capabilities,
service_log_path=os.path.devnull,
)

# Firefox doesn't currently supported pulling JavaScript console logs, which we currently scan to affirm that
Expand Down
10 changes: 5 additions & 5 deletions tests/integration/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,20 @@ def test_04_file_access(driver: webdriver.Remote):
assert driver.title == "Eel Demo"

with TemporaryDirectory() as temp_dir, NamedTemporaryFile(dir=temp_dir) as temp_file:
driver.find_element_by_id('input-box').clear()
driver.find_element_by_id('input-box').send_keys(temp_dir)
driver.find_element(value='input-box').clear()
driver.find_element(value='input-box').send_keys(temp_dir)
time.sleep(0.5)
driver.find_element_by_css_selector('button').click()
driver.find_element(By.CSS_SELECTOR, 'button').click()

assert driver.find_element_by_id('file-name').text == os.path.basename(temp_file.name)
assert driver.find_element(value='file-name').text == os.path.basename(temp_file.name)


def test_06_jinja_templates(driver: webdriver.Remote):
with get_eel_server('examples/06 - jinja_templates/hello.py', 'templates/hello.html') as eel_url:
driver.get(eel_url)
assert driver.title == "Hello, World!"

driver.find_element_by_css_selector('a').click()
driver.find_element(By.CSS_SELECTOR, 'a').click()
WebDriverWait(driver, 2.0).until(expected_conditions.presence_of_element_located((By.XPATH, '//h1[text()="This is page 2"]')))


Expand Down

0 comments on commit a589ad0

Please sign in to comment.