-
-
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
[plugin-mobile-app] Add steps to record performance data on iOS devices #1988
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1988 +/- ##
=========================================
Coverage 96.34% 96.34%
- Complexity 5396 5400 +4
=========================================
Files 764 765 +1
Lines 15483 15499 +16
Branches 1032 1032
=========================================
+ Hits 14917 14933 +16
Misses 442 442
Partials 124 124
Continue to review full report at Codecov.
|
...dus-plugin-mobile-app/src/main/java/org/vividus/bdd/mobileapp/steps/IOSInstrumentsSteps.java
Outdated
Show resolved
Hide resolved
...dus-plugin-mobile-app/src/main/java/org/vividus/bdd/mobileapp/steps/IOSInstrumentsSteps.java
Outdated
Show resolved
Hide resolved
...dus-plugin-mobile-app/src/main/java/org/vividus/bdd/mobileapp/steps/IOSInstrumentsSteps.java
Outdated
Show resolved
Hide resolved
args.put(PROFILE_NAME, instrument); | ||
|
||
File traceZip = new File(path); | ||
String b64Zip = (String) getWebDriver().executeScript("mobile: stopPerfRecord", args); |
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.
what if I forget to stop recording by the end of scenario? can it lead to resource leaks?
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 data is recorder by appium. I haven't seen any information about possibility of memory leaks.
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.
My question was about consequences if we don't stop performance recording, is the recording just aborted if we close the session?
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.
Yeah, recording will be aborted on Appium session close.
|
||
File traceZip = new File(path); | ||
String b64Zip = (String) getWebDriver().executeScript("mobile: stopPerfRecord", args); | ||
byte[] bytesZip = Base64.getMimeDecoder().decode(b64Zip); |
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.
why do we need mime decoder here?
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 don't know. I don't familiar with encode/decode functionality. I just reused official appium's approach to work with such data.
* @param path Path to the location for saving the screenshot | ||
* @throws IOException If an input or output exception occurred | ||
*/ | ||
@When("I stop recording '$instrument' metrics and save data to '$path'") |
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 unclear how these results could be helpful, should we import them into instruments manually?
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.
Is possible to parse the results and push some HTML attachment into allure?
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.
Result is *.trace file. It could be opened by Xcode Instrument application to see data in visual format. Also it is possible to parse this data into xml format using xcrun xctrace Xcode's utility
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.
Am I correct that in your case you're parsing perf results with xctrace and validating XML? If that so. could you please submit a short user guide on that here:
https://github.com/vividus-framework/vividus/tree/master/docs/modules/guides
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.
We don't actually measure performance of application now, but use this functional only for collecting custom development metrics which where added into code. I don't think it will be useful. I added link to documentation for xctrace utility with examples of usage
...dus-plugin-mobile-app/src/main/java/org/vividus/bdd/mobileapp/steps/IOSInstrumentsSteps.java
Outdated
Show resolved
Hide resolved
...dus-plugin-mobile-app/src/main/java/org/vividus/bdd/mobileapp/steps/IOSInstrumentsSteps.java
Outdated
Show resolved
Hide resolved
...dus-plugin-mobile-app/src/main/java/org/vividus/bdd/mobileapp/steps/IOSInstrumentsSteps.java
Outdated
Show resolved
Hide resolved
...dus-plugin-mobile-app/src/main/java/org/vividus/bdd/mobileapp/steps/IOSInstrumentsSteps.java
Outdated
Show resolved
Hide resolved
{ | ||
if (!webDriverManager.isIOS()) | ||
{ | ||
throw new IllegalStateException("Step is only supported on IOS devices"); |
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.
is it applicable for iOS real devices only? or simulators are in scope as well?
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.
Simulators are in scope
...dus-plugin-mobile-app/src/main/java/org/vividus/bdd/mobileapp/steps/IOSInstrumentsSteps.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Valery Yatsynovich <valfirst@yandex.ru>
When I stop recording `$instrument` metrics and save results to file `$path` | ||
---- | ||
|
||
. `$instrument` - The instrument of Xcode Instruments utility |
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 believe it was already mentioned in the previous comments, but not fixed yet: please enumerate the available instruments or provide the link how to find the list
When I stop recording `$instrument` metrics and save results to file `$path` | ||
---- | ||
|
||
. `$instrument` - The instrument of Xcode Instruments utility |
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.
. `$instrument` - The instrument of Xcode Instruments utility | |
. `$instrument` - The instrument of Xcode Instruments utility. |
---- | ||
|
||
. `$instrument` - The instrument of Xcode Instruments utility | ||
. `$path` - Path to save archive with collected 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.
. `$path` - Path to save archive with collected data | |
. `$path` - The path to the file to save an archive with collected data. |
|
||
private void checkIOS() | ||
{ | ||
Validate.isTrue(webDriverManager.isIOS()); |
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.
please put some message here so that users can understand the error
Closes #1789