browsertime 19.3.0 → 19.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Browsertime changelog (we do [semantic versioning](https://semver.org))
2
2
 
3
+ ## 19.3.1 - 2023-12-18
4
+ ### Fixed
5
+ * Ensure that visual metrics python script is included in the release.
6
+
3
7
  ## 19.3.0 - 2023-12-18
4
8
 
5
9
  ### Added
package/README.md CHANGED
@@ -185,6 +185,8 @@ Join our community! Whether you need help, want to share your experience, or dis
185
185
 
186
186
  - **Slack**: Connect with fellow users and the development team on [Slack](https://join.slack.com/t/sitespeedio/shared_invite/zt-296jzr7qs-d6DId2KpEnMPJSQ8_R~WFw).
187
187
  - **GitHub Issues**: For technical questions, feature requests, and bug reports, use our [GitHub issues](https://github.com/sitespeedio/browsertime/issues).
188
+ - **RSS/Changelog**: Latest releases and information can always be found in our [RSS feed](https://github.com/sitespeedio/browsertime/releases.atom) and in our [changelog](https://github.com/sitespeedio/browsertime/blob/main/CHANGELOG.md).
189
+ - **Mastodon**: Follow us on Mastodon [https://fosstodon.org/@sitespeedio](https://fosstodon.org/@sitespeedio).
188
190
 
189
191
  We're excited to have you in our community and look forward to your contributions and interactions!
190
192
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "browsertime",
3
3
  "description": "Get performance metrics from your web page using Browsertime.",
4
- "version": "19.3.0",
4
+ "version": "19.3.1",
5
5
  "bin": "./bin/browsertime.js",
6
6
  "type": "module",
7
7
  "dependencies": {
@@ -56,7 +56,7 @@
56
56
  "bin",
57
57
  "browserscripts",
58
58
  "browsersupport",
59
- "browsertime",
59
+ "visualmetrics",
60
60
  "browsertime.png",
61
61
  "docs",
62
62
  "index.js",
@@ -0,0 +1 @@
1
+ #
@@ -0,0 +1,34 @@
1
+ import unittest
2
+ import os
3
+
4
+ from browsertime.visualmetrics import (
5
+ calculate_contentful_speed_index,
6
+ calculate_perceptual_speed_index,
7
+ )
8
+
9
+ HERE = os.path.dirname(__file__)
10
+
11
+
12
+ class TestVisualMetrics(unittest.TestCase):
13
+ def setUp(self):
14
+ self.directory = "test_data"
15
+ images = os.listdir(os.path.join(HERE, self.directory))
16
+
17
+ def _p(image):
18
+ p = {}
19
+ p["time"] = int(image.split(".")[0].split("ms_")[-1])
20
+ return p
21
+
22
+ progress = [_p(image) for image in images if image.startswith("ms_")]
23
+ self.sorted_progress = sorted(progress,
24
+ key = lambda image: image['time'])
25
+
26
+ def test_calculate_contentful_speed_index(self):
27
+ res = calculate_contentful_speed_index(self.sorted_progress,
28
+ self.directory)
29
+ self.assertEqual(res[0], 1188)
30
+
31
+ def test_calculate_perceptual_speed_index(self):
32
+ res = calculate_perceptual_speed_index(self.sorted_progress,
33
+ self.directory)
34
+ self.assertEqual(res[0], 946)