Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #266 from iamnotturner/quit-selenium
Browse files Browse the repository at this point in the history
chromedriver: replaced with-statement with quit()
  • Loading branch information
timreibe authored Jun 2, 2021
2 parents 4728edd + e4f2dbb commit cdcca2b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tools/its.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,11 @@ def renew_cookies(self):
"""

self.log.info("Browser-Cookies generieren")
with self.get_chromedriver(headless=True) as driver:
driver = self.get_chromedriver(headless=True)
try:
return self.driver_renew_cookies(driver, choice(self.plz_impfzentren))

finally:
driver.quit()

@retry_on_failure()
def renew_cookies_code(self, manual=False):
Expand All @@ -496,10 +498,11 @@ def renew_cookies_code(self, manual=False):
"""

self.log.info("Browser-Cookies generieren")
with self.get_chromedriver(headless=False) as driver:
driver = self.get_chromedriver(headless=False)
try:
return self.driver_renew_cookies_code(driver, choice(self.plz_impfzentren), manual)


finally:
driver.quit()

@retry_on_failure()
def book_appointment(self):
Expand All @@ -511,8 +514,11 @@ def book_appointment(self):
"""

self.log.info("Termin über Selenium buchen")
with self.get_chromedriver(headless=False) as driver:
driver = self.get_chromedriver(headless=False)
try:
return self.driver_book_appointment(driver, self.plz_termin)
finally:
driver.quit()

@retry_on_failure()
def login(self):
Expand Down

0 comments on commit cdcca2b

Please sign in to comment.