Ifd_Mobile 0.1.1 → 0.1.2
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/Ifd_Mobile/lib_web.rb +70 -69
- data/lib/Ifd_Mobile/methods/IFD_Assertion.rb +44 -44
- data/lib/Ifd_Mobile/methods/core.rb +136 -136
- data/lib/Ifd_Mobile/methods/lib_var.rb +53 -53
- data/lib/Ifd_Mobile/version.rb +1 -1
- data/lib/LICENSE +3 -0
- data/project/Gemfile +7 -7
- data/project/apps/TestApp/Test App 2/GestureTestViewController.h +18 -18
- data/project/apps/TestApp/Test App 2/GestureTestViewController.m +48 -48
- data/project/apps/TestApp/Test App 2/GestureTestViewController.xib +46 -46
- data/project/apps/TestApp/Test App 2/MyViewControllerViewController.h +42 -42
- data/project/apps/TestApp/Test App 2/MyViewControllerViewController.m +193 -193
- data/project/apps/TestApp/Test App 2/TA2AppDelegate.h +28 -28
- data/project/apps/TestApp/Test App 2/TA2AppDelegate.m +85 -85
- data/project/apps/TestApp/Test App 2/TestApp-Info.plist +40 -40
- data/project/apps/TestApp/Test App 2/TestApp-Prefix.pch +29 -29
- data/project/apps/TestApp/Test App 2/en.lproj/InfoPlist.strings +21 -21
- data/project/apps/TestApp/Test App 2/en.lproj/MyViewControllerViewController.xib +175 -175
- data/project/apps/TestApp/Test App 2/main.m +31 -31
- data/project/apps/TestApp/TestApp.xcodeproj/project.pbxproj +336 -336
- data/project/apps/TestApp/TestApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -7
- data/project/apps/TestApp/TestApp.xcodeproj/xcuserdata/anhpham.xcuserdatad/xcschemes/TestApp.xcscheme +88 -88
- data/project/apps/TestApp/TestApp.xcodeproj/xcuserdata/anhpham.xcuserdatad/xcschemes/xcschememanagement.plist +22 -22
- data/project/apps/TestApp/build/release-iphonesimulator/TestApp.app/Info.plist +0 -0
- data/project/features/android/Android_test1.feature +14 -14
- data/project/features/android/Android_test2.feature +14 -14
- data/project/features/iOS/iOS_test.feature +15 -15
- data/project/features/step_definitions/lib_steps/PolyClaim_homepage.rb +2 -2
- data/project/features/step_definitions/lib_steps/PolyClaim_loginpage.rb +3 -3
- data/project/features/step_definitions/repositories/android_ob_test.rb +9 -9
- data/project/features/step_definitions/repositories/ios_ob_test.rb +6 -6
- data/project/features/support/env.rb +72 -5
- data/project/features/support/hooks.rb +24 -24
- data/project/features/support/project_env.rb +41 -41
- metadata +45 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbf6b3f6df0ef5a901dc7507dac92760b0772739
|
4
|
+
data.tar.gz: 889512b8a1a2fa5710ea40e5f5f252bf0d186af3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0310a2101eddd36154660d0bfd9300587cd5cbdbcad23ea557e546e073121d91ec2cf7ee072af8f45376d42349ec505dd757879e66d230caf5eaf5ce62d7beba
|
7
|
+
data.tar.gz: 81b7d5b811227742717bc3c41dfc4c03a58777f5aba92c739499d214724ba10b91f8832575e8cdb957c1b71495d3a1b4d5ab43e2c85eb27de938c09c6b29ee64
|
data/lib/Ifd_Mobile/lib_web.rb
CHANGED
@@ -1,70 +1,71 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
end
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
1
|
+
require_relative 'methods/required_files'
|
2
|
+
|
3
|
+
Given(/^I have App running with appium$/) do
|
4
|
+
# Make sure you have started appium server
|
5
|
+
end
|
6
|
+
|
7
|
+
# Wait for the specific time
|
8
|
+
When /^I wait for (\d+) seconds$/ do |second|
|
9
|
+
sleep(second.to_i)
|
10
|
+
end
|
11
|
+
|
12
|
+
And /^I input text "(.*)" on "(.*)"$/ do |text,object|
|
13
|
+
execute_settext(object,text)
|
14
|
+
end
|
15
|
+
|
16
|
+
And /^I click on "(.*)"$/ do |object|
|
17
|
+
execute_click object
|
18
|
+
end
|
19
|
+
|
20
|
+
Then /^I verify property "(.*)" with "(.*)" has( | not)? value "(.*)"$/ do |object, property, negate, value|
|
21
|
+
sleep(0.5)
|
22
|
+
value = var_collect(value)
|
23
|
+
execute_checkproperty(object, property, negate, value)
|
24
|
+
end
|
25
|
+
|
26
|
+
Given /^I click on element with x: "(.*)", y: "(.*)"$/ do |x,y|
|
27
|
+
click_by_coordinate x,y
|
28
|
+
end
|
29
|
+
|
30
|
+
And /^I scroll the screen from startX (\d+) startY (\d+) to endX (\d+) endY (\d+) and millisecond timeout is (\d+)$/ do |startX, startY, endX, endY, timeout|
|
31
|
+
selenium.swipe(startX:startX, startY:startY, endX:endX,endY:endY, duration:timeout)
|
32
|
+
end
|
33
|
+
|
34
|
+
Given /^I get attribute of element "(.*)"$/ do |element|
|
35
|
+
found_element = find_object element
|
36
|
+
actual_value = found_element.attribute("name")
|
37
|
+
puts actual_value
|
38
|
+
end
|
39
|
+
|
40
|
+
And /^I rotate device to (landscape|portrait)$/ do |type|
|
41
|
+
case type.to_sym
|
42
|
+
when :landscape
|
43
|
+
$driver.rotate :landscape
|
44
|
+
when :portrait
|
45
|
+
$driver.rotate :portrait
|
46
|
+
else
|
47
|
+
raise "ERROR: *** unknown rotate type"
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
And /^I accept alert$/ do
|
52
|
+
selenium.alert_accept
|
53
|
+
end
|
54
|
+
|
55
|
+
And /^I dismiss alert$/ do
|
56
|
+
selenium.alert_dismiss
|
57
|
+
end
|
58
|
+
|
59
|
+
And /^I hide the keyboard$/ do
|
60
|
+
selenium.hide_keyboard
|
61
|
+
end
|
62
|
+
|
63
|
+
And /^I delete an character$/ do
|
64
|
+
system('adb shell input keyevent 67')
|
65
|
+
end
|
66
|
+
|
67
|
+
And /^I test "(.*)"$/ do |element|
|
68
|
+
found_element = find_object element
|
69
|
+
actual_value = found_element.attribute("value")
|
70
|
+
puts actual_value
|
70
71
|
end
|
@@ -1,44 +1,44 @@
|
|
1
|
-
# include Test::Unit::Assertions
|
2
|
-
class IFD_Assertion
|
3
|
-
# Assert 2 values
|
4
|
-
def self.reg_compare sActual, regValue, isSpecialChar=false
|
5
|
-
begin
|
6
|
-
if !isSpecialChar
|
7
|
-
sActual = sActual.strip
|
8
|
-
regValue = regValue.strip.gsub("[", "\\[").gsub("]", "\\]").gsub("(", "\\(").gsub(")", "\\)").gsub(">", "\\>")
|
9
|
-
end
|
10
|
-
rescue StandardError => myStandardError
|
11
|
-
put_log "\n>>> Error: #{myStandardError}"
|
12
|
-
end
|
13
|
-
|
14
|
-
# put_log "\nsActual:#{sActual}, regValue:#{regValue}"
|
15
|
-
if ((sActual.nil? and regValue.nil?) or (!sActual.nil? and sActual.empty? and !regValue.nil? and regValue.empty?))
|
16
|
-
return true
|
17
|
-
end
|
18
|
-
|
19
|
-
if ((sActual.nil? and !regValue.nil?) or (!sActual.nil? and regValue.nil?))
|
20
|
-
return false
|
21
|
-
end
|
22
|
-
|
23
|
-
if (!sActual.nil? and !sActual.empty?)
|
24
|
-
sCookActual = sActual.gsub(/\n|\r/, " ")
|
25
|
-
if (sCookActual == regValue or (isSpecialChar and sCookActual.include? regValue) or (!isSpecialChar and sCookActual =~ /^.*#{regValue}.*$/))
|
26
|
-
return true
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
return false
|
31
|
-
end
|
32
|
-
|
33
|
-
def self.assert_string_contain(expected, actual)
|
34
|
-
unless (actual.to_s).include? (expected.to_s)
|
35
|
-
raise ("*** ASSERTION ERROR: \nExpected: #{expected}. \nGot: #{actual}.")
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
def self.assert_string_equal(expected, actual)
|
40
|
-
if expected.to_s != actual.to_s
|
41
|
-
raise ("*** ASSERTION ERROR: \nExpected: #{expected}. \nGot: #{actual}.")
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
1
|
+
# include Test::Unit::Assertions
|
2
|
+
class IFD_Assertion
|
3
|
+
# Assert 2 values
|
4
|
+
def self.reg_compare sActual, regValue, isSpecialChar=false
|
5
|
+
begin
|
6
|
+
if !isSpecialChar
|
7
|
+
sActual = sActual.strip
|
8
|
+
regValue = regValue.strip.gsub("[", "\\[").gsub("]", "\\]").gsub("(", "\\(").gsub(")", "\\)").gsub(">", "\\>")
|
9
|
+
end
|
10
|
+
rescue StandardError => myStandardError
|
11
|
+
put_log "\n>>> Error: #{myStandardError}"
|
12
|
+
end
|
13
|
+
|
14
|
+
# put_log "\nsActual:#{sActual}, regValue:#{regValue}"
|
15
|
+
if ((sActual.nil? and regValue.nil?) or (!sActual.nil? and sActual.empty? and !regValue.nil? and regValue.empty?))
|
16
|
+
return true
|
17
|
+
end
|
18
|
+
|
19
|
+
if ((sActual.nil? and !regValue.nil?) or (!sActual.nil? and regValue.nil?))
|
20
|
+
return false
|
21
|
+
end
|
22
|
+
|
23
|
+
if (!sActual.nil? and !sActual.empty?)
|
24
|
+
sCookActual = sActual.gsub(/\n|\r/, " ")
|
25
|
+
if (sCookActual == regValue or (isSpecialChar and sCookActual.include? regValue) or (!isSpecialChar and sCookActual =~ /^.*#{regValue}.*$/))
|
26
|
+
return true
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
return false
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.assert_string_contain(expected, actual)
|
34
|
+
unless (actual.to_s).include? (expected.to_s)
|
35
|
+
raise ("*** ASSERTION ERROR: \nExpected: #{expected}. \nGot: #{actual}.")
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.assert_string_equal(expected, actual)
|
40
|
+
if expected.to_s != actual.to_s
|
41
|
+
raise ("*** ASSERTION ERROR: \nExpected: #{expected}. \nGot: #{actual}.")
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -1,136 +1,136 @@
|
|
1
|
-
$_RP_OBJECT = {}
|
2
|
-
|
3
|
-
def call_step str_step
|
4
|
-
put_log "\n-=> call step: #{str_step}"
|
5
|
-
step %{#{str_step}}
|
6
|
-
end
|
7
|
-
|
8
|
-
def put_log str
|
9
|
-
puts str if $_CONFIG['Print Log'] == true
|
10
|
-
end
|
11
|
-
|
12
|
-
def find_object string_object
|
13
|
-
# startTime = Time.new.to_i
|
14
|
-
string_object = string_object.gsub(/"/, "'")
|
15
|
-
# puts string_object
|
16
|
-
locator_matching = /(.*?)(\{.*?\})/.match(string_object)
|
17
|
-
# puts "locator_matching : #{locator_matching}"
|
18
|
-
dyn_pros = {}
|
19
|
-
if locator_matching != nil
|
20
|
-
string_object = locator_matching[1]
|
21
|
-
eval(locator_matching[2].gsub(/['][\s,\t]*?:[\s,\t]*?[']?/, "'=>'")).each { |k, v|
|
22
|
-
dyn_pros[k.to_s.upcase] = v
|
23
|
-
}
|
24
|
-
end
|
25
|
-
hash_object = $_RP_OBJECT[string_object]
|
26
|
-
puts hash_object
|
27
|
-
if hash_object == nil
|
28
|
-
put_log ">>> OBJECT NAME MAYBE NOT FOUND!!!"
|
29
|
-
true.should eq false
|
30
|
-
end
|
31
|
-
attribute = {}
|
32
|
-
if hash_object != nil
|
33
|
-
hash_object.each { |k, v|
|
34
|
-
k = k.to_s
|
35
|
-
if k =~ /ph_/i
|
36
|
-
if dyn_pros[k] != nil
|
37
|
-
# Assign place holder value to place holder property, also remove prefix ph_ from property key,
|
38
|
-
# also remove this pl from dyn_pros <= should be consider to continue transfer into inner object in relation
|
39
|
-
if v =~ /<ph_value>/i
|
40
|
-
attribute[k[3..k.size-1]] = v.gsub(/<ph_value>/i, dyn_pros[k])
|
41
|
-
else
|
42
|
-
attribute[k[3..k.size-1]] = dyn_pros[k]
|
43
|
-
end
|
44
|
-
dyn_pros.delete(k)
|
45
|
-
end
|
46
|
-
else
|
47
|
-
attribute[k.to_s] = v
|
48
|
-
end
|
49
|
-
}
|
50
|
-
end
|
51
|
-
# put_log string_object
|
52
|
-
# put_log "\nattribute: #{attribute}"
|
53
|
-
|
54
|
-
attribute.each { |key, value|
|
55
|
-
$element_tag = key
|
56
|
-
$element_value = value
|
57
|
-
}
|
58
|
-
return selenium.find_element($element_tag, $element_value)
|
59
|
-
end
|
60
|
-
|
61
|
-
def execute_click element
|
62
|
-
found_element = find_object element
|
63
|
-
if found_element != nil
|
64
|
-
startTime = Time.new.to_i
|
65
|
-
begin
|
66
|
-
sleep(1)
|
67
|
-
currentTime= Time.new.to_i
|
68
|
-
end while (currentTime - startTime) < $_CONFIG['Wait Time']
|
69
|
-
# selenium.execute_script('mobile: scroll', found_element)
|
70
|
-
found_element.click
|
71
|
-
else
|
72
|
-
put_log "\nERROR: *** not found object: #{element}"
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
def execute_settext element, text
|
77
|
-
found_element = find_object element
|
78
|
-
if found_element != nil
|
79
|
-
begin
|
80
|
-
sleep(1)
|
81
|
-
# found_element.long_press_keycode(46)
|
82
|
-
found_element.send_keys(text)
|
83
|
-
rescue StandardError => myStandardError
|
84
|
-
put_log "\nERROR: *** #{myStandardError}"
|
85
|
-
end
|
86
|
-
else
|
87
|
-
put_log "\nERROR: *** not found object: #{element}"
|
88
|
-
exit
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
def execute_checkproperty element, property, negate, value
|
93
|
-
found_element = find_object element
|
94
|
-
check = false
|
95
|
-
if found_element == nil and value == ""
|
96
|
-
check = true
|
97
|
-
expect(check).to eq true
|
98
|
-
else
|
99
|
-
put_log "\n*** Execute_CheckProperty: finish to found element"
|
100
|
-
if found_element != nil
|
101
|
-
if property.upcase == 'VALUE'
|
102
|
-
actual_value = found_element.attribute("value")
|
103
|
-
elsif property.upcase == 'NAME'
|
104
|
-
actual_value = found_element.attribute("name")
|
105
|
-
elsif property.upcase == 'LABEL'
|
106
|
-
actual_value = found_element.attribute("label")
|
107
|
-
elsif property.upcase == 'TYPE'
|
108
|
-
actual_value = found_element.attribute("type")
|
109
|
-
elsif property.upcase == 'ENABLE'
|
110
|
-
actual_value = found_element.attribute("enable")
|
111
|
-
else
|
112
|
-
actual_value = found_element.attribute("#{property}")
|
113
|
-
end
|
114
|
-
if actual_value == nil
|
115
|
-
actual_value = ''
|
116
|
-
end
|
117
|
-
else
|
118
|
-
put_log "ERROR: *** Not found object: #{element}"
|
119
|
-
end
|
120
|
-
|
121
|
-
if IFD_Assertion.reg_compare(actual_value, value)
|
122
|
-
check = true
|
123
|
-
end
|
124
|
-
|
125
|
-
put_log "\n#{property} :: Actual Result Is '#{actual_value}' -- Expected Result Is '#{value}'"
|
126
|
-
|
127
|
-
if negate == " not"
|
128
|
-
expect(check).not_to eql true
|
129
|
-
elsif expect(check).to eq true
|
130
|
-
end
|
131
|
-
end
|
132
|
-
end
|
133
|
-
|
134
|
-
def click_by_coordinate x, y
|
135
|
-
selenium.execute_script 'mobile: tap', :x => x, :y => y
|
136
|
-
end
|
1
|
+
$_RP_OBJECT = {}
|
2
|
+
|
3
|
+
def call_step str_step
|
4
|
+
put_log "\n-=> call step: #{str_step}"
|
5
|
+
step %{#{str_step}}
|
6
|
+
end
|
7
|
+
|
8
|
+
def put_log str
|
9
|
+
puts str if $_CONFIG['Print Log'] == true
|
10
|
+
end
|
11
|
+
|
12
|
+
def find_object string_object
|
13
|
+
# startTime = Time.new.to_i
|
14
|
+
string_object = string_object.gsub(/"/, "'")
|
15
|
+
# puts string_object
|
16
|
+
locator_matching = /(.*?)(\{.*?\})/.match(string_object)
|
17
|
+
# puts "locator_matching : #{locator_matching}"
|
18
|
+
dyn_pros = {}
|
19
|
+
if locator_matching != nil
|
20
|
+
string_object = locator_matching[1]
|
21
|
+
eval(locator_matching[2].gsub(/['][\s,\t]*?:[\s,\t]*?[']?/, "'=>'")).each { |k, v|
|
22
|
+
dyn_pros[k.to_s.upcase] = v
|
23
|
+
}
|
24
|
+
end
|
25
|
+
hash_object = $_RP_OBJECT[string_object]
|
26
|
+
puts hash_object
|
27
|
+
if hash_object == nil
|
28
|
+
put_log ">>> OBJECT NAME MAYBE NOT FOUND!!!"
|
29
|
+
true.should eq false
|
30
|
+
end
|
31
|
+
attribute = {}
|
32
|
+
if hash_object != nil
|
33
|
+
hash_object.each { |k, v|
|
34
|
+
k = k.to_s
|
35
|
+
if k =~ /ph_/i
|
36
|
+
if dyn_pros[k] != nil
|
37
|
+
# Assign place holder value to place holder property, also remove prefix ph_ from property key,
|
38
|
+
# also remove this pl from dyn_pros <= should be consider to continue transfer into inner object in relation
|
39
|
+
if v =~ /<ph_value>/i
|
40
|
+
attribute[k[3..k.size-1]] = v.gsub(/<ph_value>/i, dyn_pros[k])
|
41
|
+
else
|
42
|
+
attribute[k[3..k.size-1]] = dyn_pros[k]
|
43
|
+
end
|
44
|
+
dyn_pros.delete(k)
|
45
|
+
end
|
46
|
+
else
|
47
|
+
attribute[k.to_s] = v
|
48
|
+
end
|
49
|
+
}
|
50
|
+
end
|
51
|
+
# put_log string_object
|
52
|
+
# put_log "\nattribute: #{attribute}"
|
53
|
+
|
54
|
+
attribute.each { |key, value|
|
55
|
+
$element_tag = key
|
56
|
+
$element_value = value
|
57
|
+
}
|
58
|
+
return selenium.find_element($element_tag, $element_value)
|
59
|
+
end
|
60
|
+
|
61
|
+
def execute_click element
|
62
|
+
found_element = find_object element
|
63
|
+
if found_element != nil
|
64
|
+
startTime = Time.new.to_i
|
65
|
+
begin
|
66
|
+
sleep(1)
|
67
|
+
currentTime= Time.new.to_i
|
68
|
+
end while (currentTime - startTime) < $_CONFIG['Wait Time']
|
69
|
+
# selenium.execute_script('mobile: scroll', found_element)
|
70
|
+
found_element.click
|
71
|
+
else
|
72
|
+
put_log "\nERROR: *** not found object: #{element}"
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def execute_settext element, text
|
77
|
+
found_element = find_object element
|
78
|
+
if found_element != nil
|
79
|
+
begin
|
80
|
+
sleep(1)
|
81
|
+
# found_element.long_press_keycode(46)
|
82
|
+
found_element.send_keys(text)
|
83
|
+
rescue StandardError => myStandardError
|
84
|
+
put_log "\nERROR: *** #{myStandardError}"
|
85
|
+
end
|
86
|
+
else
|
87
|
+
put_log "\nERROR: *** not found object: #{element}"
|
88
|
+
exit
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
def execute_checkproperty element, property, negate, value
|
93
|
+
found_element = find_object element
|
94
|
+
check = false
|
95
|
+
if found_element == nil and value == ""
|
96
|
+
check = true
|
97
|
+
expect(check).to eq true
|
98
|
+
else
|
99
|
+
put_log "\n*** Execute_CheckProperty: finish to found element"
|
100
|
+
if found_element != nil
|
101
|
+
if property.upcase == 'VALUE'
|
102
|
+
actual_value = found_element.attribute("value")
|
103
|
+
elsif property.upcase == 'NAME'
|
104
|
+
actual_value = found_element.attribute("name")
|
105
|
+
elsif property.upcase == 'LABEL'
|
106
|
+
actual_value = found_element.attribute("label")
|
107
|
+
elsif property.upcase == 'TYPE'
|
108
|
+
actual_value = found_element.attribute("type")
|
109
|
+
elsif property.upcase == 'ENABLE'
|
110
|
+
actual_value = found_element.attribute("enable")
|
111
|
+
else
|
112
|
+
actual_value = found_element.attribute("#{property}")
|
113
|
+
end
|
114
|
+
if actual_value == nil
|
115
|
+
actual_value = ''
|
116
|
+
end
|
117
|
+
else
|
118
|
+
put_log "ERROR: *** Not found object: #{element}"
|
119
|
+
end
|
120
|
+
|
121
|
+
if IFD_Assertion.reg_compare(actual_value, value)
|
122
|
+
check = true
|
123
|
+
end
|
124
|
+
|
125
|
+
put_log "\n#{property} :: Actual Result Is '#{actual_value}' -- Expected Result Is '#{value}'"
|
126
|
+
|
127
|
+
if negate == " not"
|
128
|
+
expect(check).not_to eql true
|
129
|
+
elsif expect(check).to eq true
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
def click_by_coordinate x, y
|
135
|
+
selenium.execute_script 'mobile: tap', :x => x, :y => y
|
136
|
+
end
|
@@ -1,54 +1,54 @@
|
|
1
|
-
def var_collect string_var
|
2
|
-
if string_var =~ /^.*{year}.*$/
|
3
|
-
string_var = replace_year(string_var)
|
4
|
-
end
|
5
|
-
|
6
|
-
if string_var =~ /^.*{month}.*$/
|
7
|
-
string_var = replace_month(string_var)
|
8
|
-
end
|
9
|
-
|
10
|
-
if string_var =~ /^.*{day}.*$/
|
11
|
-
string_var = replace_day(string_var)
|
12
|
-
end
|
13
|
-
|
14
|
-
if string_var =~ /^.*{store_value}.*$/
|
15
|
-
string_var = $context_value
|
16
|
-
end
|
17
|
-
|
18
|
-
return string_var
|
19
|
-
end
|
20
|
-
|
21
|
-
def replace_year str
|
22
|
-
t = Time.now()
|
23
|
-
return str.gsub("{year}", t.year.to_s)
|
24
|
-
end
|
25
|
-
|
26
|
-
def replace_month str
|
27
|
-
t = Time.now()
|
28
|
-
_month = t.month
|
29
|
-
if _month < 10
|
30
|
-
return str.gsub("{month}", "0#{_month.to_s}")
|
31
|
-
else
|
32
|
-
return str.gsub("{month}", "#{_month.to_s}")
|
33
|
-
end
|
34
|
-
return str
|
35
|
-
end
|
36
|
-
|
37
|
-
def replace_day str
|
38
|
-
t = Time.now()
|
39
|
-
_day = t.day
|
40
|
-
if _day < 10
|
41
|
-
return str.gsub("{day}", "0#{_day.to_s}")
|
42
|
-
else
|
43
|
-
return str.gsub("{day}", "#{_day.to_s}")
|
44
|
-
end
|
45
|
-
return str
|
46
|
-
end
|
47
|
-
|
48
|
-
def replace_pipe str_pipe
|
49
|
-
put_log ">>>> #{str_pipe}"
|
50
|
-
if str_pipe =~ /^.*{pipe}.*$/
|
51
|
-
return str_pipe.gsub("{pipe}", "|")
|
52
|
-
end
|
53
|
-
return str_pipe
|
1
|
+
def var_collect string_var
|
2
|
+
if string_var =~ /^.*{year}.*$/
|
3
|
+
string_var = replace_year(string_var)
|
4
|
+
end
|
5
|
+
|
6
|
+
if string_var =~ /^.*{month}.*$/
|
7
|
+
string_var = replace_month(string_var)
|
8
|
+
end
|
9
|
+
|
10
|
+
if string_var =~ /^.*{day}.*$/
|
11
|
+
string_var = replace_day(string_var)
|
12
|
+
end
|
13
|
+
|
14
|
+
if string_var =~ /^.*{store_value}.*$/
|
15
|
+
string_var = $context_value
|
16
|
+
end
|
17
|
+
|
18
|
+
return string_var
|
19
|
+
end
|
20
|
+
|
21
|
+
def replace_year str
|
22
|
+
t = Time.now()
|
23
|
+
return str.gsub("{year}", t.year.to_s)
|
24
|
+
end
|
25
|
+
|
26
|
+
def replace_month str
|
27
|
+
t = Time.now()
|
28
|
+
_month = t.month
|
29
|
+
if _month < 10
|
30
|
+
return str.gsub("{month}", "0#{_month.to_s}")
|
31
|
+
else
|
32
|
+
return str.gsub("{month}", "#{_month.to_s}")
|
33
|
+
end
|
34
|
+
return str
|
35
|
+
end
|
36
|
+
|
37
|
+
def replace_day str
|
38
|
+
t = Time.now()
|
39
|
+
_day = t.day
|
40
|
+
if _day < 10
|
41
|
+
return str.gsub("{day}", "0#{_day.to_s}")
|
42
|
+
else
|
43
|
+
return str.gsub("{day}", "#{_day.to_s}")
|
44
|
+
end
|
45
|
+
return str
|
46
|
+
end
|
47
|
+
|
48
|
+
def replace_pipe str_pipe
|
49
|
+
put_log ">>>> #{str_pipe}"
|
50
|
+
if str_pipe =~ /^.*{pipe}.*$/
|
51
|
+
return str_pipe.gsub("{pipe}", "|")
|
52
|
+
end
|
53
|
+
return str_pipe
|
54
54
|
end
|
data/lib/Ifd_Mobile/version.rb
CHANGED
data/lib/LICENSE
ADDED
data/project/Gemfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
source "https://www.rubygems.org"
|
2
|
-
|
3
|
-
gem "rest-client"
|
4
|
-
gem "rspec"
|
5
|
-
gem "selenium-webdriver"
|
6
|
-
gem "cucumber"
|
7
|
-
gem "rspec-expectations"
|
1
|
+
source "https://www.rubygems.org"
|
2
|
+
|
3
|
+
gem "rest-client"
|
4
|
+
gem "rspec"
|
5
|
+
gem "selenium-webdriver"
|
6
|
+
gem "cucumber"
|
7
|
+
gem "rspec-expectations"
|