taf 0.2.3 → 0.2.4
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/open_url.rb +13 -4
- data/lib/functions/handlers/write_box_data.rb +15 -7
- data/lib/report/junit_report.rb +3 -14
- data/lib/version.rb +1 -1
- metadata +3 -7
- data/lib/functions/handlers/insert_value_config.rb +0 -27
- data/lib/functions/handlers/switch_iframe.rb +0 -23
- data/lib/functions/handlers/write_to_editor.rb +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7708523ab29d3c19ee1d77c632c8059b22bd5f0bc53c4f1c44cdcaad3bdde2de
|
4
|
+
data.tar.gz: b37e08f02f1e1898e1bbd0c1acdd1c7d66d654885ec3dff5f8fe63a366236be2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69bfe9f27d479f1bbc0cdf409ff6b86c134a49ad5f74cba6c0e28e8dd0b2389447645bfaa2de6c329eecc415106451e6c6a4e79e701f29508ed34cc4716ed1ad
|
7
|
+
data.tar.gz: b8fe981921bab3a1f71cb354b64a4a140dc5a30d16872e54f7029f51758d23b9f785443dae70c643535cc6f5697ca2a3af97d805b3616990d438adcaaf914a0b
|
@@ -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 ')
|
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,14 +9,23 @@ module TestSteps
|
|
9
9
|
url = step_attributes[:testvalue]
|
10
10
|
|
11
11
|
Browser.open_browser
|
12
|
+
|
13
|
+
url = if ENV[url]
|
14
|
+
ENV[url.to_s]
|
15
|
+
else
|
16
|
+
step_attributes[:testvalue]
|
17
|
+
end
|
12
18
|
Browser.b.goto(url)
|
13
|
-
|
14
|
-
|
15
|
-
|
19
|
+
OpenUrl.check_current_url(url)
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.check_current_url(url)
|
23
|
+
url_check = Browser.b.url
|
24
|
+
if url_check == url
|
16
25
|
MyLog.log.info("Opened URL: #{url}")
|
17
26
|
return true
|
18
27
|
else
|
19
|
-
MyLog.log.warn("URL not open: #{url} - opened #{
|
28
|
+
MyLog.log.warn("URL not open: #{url} - opened #{url_check} instead")
|
20
29
|
return false
|
21
30
|
end
|
22
31
|
end
|
@@ -10,9 +10,15 @@ module TestSteps
|
|
10
10
|
value = step_attributes[:testvalue2]
|
11
11
|
locate = step_attributes[:locate]
|
12
12
|
|
13
|
+
text = ENV[value.to_s] || step_attributes[:testvalue2]
|
14
|
+
WriteBoxdata.input_value(box, text, locate)
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.input_value(box, text, locate)
|
13
18
|
found_box = [
|
14
19
|
Browser.b.textarea(:"#{locate}" => box).exist?,
|
15
|
-
Browser.b.text_field(:"#{locate}" => box).exist
|
20
|
+
Browser.b.text_field(:"#{locate}" => box).exist?,
|
21
|
+
Browser.b.iframe(:"#{locate}" => box).exist?
|
16
22
|
]
|
17
23
|
|
18
24
|
raise 'Multiple matches' if found_box.select { |i| i }.empty?
|
@@ -21,16 +27,18 @@ module TestSteps
|
|
21
27
|
return unless index
|
22
28
|
|
23
29
|
if index.zero?
|
24
|
-
Browser.b.textarea(:"#{locate}" => box).wait_until(&:exists?).set
|
25
|
-
(Browser.b.textarea(:"#{locate}" => box).
|
30
|
+
Browser.b.textarea(:"#{locate}" => box).wait_until(&:exists?).set text
|
31
|
+
(Browser.b.textarea(:"#{locate}" => box).text == text)
|
26
32
|
elsif index == 1
|
27
|
-
Browser.b.text_field(:"#{locate}" => box).wait_until(&:exists?).set
|
28
|
-
(Browser.b.text_field(:"#{locate}" => box).
|
33
|
+
Browser.b.text_field(:"#{locate}" => box).wait_until(&:exists?).set text
|
34
|
+
(Browser.b.text_field(:"#{locate}" => box).text == text)
|
35
|
+
elsif index == 2
|
36
|
+
Browser.b.iframe(:"#{locate}" => box).wait_until(&:exists?).send_keys text
|
29
37
|
end
|
30
|
-
MyLog.log.info("Textbox: #{box} has correct value: #{
|
38
|
+
MyLog.log.info("Textbox: #{box} has correct value: #{text}")
|
31
39
|
true
|
32
40
|
rescue StandardError
|
33
|
-
MyLog.log.warn("Textbox: #{box} has the incorrect value: #{
|
41
|
+
MyLog.log.warn("Textbox: #{box} has the incorrect value: #{text}")
|
34
42
|
false
|
35
43
|
rescue StandardError
|
36
44
|
MyLog.log.warn("Textbox: #{box} does not exist")
|
data/lib/report/junit_report.rb
CHANGED
@@ -58,19 +58,8 @@ module JunitReport
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
# open the test suite (TS) summary file for writing if not already open
|
65
|
-
if !File.exist?($TestSuiteSummaryXML) || $TestSuiteSummaryXML.closed?
|
66
|
-
ts_summary_file_xml = File.open($TestSuiteSummaryXML, 'w+')
|
67
|
-
ts_summary_file_xml.write builder.to_xml
|
68
|
-
else
|
69
|
-
MyLog.log.warn 'test suite summary file xml name:' \
|
70
|
-
" #{$TestSuiteSummaryXML} is already open"
|
71
|
-
end
|
72
|
-
|
73
|
-
# if the file is open then close it
|
74
|
-
ts_summary_file_xml.close unless ts_summary_file_xml.closed?
|
61
|
+
ts_summary_file_xml = File.open($TestSuiteSummaryXML, 'w')
|
62
|
+
ts_summary_file_xml.write builder.to_xml
|
63
|
+
ts_summary_file_xml.close
|
75
64
|
end
|
76
65
|
end
|
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.2.
|
4
|
+
version: 0.2.4
|
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-
|
11
|
+
date: 2019-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -189,7 +189,6 @@ files:
|
|
189
189
|
- lib/functions/handlers/click_button.rb
|
190
190
|
- lib/functions/handlers/execute_system_command.rb
|
191
191
|
- lib/functions/handlers/handle_browser_window.rb
|
192
|
-
- lib/functions/handlers/insert_value_config.rb
|
193
192
|
- lib/functions/handlers/ipause.rb
|
194
193
|
- lib/functions/handlers/list_all_dropdowns_values.rb
|
195
194
|
- lib/functions/handlers/open_url.rb
|
@@ -198,9 +197,7 @@ files:
|
|
198
197
|
- lib/functions/handlers/radio_button.rb
|
199
198
|
- lib/functions/handlers/select_dropdown.rb
|
200
199
|
- lib/functions/handlers/send_special_keys.rb
|
201
|
-
- lib/functions/handlers/switch_iframe.rb
|
202
200
|
- lib/functions/handlers/write_box_data.rb
|
203
|
-
- lib/functions/handlers/write_to_editor.rb
|
204
201
|
- lib/main.rb
|
205
202
|
- lib/parser/parser.rb
|
206
203
|
- lib/parser/xlsx_parser.rb
|
@@ -234,8 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
234
231
|
- !ruby/object:Gem::Version
|
235
232
|
version: '0'
|
236
233
|
requirements: []
|
237
|
-
|
238
|
-
rubygems_version: 2.7.6
|
234
|
+
rubygems_version: 3.0.3
|
239
235
|
signing_key:
|
240
236
|
specification_version: 4
|
241
237
|
summary: TAF to allow simple web automation.
|
@@ -1,27 +0,0 @@
|
|
1
|
-
require_relative 'base_handler'
|
2
|
-
|
3
|
-
module TestSteps
|
4
|
-
module Handlers
|
5
|
-
class InsertValueConfig < Base
|
6
|
-
register :insert_value_config
|
7
|
-
|
8
|
-
def perform(step_attributes)
|
9
|
-
box = step_attributes[:testvalue]
|
10
|
-
locate = step_attributes[:locate]
|
11
|
-
value = step_attributes[:testvalue2]
|
12
|
-
value = ENV[value.to_s]
|
13
|
-
|
14
|
-
Browser.b.text_field(:"#{locate}" => box).wait_until.set value
|
15
|
-
(Browser.b.text_field(:"#{locate}" => box).value == value)
|
16
|
-
MyLog.log.info("Textbox: #{box} has correct value: #{value}")
|
17
|
-
true
|
18
|
-
rescue StandardError
|
19
|
-
MyLog.log.warn("Textbox: #{box} has the incorrect value: #{value}")
|
20
|
-
false
|
21
|
-
rescue StandardError
|
22
|
-
MyLog.log.warn("Textbox: #{box} does not exist")
|
23
|
-
false
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require_relative 'base_handler'
|
2
|
-
|
3
|
-
module TestSteps
|
4
|
-
module Handlers
|
5
|
-
class SwitchIframe < Base
|
6
|
-
register :switch_iframe
|
7
|
-
|
8
|
-
def perform(step_attributes)
|
9
|
-
frame = step_attributes[:testvalue]
|
10
|
-
locate = step_attributes[:locate]
|
11
|
-
|
12
|
-
Browser.b.iframe(:"#{locate}" => frame).exists?
|
13
|
-
# Browser.b.wait_until { iframe(:"#{locate}" => frame).exists? }
|
14
|
-
# Browser.b.switch_to(:"#{locate}" => iframe)
|
15
|
-
MyLog.log.info("iframe found: #{frame} is correct")
|
16
|
-
true
|
17
|
-
rescue StandardError
|
18
|
-
MyLog.log.warn("iframe not found: #{frame}")
|
19
|
-
false
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require_relative 'base_handler'
|
2
|
-
|
3
|
-
module TestSteps
|
4
|
-
module Handlers
|
5
|
-
class WriteToEditor < Base
|
6
|
-
register :write_to_editor
|
7
|
-
|
8
|
-
def perform(step_attributes)
|
9
|
-
iframe = step_attributes[:testvalue]
|
10
|
-
value = step_attributes[:testvalue2]
|
11
|
-
locate = step_attributes[:locate]
|
12
|
-
|
13
|
-
Browser.b.iframe(:"#{locate}" => iframe).wait_until(&:exists?)
|
14
|
-
Browser.b.iframe(:"#{locate}" => iframe).send_keys value
|
15
|
-
MyLog.log.info("Editor box: #{iframe} has correct value: #{value}")
|
16
|
-
true
|
17
|
-
rescue StandardError
|
18
|
-
MyLog.log.warn("Editor box: #{iframe} has wrong value: #{value}")
|
19
|
-
false
|
20
|
-
rescue StandardError
|
21
|
-
MyLog.log.warn("Editor box: #{iframe} does not exist")
|
22
|
-
false
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|