Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
ferrum-har is a gem that adds the ability to capture HAR files while running tests using ferrum.
Add ferrum-har to your Gemfile and bundle install
:
gem "ferrum-har"
Use ferrum as normal and call the har
method on
the page
(or browser
) object. Chrome must be used as the browser engine.
Note, the devtools window in Chrome will be opened by ferrum-har for the duration of the ferrum test run. This is mandatory to obtain the HAR from Chrome.
browser = Ferrum::Browser.new
page = browser.create_page
page.go_to("https://www.bbc.co.uk")
page.network.wait_for_idle
# Returns the HAR as a JSON string
puts page.har
Creating a HAR file from ferrum network objects is complex and potentially incompatible with the HAR generated by other tools (including Chrome).
Instead, ferrum-har contains a small Chrome extension that
is automatically loaded into the test browser. When the har
method is called, this extension
asks the Chrome devtools Network panel for the HAR file and returns it to the Ruby process. This
means the HAR is always a valid version of exactly what Chrome would produce.
The JS method that is ultimately called is chrome.devtools.network.getHAR()
and you can read more
about it here.
One ramification of this is that the Chrome devtools must be open for the extension to work.
To get the extension to be loaded we must pass some switches to the Chrome process via ferrum,
specifically the --auto-open-devtools-for-tabs
and --load-extension
switches. This is done
by ferrum-har automatically.
For further reading, a full list of Chrome switches can be found here.
ferrum-har
uses semantic versioning, so major version changes will usually
require additional actions to be taken upgrading from one major version to another.
A full changelog can be found here: CHANGELOG.md
Some ideas for improvements.
"user-data-dir=profile" => "somedir"
And have a "Default/Preferences" file in there that contains a sizing element like this:
{
"devtools": {
"preferences": {
"inspector-view.split-view-state": "{\"vertical\":{\"size\":1},\"horizontal\":{\"size\":0}}"
}
}
}
However, that doesn't work as it stands as it is just a partial profile. We could add an entire
Chrome profile but that would be hundreds of files.FAQs
Unknown package
We found that ferrum-har demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.