diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-05-10 13:18:14 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-05-10 13:18:14 +0200 |
| commit | cd5019305db965b4e3acb028ec1f1524d0199917 (patch) | |
| tree | 798318aee35661a8e3d07da5e3b4e8a992d32052 /selenium_eduvpn.py | |
| parent | 9e3e7f22892c3504e6de9827af0fabd9b4b098ea (diff) | |
Python: Add config retrieval test
Diffstat (limited to 'selenium_eduvpn.py')
| -rw-r--r-- | selenium_eduvpn.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/selenium_eduvpn.py b/selenium_eduvpn.py index 6c91fa5..76e86aa 100644 --- a/selenium_eduvpn.py +++ b/selenium_eduvpn.py @@ -5,6 +5,18 @@ from selenium.webdriver.common.keys import Keys from selenium.webdriver.firefox.options import Options +def login_eduvpn(authURL): + options = Options() + options.headless = True + + # Use the firefox driver + driver = webdriver.Firefox(options=options) + + login_oauth(driver, authURL) + + # Cleanup + driver.close() + # Logs in to the default vpn user portal with selenium def login_oauth(driver, authURL): # Go to the oauth url and verify the title @@ -51,15 +63,6 @@ if __name__ == "__main__": print("Error: no auth url specified") sys.exit(1) - options = Options() - options.headless = True - - # Use the firefox driver - driver = webdriver.Firefox(options=options) - # Login to the portal authURL = sys.argv[1] - login_oauth(driver, authURL) - - # Cleanup - driver.close() + login_eduvpn(authURL) |
