closer 0.13.1 → 0.13.3

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: 0ab4a2e742711a7019e7882ac2ed0713112545d0b04c1167b455ea573bf06097
4
- data.tar.gz: 0f4648e0ea9f93c1bc489045db5579d3e3344241b6e0d36272323567ac880dc3
3
+ metadata.gz: e9f7e1bdd6894caafae58187ee513c17f9b6a66e6dd4e3c98808f0eef97477db
4
+ data.tar.gz: 1cca731a5f73e65df1654c291de06715452936df46b0eb8cf3f636de34e42e5a
5
5
  SHA512:
6
- metadata.gz: 9d86c120eb3b645b6c156a09cccfc4cf41cfff87a8abc0a37cddd2a26a827606c792b46d73cdf61a8619a4d45415604a0c943ddef5fb859ac06dcf37baa174e4
7
- data.tar.gz: 4e81e54b70954af95094e24c30f8d58ee800010a9b9601b2d355213fa462a52e31b0bd1b8c859818faed745b80908cb712716619261a77eb295f8eaa5c5b95b2
6
+ metadata.gz: 35fa23d0395e1e677026fb46e11338818f450d64bdbc9ca52508adddd941181845745f59711e66413ad23410f9e4af9b21fc0844d4dfc778d7fd75dd3e6b2a49
7
+ data.tar.gz: '080857e1382aa55d8a2fe8d007fc1f85dc3da2318967677d806f785f2ab7c6a57c3524aec89e7f4efdb3d610dce276a12e2108b3e87f2353ed8262f9e7a8574d'
data/HISTORY.md CHANGED
@@ -1,3 +1,12 @@
1
+ # 0.13.3
2
+ Release Date: 2024-12-22
3
+ * add --no-tablespaces option to mysqldump
4
+ * drop support for travis
5
+
6
+ # 0.13.2
7
+ Release Date: 2024-12-20
8
+ * drop support for poltergeist
9
+
1
10
  # 0.13.1
2
11
  Release Date: 2024-11-10
3
12
  * use --publish-quiet option
data/lib/closer/config.rb CHANGED
@@ -8,6 +8,10 @@ class Closer::Config
8
8
  ENV['MERGE_TIMEOUT'] || 3600
9
9
  end
10
10
 
11
+ def remote?
12
+ true_value?(ENV['REMOTE'])
13
+ end
14
+
11
15
  private
12
16
 
13
17
  def true_value?(value)
@@ -19,7 +19,6 @@ module Closer
19
19
 
20
20
  unless options.fetch(:force, false)
21
21
  return if ENV['FORMAT'] == 'junit'
22
- return if ENV['CI'] == 'travis'
23
22
  end
24
23
 
25
24
  url = Rack::Utils.unescape(current_url)
@@ -27,12 +26,12 @@ module Closer
27
26
  @@_screen_count += 1
28
27
 
29
28
  image = File.join(IMAGE_DIR, "#{@@_screen_count}.png")
30
- page.driver.save_screenshot(image, :full => true)
29
+ page.driver.save_screenshot(image, full: true)
31
30
 
32
31
  attrs = {
33
- :class => 'screenshot',
34
- :src => "#{File.basename(IMAGE_DIR)}/#{File.basename(image)}",
35
- :alt => url
32
+ class: 'screenshot',
33
+ src: "#{File.basename(IMAGE_DIR)}/#{File.basename(image)}",
34
+ alt: url
36
35
  }
37
36
  attrs[:title] = options[:title] if options[:title]
38
37
 
@@ -58,12 +57,7 @@ module Closer
58
57
  end
59
58
 
60
59
  def resize_window(width, height)
61
- case Capybara.current_driver
62
- when :poltergeist
63
- Capybara.current_session.driver.resize(width, height)
64
- when :selenium
65
- Capybara.current_session.driver.browser.manage.window.resize_to(width, height)
66
- end
60
+ page.driver.browser.manage.window.resize_to(width, height)
67
61
  end
68
62
 
69
63
  def flash_image_tags
@@ -2,7 +2,7 @@ require 'capybara'
2
2
  Capybara.default_selector = :css
3
3
  Capybara.server = :puma, {Silent: true} if defined?(Puma)
4
4
 
5
- if ENV['CI'] == 'travis'
5
+ if ENV['REMOTE']
6
6
  Capybara.server_host = '127.0.0.1'
7
7
  Capybara.server_port = '3000'
8
8
  end
@@ -1,61 +1,52 @@
1
1
  require 'capybara'
2
2
  require 'selenium-webdriver'
3
3
 
4
- require_relative 'drivers/file_detector'
4
+ Dir::glob(File.join(File.dirname(__FILE__), 'drivers', '*.rb')).each do |file|
5
+ require_relative "drivers/#{File.basename(file)}"
6
+ end
5
7
 
6
8
  Capybara.default_driver = (ENV['DRIVER'] || 'firefox').to_sym
7
9
 
8
- if ENV['CI'] == 'travis'
9
- caps = Selenium::WebDriver::Remote::Capabilities.__send__(Capybara.default_driver, {
10
- 'tunnel-identifier' => ENV['TRAVIS_JOB_NUMBER']
11
- })
12
- caps.platform = ENV['PLATFORM'] unless ENV['PLATFORM'].empty?
13
-
14
- Capybara.register_driver Capybara.default_driver do |app|
10
+ case Capybara.default_driver
11
+ when :chrome
12
+ Capybara.register_driver :chrome do |app|
13
+ driver = Capybara::Selenium::Driver.new(app,
14
+ browser: :chrome
15
+ )
16
+ end
17
+ when :firefox
18
+ Capybara.register_driver :firefox do |app|
15
19
  driver = Capybara::Selenium::Driver.new(app,
16
- :browser => :remote,
17
- :url => "http://#{ENV['SAUCE_USERNAME']}:#{ENV['SAUCE_ACCESS_KEY']}@ondemand.saucelabs.com/wd/hub",
18
- :capabilities => caps
20
+ browser: :firefox
19
21
  )
22
+ end
23
+ when :headless_chrome
24
+ Capybara.register_driver :headless_chrome do |app|
25
+ Capybara::Selenium::Driver.new(
26
+ app,
27
+ browser: :chrome,
28
+ options: Closer::Drivers::Chrome.options
29
+ )
30
+ end
31
+ when :headless_firefox
32
+ Capybara.register_driver :headless_firefox do |app|
33
+ options = Selenium::WebDriver::Firefox::Options.new
34
+ options.args << '--headless'
20
35
 
21
- Closer::Drivers::FileDetector.apply(driver)
36
+ Capybara::Selenium::Driver.new(
37
+ app,
38
+ browser: :firefox,
39
+ options: options
40
+ )
22
41
  end
23
- else
24
- case Capybara.default_driver
25
- when :chrome
26
- Capybara.register_driver :chrome do |app|
27
- driver = Capybara::Selenium::Driver.new(app,
28
- browser: :chrome
29
- )
30
- end
31
- when :firefox
32
- Capybara.register_driver :firefox do |app|
33
- driver = Capybara::Selenium::Driver.new(app,
34
- browser: :firefox
35
- )
36
- end
37
- when :headless_chrome
38
- Capybara.register_driver :headless_chrome do |app|
39
- options = Selenium::WebDriver::Chrome::Options.new
40
- options.add_argument('headless')
41
- options.add_argument('disable-gpu')
42
- options.add_argument('no-sandbox')
43
- Capybara::Selenium::Driver.new(
44
- app,
45
- browser: :chrome,
46
- options: options
47
- )
48
- end
49
- when :headless_firefox
50
- Capybara.register_driver :headless_firefox do |app|
51
- options = Selenium::WebDriver::Firefox::Options.new
52
- options.args << '--headless'
53
-
54
- Capybara::Selenium::Driver.new(
55
- app,
56
- browser: :firefox,
57
- options: options
58
- )
59
- end
42
+ when :remote_chrome
43
+ Capybara.register_driver :remote_chrome do |app|
44
+
45
+ Capybara::Selenium::Driver.new(
46
+ app,
47
+ browser: :remote,
48
+ url: 'http://127.0.0.1:4444/wd/hub',
49
+ options: Closer::Drivers::Chrome.options
50
+ )
60
51
  end
61
52
  end
@@ -0,0 +1,17 @@
1
+ module Closer
2
+ module Drivers
3
+ class Chrome
4
+
5
+ def self.options
6
+ options = Selenium::WebDriver::Chrome::Options.new
7
+ options.add_argument('disable-dev-shm-usage')
8
+ options.add_argument('disable-gpu')
9
+ options.add_argument('headless=new')
10
+ options.add_argument('no-sandbox')
11
+ options.add_argument('window-size=1280,720')
12
+ options
13
+ end
14
+
15
+ end
16
+ end
17
+ end
@@ -41,7 +41,7 @@ class DbDump
41
41
  filepath = File.join(dump_dir, "#{database}-#{Time.now.strftime('%Y-%m-%d_%H%M')}.dump.gz")
42
42
 
43
43
  FileUtils.mkdir_p(File.dirname(filepath))
44
- system("mysqldump -u #{user} -p#{password} -h #{host} #{database} | gzip > #{filepath}")
44
+ system("mysqldump -u #{user} -p#{password} -h #{host} #{database} --no-tablespaces | gzip > #{filepath}")
45
45
  end
46
46
 
47
47
  def load_mysql(dump_file)
@@ -1,3 +1,3 @@
1
1
  module Closer
2
- VERSION = '0.13.1'
2
+ VERSION = '0.13.3'
3
3
  end
data/lib/closer.rb CHANGED
@@ -14,8 +14,7 @@ end
14
14
  if Closer.config.coverage_enabled?
15
15
  require 'simplecov'
16
16
  require 'simplecov-rcov'
17
- require 'closer/coverage/rcov_formatter'
18
- SimpleCov.formatter = Closer::Coverage::RcovFormatter
17
+ SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
19
18
  SimpleCov.command_name(ENV['COMMAND_NAME'] || 'Cucumber')
20
19
  SimpleCov.merge_timeout(Closer.config.merge_timeout)
21
20
  SimpleCov.start
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: closer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.1
4
+ version: 0.13.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ichy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-08 00:00:00.000000000 Z
11
+ date: 2024-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -110,7 +110,6 @@ files:
110
110
  - closer.gemspec
111
111
  - lib/closer.rb
112
112
  - lib/closer/config.rb
113
- - lib/closer/coverage/rcov_formatter.rb
114
113
  - lib/closer/cucumber_ext.rb
115
114
  - lib/closer/cucumber_ext/compiler.rb
116
115
  - lib/closer/formatter/html.rb
@@ -118,6 +117,7 @@ files:
118
117
  - lib/closer/helpers/capture.rb
119
118
  - lib/closer/helpers/capybara.rb
120
119
  - lib/closer/helpers/driver.rb
120
+ - lib/closer/helpers/drivers/chrome.rb
121
121
  - lib/closer/helpers/drivers/file_detector.rb
122
122
  - lib/closer/helpers/multi_test.rb
123
123
  - lib/closer/helpers/snapshot.rb
@@ -1,18 +0,0 @@
1
- require 'simplecov-rcov'
2
-
3
- module Closer
4
- module Coverage
5
- class RcovFormatter < SimpleCov::Formatter::RcovFormatter
6
-
7
- private
8
-
9
- def write_file(template, output_filename, binding)
10
- rcov_result = template.result(binding).force_encoding('UTF-8')
11
-
12
- File.open( output_filename, "w" ) do |file_result|
13
- file_result.write rcov_result
14
- end
15
- end
16
- end
17
- end
18
- end