-
-
Notifications
You must be signed in to change notification settings - Fork 373
Add save all transactions functionality #1214
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
Conversation
* Impacted screen: Main transaction list * New UI elements: Save buttons (grouped, separated from share buttons with the divider) * Save options: Text file, HAR file * Internal: Create FileSaver object for file writing
* Add kotlinx-coroutines-test dependency * Test verifies correct file content is written using the provided URI
Add a line to the unreleased block about save all transactions to the file
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.
Thanks for sending this over @irakliy01
I believe we can include this 👍
assertThat(file.length()).isEqualTo(TEST_FILE_CONTENT.length) | ||
assertThat(file.readText()).isEqualTo(TEST_FILE_CONTENT) | ||
|
||
file.delete() |
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 you delete the file here? YOu should instead use a JUnit temp folder if you're afraid this will pollute other test runs
): Boolean { | ||
return withContext(Dispatchers.IO) { |
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.
): Boolean { | |
return withContext(Dispatchers.IO) { | |
): Boolean = withContext(Dispatchers.IO) { |
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.
Corrected
): Source { | ||
return when (type) { |
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.
): Source { | |
return when (type) { | |
): Source = when (type) { |
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.
Corrected
HAR -> saveHarToFile.launch(EXPORT_HAR_FILE_NAME) | ||
} | ||
}, | ||
onNegativeClick = null, |
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 unneceesary?
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.
There is no action on dismiss (old actions also set this listener as null)
@cortinico updated PR |
📷 Screenshots
📄 Context
I usually test my apps on an emulator that isn't connected to Google services. This means I can't directly share transactions with others, as I don't have suitable apps for that purpose. Instead, it's much easier for me to save transactions locally and then share the file from my computer using Device Explorer.
Chucker only supported sharing transaction details as text or HAR but lacked direct file saving capabilities (you could save only a one request/response body).
This PR adds a feature to save all transactions on the local storage. New save buttons are located within share menu separated from share buttons group by divider.
📝 Changes
🛠️ How to test
Click on the share button in the app bar and then click on save as text / save as .har file. Check created files in a directory you specified.