ferrum-har 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +18 -7
- data/lib/ferrum/har/page_extension.rb +2 -1
- data/lib/ferrum/har/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46ed855d025e19faa838772982f3b4e4bf6be389750445d91ff45a240e17da2b
|
4
|
+
data.tar.gz: 5604f75db7e5fe01ea8d406377c5325ddf59761eef503ebd8e72f581b6cd0017
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d16fa7164a200c6eecfd06f51f751f335c38222c95077a3a89ca6923557decab9d4a174846c160b36539be22c42651c024194699a7f861816f13badaec3d37bb
|
7
|
+
data.tar.gz: 0522dec550b943209ea34edf0991915cd90f23f382e64a8a593eede11f2dfa0fc806534831224e7ca63911654ab95d29acf7751495b238f1f740b81673d2f1c6
|
data/README.md
CHANGED
@@ -4,9 +4,10 @@ ferrum-har
|
|
4
4
|
[](https://img.shields.io/gem/v/ferrum-har?color=green)
|
5
5
|
|
6
6
|
[ferrum-har](https://github.com/hlascelles/ferrum-har) is a gem that adds the ability to capture
|
7
|
-
HAR files while running tests
|
7
|
+
[HAR](https://en.wikipedia.org/wiki/HAR_(file_format)) files while running tests
|
8
|
+
using [ferrum](https://github.com/rubycdp/ferrum).
|
8
9
|
|
9
|
-
|
10
|
+
## Installation
|
10
11
|
|
11
12
|
Add ferrum-har to your Gemfile and `bundle install`:
|
12
13
|
|
@@ -14,13 +15,14 @@ Add ferrum-har to your Gemfile and `bundle install`:
|
|
14
15
|
gem "ferrum-har"
|
15
16
|
```
|
16
17
|
|
17
|
-
|
18
|
+
## Usage
|
18
19
|
|
19
20
|
Use [ferrum](https://github.com/rubycdp/ferrum) as normal and call the `har` method on
|
20
|
-
the `page` (or `browser`) object.
|
21
|
+
the `page` (or `browser`) object. You will have to use some of the required browser options
|
21
22
|
by using the `Ferrum::Har::REQUIRED_BROWSER_OPTIONS` constant.
|
22
23
|
|
23
|
-
Note, the devtools window in Chrome will be opened
|
24
|
+
Note, the devtools window in Chrome will be opened for the duration of the ferrum test run.
|
25
|
+
This is mandatory to obtain the HAR from Chrome.
|
24
26
|
|
25
27
|
```ruby
|
26
28
|
browser = Ferrum::Browser.new(
|
@@ -33,7 +35,7 @@ page.go_to("https://www.bbc.co.uk")
|
|
33
35
|
puts page.har
|
34
36
|
```
|
35
37
|
|
36
|
-
|
38
|
+
## How it works
|
37
39
|
|
38
40
|
Creating a HAR file from [ferrum](https://github.com/rubycdp/ferrum) network objects is complex and
|
39
41
|
potentially incompatible with the HAR generated
|
@@ -56,7 +58,16 @@ by the `Ferrum::Har::REQUIRED_BROWSER_OPTIONS` constant.
|
|
56
58
|
For further reading, a full list of Chrome switches can be found
|
57
59
|
[here](https://peter.sh/experiments/chromium-command-line-switches/).
|
58
60
|
|
59
|
-
|
61
|
+
## Upgrading
|
62
|
+
|
63
|
+
`ferrum-har` uses [semantic versioning](https://semver.org/), so major version changes will usually
|
64
|
+
require additional actions to be taken upgrading from one major version to another.
|
65
|
+
|
66
|
+
## Changelog
|
67
|
+
|
68
|
+
A full changelog can be found here: [CHANGELOG.md](https://github.com/hlascelles/ferrum-har/blob/master/CHANGELOG.md)
|
69
|
+
|
70
|
+
## Further work
|
60
71
|
|
61
72
|
Some ideas for improvements.
|
62
73
|
|
@@ -14,7 +14,8 @@ module Ferrum
|
|
14
14
|
execute("document.ferrumHarRequested = true;")
|
15
15
|
base64_encoded_har = Ferrum::Utils::Attempt.with_retry(
|
16
16
|
errors: [HarNotReadyError],
|
17
|
-
|
17
|
+
# 10 seconds
|
18
|
+
max: 20,
|
18
19
|
wait: 0.5
|
19
20
|
) do
|
20
21
|
found = evaluate("document.ferrumHar;")
|
data/lib/ferrum/har/version.rb
CHANGED