itms_automation 2.6.2 → 2.6.8

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 (44) hide show
  1. checksums.yaml +4 -4
  2. data/doc/installation.md +1 -1
  3. data/features-skeleton/README.md +128 -66
  4. data/features-skeleton/my_first.feature +19 -10
  5. data/features-skeleton/step_definitions/assertion_steps.rb +69 -0
  6. data/features-skeleton/step_definitions/click_elements_steps.rb +25 -0
  7. data/features-skeleton/step_definitions/configuration_steps.rb +8 -0
  8. data/features-skeleton/step_definitions/input_steps.rb +60 -0
  9. data/features-skeleton/step_definitions/javascript_handling_steps.rb +11 -0
  10. data/features-skeleton/step_definitions/my_first_steps.rb +14 -0
  11. data/features-skeleton/step_definitions/navigation_steps.rb +80 -0
  12. data/features-skeleton/step_definitions/progress_steps.rb +18 -0
  13. data/features-skeleton/step_definitions/repositories/project_object.yml +1 -1
  14. data/features-skeleton/support/env.rb +29 -96
  15. data/lib/itms_automation/input_steps.rb +1 -1
  16. data/lib/itms_automation/methods/assertion_methods.rb +2 -2
  17. data/lib/itms_automation/methods/misc_methods.rb +2 -1
  18. data/lib/itms_automation/methods/navigate_methods.rb +2 -4
  19. data/lib/itms_automation/version.rb +1 -1
  20. metadata +28 -44
  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
  44. data/features-skeleton/step_definitions/custom_steps.rb +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4feb41c4f5dd09900380546aff2b9631e24f56e0f71221f537ea430ed6bd0aa5
4
- data.tar.gz: 40dbc3a2a3b1221a55801afc5718d196e1532be10cdba9273c7bd683f9d13b94
3
+ metadata.gz: 152915e55093128d7fc658318c8b62d5125cd56933a7a99153aa1db6417212cc
4
+ data.tar.gz: dc2329818b77297eb021962d60e03b14134375d46b281cf2c153b5003c0e52df
5
5
  SHA512:
6
- metadata.gz: 0bb2b034e973e9672ac206c8a6f1105881e5b598874a727ff15560bc3b366d7b3e69b0d56312568f248191cb0cf0a538771a7b268c39001ec2963d2bc3188d48
7
- data.tar.gz: 0767eab9e0c95a774932f66916a2316606006e420497a68e2793286dd501a683e74bedb4734f86b82dfc521ba96eea92ac29397f36858f1b936e8af0f6be72f1
6
+ metadata.gz: 95685084ff2886f18defefdadb15212eca6a1ac1679982f122d706f0ead93a581838046dd70935c616e5fe52082d80b2af41f8d1bccb1b7ef44eac297f1077ed
7
+ data.tar.gz: 5e0d573679aafffa4a59e3a30821dc5915c90ef965cff47e1c756b287ca5ff664cefb9ba3cc8d12253ccb3359ee37ab263403936938157125094d6d7a40794d3
@@ -2,7 +2,7 @@ Installation
2
2
  ============
3
3
  ### Prerequisites
4
4
  You need to have Ruby installed.
5
- Verify your installation by running ruby -v in a terminal - it should print "ruby 1.9.3" (or higher).
5
+ Verify your installation by running ruby -v in a terminal - it should print "ruby 2.0.0" (or higher).
6
6
 
7
7
  You need to have DevKit installed.
8
8
 
@@ -17,102 +17,164 @@ Note : For some of the API paramtere values are fixed. Such values for paramater
17
17
 
18
18
  Navigation API's
19
19
  ----------------
20
-
20
+ # method to open link
21
21
  navigate_to("link")
22
-
22
+ # method to navigate back & forward
23
23
  navigate(direction) # direction => "back" / "forward"
24
-
24
+ # method to quite webdriver instance
25
25
  close_driver()
26
-
27
-
28
- Browser Interaction API's
29
- -------------------------
30
-
31
- resize_browser(width, height)
32
-
33
- scroll_page(to) # to => "top" / "end"
34
-
35
- scroll_to_element(by, access_value)
36
-
37
- zoom_in_out(in_out) # in_out => "add" / "subtract"
38
-
39
- zoom_in_out_till_element_display(by, in_out, access_value) # in_out => "add" / "subtract"
40
-
26
+ # method to return key by os wise
27
+ get_key()
28
+ # Method to zoom in/out page
29
+ zoom_in_out(in_out) # in_out => "in" / "out"
30
+ # Method to zoom in/out web page until web element dislays
31
+ zoom_in_out_till_element_display(element, in_out)
32
+ # Method to resize browser
33
+ resize_browser(width, heigth)
34
+ # Method to maximize browser
35
+ maximize_browser
36
+ # Method to refresh page
37
+ refresh_page
38
+ # Method to hover on element
39
+ hover_over_element(element)
40
+ # Method to scroll page to perticular element
41
+ scroll_to_element(element)
42
+ # method to scroll page to top or end
43
+ scroll_page(to)
44
+ # Method to switch to new window
45
+ switch_to_new_window
46
+ # Method to switch to old window
47
+ switch_to_old_window
48
+ # Method to close new window
49
+ close_new_window
41
50
 
42
51
  Input API's
43
- ------------
44
-
45
- click(element)
46
-
47
- double_click(element)
48
-
49
- click_forcefully(element)
52
+ -------------------------
50
53
 
54
+ # method to enter text into textfield
51
55
  enter_text(element, text)
52
-
56
+ # method to clear text from textfield
53
57
  clear_text(element)
54
-
58
+ # method to select option from dropdwon list
59
+ select_option_from_dropdown(element, by, option)
60
+ # method to select all option from dropdwon list
61
+ select_all_option_from_multiselect_dropdown(element)
62
+ # method to unselect all option from dropdwon list
63
+ unselect_all_option_from_multiselect_dropdown(element)
64
+ # method to check checkbox
55
65
  check_checkbox(element)
56
-
66
+ # method to uncheck checkbox
57
67
  uncheck_checkbox(element)
58
-
68
+ # method to select radio button
59
69
  toggle_checkbox(element)
60
-
70
+ # method to select radio button
61
71
  select_radio_button(element)
72
+ # method to select option from radio button group
73
+ select_option_from_radio_button_group(element, by, option)
62
74
 
63
- get_page_title()
64
-
65
- get_element_text(element)
66
-
67
- get_element_attribute(element, attribute)
68
-
69
- is_element_enabled(element)
70
-
71
- is_element_displayed(element)
72
-
73
- hover_over_element(element)
74
-
75
- by => "locators type" ("id", "name", "class", "xpath", "css")
76
-
77
- access_value => "locator value"
78
-
75
+ Click API's
76
+ ------------
77
+ # method to click on an element
78
+ click(element)
79
+ # method to double-click on an element
80
+ double_click(element)
81
+ # method to forcefully click on an element
82
+ click_forcefully(element)
79
83
 
80
84
  Javascript Handling API
81
85
  -----------------------
82
-
86
+ # method to interact with alert
83
87
  handle_alert(decision) # decision => "accept" / "dismiss"
84
88
 
85
- get_alert_text
86
-
87
-
88
89
  Progress API's
89
90
  --------------
90
-
91
+ # method to wait with second
91
92
  wait(time_in_sec)
92
-
93
+ # method to wait for the element display
93
94
  wait_for_element_to_display(element, duration)
94
-
95
+ # method to wait for the element enable
95
96
  wait_for_element_to_enable(element, duration)
96
97
 
97
-
98
- by => "locators type" ("id", "name", "class", "xpath", "css")
99
-
100
- access_value => "locator value"
101
-
102
- duration => duration in seconds.
103
-
104
-
105
- Screenshot API
98
+ Screenshot API's
106
99
  --------------
100
+ # method to take screenshot and save in screenshot folder
107
101
  take_screenshots
108
102
 
109
-
110
- Configuration API
103
+ Configuration API's
111
104
  -----------------
112
-
105
+ # method to print configuration
113
106
  print_congifugartion
107
+ # method to print desktop configuration
108
+ print_desktop_configuration
109
+ # method to print mobile configuration
110
+ print_mobile_configuration
114
111
 
115
-
112
+ Assertion API's
113
+ -----------------
114
+ # Method to return page title
115
+ get_page_title
116
+ # Method to verify title
117
+ # param 1 : String : expected title
118
+ # param 2 : Boolean : test case [true or flase]
119
+ check_title(title, test_case)
120
+ # Method to verify partial title
121
+ # param 1 : String : partial title string
122
+ # param 2 : Boolean : test case [true or flase]
123
+ check_partial_title(partial_text_title, test_case)
124
+ # Method to get element text
125
+ # param : String
126
+ get_element_text(element)
127
+ # Method to check element text
128
+ # param 1 : String : Element
129
+ # param 2 : String : Expected element text
130
+ # param 3 : Boolean : test case [true or flase]
131
+ check_element_text(element, expected_value, test_case)
132
+ # Method to check partial element text
133
+ # param 1 : String : Element
134
+ # param 2 : String : Expected element partial text
135
+ # param 3 : Boolean : test case [true or flase]
136
+ check_element_partial_text(element, expected_value, test_case)
137
+ # Method to return element status - enabled?
138
+ # param : String : Element
139
+ is_element_enabled(element)
140
+ # method to check element status - enabled?
141
+ # param 1 : String : Element
142
+ # param 2 : Boolean : test case [true or flase]
143
+ check_element_enable(element, test_case)
144
+ # method to get attribute value
145
+ # param 1 : String : Element
146
+ # param 2 : String : atrribute name
147
+ get_element_attribute(element, attribute_name)
148
+ # method to check attribute value
149
+ # param 1 : String : Element
150
+ # param 2 : String : atrribute name
151
+ # param 3 : String : atrribute value
152
+ # param 4 : Boolean : test case [true or flase]
153
+ check_element_attribute(element, attribute_name, attribute_value, test_case)
154
+ # method to get element status - displayed?
155
+ # param : String : Element
156
+ is_element_displayed(element)
157
+ # method to check element presence
158
+ # param 1 : String : Element
159
+ # param 2 : Boolean : test case [true or flase]
160
+ check_element_presence(element, test_case)
161
+ # method to assert checkbox check/uncheck
162
+ # param 1 : String : Element
163
+ # param 2 : Boolean : test case [true or flase]
164
+ is_checkbox_checked(element, should_be_checked = true)
165
+ # method to assert radio button selected/unselected
166
+ # param 1 : String : Element
167
+ # param 2 : Boolean : test case [true or flase]
168
+ is_radio_button_selected(element, should_be_selected = true)
169
+ # method to assert option from radio button group is selected/unselected
170
+ is_option_from_radio_button_group_selected(element, by, option, should_be_selected = true)
171
+ # method to get javascript pop-up alert text
172
+ get_alert_text
173
+ # method to check javascript pop-up alert text
174
+ check_alert_text(text)
175
+ # method to check dropdown status -> selected
176
+ is_option_from_dropdown_selected(element, by, option, should_be_selected=true)
177
+
116
178
  Usage: itms_automation <command-name> [parameters] [options]
117
179
 
118
180
  <command-name> can be one of
@@ -1,10 +1,19 @@
1
- Feature: Addition
2
- As a math idiot
3
- In order to not feel silly
4
- I add two numbers
5
-
6
- Scenario: Adding a and b
7
- Given I have variable a
8
- And I have variable b
9
- When I add a and b
10
- Then I display the sum
1
+ # Feature: Login Functionality
2
+ # In order to ensure login functionality works,
3
+ # I want to run the cucumber test to verify it is working
4
+
5
+ # Background:
6
+ # Given the login page is opened successfully
7
+
8
+ # Scenario: Login Valid
9
+ # When user input username "tomsmith" and password "SuperSecretPassword!"
10
+ # Then the message "You logged into a secure area!×" should be displayed
11
+
12
+ # Scenario Outline: Login Invalid
13
+ # When user input username "<username>" and password "<password>"
14
+ # Then the message "<messsage>" should be displayed
15
+
16
+ # Examples:
17
+ # | username | password | messsage |
18
+ # | anhpham | SuperSecretPassword! | Your username is invalid!× |
19
+ # | tomsmith | wrong_password | Your password is invalid!× |
@@ -0,0 +1,69 @@
1
+ # Do Not Remove This File
2
+ # Please adjust the below steps as your needed
3
+ # $driver is instance of webdriver use this instance to write your custom code
4
+
5
+ # # page title checking
6
+ # Then(/^I should\s*((?:not)?)\s+see page title as "(.*?)"$/) do |present, title|
7
+ # check_title(title, present.empty?)
8
+ # end
9
+
10
+ # Then(/^I should\s*((?:not)?)\s+see page title having partial text as "(.*?)"$/) do |present, partial_text_title|
11
+ # check_partial_title(partial_text_title, present.empty?)
12
+ # end
13
+
14
+ # # step to check element text
15
+ # Then(/^element "([^\"]*)" should\s*((?:not)?)\s+have text as "(.*?)"$/) do |element, present, value |
16
+ # check_element_text(element, value, present.empty?)
17
+ # end
18
+
19
+ # # step to check element partial text
20
+ # Then(/^element "([^\"]*)" should\s*((?:not)?)\s+have partial text as "(.*?)"$/) do |element, present, value |
21
+ # check_element_partial_text(element, value, present.empty?)
22
+ # end
23
+
24
+ # # step to check attribute value
25
+ # Then(/^element "([^\"]*)" should\s*((?:not)?)\s+have attribute "(.*?)" with value "(.*?)"$/) do |element, present, attrb, value|
26
+ # check_element_attribute(element, attrb, value, present.empty?)
27
+ # end
28
+
29
+ # # step to check element enabled or not
30
+ # Then(/^element "([^\"]*)" should\s*((?:not)?)\s+be (enabled|disabled)$/) do |element, present, state|
31
+ # flag = state == 'enabled'
32
+ # flag = !flag unless present.empty?
33
+ # check_element_enable(element, flag)
34
+ # end
35
+
36
+ # # step to check element present or not
37
+ # Then(/^element "(.*?)" should\s*((?:not)?)\s+be present$/) do |element, present|
38
+ # check_element_presence(element, present.empty?)
39
+ # end
40
+
41
+ # # step to assert checkbox is checked or unchecked
42
+ # Then(/^checkbox "(.*?)" should be (checked|unchecked)$/) do |element, state|
43
+ # flag = state == 'checked'
44
+ # is_checkbox_checked(element, flag)
45
+ # end
46
+
47
+ # # steps to assert radio button checked or unchecked
48
+ # Then(/^radio button"(.*?)" should be (selected|unselected)$/) do |element, state|
49
+ # flag = state == 'selected'
50
+ # is_radio_button_selected(element, flag)
51
+ # end
52
+
53
+ # # steps to assert option by text from radio button group selected/unselected
54
+ # Then(/^option "(.*?)" by (.+) from radio button group "(.*?)" should be (selected|unselected)$/) do |option, attrb, element, state|
55
+ # flag = state == 'selected'
56
+ # is_option_from_radio_button_group_selected(element, attrb, option, flag)
57
+ # end
58
+
59
+ # # step to assert javascript pop-up alert text
60
+ # Then(/^I should see alert text as "(.*?)"$/) do |actual_value|
61
+ # check_alert_text(actual_value)
62
+ # end
63
+
64
+ # # step to assert dropdown list
65
+ # Then(/^option "(.*?)" by (.+) from dropdown "(.*?)" should be (selected|unselected)$/) do |option, by, element, state|
66
+ # flag = state == 'selected'
67
+ # is_option_from_dropdown_selected(element, by, option, state)
68
+ # end
69
+
@@ -0,0 +1,25 @@
1
+ # Do Not Remove This File
2
+ # Please adjust the below steps as your needed
3
+ # $driver is instance of webdriver use this instance to write your custom code
4
+
5
+ # # click on web element
6
+ # When(/^I click on element"(.*?)"$/) do |element|
7
+ # click(element)
8
+ # end
9
+
10
+ # Then(/^I forcefully click on element "(.*?)"$/) do |element|
11
+ # click_forcefully(element)
12
+ # end
13
+
14
+ # # double click on web element
15
+ # Then(/^I double click on element "(.*?)"$/) do |element|
16
+ # double_click(element)
17
+ # end
18
+
19
+ # When(/^I tap on element"(.*?)"$/) do |element|
20
+ # click(element)
21
+ # end
22
+
23
+ # Then(/^I long press on element "(.*?)"$/) do |element|
24
+ # long_press(element, duration)
25
+ # end
@@ -0,0 +1,8 @@
1
+ # Do Not Remove This File
2
+ # Please adjust the below steps as your needed
3
+ # $driver is instance of webdriver use this instance to write your custom code
4
+
5
+ # # step to print configuration
6
+ # Then(/^I print configuration$/) do
7
+ # print_congifugartion
8
+ # end
@@ -0,0 +1,60 @@
1
+ # Do Not Remove This File
2
+ # Please adjust the below steps as your needed
3
+ # $driver is instance of webdriver use this instance to write your custom code
4
+
5
+ # # enter text into input field steps
6
+ # Then(/^I enter "([^\"]*)" into element "(.*?)"$/) do |text, element|
7
+ # enter_text(element, text)
8
+ # end
9
+
10
+ # # clear input field steps
11
+ # Then(/^I clear input element "(.*?)"$/) do |element|
12
+ # clear_text(element)
13
+ # end
14
+
15
+ # # select option by text/value from dropdown/multiselect
16
+ # Then(/^I select "(.*?)" option by (.+) from\s*((?:multiselect)?)\sdropdown "(.*?)"$/) do |option, option_by, present, element|
17
+ # validate_option_by option_by
18
+ # select_option_from_dropdown(element, option_by, option)
19
+ # end
20
+
21
+ # # select option by index from dropdown/multiselect
22
+ # Then(/^I select (\d+) option by index from\s*((?:multiselect)?)\sdropdown "(.*?)"$/) do |option, present, element|
23
+ # select_option_from_dropdown(element, 'index', (option.to_i) -1)
24
+ # end
25
+
26
+ # # step to select option from mutliselect dropdown list
27
+ # Then(/^I select all options from multiselect dropdown "(.*?)"$/) do |element|
28
+ # select_all_option_from_multiselect_dropdown(element)
29
+ # end
30
+
31
+ # # step to unselect option from mutliselect dropdown list
32
+ # Then(/^I unselect all options from multiselect dropdown "(.*?)"$/) do |element|
33
+ # unselect_all_option_from_multiselect_dropdown(element)
34
+ # end
35
+
36
+ # # check checkbox steps
37
+ # Then(/^I check the checkbox "(.*?)"$/) do |element|
38
+ # check_checkbox(element)
39
+ # end
40
+
41
+ # # uncheck checkbox steps
42
+ # Then(/^I uncheck the checkbox "(.*?)"$/) do |element|
43
+ # uncheck_checkbox(element)
44
+ # end
45
+
46
+ # # steps to toggle checkbox
47
+ # Then(/^I toggle checkbox "(.*?)"$/) do |element|
48
+ # toggle_checkbox(element)
49
+ # end
50
+
51
+ # # step to select radio button
52
+ # Then(/^I select radio button "(.*?)"$/) do |element|
53
+ # select_radio_button(element)
54
+ # end
55
+
56
+ # # steps to select option by text from radio button group
57
+ # Then(/^I select "(.*?)" option by (.+) from radio button group "(.*?)"$/) do |option, option_by, element|
58
+ # validate_option_by option_by
59
+ # select_option_from_radio_button_group(element, option_by, option)
60
+ # end