playwright-runner 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb83cf6ffdbe44db313ffa0df1f4d4ea4bcec52d9e1794180c4743b4be5ccf36
4
- data.tar.gz: f5e1161fe4e70c3341eb5061762c48d1268101fd233bcb949ff4e8e5ee59a03e
3
+ metadata.gz: 96731975daab3c59ab001fb663aadfdd3cdc79b79af624f24823fd886624908e
4
+ data.tar.gz: 61b9e76b66eab8488d5569988726cee661c0fc9e2ad4549fe8fe3faf49c0c688
5
5
  SHA512:
6
- metadata.gz: ffbf52ebc42b1c0c32261a839dfc2d6f62f2b21371153c83873e665efba28f5745a38230d9874cbf3563b589bdbd581aba91cfa10e83924988cb6da8b8b72bd5
7
- data.tar.gz: 3ca59db2b366e4d034da55c82caeaff811cf86a3d9862616a55dab221e87a692adc5111700215e5bae04020ffbb3c9c30ba2ef43e931b1c45d7792fc28ed7649
6
+ metadata.gz: 470deb264f7e15c05ced9c9021e4e0efad66f5b2e36f797f75a69a21f7fc5ff938899e1499aa4bf1709f61ef51ae442835d8d230ec4818d230596021e2e311c2
7
+ data.tar.gz: a75b6871098d4954b84579a9059141e92daea649cfaf30ee68fd6bfe47fd1f2707fa583a3ec7162a2fd7b80e52af94afebc980e8d8aa3b0f2efc200c44030514
data/.rubocop.yml CHANGED
@@ -7,6 +7,9 @@ require:
7
7
  - rubocop-performance
8
8
  - rubocop-rake
9
9
 
10
+ Metrics/BlockLength:
11
+ Max: 50
12
+
10
13
  Metrics/MethodLength:
11
14
  Max: 100
12
15
 
data/README.md CHANGED
@@ -9,7 +9,7 @@ This module is intended to provide useful toolset for [Re:VIEW](https://reviewml
9
9
  Add this line to your application's Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'playwrightrunner'
12
+ gem 'playwright-runner'
13
13
  ```
14
14
 
15
15
  And then execute:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PlaywrightRunner
4
- VERSION = '1.0.0'
4
+ VERSION = '1.1.0'
5
5
  end
@@ -24,9 +24,20 @@ module PlaywrightRunner
24
24
  Dir.glob(File.join(src, '*.html')).each do |entry|
25
25
  id = File.basename(entry).sub('.html', '')
26
26
  page.goto("file:///#{File.absolute_path(entry)}")
27
- page.locator('svg').click # to wait drawn
27
+ page.locator('svg').wait_for(state: 'visible')
28
+ sleep(1)
29
+ 1.upto(4) do
30
+ bounds = page.locator('svg').bounding_box
31
+
32
+ unless bounds
33
+ sleep(1)
34
+ next
35
+ end
36
+
37
+ page.pdf(path: File.join(dest, '__PLAYWRIGHT_TMP__.pdf'))
38
+ break
39
+ end
28
40
 
29
- page.pdf(path: File.join(dest, '__PLAYWRIGHT_TMP__.pdf'))
30
41
  Open3.capture2e(config[:pdfcrop_path],
31
42
  File.join(dest, '__PLAYWRIGHT_TMP__.pdf'),
32
43
  File.join(dest, "#{id}.pdf"))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playwright-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenshi Muto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-02 00:00:00.000000000 Z
11
+ date: 2023-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: playwright-ruby-client