Ifd_Mobile 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/lib/Ifd_Mobile/lib_steps.rb +145 -145
  3. data/lib/Ifd_Mobile/methods/IFD_Assertion.rb +44 -44
  4. data/lib/Ifd_Mobile/methods/IFD_Connection.rb +28 -0
  5. data/lib/Ifd_Mobile/methods/core.rb +256 -256
  6. data/lib/Ifd_Mobile/methods/database_methods.rb +25 -0
  7. data/lib/Ifd_Mobile/methods/lib_schema_data_steps.rb +53 -0
  8. data/lib/Ifd_Mobile/methods/lib_var.rb +53 -53
  9. data/lib/Ifd_Mobile/methods/required_files.rb +3 -0
  10. data/lib/Ifd_Mobile/version.rb +5 -5
  11. data/project/Gemfile +11 -9
  12. data/project/Gemfile.lock +137 -50
  13. data/project/apps/TestApp/Test App 2/GestureTestViewController.h +18 -18
  14. data/project/apps/TestApp/Test App 2/GestureTestViewController.m +48 -48
  15. data/project/apps/TestApp/Test App 2/GestureTestViewController.xib +46 -46
  16. data/project/apps/TestApp/Test App 2/MyViewControllerViewController.h +42 -42
  17. data/project/apps/TestApp/Test App 2/MyViewControllerViewController.m +193 -193
  18. data/project/apps/TestApp/Test App 2/TA2AppDelegate.h +28 -28
  19. data/project/apps/TestApp/Test App 2/TA2AppDelegate.m +85 -85
  20. data/project/apps/TestApp/Test App 2/TestApp-Info.plist +40 -40
  21. data/project/apps/TestApp/Test App 2/TestApp-Prefix.pch +29 -29
  22. data/project/apps/TestApp/Test App 2/en.lproj/InfoPlist.strings +21 -21
  23. data/project/apps/TestApp/Test App 2/en.lproj/MyViewControllerViewController.xib +175 -175
  24. data/project/apps/TestApp/Test App 2/main.m +31 -31
  25. data/project/apps/TestApp/TestApp.xcodeproj/project.pbxproj +336 -336
  26. data/project/apps/TestApp/TestApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -7
  27. data/project/apps/TestApp/TestApp.xcodeproj/xcuserdata/anhpham.xcuserdatad/xcschemes/TestApp.xcscheme +88 -88
  28. data/project/apps/TestApp/TestApp.xcodeproj/xcuserdata/anhpham.xcuserdatad/xcschemes/xcschememanagement.plist +22 -22
  29. data/project/features/TestData/SqlScript/test.sql +0 -0
  30. data/project/features/android/Android_test1.feature +14 -16
  31. data/project/features/android/Android_test2.feature +14 -14
  32. data/project/features/iOS/iOS_test.feature +15 -15
  33. data/project/features/step_definitions/lib_steps/PolyClaim_homepage.rb +2 -12
  34. data/project/features/step_definitions/lib_steps/PolyClaim_loginpage.rb +3 -3
  35. data/project/features/step_definitions/repositories/android_ob_test.rb +9 -9
  36. data/project/features/step_definitions/repositories/ios_ob_test.rb +6 -6
  37. data/project/features/support/env.rb +36 -36
  38. data/project/features/support/hooks.rb +8 -8
  39. data/project/features/support/project_env.rb +55 -42
  40. metadata +7 -5
  41. data/project/apps/Bedder_2.0_0.17_VN.apk +0 -0
  42. data/project/apps/polyclaim.apk +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 72fc06fc59c80d2a962572eb4d330b8ee169b3f4
4
- data.tar.gz: 9bc07699132dc63271bd37992571c2ad9ee270dd
3
+ metadata.gz: 1f01da73e099e8c9481b79ac4c32c191ac35537b
4
+ data.tar.gz: f1150589243410b4336a33ce0756802219001c40
5
5
  SHA512:
6
- metadata.gz: 70e2b7f4aa02b3e761c27fcb8644812b9a974f529e9fb856d1d578c9b95b3c0f4378139e87958131edf1e5fed1c35fe7a39206b464f5ffac666016e6f0d78334
7
- data.tar.gz: 238fb31ca607df8802191377374b15faff5d6fbcc4bcc19fb6810c973a1b21402d4c03fdc1462de0844ed5a6a8a59dae1c6bae6b9403296fb7541959ce8aa55b
6
+ metadata.gz: c5461024ffafba0dd9c8793f5b8afd4f69c6c7863025d6bb8a372c0bf4d126c524ce54be0f501d149c403a72868118e1878e285ecaa5f5bfcdcd5194838bf973
7
+ data.tar.gz: 4c4d3ae869c7e7b9bd961356a468374c9aea0d740e5e3334843745868a3a17e0e654e3f7763f8670c0912b9684fb80ec606072e7bcbbb988bfa03964f826f7e7
@@ -1,145 +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(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
+ 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
@@ -0,0 +1,28 @@
1
+ require 'mysql2'
2
+ require 'tiny_tds'
3
+
4
+ class IFD_Connections
5
+ # Open the MYSQL connection to specific schema
6
+ def self.get_mysql_db_connection(schema)
7
+ begin
8
+ # puts ("Connecting to database...");
9
+ data_source_schema = schema.downcase
10
+ return Mysql2::Client.new(host: $data_source_url, username: $data_source_username, password: $data_source_password,database:data_source_schema);
11
+ rescue Exception => e
12
+ raise "Cannot connect to database [username: %s; password: %s, dbUrl: %s, dbName: %s] with error %s" %
13
+ [$data_source_username, $data_source_password, $data_source_url,data_source_schema, e.message]
14
+ end
15
+ end
16
+
17
+ # Open the SQL Server connection to specific schema
18
+ def self.get_sql_server_db_connection(schema)
19
+ begin
20
+ # puts ("Connecting to database...");
21
+ data_source_schema = schema.downcase
22
+ return TinyTds::Client.new(dataserver: $data_source_url, username: $data_source_username, password: $data_source_password, database:data_source_schema);
23
+ rescue Exception => e
24
+ raise "Cannot connect to database [username: %s; password: %s, dbUrl: %s, dbName: %s] with error %s" %
25
+ [$data_source_username, $data_source_password, $data_source_url,data_source_schema, e.message]
26
+ end
27
+ end
28
+ end