-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add wrappers for native XCTest video recorder #858
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
|
succeeded in getting a file to the local file.mp4. hm, no method to delete stored file via |
It's actually .mov rather than .mp4:
Regarding file deletion, I've added a workaround https://github.com/appium/WebDriverAgent/pull/858/files#diff-f437ff5a0a8b42227214d5e8edf7bba1aa8ca97eb4a9632f8f95394996b19b7eR49, although I can only observe files are deleted after WDA quits completely (calling From native API perspective it is only possible to initiate file deletion via
protocol. This protocol is solely implemented by |
I confirmed when the WDA process ended with the shutdown endpoint, the created files were removed |
i wonder if we should block this endpoint for real devices with a security flag to avoid accidental usage at least in appium-xcuitest layer let me check if reset device (erase all data) could remove remained files [update] lgtm, overall |
@Dan-Maor Do you have anything to add? |
Sorry, it has been a hectic few days at the office so I wasn't able to look into it. I would like to run some tests with my devices, however I'm working from home today and the device I have here at the moment failed to start recording with a "does not support screen recording" error (iOS 15.7). I will be at the office tomorrow and will run some tests as soon as I can. |
this is expected. The feature has been added by Apple only since Xcode 15/iOS 17 |
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.
Looks good to me overall, however I did notice that files are actually not removed when stopping the test on my 17.4 device. Give that at this point devicectl does not allow file removal and the only way to remove these is a factory reset, I tend to agree with @KazuCocoa that allowing recording should be enabled by a flag to avoid accidental usage, at least until a way can be found to remove the recordings.
🎉 This PR is included in version 7.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The XCUITest Driver already had a method to record the screen, which would also make available a stream of the screen. This new feature is just about recording the screen or can it also be used to stream it in a better way? |
It cannot be used for streaming as we only get the recorded video at the very end when we call the stop API |
It is a resurrection of #724 with some major changes.
I was able to figure out that videos are actually available, but cannot be fetched directly from WDA. Instead they are stored into the testmanagerd's container. On Simulators the path looks like
$HOME/Library/Developer/CoreSimulator/Devices/F8E1968A-8443-4A9A-AB86-27C54C36A2F6/data/Containers/Data/InternalDaemon/4E3FE8DF-AD0A-41DA-B6EC-C35E5798C219/Attachments/A044DAF7-4A58-4CD5-95C3-29B4FE80C377
Where
$HOME/Library/Developer/CoreSimulator/Devices/F8E1968A-8443-4A9A-AB86-27C54C36A2F6/
is the common Simulators containers root,InternalDaemon/4E3FE8DF-AD0A-41DA-B6EC-C35E5798C219/Attachments
is the com.apple.testmanagerd 's domain and theA044DAF7-4A58-4CD5-95C3-29B4FE80C377
is the attachment UUID, which is uniquely assigned to each screen recording future upon startup.With the above knowledge we can already fetch these videos from simulators. Need to only figure out how to get the access to this container for real devices...