-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added SaveCookiesToDisk function and tests in cdpu package. (#477)
**Added:** - SaveCookiesToDisk function in chrome.go: New function to retrieve cookies from the current session and write them to a file, with parameters for site and file path. - Test cases for SaveCookiesToDisk in chrome_test.go: Added a series of tests to ensure the proper functionality of SaveCookiesToDisk, including a successful scenario and an error case for file writing. **Changed:** - chrome.go: Included "encoding/json" package for JSON marshaling of cookies. - chrome_test.go: Increased test coverage by validating cookie file creation and handling error scenarios in SaveCookiesToDisk function. **Notes:** - The tests navigate to Google and attempt to save cookies, verifying the file creation and error handling in different scenarios. - The SaveCookiesToDisk function enhances the cdpu package by offering a convenient way to save browser cookies to a file.
- Loading branch information
Showing
8 changed files
with
213 additions
and
68 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.