Skip to content

Commit c497507

Browse files
Feat: Add iOS app live session testing and improve app download logic
1 parent e88da45 commit c497507

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

tests/manual/manual_tests.sh

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,18 @@ function download_apps() {
1111
# Skip if Calculator.apk already exists
1212
if [ -f "Calculator.apk" ]; then
1313
echo "Calculator.apk already exists, skipping download"
14-
return
14+
else
15+
local android_app_url="https://www.browserstack.com/app-automate/sample-apps/android/Calculator.apk"
16+
curl -o Calculator.apk $android_app_url
1517
fi
1618

17-
local app_url="https://www.browserstack.com/app-automate/sample-apps/android/Calculator.apk"
18-
curl -o Calculator.apk $app_url
19+
# Skip if BrowserStack-SampleApp.ipa already exists
20+
if [ -f "BrowserStack-SampleApp.ipa" ]; then
21+
echo "BrowserStack-SampleApp.ipa already exists, skipping download"
22+
else
23+
local ios_app_url="https://www.browserstack.com/app-automate/sample-apps/ios/BrowserStack-SampleApp.ipa"
24+
curl -o BrowserStack-SampleApp.ipa $ios_app_url
25+
fi
1926
}
2027

2128
function ensure_deps() {
@@ -86,6 +93,9 @@ function testO11YValidBuild() {
8693
function testAppLive() {
8794
echo "Testing App Live..."
8895
testAppLiveAndroid
96+
# # echo "Sleeping for 5 seconds before starting iOS test..."
97+
# # sleep 5
98+
# testAppLiveiOS
8999
}
90100

91101
function testAppLiveAndroid() {
@@ -101,6 +111,19 @@ function testAppLiveAndroid() {
101111
exit 1
102112
fi
103113
}
114+
function testAppLiveiOS() {
115+
realpath=$(realpath "./BrowserStack-SampleApp.ipa")
116+
response=$(npx @modelcontextprotocol/inspector -e BROWSERSTACK_USERNAME=$_BROWSERSTACK_USERNAME -e BROWSERSTACK_ACCESS_KEY=$_BROWSERSTACK_ACCESS_KEY --cli node dist/index.js --method tools/call --tool-name runAppLiveSession --tool-arg desiredPlatform='ios' --tool-arg desiredPlatformVersion='17.0' --tool-arg appPath="$realpath" --tool-arg desiredPhone='iPhone 15 Pro Max')
117+
118+
echo "Response was: $response"
119+
if echo "$response" | grep -q "Successfully started a session"; then
120+
log_success "Successfully started iOS app live session"
121+
else
122+
log_failure "Failed to start iOS app live session"
123+
echo "Response was: $response"
124+
exit 1
125+
fi
126+
}
104127

105128
function testBrowserLive() {
106129
echo "Testing Browser Live..."
@@ -170,8 +193,8 @@ echo -e "\n\t Starting manual tests...\n\n"
170193

171194
# testO11Y
172195
# sleep 5
173-
# testAppLive
196+
testAppLive
174197
# sleep 5
175198
# testBrowserLive
176199
sleep 5
177-
testAccessibility
200+
# testAccessibility

0 commit comments

Comments
 (0)