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 +4 -4
- data/HISTORY.md +9 -0
- data/lib/closer/config.rb +4 -0
- data/lib/closer/helpers/capture.rb +5 -11
- data/lib/closer/helpers/capybara.rb +1 -1
- data/lib/closer/helpers/driver.rb +40 -49
- data/lib/closer/helpers/drivers/chrome.rb +17 -0
- data/lib/closer/helpers/snapshots/db_dump.rb +1 -1
- data/lib/closer/version.rb +1 -1
- data/lib/closer.rb +1 -2
- metadata +3 -3
- data/lib/closer/coverage/rcov_formatter.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9f7e1bdd6894caafae58187ee513c17f9b6a66e6dd4e3c98808f0eef97477db
|
4
|
+
data.tar.gz: 1cca731a5f73e65df1654c291de06715452936df46b0eb8cf3f636de34e42e5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35fa23d0395e1e677026fb46e11338818f450d64bdbc9ca52508adddd941181845745f59711e66413ad23410f9e4af9b21fc0844d4dfc778d7fd75dd3e6b2a49
|
7
|
+
data.tar.gz: '080857e1382aa55d8a2fe8d007fc1f85dc3da2318967677d806f785f2ab7c6a57c3524aec89e7f4efdb3d610dce276a12e2108b3e87f2353ed8262f9e7a8574d'
|
data/HISTORY.md
CHANGED
data/lib/closer/config.rb
CHANGED
@@ -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, :
|
29
|
+
page.driver.save_screenshot(image, full: true)
|
31
30
|
|
32
31
|
attrs = {
|
33
|
-
:
|
34
|
-
:
|
35
|
-
:
|
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
|
-
|
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
|
@@ -1,61 +1,52 @@
|
|
1
1
|
require 'capybara'
|
2
2
|
require 'selenium-webdriver'
|
3
3
|
|
4
|
-
|
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
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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
|
-
:
|
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
|
-
|
36
|
+
Capybara::Selenium::Driver.new(
|
37
|
+
app,
|
38
|
+
browser: :firefox,
|
39
|
+
options: options
|
40
|
+
)
|
22
41
|
end
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
Capybara.
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
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)
|
data/lib/closer/version.rb
CHANGED
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
|
-
|
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.
|
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-
|
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
|