Skip to content

Commit

Permalink
Removed the dependency to webdriver-manager (tests)
Browse files Browse the repository at this point in the history
  • Loading branch information
niconoe committed Mar 25, 2024
1 parent d6e2826 commit 624448c
Show file tree
Hide file tree
Showing 6 changed files with 435 additions and 407 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Current (unreleased)

- Technical: got rid of webdriver-manager, now using the manager provided by selenium itself

# v1.7.0 (2023-11-08)

- Improvements to the WFS server (https://github.com/riparias/gbif-alert/issues/268)
Expand Down
13 changes: 4 additions & 9 deletions dashboard/tests/selenium/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.select import Select
from selenium.webdriver.support.wait import WebDriverWait
from webdriver_manager.chrome import ChromeDriverManager # type: ignore
from webdriver_manager.core.os_manager import ChromeType # type: ignore

# from webdriver_manager.chrome import ChromeDriverManager # type: ignore
# from webdriver_manager.core.os_manager import ChromeType # type: ignore


from dashboard.models import (
Expand All @@ -40,14 +41,8 @@ def _get_webdriver() -> WebDriver:
options.add_argument("--headless")
options.add_argument("--window-size=2560,1440")

# Workaround for https://github.com/SergeyPirogov/webdriver_manager/issues/500
if hasattr(settings, "SELENIUM_CHROMEDRIVER_VERSION"):
chromedriver_args = {"driver_version": settings.SELENIUM_CHROMEDRIVER_VERSION} # type: ignore
else:
chromedriver_args = {"chrome_type": ChromeType.CHROMIUM}

selenium = webdriver.Chrome(
service=ChromiumService(ChromeDriverManager(**chromedriver_args).install()), # type: ignore
# service=ChromiumService(ChromeDriverManager(**chromedriver_args).install()), # type: ignore
options=options,
)

Expand Down
25 changes: 14 additions & 11 deletions dashboard/views/public_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,21 @@ class ObservationsWFSView(WFSView):
Observation.objects.all(),
fields=[
"gbif_id",
field("data_provider_occurrence_id", model_attribute="occurrence_id"),
# field("data_provider_occurrence_id", model_attribute="occurrence_id"),
"stable_id",
field(
"species",
fields=[
"id",
"name",
"vernacular_name_nl",
"vernacular_name_en",
"vernacular_name_fr",
],
),
# field("species-id", model_attribute="species_id"),
# ".species.name",
field("species-name", model_attribute="species.name"),
# field(
# "species",
# fields=[
# "id",
# "name",
# "vernacular_name_nl",
# "vernacular_name_en",
# "vernacular_name_fr",
# ],
# ),
field(
"dataset",
fields=[
Expand Down
2 changes: 0 additions & 2 deletions djangoproject/local_settings_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,3 @@ def build_gbif_download_predicate(species_list: "QuerySet[Species]"): # type: i
"initialLon": 4.47,
},
}

# SELENIUM_CHROMEDRIVER_VERSION = "116.0.5845.96"
Loading

0 comments on commit 624448c

Please sign in to comment.