Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
9932db2
Updated Appium iOS and Android test and added yaml for ADO
namratab-boop Mar 9, 2026
5fe8c61
Update azure-pipelines.yml
namratab-boop Mar 9, 2026
ad1ec84
Update azure-pipelines.yml
namratab-boop Mar 9, 2026
06ebf60
latest Update azure-pipelines.yml
namratab-boop Mar 9, 2026
0160a25
Update azure-pipelines.yml
namratab-boop Mar 9, 2026
2f710ef
new azure-pipelines.yml
namratab-boop Mar 9, 2026
645eef8
new azure-pipelines.yml
namratab-boop Mar 9, 2026
12bdc80
Update azure-pipelines.yml
namratab-boop Mar 9, 2026
2812ca8
final azure-pipelines.yml
namratab-boop Mar 9, 2026
5f52ebd
final azure-pipelines.yml
namratab-boop Mar 9, 2026
600375b
PR Feedback
namratab-boop Apr 14, 2026
443b34f
Latest pull
namratab-boop Apr 14, 2026
52c6bde
Update azure-pipelines.yml for Azure Pipelines
namratab-boop May 29, 2026
7119b3d
Update azure-pipelines.yml for Azure Pipelines
namratab-boop May 29, 2026
67e3b4a
Update azure-pipelines.yml for Azure Pipelines
namratab-boop May 29, 2026
8e01f8b
Update appConfig.py
namratab-boop May 29, 2026
a518417
Update appConfig.py
namratab-boop May 29, 2026
73dc2ce
Update azure-pipelines.yml for Azure Pipelines
namratab-boop May 29, 2026
bc14f2e
Update azure-pipelines.yml for Azure Pipelines
namratab-boop May 29, 2026
84a4566
Update azure-pipelines.yml for Azure Pipelines
namratab-boop May 29, 2026
c1ef2c5
Update azure-pipelines.yml
namratab-boop May 29, 2026
658d4ca
Update azure-pipelines.yml
namratab-boop May 29, 2026
51b9d56
Update azure-pipelines.yml for Azure Pipelines
namratab-boop May 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 27 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,18 @@ You need to update your capabilities in `appConfig.py` files. In this sample pro

```python title="appConfig.py"
app_ios_desired_caps = {
"lt:options": {
"deviceName":"iPhone 12",
"platformName":"ios",
"platformVersion":"14",
"build":"Python Behave - iOS",
"name":"Sample Test iOS",
"app":"app_url" ,#Enter app_url here
"isRealMobile":True,
"network":True,
"visual":True,
"video":True,
"w3c":True
}
"platformName": "iOS",
"appium:deviceName": "iPhone 14",
"appium:platformVersion": "16",
"appium:automationName": "XCUITest",
"appium:app": "lt://proverbial-ios",

"lt:options": {
"w3c": True,
"build": "Python Behave iOS Build",
"name": "iOS App Automation Test",
"isRealMobile": True
}
}
```

Expand All @@ -149,19 +148,22 @@ app_ios_desired_caps = {

```python title="appConfig.py"
app_android_desired_caps = {
"lt:options": {
"platformName": "android",
"deviceName": "OnePlus 6",
"platformVersion": "8",
"build": "Python Behave - Android",
"name": "Sample Test Android",
"app": "app_url", #Enter app_url here
"visual": True,
"video": True,
"w3c": True,
"isRealMobile": True
}
"platformName": "Android",
"appium:deviceName": "Galaxy S20",
"appium:platformVersion": "10",
"appium:automationName": "UiAutomator2",
"appium:app": "lt://proverbial-android",

"lt:options": {
"build": "Python Behave - Android",
"name": "Sample Test Android",
"isRealMobile": True,
"visual": True,
"video": True,
"w3c": True
}
}

```

</TabItem>
Expand Down
49 changes: 49 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
trigger:
- main

pool:
vmImage: 'ubuntu-latest'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.14'
displayName: "Set Python Version"

- script: |
python -m pip install --upgrade pip
pip install -r requirements.txt
displayName: "Install Dependencies"


- script: |
python -m behave --tags=@iosApp --junit --junit-directory test-results/ios
displayName: "Run iOS App Automation Tests"
env:
LT_USERNAME: $(LT_USERNAME)
LT_ACCESS_KEY: $(LT_ACCESS_KEY)

- script: |
python -m behave --tags=@androidApp --junit --junit-directory test-results/android
displayName: "Run Android App Automation Tests"
condition: succeededOrFailed()
env:
LT_USERNAME: $(LT_USERNAME)
LT_ACCESS_KEY: $(LT_ACCESS_KEY)

- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/test-results/**/*.xml'
testRunTitle: 'LambdaTest Results'
condition: succeededOrFailed()

- task: configuration@1
inputs:
connection: 'testing'
isTunnelActivate: false
isAppAutomate: true
isSmartUI: true


- task: LambdatestResults@1
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Paver==1.3.4
selenium==3.141.0
behave==1.2.6
Appium-Python-Client==1.0.2
urllib3==1.26.16
selenium==4.40.0
behave==1.3.3
Appium-Python-Client==3.0.0
urllib3>=2.6.3,<3.0
96 changes: 50 additions & 46 deletions steps/AndroidStepDef.py
Original file line number Diff line number Diff line change
@@ -1,79 +1,83 @@
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from appium.webdriver.common.mobileby import MobileBy
import appConfig as appConf
from appium.webdriver.common.appiumby import AppiumBy
from appium.options.android import UiAutomator2Options
from appium import webdriver
from behave import given
from time import time
import appConfig as appConf
import sys
import os

path = os.getcwd()
sys.path.append(os.path.abspath(os.path.join(path, os.pardir)))


@given("Start the android app automation test")
def startAndroidAppAutomationTest(self):
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")
def startAndroidAppAutomationTest(context):

username = os.environ.get("LT_USERNAME") or "username"
accesskey = os.environ.get("LT_ACCESS_KEY") or "accesskey"

caps = appConf.app_android_desired_caps

# Add LambdaTest credentials inside lt:options
if "lt:options" not in caps:
caps["lt:options"] = {}

caps["lt:options"]["user"] = username
caps["lt:options"]["accessKey"] = accesskey

options = UiAutomator2Options().load_capabilities(caps)

driver = webdriver.Remote(
command_executor="https://"+username+":" +
accesskey+"@mobile-hub.lambdatest.com/wd/hub",
desired_capabilities=appConf.app_android_desired_caps
command_executor="https://mobile-hub.lambdatest.com/wd/hub",
options=options
)

try:
colorElement = WebDriverWait(driver, 20).until(EC.element_to_be_clickable(
(MobileBy.ID, "com.lambdatest.proverbial:id/color")))

colorElement = WebDriverWait(driver, 20).until(
EC.element_to_be_clickable((AppiumBy.ID, "com.lambdatest.proverbial:id/color"))
)
colorElement.click()

textElement = WebDriverWait(driver, 20).until(
EC.element_to_be_clickable((MobileBy.ID, "com.lambdatest.proverbial:id/Text")))
EC.element_to_be_clickable((AppiumBy.ID, "com.lambdatest.proverbial:id/Text"))
)
textElement.click()

toastElement = WebDriverWait(driver, 20).until(EC.element_to_be_clickable(
(MobileBy.ID, "com.lambdatest.proverbial:id/toast")))
toastElement = WebDriverWait(driver, 20).until(
EC.element_to_be_clickable((AppiumBy.ID, "com.lambdatest.proverbial:id/toast"))
)
toastElement.click()

notification = WebDriverWait(driver, 20).until(EC.element_to_be_clickable(
(MobileBy.ID, "com.lambdatest.proverbial:id/notification")))
notification = WebDriverWait(driver, 20).until(
EC.element_to_be_clickable((AppiumBy.ID, "com.lambdatest.proverbial:id/notification"))
)
notification.click()

geolocation = WebDriverWait(driver, 20).until(EC.element_to_be_clickable(
(MobileBy.ID, "com.lambdatest.proverbial:id/geoLocation")))
geolocation = WebDriverWait(driver, 20).until(
EC.element_to_be_clickable((AppiumBy.ID, "com.lambdatest.proverbial:id/geoLocation"))
)
geolocation.click()

home = WebDriverWait(driver, 20).until(EC.element_to_be_clickable(
(MobileBy.ID, "com.lambdatest.proverbial:id/Home")))
home = WebDriverWait(driver, 20).until(
EC.element_to_be_clickable((AppiumBy.ID, "com.lambdatest.proverbial:id/Home"))
)
home.click()

speedTest = WebDriverWait(driver, 20).until(EC.element_to_be_clickable(
(MobileBy.ID, "com.lambdatest.proverbial:id/speedTest")))
speedTest = WebDriverWait(driver, 20).until(
EC.element_to_be_clickable((AppiumBy.ID, "com.lambdatest.proverbial:id/speedTest"))
)
speedTest.click()

home = WebDriverWait(driver, 20).until(EC.element_to_be_clickable(
(MobileBy.ID, "com.lambdatest.proverbial:id/Home")))
home = WebDriverWait(driver, 20).until(
EC.element_to_be_clickable((AppiumBy.ID, "com.lambdatest.proverbial:id/Home"))
)
home.click()

# browser = WebDriverWait(driver, 20).until(EC.element_to_be_clickable(
# (MobileBy.ID, "com.lambdatest.proverbial:id/Browser")))
# browser.click()

# url = WebDriverWait(driver, 20).until(EC.element_to_be_clickable(
# (MobileBy.ID, "com.lambdatest.proverbial:id/url")))
# url.send_keys("https://www.lambdatest.com")

# find = WebDriverWait(driver, 20).until(EC.element_to_be_clickable(
# (MobileBy.ID, "com.lambdatest.proverbial:id/find")))
# find.click()

driver.quit()
except:
driver.quit()

except Exception as e:
print("Test failed:", e)
driver.quit()
67 changes: 38 additions & 29 deletions steps/IosStepDef.py
Original file line number Diff line number Diff line change
@@ -1,82 +1,91 @@
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from appium.webdriver.common.mobileby import MobileBy
from appium.webdriver.common.appiumby import AppiumBy
from appium.options.common import AppiumOptions
import time
from appium import webdriver
from behave import given
import appConfig as appConf
import sys
import os

path = os.getcwd()
sys.path.append(os.path.abspath(os.path.join(path, os.pardir)))


@given("Start the ios app automation test")
def startIOSAppAutomationTest(self):
def startIOSAppAutomationTest(context):

# LambdaTest Credentials
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")

# Appium Options (New way for capabilities)
options = AppiumOptions()
options.load_capabilities(appConf.app_ios_desired_caps)

# Driver Initialization
driver = webdriver.Remote(
command_executor="https://"+username+":" +
accesskey+"@mobile-hub.lambdatest.com/wd/hub",
desired_capabilities=appConf.app_ios_desired_caps
command_executor="https://" + username + ":" + accesskey + "@mobile-hub.lambdatest.com/wd/hub",
options=options
)

try:
colorElement = WebDriverWait(driver, 20).until(
EC.element_to_be_clickable((MobileBy.ACCESSIBILITY_ID, "color")))
EC.element_to_be_clickable((AppiumBy.ACCESSIBILITY_ID, "color"))
)
colorElement.click()

textElement = WebDriverWait(driver, 20).until(
EC.element_to_be_clickable((MobileBy.ACCESSIBILITY_ID, "Text")))
EC.element_to_be_clickable((AppiumBy.ACCESSIBILITY_ID, "Text"))
)
textElement.click()

toastElement = WebDriverWait(driver, 20).until(
EC.element_to_be_clickable((MobileBy.ACCESSIBILITY_ID, "toast")))
EC.element_to_be_clickable((AppiumBy.ACCESSIBILITY_ID, "toast"))
)
toastElement.click()

notification = WebDriverWait(driver, 20).until(
EC.element_to_be_clickable((MobileBy.ACCESSIBILITY_ID, "notification")))
EC.element_to_be_clickable((AppiumBy.ACCESSIBILITY_ID, "notification"))
)
notification.click()

time.sleep(3)

geolocation = WebDriverWait(driver, 20).until(
EC.element_to_be_clickable((MobileBy.ACCESSIBILITY_ID, "geoLocation")))
EC.element_to_be_clickable((AppiumBy.ACCESSIBILITY_ID, "geoLocation"))
)
geolocation.click()

time.sleep(3)

home = WebDriverWait(driver, 20).until(
EC.element_to_be_clickable((MobileBy.ACCESSIBILITY_ID, "Back")))
EC.element_to_be_clickable((AppiumBy.ACCESSIBILITY_ID, "Back"))
)
home.click()

speedTest = WebDriverWait(driver, 20).until(
EC.element_to_be_clickable((MobileBy.ACCESSIBILITY_ID, "speedTest")))
EC.element_to_be_clickable((AppiumBy.ACCESSIBILITY_ID, "speedTest"))
)
speedTest.click()

time.sleep(3)

home = WebDriverWait(driver, 20).until(
EC.element_to_be_clickable((MobileBy.ACCESSIBILITY_ID, "Back")))
EC.element_to_be_clickable((AppiumBy.ACCESSIBILITY_ID, "Back"))
)
home.click()

# browser = WebDriverWait(driver, 20).until(
# EC.element_to_be_clickable((MobileBy.ACCESSIBILITY_ID, "Browser")))
# browser.click()

# url = WebDriverWait(driver, 20).until(
# EC.element_to_be_clickable((MobileBy.ACCESSIBILITY_ID, "url")))
# url.send_keys("https://www.lambdatest.com")

# find = WebDriverWait(driver, 20).until(
# EC.element_to_be_clickable((MobileBy.ACCESSIBILITY_ID, "find")))
# find.click()

driver.quit()
except:
driver.quit()

except Exception as e:
print("Test failed:", e)
driver.quit()
Binary file removed steps/__pycache__/appConfig.cpython-310.pyc
Binary file not shown.
Binary file added steps/__pycache__/appConfig.cpython-314.pyc
Binary file not shown.
Loading