diff --git a/SplunkRumWorkspace/SauceLabsTestApp/sl_tests.py b/SplunkRumWorkspace/SauceLabsTestApp/sl_tests.py index b5472002..70930fd9 100644 --- a/SplunkRumWorkspace/SauceLabsTestApp/sl_tests.py +++ b/SplunkRumWorkspace/SauceLabsTestApp/sl_tests.py @@ -11,23 +11,22 @@ class IOSTests(unittest.TestCase): def setUp(self): currentTime = datetime.now().strftime('%Y-%m-%d %H:%M:%S') - options = Options() - options.platform_name = 'iOS' + caps = {} sl_file_id = sys.argv[2] - options.set_capability('appium:app', f'storage:{sl_file_id}') - options.set_capability('appium:deviceName', 'iPhone Simulator') - options.set_capability('appium:platformVersion', sys.argv[1]) - options.set_capability('appium:automationName', 'XCUITest') - sauce_options = { - 'name': 'SplunkRum tests' + currentTime, - 'accessKey': os.environ['SAUCELABS_KEY'], - 'username': os.environ['SAUCELABS_USER'] - } - options.set_capability('sauce:options', sauce_options) + caps['platformName'] = 'iOS' + caps['appium:app'] = f'storage:{sl_file_id}' + caps['appium:deviceName'] = 'iPhone Simulator' + caps['appium:platformVersion'] = sys.argv[1] + caps['appium:automationName'] = 'XCUITest' + caps['sauce:options'] = {} + caps['sauce:options']['name'] = 'SplunkRum tests' + currentTime + caps['sauce:options']['accessKey'] = os.environ['SAUCELABS_KEY'] + caps['sauce:options']['username'] = os.environ['SAUCELABS_USER'] url = f'https://ondemand.us-west-1.saucelabs.com:443/wd/hub' - self.driver=webdriver.Remote(url, options=options) + self.driver=webdriver.Remote(url, caps) + def tearDown(self): self.driver.quit()