Ifd_Mobile 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -1,20 +1,11 @@
1
- require 'rubygems'
2
- # require 'selenium-webdriver'
3
- # require 'open-uri'
4
- # require 'rbconfig'
5
- # require 'appium_lib'
6
- # require 'rubygems'
7
- # require 'yaml'
8
- # require 'cucumber'
9
- # require 'rack/utf8_sanitizer'
10
- # require 'net/https'
11
- # require 'rspec/expectations'
12
- require 'Ifd_Mobile'
13
- include RbConfig
14
-
15
- require_relative 'core'
16
- require_relative 'IFD_Assertion'
17
- require_relative 'lib_var'
18
- require_relative 'IFD_Assertion'
19
- require_relative 'IFD_Connection'
20
-
1
+ require 'rubygems'
2
+ require 'Ifd_Mobile'
3
+ include RbConfig
4
+
5
+ require_relative 'core'
6
+ require_relative 'IFD_Assertion'
7
+ require_relative 'lib_var'
8
+ require_relative 'IFD_Assertion'
9
+ require_relative 'IFD_Connection'
10
+ require_relative 'auto_utils'
11
+
@@ -1,5 +1,5 @@
1
- module Ifd
2
- module Mobile
3
- VERSION = '1.4.0'
4
- end
5
- end
1
+ module Ifd
2
+ module Mobile
3
+ VERSION = '1.5.0'
4
+ end
5
+ end
data/lib/LICENSE CHANGED
@@ -1,3 +1,3 @@
1
- Infodation Automation
2
- Copyright (c) Anh Pham. All rights reserved.
1
+ Infodation Automation
2
+ Copyright (c) Anh Pham. All rights reserved.
3
3
  You must not remove this notice, or any other, from this software.
data/project/Gemfile CHANGED
@@ -1,12 +1,12 @@
1
- source "http://www.rubygems.org"
2
-
3
- gem "rest-client"
4
- gem "rspec"
5
- gem "selenium-webdriver"
6
- gem "cucumber"
7
- gem "rspec-expectations"
8
- gem "appium_lib"
9
- gem "rack-utf8_sanitizer"
10
- gem "mysql2","> 0.3.18"
11
- gem "tiny_tds", ">0.6.3.rc2"
1
+ source "http://www.rubygems.org"
2
+
3
+ gem "rest-client"
4
+ gem "rspec"
5
+ gem "selenium-webdriver"
6
+ gem "cucumber"
7
+ gem "rspec-expectations"
8
+ gem "appium_lib"
9
+ gem "rack-utf8_sanitizer"
10
+ gem "mysql2","> 0.3.18"
11
+ gem "tiny_tds", ">0.6.3.rc2"
12
12
  gem "Ifd_Mobile"
@@ -0,0 +1,182 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ actionmailer (4.2.4)
5
+ actionpack (= 4.2.4)
6
+ actionview (= 4.2.4)
7
+ activejob (= 4.2.4)
8
+ mail (~> 2.5, >= 2.5.4)
9
+ rails-dom-testing (~> 1.0, >= 1.0.5)
10
+ actionpack (4.2.4)
11
+ actionview (= 4.2.4)
12
+ activesupport (= 4.2.4)
13
+ rack (~> 1.6)
14
+ rack-test (~> 0.6.2)
15
+ rails-dom-testing (~> 1.0, >= 1.0.5)
16
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
17
+ actionview (4.2.4)
18
+ activesupport (= 4.2.4)
19
+ builder (~> 3.1)
20
+ erubis (~> 2.7.0)
21
+ rails-dom-testing (~> 1.0, >= 1.0.5)
22
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
23
+ activejob (4.2.4)
24
+ activesupport (= 4.2.4)
25
+ globalid (>= 0.3.0)
26
+ activemodel (4.2.4)
27
+ activesupport (= 4.2.4)
28
+ builder (~> 3.1)
29
+ activerecord (4.2.4)
30
+ activemodel (= 4.2.4)
31
+ activesupport (= 4.2.4)
32
+ arel (~> 6.0)
33
+ activesupport (4.2.4)
34
+ i18n (~> 0.7)
35
+ json (~> 1.7, >= 1.7.7)
36
+ minitest (~> 5.1)
37
+ thread_safe (~> 0.3, >= 0.3.4)
38
+ tzinfo (~> 1.1)
39
+ addressable (2.3.8)
40
+ arel (6.0.3)
41
+ builder (3.2.2)
42
+ capybara (2.4.4)
43
+ mime-types (>= 1.16)
44
+ nokogiri (>= 1.3.3)
45
+ rack (>= 1.0.0)
46
+ rack-test (>= 0.5.4)
47
+ xpath (~> 2.0)
48
+ chromedriver2-helper (0.0.8)
49
+ nokogiri
50
+ csv-diff (0.3.0)
51
+ diff-lcs (1.2.5)
52
+ domain_name (0.5.25)
53
+ unf (>= 0.0.5, < 1.0.0)
54
+ email_spec (1.6.0)
55
+ launchy (~> 2.1)
56
+ mail (~> 2.2)
57
+ erubis (2.7.0)
58
+ ffi (1.9.10-x64-mingw32)
59
+ gherkin (2.12.2)
60
+ multi_json (~> 1.3)
61
+ globalid (0.3.6)
62
+ activesupport (>= 4.1.0)
63
+ http-cookie (1.0.2)
64
+ domain_name (~> 0.5)
65
+ httparty (0.13.7)
66
+ json (~> 1.8)
67
+ multi_xml (>= 0.5.2)
68
+ i18n (0.7.0)
69
+ json (1.8.3)
70
+ launchy (2.4.3)
71
+ addressable (~> 2.3)
72
+ loofah (2.0.3)
73
+ nokogiri (>= 1.5.9)
74
+ mail (2.6.3)
75
+ mime-types (>= 1.16, < 3)
76
+ mime-types (2.6.2)
77
+ mini_portile (0.6.2)
78
+ minitest (5.8.1)
79
+ multi_json (1.11.2)
80
+ multi_xml (0.5.5)
81
+ mysql2 (0.3.18-x64-mingw32)
82
+ netrc (0.10.3)
83
+ nokogiri (1.6.6.2-x64-mingw32)
84
+ mini_portile (~> 0.6.0)
85
+ parallel (1.6.1)
86
+ parallel_tests (1.9.0)
87
+ parallel
88
+ power_assert (0.2.4)
89
+ rack (1.6.4)
90
+ rack-test (0.6.3)
91
+ rack (>= 1.0)
92
+ rack-utf8_sanitizer (1.3.1)
93
+ rack (~> 1.0)
94
+ rails (4.2.4)
95
+ actionmailer (= 4.2.4)
96
+ actionpack (= 4.2.4)
97
+ actionview (= 4.2.4)
98
+ activejob (= 4.2.4)
99
+ activemodel (= 4.2.4)
100
+ activerecord (= 4.2.4)
101
+ activesupport (= 4.2.4)
102
+ bundler (>= 1.3.0, < 2.0)
103
+ railties (= 4.2.4)
104
+ sprockets-rails
105
+ rails-deprecated_sanitizer (1.0.3)
106
+ activesupport (>= 4.2.0.alpha)
107
+ rails-dom-testing (1.0.7)
108
+ activesupport (>= 4.2.0.beta, < 5.0)
109
+ nokogiri (~> 1.6.0)
110
+ rails-deprecated_sanitizer (>= 1.0.1)
111
+ rails-html-sanitizer (1.0.2)
112
+ loofah (~> 2.0)
113
+ railties (4.2.4)
114
+ actionpack (= 4.2.4)
115
+ activesupport (= 4.2.4)
116
+ rake (>= 0.8.7)
117
+ thor (>= 0.18.1, < 2.0)
118
+ rake (10.4.2)
119
+ rautomation (0.17.0)
120
+ ffi (~> 1.9.0)
121
+ rest-client (1.8.0-x64-mingw32)
122
+ ffi (~> 1.9)
123
+ http-cookie (>= 1.0.2, < 2.0)
124
+ mime-types (>= 1.16, < 3.0)
125
+ netrc (~> 0.7)
126
+ rspec (3.3.0)
127
+ rspec-core (~> 3.3.0)
128
+ rspec-expectations (~> 3.3.0)
129
+ rspec-mocks (~> 3.3.0)
130
+ rspec-core (3.3.2)
131
+ rspec-support (~> 3.3.0)
132
+ rspec-expectations (3.3.1)
133
+ diff-lcs (>= 1.2.0, < 2.0)
134
+ rspec-support (~> 3.3.0)
135
+ rspec-mocks (3.3.2)
136
+ diff-lcs (>= 1.2.0, < 2.0)
137
+ rspec-support (~> 3.3.0)
138
+ rspec-support (3.3.0)
139
+ sprockets (3.4.0)
140
+ rack (> 1, < 3)
141
+ sprockets-rails (2.3.3)
142
+ actionpack (>= 3.0)
143
+ activesupport (>= 3.0)
144
+ sprockets (>= 2.8, < 4.0)
145
+ test-unit (3.1.5)
146
+ power_assert
147
+ thor (0.19.1)
148
+ thread_safe (0.3.5)
149
+ tiny_tds (0.6.2-x64-mingw32)
150
+ tzinfo (1.2.2)
151
+ thread_safe (~> 0.1)
152
+ unf (0.1.4)
153
+ unf_ext
154
+ unf_ext (0.0.7.1-x64-mingw32)
155
+ xpath (2.0.0)
156
+ nokogiri (~> 1.3)
157
+
158
+ PLATFORMS
159
+ x64-mingw32
160
+
161
+ DEPENDENCIES
162
+ actionmailer (~> 4.2.3)
163
+ capybara (~> 2.4.4)
164
+ chromedriver2-helper
165
+ csv-diff (~> 0.3.0)
166
+ email_spec
167
+ gherkin (~> 2.12.2)
168
+ httparty (~> 0.13.5)
169
+ json (= 1.8.3)
170
+ mail
171
+ mysql2 (= 0.3.18)
172
+ parallel_tests
173
+ rack-utf8_sanitizer
174
+ rails
175
+ rautomation (~> 0.17.0)
176
+ rest-client (~> 1.8.0)
177
+ rspec (~> 3.3.0)
178
+ test-unit (~> 3.1.2)
179
+ tiny_tds (~> 0.6.2)
180
+
181
+ BUNDLED WITH
182
+ 1.10.6
@@ -1,2 +1,2 @@
1
- username: demo
1
+ username: demo
2
2
  password: demo
@@ -1,6 +1,8 @@
1
- #Feature: Version check
2
- # Settings must display the Android version
3
- #
4
- # Scenario: Settings
5
- # Given I click on "button_OK_welcome"
6
- # And I click on "button_agree"
1
+ Feature: Sample test Vu App
2
+
3
+ Scenario: Login
4
+ # Given I wait for 30 seconds
5
+ # * I input text "info1@yopmail.com" on "login_textbox_username"
6
+ # * I input text "111111" on "login_textbox_password"
7
+ # * I click on "login_button"
8
+ * I verify property "loggedin_welcome_username" with "text" has value "Hello, info1 bnn"
@@ -1,14 +1,3 @@
1
- # Given /^I click about phone$/ do
2
- # scroll_to('About phone').click
3
- # end
4
- #
5
- # Given /^the Android version is a number$/ do
6
- # android_version = 'Android version'
7
- # scroll_to android_version
8
- #
9
- # view = 'android.widget.TextView'
10
- # version = xpath(%Q(//#{view}[preceding-sibling::#{view}[@text="#{android_version}"]])).text
11
- # valid = !version.match(/\d/).nil?
12
- #
13
- # expect(valid).to eq(true)
14
- # end
1
+ And /I click on Sign In button/ do
2
+ step %{I click on element with x: "520", y: "1150"}
3
+ end
@@ -1,3 +1,4 @@
1
- button_OK_welcome: {xpath: '//android.widget.Button[@resource-id="android:id/button2"'}
2
- button_agree: {xpath: '//android.widget.Button[@resource-id="com.whatsapp:id/eula_accept"]'}
3
- Bedder_SignIn_Login_button: {xpath: '//android.view.View[@content-desc="Login"]'}
1
+ login_textbox_username: {xpath: '/hierarchy//android.webkit.WebView//android.view.View[2]/android.view.View[3]/android.view.View[1]'}
2
+ login_textbox_password: {xpath: '/hierarchy//android.view.View/android.view.View[2]/android.view.View[3]/android.view.View[2]/android.view.View/android.view.View/android.view.View/android.view.View/android.widget.EditText'}
3
+ login_button: {xpath: '/hierarchy//android.webkit.WebView//android.view.View[2]/android.view.View[3]/android.widget.Button'}
4
+ loggedin_welcome_username: {xpath: '/hierarchy//android.view.View/android.view.View[2]/android.view.View/android.view.View/android.view.View[1]/android.view.View/android.view.View/android.view.View[3]/android.view.View'}
@@ -1,50 +1,33 @@
1
- require 'rspec/expectations'
2
- require 'appium_lib'
3
- require 'cucumber/ast'
4
- require 'selenium-webdriver'
5
- require 'open-uri'
6
- require 'rbconfig'
7
- require 'rubygems'
8
- require 'yaml'
9
- require 'cucumber'
10
- require 'rack/utf8_sanitizer'
11
- require 'net/https'
12
- require 'Ifd_Mobile'
13
-
14
- $current_dir = File.expand_path(File.dirname(__FILE__))
15
- $base_dir = File.expand_path(File.dirname(__FILE__) + '/../..')
16
-
17
- $_CONFIG = Hash.new
18
- $_CONFIG['Print Log'] = true
19
- PROJECT_CONFIG = YAML.load_file("#{$current_dir}/project_config.yml")
20
- $_CONFIG['Wait Time'] = PROJECT_CONFIG["wait_time"]
21
- $OBJECT = YAML.load_file("#{$base_dir}/features/step_definitions/repositories/project_object.yml")
22
- $test_data_dir = $base_dir + '/features/TestData/'
23
- $globalData = YAML.load_file("#{$test_data_dir}/globalData.yml")
24
-
25
-
26
- class AppiumWorld
27
-
28
- end
29
-
30
- def caps
31
- {
32
- 'platformName' => PROJECT_CONFIG['platform_name'],
33
- 'deviceName' => PROJECT_CONFIG['device_name'],
34
- 'platformVersion' => PROJECT_CONFIG['platform_version'],
35
- 'app' => PROJECT_CONFIG['app']
36
- }
37
- end
38
-
39
- Appium::Driver.new({caps: caps, appium_lib: {server_url: PROJECT_CONFIG["server_url"]}}).start_driver
40
-
41
-
42
- Appium.promote_appium_methods AppiumWorld
43
-
44
- World do
45
- AppiumWorld.new
46
- end
47
-
48
- def selenium
49
- return $driver
50
- end
1
+ require 'appium_lib'
2
+ require 'selenium-webdriver'
3
+ require 'rubygems'
4
+ require 'yaml'
5
+ require 'cucumber'
6
+ require 'Ifd_Mobile'
7
+ $current_dir = File.expand_path(File.dirname(__FILE__))
8
+ $base_dir = File.expand_path(File.dirname(__FILE__) + '/../..')
9
+
10
+ # $_CONFIG = Hash.new
11
+ # PROJECT_CONFIG = YAML.load_file("#{$current_dir}/project_config.yml")
12
+ # $_CONFIG['Print Log'] = ENV['browserName'] || true
13
+ $print_log = true
14
+ # $_CONFIG['Wait Time'] = PROJECT_CONFIG["wait_time"]
15
+ $OBJECT = YAML.load_file("#{$base_dir}/features/step_definitions/repositories/project_object.yml")
16
+ $test_data_dir = $base_dir + '/features/TestData/'
17
+ $globalData = YAML.load_file("#{$test_data_dir}/globalData.yml")
18
+
19
+ # class AppiumWorld
20
+ # end
21
+
22
+ # Appium::Driver.new({caps: PROJECT_CONFIG['capabilities'], appium_lib: {server_url: PROJECT_CONFIG["server_url"]}}).start_driver
23
+ #
24
+
25
+ # Appium.promote_appium_methods AppiumWorld
26
+ #
27
+ # World do
28
+ # AppiumWorld.new
29
+ # end
30
+
31
+ # def selenium
32
+ # return $driver
33
+ # end