pg_rails 7.0.8.pre.alpha.7 → 7.0.8.pre.alpha.8

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: d8f126e13d79df593c4bd8937c76e7fc25527652f260d2138bf52df73d213c7b
4
- data.tar.gz: 6b160b15eefeda86ac7998f763d71f4bc0caf628c790cfba324dfa4e22a2d91d
3
+ metadata.gz: 8b3571f15d522de34ce58f735dd40b7dd3b44bc2f8292233dbcc5e451dd49f7a
4
+ data.tar.gz: 315e2de0d4c61085eaf12fb48bc2298d928e1909c2546a9bfda57e8e3e9c88ed
5
5
  SHA512:
6
- metadata.gz: b6cd37778885c293d2d828fb24f8fdbe0445c50bb95a28fc4e180d926095662e8c255e670ed0669fd59984ae33ced01968287b920e2fda626ac7bd0431345853
7
- data.tar.gz: cc7b67726322563822a559f4dfb977abe3366edc5d1270206bbad8db022a18f62a8e9e45e2b971c470cf80c9915c14b971b77c008b1eecd6dbfa8024f3fb2463
6
+ metadata.gz: 305ac09bdf7ac2a6172f71979253e8dbf90123d5c4218d5ffda7ab7a035052271ea9c6c9f3f182a7b76064075294ba2e71e3b157b49461753b954a762f9d1de4
7
+ data.tar.gz: 7d4744860de97968cd3e67710bd859a64e4610dcca69439daba8a05422fd6b8d092fbf56ef55eddee79aacc9a43154d7545b481bde7060c492694bdefebfb843
@@ -1,5 +1,6 @@
1
1
  @use 'sass:color';
2
2
 
3
+ // TODO: Quitar .pg-form?
3
4
  .pg-form {
4
5
  .pg_associable {
5
6
  .limpiar {
@@ -17,6 +17,10 @@ input[disabled] {
17
17
  color: black;
18
18
  }
19
19
 
20
+ form label {
21
+ font-weight: bold;
22
+ }
23
+
20
24
  .form-control,
21
25
  .form-select {
22
26
  border: 1px solid #a7b7bb;
@@ -0,0 +1,50 @@
1
+ def add_emulate_device(browser_options, emulate_device)
2
+ if emulate_device == 'notebook'
3
+ browser_options.add_emulation(device_metrics: { width: 800, height: 400, pixelRatio: 1, touch: true })
4
+ else
5
+ browser_options.add_emulation(device_name: emulate_device)
6
+ end
7
+
8
+ browser_options
9
+ end
10
+
11
+ def default_options(headless:)
12
+ options = Selenium::WebDriver::Chrome::Options.new
13
+ options.args << '--disable-site-isolation-trials'
14
+ # options.args << '--start-maximized'
15
+
16
+ if headless
17
+ options.args << '--headless'
18
+ options.args << '--disable-gpu' if Gem.win_platform?
19
+ end
20
+
21
+ options
22
+ end
23
+
24
+ def chrome_driver_gen(headless: true, emulate_device: nil, debugger: false)
25
+ lambda do |app|
26
+ Capybara::Selenium::Driver.load_selenium
27
+ browser_options = default_options(headless:)
28
+
29
+ if debugger
30
+ port = ENV.fetch('CHROME_PORT') { '9014' }
31
+ browser_options.debugger_address = "127.0.0.1:#{port}"
32
+ end
33
+
34
+ browser_options = add_emulate_device(browser_options, emulate_device) if emulate_device
35
+
36
+ Capybara::Selenium::Driver.new(app, browser: :chrome, options: browser_options)
37
+ end
38
+ end
39
+
40
+ Capybara.register_driver :selenium_chrome, &chrome_driver_gen(headless: false)
41
+ Capybara.register_driver :selenium_chrome_notebook, &chrome_driver_gen(headless: false, emulate_device: 'notebook')
42
+ Capybara.register_driver :selenium_chrome_iphone, &chrome_driver_gen(headless: false, emulate_device: 'iPhone 6')
43
+ Capybara.register_driver :selenium_chrome_headless, &chrome_driver_gen(headless: true)
44
+ Capybara.register_driver :selenium_chrome_headless_notebook,
45
+ &chrome_driver_gen(headless: true, emulate_device: 'notebook')
46
+ Capybara.register_driver :selenium_chrome_headless_iphone,
47
+ &chrome_driver_gen(headless: true, emulate_device: 'iPhone 6')
48
+ Capybara.register_driver :selenium_chrome_debugger, &chrome_driver_gen(headless: false, debugger: true)
49
+
50
+ Capybara.javascript_driver = ENV.fetch('WEBDRIVER') { 'selenium_chrome_notebook' }.to_sym
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.0.8-alpha.7'
4
+ VERSION = '7.0.8-alpha.8'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.8.pre.alpha.7
4
+ version: 7.0.8.pre.alpha.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso
@@ -156,6 +156,7 @@ files:
156
156
  - pg_layout/lib/pg_layout/engine.rb
157
157
  - pg_rails/js/index.js
158
158
  - pg_rails/lib/pg_rails.rb
159
+ - pg_rails/lib/pg_rails/capybara_support.rb
159
160
  - pg_rails/lib/version.rb
160
161
  - pg_rails/scss/pg_rails.scss
161
162
  - pg_scaffold/lib/generators/pg_active_record/model/model_generator.rb