From cd5019305db965b4e3acb028ec1f1524d0199917 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Tue, 10 May 2022 13:18:14 +0200 Subject: Python: Add config retrieval test --- selenium_eduvpn.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'selenium_eduvpn.py') 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) -- cgit v1.2.3