-
-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
add support of mobitru screen recording feature #5307
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5307 +/- ##
=========================================
Coverage 97.63% 97.64%
- Complexity 6941 6967 +26
=========================================
Files 958 961 +3
Lines 20153 20224 +71
Branches 1323 1323
=========================================
+ Hits 19676 19747 +71
Misses 368 368
Partials 109 109 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also please make sure Codecov is happy
...dus-plugin-mobitru/src/main/java/org/vividus/mobitru/recording/MobitruRecordingListener.java
Outdated
Show resolved
Hide resolved
...dus-plugin-mobitru/src/main/java/org/vividus/mobitru/recording/MobitruRecordingListener.java
Outdated
Show resolved
Hide resolved
String stopDeviceScreenRecording(String deviceId) throws MobitruOperationException; | ||
|
||
/** | ||
* Stop the screen recording on the device with specified UDID. | ||
* | ||
* @param recordingId The ID of the recording artifact | ||
* @return Binary content of the recording artifact. | ||
* @throws MobitruOperationException In case of any issues during start the recording. | ||
*/ | ||
byte[] downloadDeviceScreenRecording(String recordingId) throws MobitruOperationException; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in facade it makes sense to have a single method stopDeviceScreenRecording
that will return a POJO with the recording ID and its binary content
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean to add bute[] content
field to org.vividus.mobitru.client.model.ScreenRecording and then specify it in the facade method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about Mobitru REST API and its mapping to model ScreenRecording
, probably there should be another POJO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but downloadDeviceScreenRecording API call just returns a byte array.
how this another POJO should look like in this case ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just create a new object in the code from the results of 2 API calls
public record ScreenRecording(String recordingId, byte[] content)
{
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean that I should have 2 screen recording classes?
because, right now, I already have org.vividus.mobitru.client.model.ScreenRecording, which is using as DTO for result of stopRecording API and it contains recordingId only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean that I should have 2 screen recording classes?
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -46,6 +51,7 @@ public Map<String, Object> getExtraCapabilities(DesiredCapabilities desiredCapab | |||
{ | |||
deviceId = mobitruFacade.takeDevice(desiredCapabilities); | |||
mobitruFacade.installApp(deviceId, appFileName, installApplicationOptions); | |||
testContext.put(KEY, deviceId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess device ID should be available in session capabilities, thus I would avoid managing this data on test data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've checked and it's not avaialble
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Web iOS - capabilities from server:
I guess, it is
{ "appium:dc" : "US", "appium:networkConnectionEnabled" : false, "appium:takesScreenshot" : true, "appium:automationName" : "XCUITest", "appium:locationContextEnabled" : false, "appium:platformVersion" : "17.3", "appium:webDriverAgentUrl" : "http://mstf-node:7504", "appium:databaseEnabled" : false, "appium:udid" : "00008130-001958513EBA001C", "browserName" : "Safari", "appium:webStorageEnabled" : false, "appium:deviceName" : "IPHONE iPhone16,1", "appium:javascriptEnabled" : true, "platformName" : "IOS" }
appium:udid
, isn't it? - Web Android - capabilities from server:
{ "appium:dc" : "US", "appium:chromedriverPort" : 37415, "appium:takesScreenshot" : true, "appium:warnings" : { }, "appium:desired" : { "browserName" : "Chrome", "goog:chromeOptions" : { "args" : [ ], "extensions" : [ ] }, "platformName" : "Android", "platformVersion" : "14", "deviceName" : "SAMSUNG SM-S928U1", "udid" : "127.0.0.1:37293", "dc" : "US", "chromedriverExecutableDir" : "/mount/chromedriver", "chromedriverPort" : 37415 }, "appium:deviceApiLevel" : 34, "appium:locationContextEnabled" : false, "appium:deviceScreenSize" : "1080x2340", "appium:deviceManufacturer" : "samsung", "appium:chromedriverExecutableDir" : "/mount/chromedriver", "appium:udid" : "127.0.0.1:37293", "appium:pixelRatio" : 2.8125, "goog:chromeOptions" : { "args" : [ ], "extensions" : [ ] }, "browserName" : "Chrome", "platformName" : "ANDROID", "appium:networkConnectionEnabled" : true, "appium:deviceScreenDensity" : 450, "appium:viewportRect" : { "left" : 0, "top" : 76, "width" : 1080, "height" : 2146 }, "appium:deviceModel" : "SM-S928U1", "appium:platformVersion" : "14", "appium:databaseEnabled" : false, "appium:deviceUDID" : "127.0.0.1:37293", "appium:statBarHeight" : 76, "appium:webStorageEnabled" : false, "appium:appActivity" : "com.google.android.apps.chrome.Main", "appium:deviceName" : "SAMSUNG SM-S928U1", "appium:javascriptEnabled" : true, "appium:appPackage" : "com.android.chrome" }
appium:deviceUDID
looks incorrect, is it Mobitru bug? - Native mobile iOS app - capabilities from server:
I guess, it is
{ "appium:dc" : "CIS", "appium:networkConnectionEnabled" : false, "mobitru-device-search:manufacturer" : "IPAD", "appium:takesScreenshot" : true, "appium:automationName" : "XCUITest", "appium:locationContextEnabled" : false, "appium:platformVersion" : "17.2", "appium:webDriverAgentUrl" : "http://mstf-node:7480", "mobitru-device-search:model" : "iPad", "appium:databaseEnabled" : false, "appium:udid" : "00008020-000669981A43002E", "appium:webStorageEnabled" : false, "appium:deviceName" : "IPAD iPad11,1", "appium:javascriptEnabled" : true, "platformName" : "IOS", "mobitru-device-search:type" : "tablet" }
appium:udid
, isn't it? - Native Android app - capabilities from server:
the same as for web Android
{ "appium:dc" : "EU", "appium:chromedriverPort" : 45497, "appium:takesScreenshot" : true, "appium:warnings" : { }, "appium:desired" : { "mobitru-device-search:type" : "phone", "platformName" : "Android", "mobitru-device-search:manufacturer" : "SAMSUNG", "udid" : "127.0.0.1:42833", "automationName" : "UIAutomator2", "platformVersion" : "12", "deviceName" : "SAMSUNG SM-A525F", "dc" : "EU", "chromedriverExecutableDir" : "/mount/chromedriver", "chromedriverPort" : 45497 }, "appium:deviceApiLevel" : 31, "appium:automationName" : "UIAutomator2", "appium:locationContextEnabled" : false, "appium:deviceScreenSize" : "1080x2400", "appium:deviceManufacturer" : "samsung", "appium:chromedriverExecutableDir" : "/mount/chromedriver", "appium:udid" : "127.0.0.1:42833", "appium:pixelRatio" : 2.625, "platformName" : "ANDROID", "mobitru-device-search:type" : "phone", "appium:networkConnectionEnabled" : true, "mobitru-device-search:manufacturer" : "SAMSUNG", "appium:deviceScreenDensity" : 420, "appium:viewportRect" : { "left" : 0, "top" : 87, "width" : 1080, "height" : 2099 }, "appium:deviceModel" : "SM-A525F", "appium:platformVersion" : "12", "appium:databaseEnabled" : false, "appium:deviceUDID" : "127.0.0.1:42833", "appium:statBarHeight" : 87, "appium:webStorageEnabled" : false, "appium:deviceName" : "SAMSUNG SM-A525F", "appium:javascriptEnabled" : true }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes and please look at p.4 where there is no real UDID of the Device:
"udid" : "127.0.0.1:42833", "appium:udid" : "127.0.0.1:42833", "appium:deviceUDID" : "127.0.0.1:42833",
only IPs
the same for Android web
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so obviously it's a Mobitru bug, I believe many people are affected, is this bug going to be fixed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not a bug, because this option is not required by official Appium capabilities and, according to this, this situation doesn't affect our users
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a bug because 127.0.0.1:42833
is not UDID, if this option is not mandatory, then it could be removed, but as it's present, it contains invalid value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the bug has been reported to Support, nevertheless, there should be some class which represents Mobitru storage, e.g. MobitruTestContext
, so that data sharing won't happen by re-using key and access test context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not a bug :) because ip:port as UDID is the normal behaviour for Android adb connection over network (not usb):
more details can be found here https://developer.android.com/tools/adb#:~:text=Confirm%20that%20your%20host%20computer%20is%20connected%20to%20the%20target%20device%3A
perform stop and download actions in the same method inside MobitruFacade
…d or driver is not initialized
Tested in #5318 |
No description provided.