-
Notifications
You must be signed in to change notification settings - Fork 31
/
iosWeb.py
57 lines (46 loc) · 1.73 KB
/
iosWeb.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
from appium import webdriver
from appium.webdriver.common.mobileby import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
import os
desired_caps = {
"deviceName": "iPhone .*",
"platformName": "ios",
"platformVersion": "14",
"isRealMobile": True,
"build": "Python Vanilla iOS",
"name": "Sample Test - Python",
"network": False,
"visual": True,
"video": True
}
def startingTest():
if os.environ.get("LT_USERNAME") is None:
# Enter LT username here if environment variables have not been added
username = "username"
else:
username = os.environ.get("LT_USERNAME")
if os.environ.get("LT_ACCESS_KEY") is None:
# Enter LT accesskey here if environment variables have not been added
accesskey = "accesskey"
else:
accesskey = os.environ.get("LT_ACCESS_KEY")
driver = webdriver.Remote(desired_capabilities=desired_caps, command_executor="https://" +
username+":"+accesskey+"@mobile-hub.lambdatest.com/wd/hub")
driver.get("https://mfml.in/api/getInfo")
colorElement = WebDriverWait(driver, 30).until(EC.element_to_be_clickable(
(By.ID, "resolution")))
colorElement.click()
textElement = WebDriverWait(driver, 30).until(
EC.element_to_be_clickable((By.ID, "location")))
textElement.click()
toastElement = WebDriverWait(driver, 30).until(EC.element_to_be_clickable(
(By.ID, "details")))
toastElement.click()
notification = WebDriverWait(driver, 30).until(EC.element_to_be_clickable(
(By.ID, "timezone")))
notification.click()
time.sleep(5)
driver.quit()
startingTest()