Add save all transactions functionality#1214
Merged
Merged
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
cortinico
approved these changes
May 6, 2024
cortinico
left a comment
Member
There was a problem hiding this comment.
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() |
Member
There was a problem hiding this comment.
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
Comment on lines
+16
to
+17
| ): Boolean { | ||
| return withContext(Dispatchers.IO) { |
Member
There was a problem hiding this comment.
Suggested change
| ): Boolean { | |
| return withContext(Dispatchers.IO) { | |
| ): Boolean = withContext(Dispatchers.IO) { |
Comment on lines
+430
to
+431
| ): Source { | ||
| return when (type) { |
Member
There was a problem hiding this comment.
Suggested change
| ): Source { | |
| return when (type) { | |
| ): Source = when (type) { |
| HAR -> saveHarToFile.launch(EXPORT_HAR_FILE_NAME) | ||
| } | ||
| }, | ||
| onNegativeClick = null, |
Contributor
Author
There was a problem hiding this comment.
There is no action on dismiss (old actions also set this listener as null)
Contributor
Author
|
@cortinico updated PR |
cortinico
approved these changes
May 8, 2024
This was referenced Dec 10, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📷 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.