qat-web 6.1.3 → 7.0.0.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/qat/web/browser/html_dump.rb +16 -3
- data/lib/qat/web/browser/screenshot.rb +16 -4
- data/lib/qat/web/hooks/html_dump.rb +1 -1
- data/lib/qat/web/hooks/screenshot.rb +1 -1
- data/lib/qat/web/version.rb +1 -1
- metadata +12 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0aadd76d0544542a1d7b1ec9a392ddbc5049fb6f137a8f9d65f816ad1a277281
|
4
|
+
data.tar.gz: 1947029c65e7cec67c756e23092b72d5da026bf400996c67f61d1d5c43ee2ca0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f23e24e6e48a67fb47cb9cbf9ece4f9ff2c6da5ee0e0cc5474a2c3a590908dfd740c3369500741798013a0f73fec4ea612ce1aead9d76c654ba0bca9b9dda867
|
7
|
+
data.tar.gz: af97afa92c26af6a3153099b4698373865659aa5155a6e82c1a92ed3b6d9bfcab49a78324bc955db1f92f625600e764cf3b0fc310897a1271be01fa7a532ed46
|
@@ -17,23 +17,36 @@ module QAT::Web
|
|
17
17
|
#@return [String/NilClass] File path to where the HTML dump file was saved or nil if the browser doesn't support HTML dumps
|
18
18
|
#@since 1.0.0
|
19
19
|
def take_html_dump(page=Capybara.current_session, path=html_dump_path)
|
20
|
-
log.info { "Saving HTML dump to #{path}" }
|
21
20
|
raise ArgumentError.new "File #{path} already exists! Choose another filename" if ::File.exists? path
|
22
|
-
|
21
|
+
log.info { "Saving HTML dump to #{path}" }
|
22
|
+
path = read_html_dump page ,path
|
23
23
|
log.info { "HTML dump available" }
|
24
|
-
|
24
|
+
path
|
25
25
|
rescue Capybara::NotSupportedByDriverError
|
26
26
|
log.warn { "Driver #{page.mode} does not support HTML dumps!" }
|
27
27
|
return nil
|
28
28
|
end
|
29
29
|
|
30
|
+
|
31
|
+
##Helper for reading file, in cucumber 6 this could be reverted to path directly
|
32
|
+
def read_html_dump page, dump_path
|
33
|
+
file = page.save_page dump_path
|
34
|
+
dump_path_read = File.open file
|
35
|
+
dump_path_read.read
|
36
|
+
end
|
37
|
+
|
30
38
|
#Default HTML dump path. Can be set with {#html_dump_path=}.
|
31
39
|
#@return [String] HTML dump path
|
32
40
|
#@since 1.0.0
|
41
|
+
|
33
42
|
def html_dump_path
|
34
43
|
@html_dump_path || ::File.join('public', "browser_#{Time.new.strftime("%H%M%S%L")}.html")
|
35
44
|
end
|
36
45
|
|
46
|
+
def html_dump_filename
|
47
|
+
File.basename(@html_dump_path)
|
48
|
+
end
|
49
|
+
|
37
50
|
#Set new default HTML dump path.
|
38
51
|
#@param path [String] HTML dump path
|
39
52
|
#@since 1.0.0
|
@@ -16,17 +16,29 @@ module QAT::Web
|
|
16
16
|
#@param path [String] File path to save screenshot file
|
17
17
|
#@return [String/NilClass]File path to where the screenshot file was saved or nil if the browser doesn't support screenshots
|
18
18
|
#@since 1.0.0
|
19
|
-
def take_screenshot page=Capybara.current_session,
|
20
|
-
log.info {"Saving screenshot to #{path}"}
|
19
|
+
def take_screenshot page = Capybara.current_session , path = screenshot_path
|
20
|
+
log.info { "Saving screenshot to #{path}" }
|
21
21
|
raise ArgumentError.new "File #{path} already exists! Choose another filename" if ::File.exists? path
|
22
|
-
path = page
|
23
|
-
log.info {"Screenshot available"}
|
22
|
+
path = read_screenshot_file page, path
|
23
|
+
log.info { "Screenshot available" }
|
24
24
|
path
|
25
25
|
rescue Capybara::NotSupportedByDriverError
|
26
26
|
log.warn {"Driver #{page.mode} does not support screenshots!"}
|
27
27
|
return nil
|
28
28
|
end
|
29
29
|
|
30
|
+
##Helper for reading file, in cucumber 6 this could be reverted to path directly
|
31
|
+
def read_screenshot_file page, image_path
|
32
|
+
file = page.save_page image_path
|
33
|
+
image_path_read = File.open file
|
34
|
+
image_path_read.read
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
def screenshot_filename
|
39
|
+
File.basename(@screenshot_path)
|
40
|
+
end
|
41
|
+
|
30
42
|
#Default screenshot path. Can be set with {#screenshot_path=}.
|
31
43
|
#@return [String] Screenshot path
|
32
44
|
#@since 1.0.0
|
@@ -15,7 +15,7 @@ After do |scenario|
|
|
15
15
|
if scenario.failed?
|
16
16
|
if QAT::Web::Exceptions::HTML_DUMP.any? { |exception| scenario.exception.kind_of?(exception) }
|
17
17
|
# Embeds an existing HTML dump to Cucumber's HTML report
|
18
|
-
|
18
|
+
attach(QAT::Web::Browser::HTMLDump.take_html_dump, 'text/html')
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -14,7 +14,7 @@ end
|
|
14
14
|
After do |scenario|
|
15
15
|
if scenario.failed?
|
16
16
|
if QAT::Web::Exceptions::SCREENSHOT.any? { |exception| scenario.exception.kind_of?(exception) }
|
17
|
-
|
17
|
+
attach QAT::Web::Browser::Screenshot.take_screenshot, 'image/png'
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
data/lib/qat/web/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qat-web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 7.0.0.rc.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- QAT
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: qat-cucumber
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 7.0.3
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 7.0.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: qat-devel
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '8.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '8.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: headless
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -126,14 +126,14 @@ dependencies:
|
|
126
126
|
requirements:
|
127
127
|
- - "~>"
|
128
128
|
- !ruby/object:Gem::Version
|
129
|
-
version: '
|
129
|
+
version: '8.0'
|
130
130
|
type: :runtime
|
131
131
|
prerelease: false
|
132
132
|
version_requirements: !ruby/object:Gem::Requirement
|
133
133
|
requirements:
|
134
134
|
- - "~>"
|
135
135
|
- !ruby/object:Gem::Version
|
136
|
-
version: '
|
136
|
+
version: '8.0'
|
137
137
|
- !ruby/object:Gem::Dependency
|
138
138
|
name: little-plugger
|
139
139
|
requirement: !ruby/object:Gem::Requirement
|
@@ -295,15 +295,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
295
295
|
requirements:
|
296
296
|
- - "~>"
|
297
297
|
- !ruby/object:Gem::Version
|
298
|
-
version: '2.
|
298
|
+
version: '2.5'
|
299
299
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
300
300
|
requirements:
|
301
|
-
- - "
|
301
|
+
- - ">"
|
302
302
|
- !ruby/object:Gem::Version
|
303
|
-
version:
|
303
|
+
version: 1.3.1
|
304
304
|
requirements: []
|
305
|
-
|
306
|
-
rubygems_version: 2.7.7
|
305
|
+
rubygems_version: 3.0.8
|
307
306
|
signing_key:
|
308
307
|
specification_version: 4
|
309
308
|
summary: QAT-Web is a browser controller for Web testing
|