taf 0.2.9 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/functions/handlers/base_handler.rb +1 -1
- data/lib/functions/handlers/check_box.rb +1 -1
- data/lib/functions/handlers/check_boxdata.rb +6 -6
- data/lib/functions/handlers/click_button.rb +11 -11
- data/lib/functions/handlers/list_all_dropdowns_values.rb +2 -2
- data/lib/functions/handlers/radio_button.rb +2 -2
- data/lib/functions/handlers/select_dropdown.rb +2 -2
- data/lib/functions/handlers/write_box_data.rb +8 -8
- data/lib/parser/json_parser.rb +2 -2
- data/lib/parser/parser.rb +2 -2
- data/lib/report/report.rb +4 -4
- data/lib/report/report_summary.rb +2 -2
- data/lib/utils/browser.rb +2 -2
- data/lib/utils/create_directories.rb +2 -2
- data/lib/utils/screenshot.rb +2 -2
- data/lib/utils/test_engine.rb +7 -7
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3ff58b175551a2af8c4be802f8f78e01938507f4b2dd05e651a0428a846d006
|
4
|
+
data.tar.gz: 92d745cf353c25157b3cc667a961b3cb98bfdbb851944d68bf79be032aa13281
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c27fad29983e3c9fbdaa059b572b843e557b4d744f5d0fbb5c7b129a507bcdba7c7c2c6d3e3d12317eb0b6789a0a92ba093a11a859d9299815bbee385079a6f
|
7
|
+
data.tar.gz: cb893b463b1c38e20b4d18d08261345f8f774a67a946f707e66917f17642e8bc1340d4cbe4aa939e05fc5f56409b427dd31a98f26de02d73b64fefab10ff37dd
|
@@ -47,7 +47,7 @@ module TestSteps
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def mem_word_check(user, b_title_sucess)
|
50
|
-
if Browser.b.title.eql?('Memorable word')
|
50
|
+
if Browser.b.title.eql?('Memorable word Portal')
|
51
51
|
portal_mem_word(user, b_title_sucess)
|
52
52
|
elsif Browser.b.title.eql?(b_title_sucess)
|
53
53
|
MyLog.log.info("User: #{user} has logged in successful.")
|
@@ -9,7 +9,7 @@ module TestSteps
|
|
9
9
|
checkbox = step_attributes[:testvalue]
|
10
10
|
locate = step_attributes[:locate]
|
11
11
|
|
12
|
-
Browser.b.checkbox(
|
12
|
+
Browser.b.checkbox("#{locate}": checkbox).wait_until(&:exists?).click
|
13
13
|
MyLog.log.info("Check box: #{checkbox} has been selected")
|
14
14
|
true
|
15
15
|
rescue StandardError
|
@@ -11,8 +11,8 @@ module TestSteps
|
|
11
11
|
locate = step_attributes[:locate]
|
12
12
|
|
13
13
|
found_box = [
|
14
|
-
Browser.b.textarea(
|
15
|
-
Browser.b.text_field(
|
14
|
+
Browser.b.textarea("#{locate}": box).exist?,
|
15
|
+
Browser.b.text_field("#{locate}": box).exist?
|
16
16
|
]
|
17
17
|
|
18
18
|
raise 'Multiple matches' if found_box.select { |i| i }.empty?
|
@@ -21,11 +21,11 @@ module TestSteps
|
|
21
21
|
return unless index
|
22
22
|
|
23
23
|
if index.zero?
|
24
|
-
Browser.b.textarea(
|
25
|
-
(Browser.b.textarea(
|
24
|
+
Browser.b.textarea("#{locate}": box).wait_until(&:exists?)
|
25
|
+
(Browser.b.textarea("#{locate}": box).value == value)
|
26
26
|
elsif index == 1
|
27
|
-
Browser.b.text_field(
|
28
|
-
(Browser.b.text_field(
|
27
|
+
Browser.b.text_field("#{locate}": box).wait_until(&:exists?)
|
28
|
+
(Browser.b.text_field("#{locate}": box).value == value)
|
29
29
|
end
|
30
30
|
MyLog.log.info("Textbox: #{box} has the correct value: #{value}")
|
31
31
|
true
|
@@ -12,7 +12,7 @@ module TestSteps
|
|
12
12
|
elms = %i[button span a div link image h1 h2 h3 h4]
|
13
13
|
|
14
14
|
found_button = elms.map do |elm|
|
15
|
-
Browser.b.send(elm,
|
15
|
+
Browser.b.send(elm, "#{locate}": button).exists?
|
16
16
|
end.compact
|
17
17
|
|
18
18
|
raise 'Multiple matches' if found_button.select { |i| i }.empty?
|
@@ -22,25 +22,25 @@ module TestSteps
|
|
22
22
|
|
23
23
|
case index
|
24
24
|
when 0
|
25
|
-
Browser.b.button(
|
25
|
+
Browser.b.button("#{locate}": button).wait_until(&:exists?).click
|
26
26
|
when 1
|
27
|
-
Browser.b.span(
|
27
|
+
Browser.b.span("#{locate}": button).wait_until(&:exists?).click
|
28
28
|
when 2
|
29
|
-
Browser.b.a(
|
29
|
+
Browser.b.a("#{locate}": button).wait_until(&:exists?).click
|
30
30
|
when 3
|
31
|
-
Browser.b.div(
|
31
|
+
Browser.b.div("#{locate}": button).wait_until(&:exists?).click
|
32
32
|
when 4
|
33
|
-
Browser.b.link(
|
33
|
+
Browser.b.link("#{locate}": button).wait_until(&:exists?).click
|
34
34
|
when 5
|
35
|
-
Browser.b.image(
|
35
|
+
Browser.b.image("#{locate}": button).wait_until(&:exists?).click
|
36
36
|
when 6
|
37
|
-
Browser.b.h1(
|
37
|
+
Browser.b.h1("#{locate}": button).wait_until(&:exists?).click
|
38
38
|
when 7
|
39
|
-
Browser.b.h2(
|
39
|
+
Browser.b.h2("#{locate}": button).wait_until(&:exists?).click
|
40
40
|
when 8
|
41
|
-
Browser.b.h3(
|
41
|
+
Browser.b.h3("#{locate}": button).wait_until(&:exists?).click
|
42
42
|
when 9
|
43
|
-
Browser.b.h4(
|
43
|
+
Browser.b.h4("#{locate}": button).wait_until(&:exists?).click
|
44
44
|
end
|
45
45
|
MyLog.log.info("Button: #{button} has been selected")
|
46
46
|
true
|
@@ -9,8 +9,8 @@ module TestSteps
|
|
9
9
|
dropdown = step_attributes[:testvalue]
|
10
10
|
locate = step_attributes[:locate]
|
11
11
|
|
12
|
-
Browser.b.element(
|
13
|
-
Browser.b.select_list(
|
12
|
+
Browser.b.element("#{locate}": dropdown).wait_until(&:exists?)
|
13
|
+
Browser.b.select_list("#{locate}": dropdown).options.each do |i|
|
14
14
|
MyLog.log.info("List of dropdown for #{dropdown} are: #{i.text}")
|
15
15
|
return true
|
16
16
|
end
|
@@ -11,8 +11,8 @@ module TestSteps
|
|
11
11
|
locate = step_attributes[:locate]
|
12
12
|
locate2 = step_attributes[:locate2]
|
13
13
|
|
14
|
-
Browser.b.radio(
|
15
|
-
Browser.b.radio(
|
14
|
+
Browser.b.radio("#{locate}": radio).wait_until(&:exists?)
|
15
|
+
Browser.b.radio("#{locate}": radio, "#{locate2}": value2.to_s).set
|
16
16
|
MyLog.log.info("Radio button: #{radio} has been selected")
|
17
17
|
true
|
18
18
|
rescue StandardError
|
@@ -11,8 +11,8 @@ module TestSteps
|
|
11
11
|
locate = step_attributes[:locate]
|
12
12
|
locate2 = step_attributes[:locate2]
|
13
13
|
|
14
|
-
Browser.b.select_list(
|
15
|
-
Browser.b.select_list(
|
14
|
+
Browser.b.select_list("#{locate}": dropdown).wait_until(&:exists?)
|
15
|
+
Browser.b.select_list("#{locate}": dropdown).option("#{locate2}": value2.to_s).select
|
16
16
|
MyLog.log.info("Dropdown item: #{value2} has been selected")
|
17
17
|
true
|
18
18
|
rescue StandardError
|
@@ -16,9 +16,9 @@ module TestSteps
|
|
16
16
|
|
17
17
|
def self.input_value(box, text, locate)
|
18
18
|
found_box = [
|
19
|
-
Browser.b.textarea(
|
20
|
-
Browser.b.text_field(
|
21
|
-
Browser.b.iframe(
|
19
|
+
Browser.b.textarea("#{locate}": box).exist?,
|
20
|
+
Browser.b.text_field("#{locate}": box).exist?,
|
21
|
+
Browser.b.iframe("#{locate}": box).exist?
|
22
22
|
]
|
23
23
|
|
24
24
|
raise 'Multiple matches' if found_box.select { |i| i }.empty?
|
@@ -27,13 +27,13 @@ module TestSteps
|
|
27
27
|
return unless index
|
28
28
|
|
29
29
|
if index.zero?
|
30
|
-
Browser.b.textarea(
|
31
|
-
(Browser.b.textarea(
|
30
|
+
Browser.b.textarea("#{locate}": box).wait_until(&:exists?).set text
|
31
|
+
(Browser.b.textarea("#{locate}": box).text == text)
|
32
32
|
elsif index == 1
|
33
|
-
Browser.b.text_field(
|
34
|
-
(Browser.b.text_field(
|
33
|
+
Browser.b.text_field("#{locate}": box).wait_until(&:exists?).set text
|
34
|
+
(Browser.b.text_field("#{locate}": box).text == text)
|
35
35
|
elsif index == 2
|
36
|
-
Browser.b.iframe(
|
36
|
+
Browser.b.iframe("#{locate}": box).wait_until(&:exists?).send_keys text
|
37
37
|
end
|
38
38
|
MyLog.log.info("Textbox: #{box} has correct value: #{text}")
|
39
39
|
true
|
data/lib/parser/json_parser.rb
CHANGED
data/lib/parser/parser.rb
CHANGED
data/lib/report/report.rb
CHANGED
@@ -102,12 +102,12 @@ module Report
|
|
102
102
|
return if @consecutive_test_fail < consecutive_fail_threshold
|
103
103
|
|
104
104
|
# write info to stdout
|
105
|
-
MyLog.log.warn "Terminating the current test
|
106
|
-
" the test failure threshold (#{
|
105
|
+
MyLog.log.warn "Terminating the current test file: #{test_file_name} as" \
|
106
|
+
" the test failure threshold (#{$testStepFailures}) has been" \
|
107
107
|
' reached.'
|
108
|
-
MyLog.log.warn '...continuing with the next test
|
108
|
+
MyLog.log.warn '...continuing with the next test file (if there is one)'
|
109
109
|
|
110
110
|
raise FailureThresholdExceeded,
|
111
|
-
"#{
|
111
|
+
"#{$testStepFailures} Test Steps Failed."
|
112
112
|
end
|
113
113
|
end
|
@@ -27,8 +27,8 @@ module ReportSummary
|
|
27
27
|
def self.print_overall_test_summary
|
28
28
|
# output to the console
|
29
29
|
|
30
|
-
MyLog.log.info 'Finished processing all test files
|
31
|
-
"
|
30
|
+
MyLog.log.info 'Finished processing all test files ' \
|
31
|
+
"from the following test folder: #{$testcasesFolder}"
|
32
32
|
MyLog.log.info "Overall Test Summary: \n"
|
33
33
|
@test_step_report_summary.each do |test_step_report_summary|
|
34
34
|
test_step_report_summary.each_line do |line|
|
data/lib/utils/browser.rb
CHANGED
@@ -27,11 +27,11 @@ module Browser
|
|
27
27
|
MyLog.log.error "unable to open selected browser: #{lc_browser_type}"
|
28
28
|
raise BrowserFailedOpen
|
29
29
|
end
|
30
|
-
rescue BrowserFailedOpen =>
|
30
|
+
rescue BrowserFailedOpen => e
|
31
31
|
# construct the error message from custom text and the actual system error
|
32
32
|
# message (converted to a string)
|
33
33
|
error_text = 'Unable to open'\
|
34
|
-
"the requested browser: #{lc_browser_type} " +
|
34
|
+
"the requested browser: #{lc_browser_type} " + e.to_s
|
35
35
|
raise error_text
|
36
36
|
end
|
37
37
|
|
@@ -47,11 +47,11 @@ module CreateDirectories
|
|
47
47
|
# abs_path_run_no_dir = File.absolute_path(runNoDir)
|
48
48
|
FileUtils.mkdir_p(abs_path_screenshot_dir)
|
49
49
|
# if any issues then set error message and re-raise the exception
|
50
|
-
rescue StandardError =>
|
50
|
+
rescue StandardError => e
|
51
51
|
# construct the error message from custom text and the actual system error
|
52
52
|
# message (converted to a string)
|
53
53
|
error_to_display = 'Error creating the test directory structure or' \
|
54
|
-
' opening the test results file : ' +
|
54
|
+
' opening the test results file : ' + e.to_s
|
55
55
|
raise error_to_display
|
56
56
|
else
|
57
57
|
# if no exception then return the screenshot file directory path
|
data/lib/utils/screenshot.rb
CHANGED
@@ -32,9 +32,9 @@ module Screenshot
|
|
32
32
|
end
|
33
33
|
|
34
34
|
# if any issues with saving the screenshot then log a warning
|
35
|
-
rescue StandardError =>
|
35
|
+
rescue StandardError => e
|
36
36
|
# construct the error message from custom text and the actual system
|
37
37
|
# error message (converted to a string).
|
38
|
-
MyLog.log.warn("Error saving the screenshot: #{sc_file_name} #{
|
38
|
+
MyLog.log.warn("Error saving the screenshot: #{sc_file_name} #{e}")
|
39
39
|
end
|
40
40
|
end
|
data/lib/utils/test_engine.rb
CHANGED
@@ -22,10 +22,10 @@ module TestEngine
|
|
22
22
|
tests = Parser.read_test_data(test_file_name)
|
23
23
|
# if unable to read the test data, show the error and move onto the
|
24
24
|
# next file (if there is one)
|
25
|
-
rescue StandardError =>
|
26
|
-
MyLog.log.warn 'Terminating the current test
|
27
|
-
"#{test_file_name} #{
|
28
|
-
MyLog.log.info '...continuing with the next test
|
25
|
+
rescue StandardError => e
|
26
|
+
MyLog.log.warn 'Terminating the current test spec: ' \
|
27
|
+
"#{test_file_name} #{e}"
|
28
|
+
MyLog.log.info '...continuing with the next test file (if there is one)'
|
29
29
|
end
|
30
30
|
|
31
31
|
# create project folders - these only need creating once per test suite
|
@@ -46,9 +46,9 @@ module TestEngine
|
|
46
46
|
Screenshot.save_screenshot(parsed_steps[:screenShotData],
|
47
47
|
parsed_steps)
|
48
48
|
end
|
49
|
-
rescue TafError =>
|
50
|
-
warn
|
51
|
-
MyLog.log.warn
|
49
|
+
rescue TafError => e
|
50
|
+
warn e
|
51
|
+
MyLog.log.warn e
|
52
52
|
end
|
53
53
|
|
54
54
|
# get the test case end time
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: taf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Perrett
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|