Ifd_Mobile 0.1.6 → 0.1.7

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.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/lib/Ifd_Mobile/lib_steps.rb +145 -140
  3. data/lib/Ifd_Mobile/methods/IFD_Assertion.rb +44 -44
  4. data/lib/Ifd_Mobile/methods/core.rb +256 -256
  5. data/lib/Ifd_Mobile/methods/lib_var.rb +53 -53
  6. data/lib/Ifd_Mobile/version.rb +5 -5
  7. data/project/Gemfile +9 -9
  8. data/project/Gemfile.lock +50 -137
  9. data/project/apps/Bedder_2.0_0.17_VN.apk +0 -0
  10. data/project/apps/TestApp/Test App 2/GestureTestViewController.h +18 -18
  11. data/project/apps/TestApp/Test App 2/GestureTestViewController.m +48 -48
  12. data/project/apps/TestApp/Test App 2/GestureTestViewController.xib +46 -46
  13. data/project/apps/TestApp/Test App 2/MyViewControllerViewController.h +42 -42
  14. data/project/apps/TestApp/Test App 2/MyViewControllerViewController.m +193 -193
  15. data/project/apps/TestApp/Test App 2/TA2AppDelegate.h +28 -28
  16. data/project/apps/TestApp/Test App 2/TA2AppDelegate.m +85 -85
  17. data/project/apps/TestApp/Test App 2/TestApp-Info.plist +40 -40
  18. data/project/apps/TestApp/Test App 2/TestApp-Prefix.pch +29 -29
  19. data/project/apps/TestApp/Test App 2/en.lproj/InfoPlist.strings +21 -21
  20. data/project/apps/TestApp/Test App 2/en.lproj/MyViewControllerViewController.xib +175 -175
  21. data/project/apps/TestApp/Test App 2/main.m +31 -31
  22. data/project/apps/TestApp/TestApp.xcodeproj/project.pbxproj +336 -336
  23. data/project/apps/TestApp/TestApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -7
  24. data/project/apps/TestApp/TestApp.xcodeproj/xcuserdata/anhpham.xcuserdatad/xcschemes/TestApp.xcscheme +88 -88
  25. data/project/apps/TestApp/TestApp.xcodeproj/xcuserdata/anhpham.xcuserdatad/xcschemes/xcschememanagement.plist +22 -22
  26. data/project/apps/polyclaim.apk +0 -0
  27. data/project/features/android/Android_test1.feature +16 -14
  28. data/project/features/android/Android_test2.feature +14 -14
  29. data/project/features/iOS/iOS_test.feature +15 -15
  30. data/project/features/step_definitions/lib_steps/PolyClaim_homepage.rb +12 -2
  31. data/project/features/step_definitions/lib_steps/PolyClaim_loginpage.rb +3 -3
  32. data/project/features/step_definitions/repositories/android_ob_test.rb +9 -9
  33. data/project/features/step_definitions/repositories/ios_ob_test.rb +6 -6
  34. data/project/features/support/env.rb +36 -36
  35. data/project/features/support/hooks.rb +8 -8
  36. data/project/features/support/project_env.rb +42 -42
  37. metadata +41 -45
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5764f9e3947fec819218c26edaf9e5d0f3a7fec8
4
- data.tar.gz: 8cadb98135a46cb6f829b130fca037e5f9672e8d
3
+ metadata.gz: 72fc06fc59c80d2a962572eb4d330b8ee169b3f4
4
+ data.tar.gz: 9bc07699132dc63271bd37992571c2ad9ee270dd
5
5
  SHA512:
6
- metadata.gz: 65a4fdfd2c3ad5c5a16c5150e47b30569ca3cacefe32911347a4ac0a2574db13b804066116a3e77d114e882f6d42e861782e5fb943c02a13b1e6c8cddfecd44a
7
- data.tar.gz: 89e74c9a7bc4734254ed4f7e871dc6f156127766f4dfa07fb7ef86e3fdeabcb45adf24c8753c20b1963bfed9d6432947c8cb4eecd18bbd4b233069b163fe1ef0
6
+ metadata.gz: 70e2b7f4aa02b3e761c27fcb8644812b9a974f529e9fb856d1d578c9b95b3c0f4378139e87958131edf1e5fed1c35fe7a39206b464f5ffac666016e6f0d78334
7
+ data.tar.gz: 238fb31ca607df8802191377374b15faff5d6fbcc4bcc19fb6810c973a1b21402d4c03fdc1462de0844ed5a6a8a59dae1c6bae6b9403296fb7541959ce8aa55b
@@ -1,140 +1,145 @@
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
- Then(/^I tap on back button of device$/) do
64
- navigate('back')
65
- end
66
-
67
- Then(/^I tap on forward button of device$/) do
68
- navigate('forward')
69
- end
70
-
71
- #---------- Swipe with direction
72
- Then(/^I swipe left$/) do
73
- swipe_direction("left")
74
- end
75
-
76
- Then(/^I swipe right$/) do
77
- swipe_direction("right")
78
- end
79
-
80
- Then(/^I swipe up$/) do
81
- swipe_direction("up")
82
- end
83
-
84
- Then(/^I swipe down$/) do
85
- swipe_direction("down")
86
- end
87
-
88
- Then(/^I long tap on element having "(.*?)"$/) do |element|
89
- long_press_on_element_default_duration(element)
90
- end
91
-
92
- Then(/^I long tap on element having (.+) "(.*?)" for "(.*?)" sec$/) do |element, duration|
93
- long_press_on_element_with_duration(element, duration)
94
- end
95
-
96
- Then(/^I long tap on co\-ordinate "(.*?)","(.*?)"$/) do |x, y|
97
- long_press_on_coordinates(x, y)
98
- end
99
-
100
- Then(/^I long tap on co\-ordinate "(.*?)","(.*?)" for "(.*?)" sec$/) do |x, y, duration|
101
- long_press_on_coordinates_with_duration(x, y, duration)
102
- end
103
-
104
- Then(/^I close app$/) do
105
- close_app
106
- end
107
-
108
- Then(/^I launch app$/) do
109
- launch_app
110
- end
111
-
112
- Then(/^I reset app$/) do
113
- reset_app
114
- end
115
-
116
- And /^I delete an character on Android$/ do
117
- delete_an_character_android
118
- end
119
-
120
- And /^I take a photo on Android$/ do
121
- take_photo_android
122
- end
123
-
124
- And /^I go home screen Android$/ do
125
- move_home
126
- end
127
-
128
- And /^I set app to run background within (\d+)$/ do |seconds|
129
- selenium.background_app seconds
130
- end
131
-
132
- And /^I press button (\d+)$/ do |button_index|
133
- # Find a button by index
134
- button(button_index.to_i).click
135
- end
136
-
137
- Given /^I set text "(.*)" on filed index (\d+)$/ do |value, field|
138
- # Get a textfield by index
139
- textfield(field.to_i).type value
140
- end
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(start_x: startX, start_y: startY, end_x: endX, end_y: 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
+ Then(/^I tap on back button of device$/) do
64
+ navigate('back')
65
+ end
66
+
67
+ Then(/^I tap on forward button of device$/) do
68
+ navigate('forward')
69
+ end
70
+
71
+ # #---------- Swipe with direction
72
+ # Then(/^I swipe left$/) do
73
+ # swipe_direction("left")
74
+ # end
75
+ #
76
+ # Then(/^I swipe right$/) do
77
+ # swipe_direction("right")
78
+ # end
79
+ #
80
+ # Then(/^I swipe up$/) do
81
+ # swipe_direction("up")
82
+ # end
83
+ #
84
+ # Then(/^I swipe down$/) do
85
+ # swipe_direction("down")
86
+ # end
87
+
88
+ Then(/^I long tap on element having "(.*?)"$/) do |element|
89
+ long_press_on_element_default_duration(element)
90
+ end
91
+
92
+ Then(/^I long tap on element having (.+) "(.*?)" for "(.*?)" sec$/) do |element, duration|
93
+ long_press_on_element_with_duration(element, duration)
94
+ end
95
+
96
+ Then(/^I long tap on co\-ordinate "(.*?)","(.*?)"$/) do |x, y|
97
+ long_press_on_coordinates(x, y)
98
+ end
99
+
100
+ Then(/^I long tap on co\-ordinate "(.*?)","(.*?)" for "(.*?)" sec$/) do |x, y, duration|
101
+ long_press_on_coordinates_with_duration(x, y, duration)
102
+ end
103
+
104
+ Then(/^I close app$/) do
105
+ close_app
106
+ end
107
+
108
+ Then(/^I launch app$/) do
109
+ launch_app
110
+ end
111
+
112
+ Then(/^I reset app$/) do
113
+ reset_app
114
+ end
115
+
116
+ And /^I set app to run background within (\d+)$/ do |seconds|
117
+ selenium.background_app seconds
118
+ end
119
+
120
+ And /^I press button (\d+)$/ do |button_index|
121
+ # Find a button by index
122
+ button(button_index.to_i).click
123
+ end
124
+
125
+ Given /^I set text "(.*)" on filed index (\d+)$/ do |value, field|
126
+ # Get a textfield by index
127
+ textfield(field.to_i).type value
128
+ end
129
+
130
+ ################## List of Steps support Android only#####################
131
+ Given /^I scroll to text "(.*)" Android$/ do |text|
132
+ scroll_to(text)
133
+ end
134
+
135
+ And /^I go home screen Android$/ do
136
+ move_home
137
+ end
138
+
139
+ And /^I delete an character on Android$/ do
140
+ delete_an_character_android
141
+ end
142
+
143
+ And /^I take a photo on Android$/ do
144
+ take_photo_android
145
+ 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