taf 0.1.8 → 0.1.9
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 +6 -6
- data/lib/functions/handlers/check_box.rb +1 -1
- data/lib/functions/handlers/check_boxdata.rb +2 -2
- data/lib/functions/handlers/check_browser_title.rb +8 -10
- data/lib/functions/handlers/check_screendata.rb +8 -10
- data/lib/functions/handlers/click_button.rb +11 -11
- data/lib/functions/handlers/list_all_dropdowns_values.rb +1 -1
- data/lib/functions/handlers/radio_button.rb +1 -1
- data/lib/functions/handlers/select_dropdown.rb +1 -1
- data/lib/functions/handlers/write_box_data.rb +2 -2
- data/lib/functions/handlers/write_to_editor.rb +1 -1
- data/lib/taf_config.rb +3 -0
- 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: 8fce262beb8801e713c9bf2bba991657eed3e3660d5098b3905d27c16abbb2c9
|
4
|
+
data.tar.gz: 9a98b39402e830e014216b8701082c89955556c90af42793ef7f797981c917c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b93e27555e02b0478cbc0615a66812fe9c1621ccbebb0fbd452493fd5831b3d0ecf41af72275dffd39955eac8c06daae3b97a07d6eb9966e4c07faf7737df460
|
7
|
+
data.tar.gz: cdbe883d6dbb0ab8bf43c273eb36ae2814eff4955ad351a04e5ab2224a3157f7ad54f1ac622fd9e01fac91140239f205866f2e7c2687f0f459e2016808b88e7c
|
@@ -17,10 +17,10 @@ module TestSteps
|
|
17
17
|
|
18
18
|
def login_process(b_title, user_elm, pass_elm, user, pass)
|
19
19
|
if Browser.b.title.eql?(b_title)
|
20
|
-
Browser.b.text_field(id: user_elm).wait_until.set user
|
21
|
-
Browser.b.text_field(id: pass_elm).wait_until.set pass
|
20
|
+
Browser.b.text_field(id: user_elm).wait_until(&:exists?).set user
|
21
|
+
Browser.b.text_field(id: pass_elm).wait_until(&:exists?).set pass
|
22
22
|
login_button
|
23
|
-
sleep
|
23
|
+
sleep 1
|
24
24
|
else
|
25
25
|
MyLog.log.warn("User: #{user} has failed to log in.")
|
26
26
|
end
|
@@ -28,9 +28,9 @@ module TestSteps
|
|
28
28
|
|
29
29
|
def login_button
|
30
30
|
if Browser.b.button(value: 'Sign in').exist?
|
31
|
-
Browser.b.button(value: 'Sign in').wait_until.click
|
31
|
+
Browser.b.button(value: 'Sign in').wait_until(&:exists?).click
|
32
32
|
elsif Browser.b.button(value: 'Log in').exist?
|
33
|
-
Browser.b.button(value: 'Log in').wait_until.click
|
33
|
+
Browser.b.button(value: 'Log in').wait_until(&:exists?).click
|
34
34
|
else
|
35
35
|
MyLog.log.warn("User: #{user} has failed to log in.")
|
36
36
|
end
|
@@ -75,7 +75,7 @@ module TestSteps
|
|
75
75
|
Browser.b.select_list(:id => elm_id).option(:value => "#{char}").select
|
76
76
|
}
|
77
77
|
|
78
|
-
Browser.b.button(value: 'Sign in').wait_until.click
|
78
|
+
Browser.b.button(value: 'Sign in').wait_until(&:exists?).click
|
79
79
|
if Browser.b.title.eql?(b_title_sucess)
|
80
80
|
MyLog.log.info("User: #{user} has logged in successful.")
|
81
81
|
return true
|
@@ -9,7 +9,7 @@ module TestSteps
|
|
9
9
|
checkbox = step_attributes[:testvalue]
|
10
10
|
locate = step_attributes[:locate]
|
11
11
|
|
12
|
-
Browser.b.checkbox(:"#{locate}" => checkbox).wait_until.click
|
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
|
@@ -19,10 +19,10 @@ module TestSteps
|
|
19
19
|
index = found_box.index(true)
|
20
20
|
return unless index
|
21
21
|
if index.zero?
|
22
|
-
Browser.b.textarea(:"#{locate}" => box).wait_until
|
22
|
+
Browser.b.textarea(:"#{locate}" => box).wait_until(&:exists?)
|
23
23
|
(Browser.b.textarea(:"#{locate}" => box).value == value)
|
24
24
|
elsif index == 1
|
25
|
-
Browser.b.text_field(:"#{locate}" => box).wait_until
|
25
|
+
Browser.b.text_field(:"#{locate}" => box).wait_until(&:exists?)
|
26
26
|
(Browser.b.text_field(:"#{locate}" => box).value == value)
|
27
27
|
end
|
28
28
|
MyLog.log.info("Textbox: #{box} has the correct value: #{value}")
|
@@ -6,17 +6,15 @@ module TestSteps
|
|
6
6
|
register :check_browser_title
|
7
7
|
|
8
8
|
def perform(step_attributes)
|
9
|
-
|
9
|
+
b_title = step_attributes[:testvalue]
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
return false
|
18
|
-
end
|
11
|
+
Browser.b.wait_until { Browser.b.title.eql? (b_title)}
|
12
|
+
MyLog.log.info("Browser title: #{b_title}")
|
13
|
+
true
|
14
|
+
rescue StandardError
|
15
|
+
MyLog.log.warn("Title not found: #{b_title}")
|
16
|
+
false
|
19
17
|
end
|
20
18
|
end
|
21
19
|
end
|
22
|
-
end
|
20
|
+
end
|
@@ -6,17 +6,15 @@ module TestSteps
|
|
6
6
|
register :check_screen_data
|
7
7
|
|
8
8
|
def perform(step_attributes)
|
9
|
-
|
9
|
+
check_text = step_attributes[:testvalue]
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
return false
|
18
|
-
end
|
11
|
+
Browser.b.wait_until { Browser.b.element.text.include? (check_text)}
|
12
|
+
MyLog.log.info("Text found: #{check_text}")
|
13
|
+
true
|
14
|
+
rescue StandardError
|
15
|
+
MyLog.log.warn("Text not found: #{check_text}")
|
16
|
+
false
|
19
17
|
end
|
20
18
|
end
|
21
19
|
end
|
22
|
-
end
|
20
|
+
end
|
@@ -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, :"#{locate}" => button).
|
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?
|
@@ -21,25 +21,25 @@ module TestSteps
|
|
21
21
|
|
22
22
|
case index
|
23
23
|
when 0
|
24
|
-
Browser.b.button(:"#{locate}" => button).wait_until.click
|
24
|
+
Browser.b.button(:"#{locate}" => button).wait_until(&:exists?).click
|
25
25
|
when 1
|
26
|
-
Browser.b.span(:"#{locate}" => button).wait_until.click
|
26
|
+
Browser.b.span(:"#{locate}" => button).wait_until(&:exists?).click
|
27
27
|
when 2
|
28
|
-
Browser.b.a(:"#{locate}" => button).wait_until.click
|
28
|
+
Browser.b.a(:"#{locate}" => button).wait_until(&:exists?).click
|
29
29
|
when 3
|
30
|
-
Browser.b.div(:"#{locate}" => button).wait_until.click
|
30
|
+
Browser.b.div(:"#{locate}" => button).wait_until(&:exists?).click
|
31
31
|
when 4
|
32
|
-
Browser.b.link(:"#{locate}" => button).wait_until.click
|
32
|
+
Browser.b.link(:"#{locate}" => button).wait_until(&:exists?).click
|
33
33
|
when 5
|
34
|
-
Browser.b.image(:"#{locate}" => button).wait_until.click
|
34
|
+
Browser.b.image(:"#{locate}" => button).wait_until(&:exists?).click
|
35
35
|
when 6
|
36
|
-
Browser.b.h1(:"#{locate}" => button).wait_until.click
|
36
|
+
Browser.b.h1(:"#{locate}" => button).wait_until(&:exists?).click
|
37
37
|
when 7
|
38
|
-
Browser.b.h2(:"#{locate}" => button).wait_until.click
|
38
|
+
Browser.b.h2(:"#{locate}" => button).wait_until(&:exists?).click
|
39
39
|
when 8
|
40
|
-
Browser.b.h3(:"#{locate}" => button).wait_until.click
|
40
|
+
Browser.b.h3(:"#{locate}" => button).wait_until(&:exists?).click
|
41
41
|
when 9
|
42
|
-
Browser.b.h4(:"#{locate}" => button).wait_until.click
|
42
|
+
Browser.b.h4(:"#{locate}" => button).wait_until(&:exists?).click
|
43
43
|
end
|
44
44
|
MyLog.log.info("Button: #{button} has been selected")
|
45
45
|
true
|
@@ -9,7 +9,7 @@ module TestSteps
|
|
9
9
|
dropdown = step_attributes[:testvalue]
|
10
10
|
locate = step_attributes[:locate]
|
11
11
|
|
12
|
-
Browser.b.element(:"#{locate}" => dropdown).wait_until
|
12
|
+
Browser.b.element(:"#{locate}" => dropdown).wait_until(&:exists?)
|
13
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
|
@@ -11,7 +11,7 @@ module TestSteps
|
|
11
11
|
locate = step_attributes[:locate]
|
12
12
|
locate2 = step_attributes[:locate2]
|
13
13
|
|
14
|
-
Browser.b.radio(:"#{locate}" => radio).wait_until
|
14
|
+
Browser.b.radio(:"#{locate}" => radio).wait_until(&:exists?)
|
15
15
|
Browser.b.radio(:"#{locate}" => radio, :"#{locate2}" => "#{value2}").set
|
16
16
|
MyLog.log.info("Radio button: #{radio} has been selected")
|
17
17
|
true
|
@@ -11,7 +11,7 @@ module TestSteps
|
|
11
11
|
locate = step_attributes[:locate]
|
12
12
|
locate2 = step_attributes[:locate2]
|
13
13
|
|
14
|
-
Browser.b.select_list(:"#{locate}" => dropdown).wait_until
|
14
|
+
Browser.b.select_list(:"#{locate}" => dropdown).wait_until(&:exists?)
|
15
15
|
Browser.b.select_list(:"#{locate}" => dropdown).option(:"#{locate2}" => "#{value2}").select
|
16
16
|
MyLog.log.info("Dropdown item: #{value2} has been selected")
|
17
17
|
true
|
@@ -19,10 +19,10 @@ module TestSteps
|
|
19
19
|
index = found_box.index(true)
|
20
20
|
return unless index
|
21
21
|
if index.zero?
|
22
|
-
Browser.b.textarea(:"#{locate}" => box).wait_until.set value
|
22
|
+
Browser.b.textarea(:"#{locate}" => box).wait_until(&:exists?).set value
|
23
23
|
(Browser.b.textarea(:"#{locate}" => box).value == value)
|
24
24
|
elsif index == 1
|
25
|
-
Browser.b.text_field(:"#{locate}" => box).wait_until.set value
|
25
|
+
Browser.b.text_field(:"#{locate}" => box).wait_until(&:exists?).set value
|
26
26
|
(Browser.b.text_field(:"#{locate}" => box).value == value)
|
27
27
|
end
|
28
28
|
MyLog.log.info("Textbox: #{box} has correct value: #{value}")
|
@@ -10,7 +10,7 @@ module TestSteps
|
|
10
10
|
value = step_attributes[:testvalue2]
|
11
11
|
locate = step_attributes[:locate]
|
12
12
|
|
13
|
-
Browser.b.iframe(:"#{locate}" => iframe).wait_until
|
13
|
+
Browser.b.iframe(:"#{locate}" => iframe).wait_until(&:exists?)
|
14
14
|
Browser.b.iframe(:"#{locate}" => iframe).send_keys value
|
15
15
|
MyLog.log.info("Editor box: #{iframe} has correct value: #{value}")
|
16
16
|
true
|
data/lib/taf_config.rb
CHANGED
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.1.
|
4
|
+
version: 0.1.9
|
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-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|