taf 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/functions/handlers/base_handler.rb +2 -0
- data/lib/functions/handlers/browser_back.rb +1 -0
- data/lib/functions/handlers/browser_forward.rb +1 -0
- data/lib/functions/handlers/browser_quit.rb +1 -0
- data/lib/functions/handlers/browser_refresh.rb +1 -0
- data/lib/functions/handlers/capture_alert.rb +1 -0
- data/lib/functions/handlers/check_box.rb +1 -0
- data/lib/functions/handlers/check_boxdata.rb +1 -0
- data/lib/functions/handlers/check_browser_title.rb +1 -0
- data/lib/functions/handlers/check_logs.rb +1 -0
- data/lib/functions/handlers/check_screendata.rb +1 -0
- data/lib/functions/handlers/check_url.rb +1 -0
- data/lib/functions/handlers/click_button.rb +1 -0
- data/lib/functions/handlers/execute_system_command.rb +1 -0
- data/lib/functions/handlers/handle_browser_window.rb +1 -0
- data/lib/functions/handlers/ipause.rb +1 -0
- data/lib/functions/handlers/list_all_dropdowns_values.rb +1 -0
- data/lib/functions/handlers/login.rb +1 -0
- data/lib/functions/handlers/open_url.rb +1 -0
- data/lib/functions/handlers/ping_test.rb +1 -0
- data/lib/functions/handlers/radio_button.rb +1 -0
- data/lib/functions/handlers/select_dropdown.rb +3 -1
- data/lib/functions/handlers/send_special_keys.rb +1 -0
- data/lib/functions/handlers/write_box_data.rb +11 -10
- data/lib/main.rb +1 -1
- data/lib/report/report.rb +6 -3
- data/lib/utils/logger.rb +1 -1
- 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: 58fdfb7b11f94ebd4ecd06d200a119f8241250bcc2f488b3bb94ae5f251546cf
|
4
|
+
data.tar.gz: ff1c43e96ee2c1616c0ed15a3524bd37045000121da45be3eedb64d8ec479eb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86db648a0fbf86aa9d05f1ee3470133aca0ff0fdc24399c406fd001376a0277345474203bb191a6606dc3836d44f84f33d257ddf81bbed3424a3baa5115a5233
|
7
|
+
data.tar.gz: 3b9b9ada89869672854e9b1558238c0ccbb4a64ff077bfdef858fc9bda8dd7fc7a4d1b342733e894735427eaa2b4e21378d52b6580115cccef659384d4fd6e3f
|
@@ -1,8 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# Base Hanfer file to contain all shared login functions
|
3
4
|
module TestSteps
|
4
5
|
require_relative '../../taf_config.rb'
|
5
6
|
module Handlers
|
7
|
+
# All Login functions function.
|
6
8
|
class Base
|
7
9
|
def self.register(name)
|
8
10
|
TestSteps.handlers[name.to_s] = self
|
@@ -4,6 +4,7 @@ require_relative 'base_handler'
|
|
4
4
|
|
5
5
|
module TestSteps
|
6
6
|
module Handlers
|
7
|
+
# Select Dropdown function.
|
7
8
|
class SelectDropdown < Base
|
8
9
|
register :select_dropdown
|
9
10
|
|
@@ -14,7 +15,8 @@ module TestSteps
|
|
14
15
|
locate2 = step_attributes[:locate2]
|
15
16
|
|
16
17
|
Browser.b.select_list("#{locate}": dropdown).wait_until(&:exists?)
|
17
|
-
Browser.b.select_list("#{locate}": dropdown).option("#{locate2}":
|
18
|
+
Browser.b.select_list("#{locate}": dropdown).option("#{locate2}":
|
19
|
+
value2.to_s).select
|
18
20
|
MyLog.log.info("Dropdown item: #{value2} has been selected")
|
19
21
|
true
|
20
22
|
rescue StandardError
|
@@ -4,6 +4,7 @@ require_relative 'base_handler'
|
|
4
4
|
|
5
5
|
module TestSteps
|
6
6
|
module Handlers
|
7
|
+
# Write box data function.
|
7
8
|
class WriteBoxdata < Base
|
8
9
|
register :write_box_data
|
9
10
|
|
@@ -12,11 +13,11 @@ module TestSteps
|
|
12
13
|
value = step_attributes[:testvalue2]
|
13
14
|
locate = step_attributes[:locate]
|
14
15
|
|
15
|
-
|
16
|
-
WriteBoxdata.input_value(box,
|
16
|
+
txt = ENV[value.to_s] || step_attributes[:testvalue2]
|
17
|
+
WriteBoxdata.input_value(box, txt, locate)
|
17
18
|
end
|
18
19
|
|
19
|
-
def self.input_value(box,
|
20
|
+
def self.input_value(box, txt, locate)
|
20
21
|
found_box = [
|
21
22
|
Browser.b.textarea("#{locate}": box).exist?,
|
22
23
|
Browser.b.text_field("#{locate}": box).exist?,
|
@@ -29,18 +30,18 @@ module TestSteps
|
|
29
30
|
return unless index
|
30
31
|
|
31
32
|
if index.zero?
|
32
|
-
Browser.b.textarea("#{locate}": box).wait_until(&:exists?).set
|
33
|
-
(Browser.b.textarea("#{locate}": box).text ==
|
33
|
+
Browser.b.textarea("#{locate}": box).wait_until(&:exists?).set txt
|
34
|
+
(Browser.b.textarea("#{locate}": box).text == txt)
|
34
35
|
elsif index == 1
|
35
|
-
Browser.b.text_field("#{locate}": box).wait_until(&:exists?).set
|
36
|
-
(Browser.b.text_field("#{locate}": box).text ==
|
36
|
+
Browser.b.text_field("#{locate}": box).wait_until(&:exists?).set txt
|
37
|
+
(Browser.b.text_field("#{locate}": box).text == txt)
|
37
38
|
elsif index == 2
|
38
|
-
Browser.b.iframe("#{locate}": box).wait_until(&:exists?).send_keys
|
39
|
+
Browser.b.iframe("#{locate}": box).wait_until(&:exists?).send_keys txt
|
39
40
|
end
|
40
|
-
MyLog.log.info("Textbox: #{box} has correct value: #{
|
41
|
+
MyLog.log.info("Textbox: #{box} has correct value: #{txt}")
|
41
42
|
true
|
42
43
|
rescue StandardError
|
43
|
-
MyLog.log.warn("Textbox: #{box} has the incorrect value: #{
|
44
|
+
MyLog.log.warn("Textbox: #{box} has the incorrect value: #{txt}")
|
44
45
|
false
|
45
46
|
rescue StandardError
|
46
47
|
MyLog.log.warn("Textbox: #{box} does not exist")
|
data/lib/main.rb
CHANGED
data/lib/report/report.rb
CHANGED
@@ -22,7 +22,8 @@ module Report
|
|
22
22
|
|
23
23
|
step = {
|
24
24
|
'id' => test_step_idx,
|
25
|
-
'classname' => "SuiteID: #{$testId} Test Step: #{test_step_idx}
|
25
|
+
'classname' => "SuiteID: #{$testId} Test Step: #{test_step_idx} "\
|
26
|
+
"#{test_desc}",
|
26
27
|
'name' => test_desc,
|
27
28
|
'file' => test_file_name
|
28
29
|
}
|
@@ -49,7 +50,8 @@ module Report
|
|
49
50
|
$testStepFailures += 1
|
50
51
|
MyLog.log.info "Test #{test_step_idx} has FAILED ".red
|
51
52
|
failstep = {
|
52
|
-
'message' => "SuiteID: #{$testId} Test Step: #{test_step_idx} Test has
|
53
|
+
'message' => "SuiteID: #{$testId} Test Step: #{test_step_idx} Test has"\
|
54
|
+
' FAILED - Check logs',
|
53
55
|
'type' => 'FAILURE',
|
54
56
|
'file' => test_file_name
|
55
57
|
}
|
@@ -66,7 +68,8 @@ module Report
|
|
66
68
|
$testStepNotrun += 1
|
67
69
|
MyLog.log.info "Test #{test_step_idx} no checks performed ".blue
|
68
70
|
skipstep = {
|
69
|
-
'message' => "SuiteID: #{$testId} Test Step: #{test_step_idx} No
|
71
|
+
'message' => "SuiteID: #{$testId} Test Step: #{test_step_idx} No"\
|
72
|
+
' checks performed - Check logs',
|
70
73
|
'type' => 'SKIPPED',
|
71
74
|
'file' => test_file_name
|
72
75
|
}
|
data/lib/utils/logger.rb
CHANGED
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: taf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Perrett
|
@@ -164,7 +164,7 @@ dependencies:
|
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '6.16'
|
167
|
-
description: Test Automation Framework (TAF) to allow simple
|
167
|
+
description: Test Automation Framework (TAF) to allow simple testweb automation -
|
168
168
|
external use
|
169
169
|
email:
|
170
170
|
executables:
|