itms_automation 2.6.7 → 2.7.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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/doc/installation.md +1 -1
  3. data/features-skeleton/my_first.feature +19 -10
  4. data/features-skeleton/step_definitions/input_steps.rb +3 -3
  5. data/features-skeleton/step_definitions/my_first_steps.rb +14 -0
  6. data/features-skeleton/step_definitions/repositories/project_object.yml +1 -1
  7. data/features-skeleton/support/env.rb +17 -88
  8. data/lib/itms_automation/input_steps.rb +1 -1
  9. data/lib/itms_automation/methods/assertion_methods.rb +159 -174
  10. data/lib/itms_automation/methods/click_elements_methods.rb +13 -6
  11. data/lib/itms_automation/methods/condition_methods.rb +13 -0
  12. data/lib/itms_automation/methods/configuration_methods.rb +14 -7
  13. data/lib/itms_automation/methods/input_methods.rb +58 -15
  14. data/lib/itms_automation/methods/javascript_handling_methods.rb +1 -1
  15. data/lib/itms_automation/methods/misc_methods.rb +1 -2
  16. data/lib/itms_automation/methods/navigate_methods.rb +52 -45
  17. data/lib/itms_automation/methods/progress_methods.rb +73 -6
  18. data/lib/itms_automation/methods/store_methods.rb +36 -0
  19. data/lib/itms_automation/version.rb +1 -1
  20. metadata +40 -40
  21. data/example/android/android_app/android_app_calculator.zip +0 -0
  22. data/example/android/android_app/android_app_calculator/AndroidCalculator.apk +0 -0
  23. data/example/android/android_app/android_app_calculator/features/calculator.feature +0 -36
  24. data/example/android/android_app/android_app_calculator/features/my_first.feature +0 -13
  25. data/example/android/android_app/android_app_calculator/features/screenshots/test.png +0 -0
  26. data/example/android/android_app/android_app_calculator/features/step_definitions/custom_steps.rb +0 -5
  27. data/example/android/android_app/android_app_calculator/features/support/env.rb +0 -52
  28. data/example/android/android_app/android_app_calculator/features/support/hooks.rb +0 -26
  29. data/example/android/android_web/android_web_gmail_login.zip +0 -0
  30. data/example/android/android_web/android_web_gmail_login/features/gmail_login.feature +0 -12
  31. data/example/android/android_web/android_web_gmail_login/features/my_first.feature +0 -1
  32. data/example/android/android_web/android_web_gmail_login/features/screenshots/test.png +0 -0
  33. data/example/android/android_web/android_web_gmail_login/features/step_definitions/custom_steps.rb +0 -5
  34. data/example/android/android_web/android_web_gmail_login/features/support/env.rb +0 -51
  35. data/example/android/android_web/android_web_gmail_login/features/support/hooks.rb +0 -27
  36. data/example/desktop web/desktop_web_gmail_login.zip +0 -0
  37. data/example/desktop web/desktop_web_gmail_login/features/gmail_login.feature +0 -9
  38. data/example/desktop web/desktop_web_gmail_login/features/gmail_multi_login.feature +0 -21
  39. data/example/desktop web/desktop_web_gmail_login/features/my_first.feature +0 -1
  40. data/example/desktop web/desktop_web_gmail_login/features/screenshots/test.png +0 -0
  41. data/example/desktop web/desktop_web_gmail_login/features/step_definitions/custom_steps.rb +0 -5
  42. data/example/desktop web/desktop_web_gmail_login/features/support/env.rb +0 -106
  43. data/example/desktop web/desktop_web_gmail_login/features/support/hooks.rb +0 -38
@@ -0,0 +1,36 @@
1
+ require 'net/https'
2
+ require_relative 'required_files'
3
+ require 'rspec'
4
+
5
+ def store(var_name, value)
6
+ $vars[var_name] = value
7
+ end
8
+
9
+ def store_json(var_name, value)
10
+ $vars[var_name] = JSON.parse(value)
11
+ end
12
+
13
+ def store_text(element, var_name)
14
+ found_element = find_object(element)
15
+ element_text = found_element.text
16
+ $vars[var_name] = element_text
17
+ end
18
+
19
+ def store_title(var_name)
20
+ $vars[var_name] = $driver.title
21
+ end
22
+
23
+ def store_xpath_count(element, var_name)
24
+ found_element = find_object(element)
25
+ $vars[var_name] = found_element.length
26
+ end
27
+
28
+ def store_window_handle(var_name)
29
+ $vars[var_name] = $driver.window_handle
30
+ end
31
+
32
+ def store_attribute(element, attribute, var_name)
33
+ found_element = find_object(element)
34
+ value = found_element.attribute(attribute)
35
+ $vars[var_name] = value
36
+ end
@@ -1,5 +1,5 @@
1
1
  module ITMS
2
2
  module Automation
3
- VERSION = '2.6.7'
3
+ VERSION = '2.7.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itms_automation
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.7
4
+ version: 2.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - INFOdation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-21 00:00:00.000000000 Z
11
+ date: 2021-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -16,40 +16,40 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.1.2
19
+ version: 5.2.0
20
20
  - - "~>"
21
21
  - !ruby/object:Gem::Version
22
- version: 3.1.2
22
+ version: 5.2.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 3.1.2
29
+ version: 5.2.0
30
30
  - - "~>"
31
31
  - !ruby/object:Gem::Version
32
- version: 3.1.2
32
+ version: 5.2.0
33
33
  - !ruby/object:Gem::Dependency
34
- name: selenium-webdriver
34
+ name: webdrivers
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '3.14'
40
37
  - - ">="
41
38
  - !ruby/object:Gem::Version
42
- version: 3.14.1
39
+ version: 4.4.1
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: 4.4.1
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - "~>"
48
- - !ruby/object:Gem::Version
49
- version: '3.14'
50
47
  - - ">="
51
48
  - !ruby/object:Gem::Version
52
- version: 3.14.1
49
+ version: 4.4.1
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: 4.4.1
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: appium_lib_core
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -110,6 +110,26 @@ dependencies:
110
110
  - - "~>"
111
111
  - !ruby/object:Gem::Version
112
112
  version: '1.8'
113
+ - !ruby/object:Gem::Dependency
114
+ name: rspec
115
+ requirement: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '3.5'
120
+ - - "~>"
121
+ - !ruby/object:Gem::Version
122
+ version: '3.5'
123
+ type: :runtime
124
+ prerelease: false
125
+ version_requirements: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: '3.5'
130
+ - - "~>"
131
+ - !ruby/object:Gem::Version
132
+ version: '3.5'
113
133
  description: Behavior driven development (BDD) approach to write automation test script
114
134
  to test Web and Android applications.
115
135
  email: anh.pham@infodation.vn
@@ -124,29 +144,6 @@ files:
124
144
  - doc/installation.md
125
145
  - doc/itms-automation-API.md
126
146
  - doc/itms-automation-help.md
127
- - example/android/android_app/android_app_calculator.zip
128
- - example/android/android_app/android_app_calculator/AndroidCalculator.apk
129
- - example/android/android_app/android_app_calculator/features/calculator.feature
130
- - example/android/android_app/android_app_calculator/features/my_first.feature
131
- - example/android/android_app/android_app_calculator/features/screenshots/test.png
132
- - example/android/android_app/android_app_calculator/features/step_definitions/custom_steps.rb
133
- - example/android/android_app/android_app_calculator/features/support/env.rb
134
- - example/android/android_app/android_app_calculator/features/support/hooks.rb
135
- - example/android/android_web/android_web_gmail_login.zip
136
- - example/android/android_web/android_web_gmail_login/features/gmail_login.feature
137
- - example/android/android_web/android_web_gmail_login/features/my_first.feature
138
- - example/android/android_web/android_web_gmail_login/features/screenshots/test.png
139
- - example/android/android_web/android_web_gmail_login/features/step_definitions/custom_steps.rb
140
- - example/android/android_web/android_web_gmail_login/features/support/env.rb
141
- - example/android/android_web/android_web_gmail_login/features/support/hooks.rb
142
- - example/desktop web/desktop_web_gmail_login.zip
143
- - example/desktop web/desktop_web_gmail_login/features/gmail_login.feature
144
- - example/desktop web/desktop_web_gmail_login/features/gmail_multi_login.feature
145
- - example/desktop web/desktop_web_gmail_login/features/my_first.feature
146
- - example/desktop web/desktop_web_gmail_login/features/screenshots/test.png
147
- - example/desktop web/desktop_web_gmail_login/features/step_definitions/custom_steps.rb
148
- - example/desktop web/desktop_web_gmail_login/features/support/env.rb
149
- - example/desktop web/desktop_web_gmail_login/features/support/hooks.rb
150
147
  - features-skeleton/Gemfile
151
148
  - features-skeleton/Gemfile.lock
152
149
  - features-skeleton/README.md
@@ -158,6 +155,7 @@ files:
158
155
  - features-skeleton/step_definitions/configuration_steps.rb
159
156
  - features-skeleton/step_definitions/input_steps.rb
160
157
  - features-skeleton/step_definitions/javascript_handling_steps.rb
158
+ - features-skeleton/step_definitions/my_first_steps.rb
161
159
  - features-skeleton/step_definitions/navigation_steps.rb
162
160
  - features-skeleton/step_definitions/progress_steps.rb
163
161
  - features-skeleton/step_definitions/repositories/project_object.yml
@@ -171,6 +169,7 @@ files:
171
169
  - lib/itms_automation/javascript_handling_steps.rb
172
170
  - lib/itms_automation/methods/assertion_methods.rb
173
171
  - lib/itms_automation/methods/click_elements_methods.rb
172
+ - lib/itms_automation/methods/condition_methods.rb
174
173
  - lib/itms_automation/methods/configuration_methods.rb
175
174
  - lib/itms_automation/methods/error_handling_methods.rb
176
175
  - lib/itms_automation/methods/input_methods.rb
@@ -180,6 +179,7 @@ files:
180
179
  - lib/itms_automation/methods/progress_methods.rb
181
180
  - lib/itms_automation/methods/required_files.rb
182
181
  - lib/itms_automation/methods/screenshot_methods.rb
182
+ - lib/itms_automation/methods/store_methods.rb
183
183
  - lib/itms_automation/navigation_steps.rb
184
184
  - lib/itms_automation/progress_steps.rb
185
185
  - lib/itms_automation/screenshot_steps.rb
@@ -196,14 +196,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
196
196
  requirements:
197
197
  - - ">="
198
198
  - !ruby/object:Gem::Version
199
- version: 1.9.3
199
+ version: 2.0.0
200
200
  required_rubygems_version: !ruby/object:Gem::Requirement
201
201
  requirements:
202
202
  - - ">="
203
203
  - !ruby/object:Gem::Version
204
204
  version: '0'
205
205
  requirements: []
206
- rubygems_version: 3.0.6
206
+ rubygems_version: 3.0.3
207
207
  signing_key:
208
208
  specification_version: 4
209
209
  summary: SELENIUM WEBDRIVER WITH RUBY & CUCUMBER
@@ -1,36 +0,0 @@
1
- Feature: Verify Calculator functionalities
2
-
3
- Scenario: Click on OK button
4
- Then I click on element having id "com.android2.calculator3:id/cling_dismiss"
5
-
6
- Scenario: Addirion
7
- Then I click on element having id "com.android2.calculator3:id/digit5"
8
- Then I click on element having id "com.android2.calculator3:id/plus"
9
- Then I click on element having id "com.android2.calculator3:id/digit9"
10
- When I click on element having id "com.android2.calculator3:id/equal"
11
- Then element having xpath "//android.widget.EditText[@index=0]" should have text as "14"
12
-
13
-
14
- Scenario: Substraction
15
- Then I click on element having id "com.android2.calculator3:id/digit9"
16
- Then I click on element having id "com.android2.calculator3:id/minus"
17
- Then I click on element having id "com.android2.calculator3:id/digit5"
18
- When I click on element having id "com.android2.calculator3:id/equal"
19
- Then element having xpath "//android.widget.EditText[@index=0]" should have text as "4"
20
-
21
- Scenario: Multiplication
22
- Then I click on element having id "com.android2.calculator3:id/digit9"
23
- Then I click on element having id "com.android2.calculator3:id/mul"
24
- Then I click on element having id "com.android2.calculator3:id/digit5"
25
- When I click on element having id "com.android2.calculator3:id/equal"
26
- Then element having xpath "//android.widget.EditText[@index=0]" should have text as "45"
27
-
28
- Scenario: Division
29
- Then I click on element having id "com.android2.calculator3:id/digit8"
30
- Then I click on element having id "com.android2.calculator3:id/div"
31
- Then I click on element having id "com.android2.calculator3:id/digit2"
32
- When I click on element having id "com.android2.calculator3:id/equal"
33
- Then element having xpath "//android.widget.EditText[@index=0]" should have text as "4"
34
-
35
- Scenario: Clear output
36
- Then I click on element having id "com.android2.calculator3:id/clear"
@@ -1,13 +0,0 @@
1
- #Scenario: Division
2
- # Then I click on element having id "com.android2.calculator3:id/digit8"
3
- # Then I click on element having id "com.android2.calculator3:id/div"
4
- # Then I click on element having id "com.android2.calculator3:id/digit4"
5
- # When I click on element having id "com.android2.calculator3:id/equal"
6
- # Then element having xpath "//android.widget.EditText[@index=0]" should have text as "2"
7
-
8
- # Scenario: Multiplication
9
- # Then I click on element having id "com.android2.calculator3:id/digit6"
10
- # Then I click on element having id "com.android2.calculator3:id/mul"
11
- # Then I click on element having id "com.android2.calculator3:id/digit5"
12
- # When I click on element having id "com.android2.calculator3:id/equal"
13
- # Then element having xpath "//android.widget.EditText[@index=0]" should have text as "30"
@@ -1,5 +0,0 @@
1
- require 'itms_automation'
2
-
3
- # Do Not Remove This File
4
- # Add your custom steps here
5
- # $driver is instance of webdriver use this instance to write your custom code
@@ -1,52 +0,0 @@
1
- require 'rubygems'
2
- require 'itms_automation'
3
-
4
- # Store command line arguments
5
- $browser_type = ENV['BROWSER'] || 'ff'
6
- $platform = ENV['PLATFORM'] || 'desktop'
7
- $os_version = ENV['OS_VERSION']
8
- $device_name = ENV['DEVICE_NAME']
9
- $udid = ENV['UDID']
10
- $app_path = ENV['APP_PATH']
11
-
12
- # check for valid parameters
13
- validate_parameters $platform, $browser_type, $app_path
14
-
15
- # If platform is android or ios create driver instance for mobile browser
16
- if $platform == 'android' or $platform == 'iOS'
17
-
18
- if $browser_type == 'native'
19
- $browser_type = "Browser"
20
- end
21
-
22
- if $platform == 'android'
23
- $device_name, $os_version = get_device_info
24
- end
25
-
26
- desired_caps = {
27
- caps: {
28
- platformName: $platform,
29
- browserName: $browser_type,
30
- versionNumber: $os_version,
31
- deviceName: $device_name,
32
- udid: $udid,
33
- app: ".//#{$app_path}"
34
- },
35
- appium_lib: { server_url: 'http://localhost:4723/wd/hub' }
36
- }
37
-
38
- begin
39
- $driver = Appium::Driver.new(desired_caps).start_driver
40
- rescue Exception => e
41
- puts e.message
42
- Process.exit(0)
43
- end
44
- else # else create driver instance for desktop browser
45
- begin
46
- $driver = Selenium::WebDriver.for(:"#{$browser_type}")
47
- $driver.manage().window().maximize()
48
- rescue Exception => e
49
- puts e.message
50
- Process.exit(0)
51
- end
52
- end
@@ -1,26 +0,0 @@
1
- #Cucumber provides a number of hooks which allow us to run blocks at various points in the Cucumber test cycle
2
-
3
- Before do
4
- # Do something before each scenario.
5
- end
6
-
7
- Before do |scenario|
8
- # The +scenario+ argument is optional, but if you use it, you can get the title,
9
- # description, or name (title + description) of the scenario that is about to be
10
- # executed.
11
- end
12
-
13
- After do
14
- # Do something after each scenario.
15
- end
16
-
17
- After do |scenario|
18
- # Do something after each scenario.
19
- # The +scenario+ argument is optional, but
20
- # if you use it, you can inspect status with
21
- # the #failed?, #passed? and #exception methods.
22
-
23
- if(scenario.failed?)
24
- #Do something if scenario fails.
25
- end
26
- end
@@ -1,12 +0,0 @@
1
- Feature: Gmail Login mobile web
2
-
3
- Scenario: valid credentials login
4
- Given I navigate to "http://www.gmail.com"
5
- Then I wait for 5 sec
6
- Then I enter "your_email" into input field having id "Email"
7
- Then I enter "your_password" into input field having id "Passwd"
8
- When I click on element having id "signIn"
9
- And I wait for 10 sec
10
- Then element having xpath "//*[@id='tltbt']/div[3]/div/div" should be present
11
- And I wait for 5 sec
12
- Then I close browser
@@ -1,5 +0,0 @@
1
- require 'itms_automation'
2
-
3
- # Do Not Remove This File
4
- # Add your custom steps here
5
- # $driver is instance of webdriver use this instance to write your custom code
@@ -1,51 +0,0 @@
1
- require 'rubygems'
2
- require 'itms_automation'
3
-
4
- # Store command line arguments
5
- $browser_type = ENV['BROWSER'] || 'ff'
6
- $platform = ENV['PLATFORM'] || 'desktop'
7
- $os_version = ENV['OS_VERSION']
8
- $device_name = ENV['DEVICE_NAME']
9
- $udid = ENV['UDID']
10
- $app_path = ENV['APP_PATH']
11
-
12
- # check for valid parameters
13
- validate_parameters $platform, $browser_type, $app_path
14
-
15
- # If platform is android or ios create driver instance for mobile browser
16
- if $platform == 'android' or $platform == 'iOS'
17
-
18
- if $browser_type == 'native'
19
- $browser_type = "Browser"
20
- end
21
-
22
- if $platform == 'android'
23
- $device_name, $os_version = get_device_info
24
- end
25
-
26
- desired_caps = {
27
- caps: {
28
- platformName: $platform,
29
- browserName: $browser_type,
30
- versionNumber: $os_version,
31
- deviceName: $device_name,
32
- udid: $udid,
33
- app: ".//#{$app_path}"
34
- },
35
- }
36
-
37
- begin
38
- $driver = Appium::Driver.new(desired_caps).start_driver
39
- rescue Exception => e
40
- puts e.message
41
- Process.exit(0)
42
- end
43
- else # else create driver instance for desktop browser
44
- begin
45
- $driver = Selenium::WebDriver.for(:"#{$browser_type}")
46
- $driver.manage().window().maximize()
47
- rescue Exception => e
48
- puts e.message
49
- Process.exit(0)
50
- end
51
- end
@@ -1,27 +0,0 @@
1
- #Cucumber provides a number of hooks which allow us to run blocks at various points in the Cucumber test cycle
2
-
3
- Before do
4
- # Do something before each scenario.
5
- end
6
-
7
- Before do |scenario|
8
- # The +scenario+ argument is optional, but if you use it, you can get the title,
9
- # description, or name (title + description) of the scenario that is about to be
10
- # executed.
11
- end
12
-
13
- After do
14
- # Do something after each scenario.
15
- end
16
-
17
- After do |scenario|
18
- # Do something after each scenario.
19
- # The +scenario+ argument is optional, but
20
- # if you use it, you can inspect status with
21
- # the #failed?, #passed? and #exception methods.
22
-
23
- if(scenario.failed?)
24
- #Do something if scenario fails.
25
- end
26
- end
27
-