summaryrefslogtreecommitdiff
path: root/selenium_eduvpn.py
diff options
context:
space:
mode:
Diffstat (limited to 'selenium_eduvpn.py')
-rw-r--r--selenium_eduvpn.py23
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)