awetestlib 0.1.28 → 0.1.29pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. data/.gitattributes +22 -22
  2. data/.gitignore +69 -69
  3. data/.yardopts +7 -7
  4. data/README.md +108 -108
  5. data/awetestlib.gemspec +57 -57
  6. data/awetestlib.windows.gemspec +41 -41
  7. data/awetestlib_notes.txt +4 -4
  8. data/awetestlib_osx.gemspec +47 -48
  9. data/bin/awetestlib +99 -99
  10. data/bin/awetestlib-android-setup.rb +26 -26
  11. data/bin/awetestlib-cucumber-setup.rb +28 -28
  12. data/bin/awetestlib-driver-setup.rb +21 -21
  13. data/bin/awetestlib-helpers.rb +41 -41
  14. data/bin/awetestlib-mobile-app-setup.rb +31 -31
  15. data/bin/awetestlib-netbeans-setup.rb +58 -58
  16. data/bin/awetestlib-regression-setup.rb +15 -15
  17. data/bin/awetestlib-rubymine-setup.rb +39 -39
  18. data/drivers/chromedriver.exe +0 -0
  19. data/ext/Rakefile +1 -1
  20. data/ext/mkrf_conf.rb +27 -27
  21. data/lib/awetestlib/html_report.rb +142 -142
  22. data/lib/awetestlib/logging.rb +366 -366
  23. data/lib/awetestlib/regression/browser.rb +1380 -1375
  24. data/lib/awetestlib/regression/drag_and_drop.rb +421 -420
  25. data/lib/awetestlib/regression/find.rb +345 -345
  26. data/lib/awetestlib/regression/legacy.rb +1187 -1187
  27. data/lib/awetestlib/regression/page_data.rb +191 -191
  28. data/lib/awetestlib/regression/runner.rb +307 -307
  29. data/lib/awetestlib/regression/tables.rb +627 -619
  30. data/lib/awetestlib/regression/user_input.rb +576 -576
  31. data/lib/awetestlib/regression/utilities.rb +1046 -988
  32. data/lib/awetestlib/regression/validations.rb +1093 -1074
  33. data/lib/awetestlib/regression/waits.rb +470 -470
  34. data/lib/awetestlib/runner.rb +18 -18
  35. data/lib/awetestlib.rb +41 -41
  36. data/lib/patches/README +2 -2
  37. data/lib/patches/firewatir.rb +106 -106
  38. data/lib/patches/watir.rb +175 -175
  39. data/lib/version.rb +2 -2
  40. data/license.txt +13 -13
  41. data/netbeans_setup.md +29 -29
  42. data/rdoc_test.bat +1 -1
  43. data/rubymine_setup.md +23 -23
  44. data/setup_samples/sample_android/features/dk.mejer.hansen.control.FlyingColorsPlayerAidActivity.apk +0 -0
  45. data/setup_samples/sample_android/features/sample_android.feature +5 -5
  46. data/setup_samples/sample_android/features/step_definitions/calabash_steps.rb +1 -1
  47. data/setup_samples/sample_android/features/support/app_installation_hooks.rb +36 -36
  48. data/setup_samples/sample_android/features/support/app_life_cycle_hooks.rb +14 -14
  49. data/setup_samples/sample_android/features/test_servers/8ba795a0288381ae346b67867b586881_0.3.2.apk +0 -0
  50. data/setup_samples/sample_cucumber/features/step_definitions/predefined_steps.rb +76 -76
  51. data/setup_samples/sample_cucumber/features/yahoo_mail.feature +11 -11
  52. data/setup_samples/sample_mobile_app/features/my_first.feature +14 -14
  53. data/setup_samples/sample_mobile_app/features/step_definitions/predefined_webview_steps.rb +80 -80
  54. data/setup_samples/sample_mobile_app/features/support/env.rb +2 -2
  55. data/setup_samples/sample_netbeans/demo.rb +86 -86
  56. data/setup_samples/sample_netbeans/nbproject/configs/Demo.properties +2 -2
  57. data/setup_samples/sample_netbeans/nbproject/private/config.properties +1 -1
  58. data/setup_samples/sample_netbeans/nbproject/private/configs/Demo.properties +2 -2
  59. data/setup_samples/sample_netbeans/nbproject/private/private.properties +2 -2
  60. data/setup_samples/sample_netbeans/nbproject/project.properties +5 -5
  61. data/setup_samples/sample_netbeans/nbproject/project.xml +13 -13
  62. data/setup_samples/sample_rubymine/.idea/encodings.xml +5 -5
  63. data/setup_samples/sample_rubymine/.idea/misc.xml +5 -5
  64. data/setup_samples/sample_rubymine/.idea/modules.xml +9 -9
  65. data/setup_samples/sample_rubymine/.idea/sample_rubymine.iml +9 -9
  66. data/setup_samples/sample_rubymine/.idea/scopes/scope_settings.xml +4 -4
  67. data/setup_samples/sample_rubymine/.idea/vcs.xml +7 -7
  68. data/setup_samples/sample_rubymine/.idea/workspace.xml +213 -213
  69. data/setup_samples/sample_rubymine/demo.rb +86 -86
  70. data/test/create_zoho.rb +66 -66
  71. data/test/create_zoho_account1.rb +68 -68
  72. data/test/create_zoho_account2.rb +72 -72
  73. data/test/demo.rb +87 -87
  74. data/test/google_search1.rb +16 -16
  75. data/test/google_search2.rb +19 -19
  76. data/test/login_1.rb +37 -37
  77. data/test/login_1a.rb +37 -37
  78. data/test/login_2.rb +32 -32
  79. data/test/zoho_exercise.rb +21 -21
  80. data/test/zoho_util.rb +487 -487
  81. data/tmp/placeholder.html +71 -71
  82. metadata +18 -49
data/lib/patches/watir.rb CHANGED
@@ -1,175 +1,175 @@
1
- module Watir
2
-
3
- class IE
4
-
5
- ###################################
6
- def browser_screen_offset(browser)
7
- parent = page_container.document.parentWindow
8
- [parent.screenLeft.to_i,
9
- parent.screenTop.to_i]
10
- end
11
-
12
- end
13
-
14
- class Element
15
- # for watir element returns array of arrays where each element is a [name, value] as long as value is other than null or blank
16
- def get_attributes
17
- attrs = []
18
- self.document.attributes.each do |atr|
19
- k= []
20
- next if (atr.value == 'null') || (atr.value == '')
21
- k << atr.name << atr.value
22
- attrs << k
23
- end
24
- attrs.sort
25
- end
26
-
27
- ###################################
28
- def attribute_values
29
- hash = Hash.new
30
- ['id', # 'offsetParent', 'style', 'currentstyle',
31
- 'offsetHeight', 'offsetWidth', 'offsetLeft', 'offsetTop',
32
- 'clientHeight', 'clientWidth', 'clientLeft', 'clientTop',
33
- 'scrollHeight', 'scrollWidth', 'scrollLeft', 'scrollTop',
34
- 'className', 'resizable',
35
- 'visible', 'sourceIndex'].each do |attr|
36
- value = attribute_value(attr)
37
- myClass = value.class
38
- if myClass =~ /WIN32OLE/i or value.is_a?(WIN32OLE)
39
- meths = Hash.new
40
- value.ole_methods.each do |m|
41
- meths[m.name] = m.helpstring
42
- end
43
- hash[attr] = meths.sort
44
- else
45
- hash[attr] = value
46
- end
47
- end
48
- hash
49
- end
50
-
51
- ###################################
52
- def fetch_attributes
53
- assert_exists
54
- assert_enabled
55
- obj = ole_object
56
- hash = Hash.new
57
- methods = obj.ole_methods
58
- methods.each do |m|
59
- hash[m.name] = "visible: #{m.visible?}: #{m.helpstring}: #{m.invoke_kind}: #{m.params}: #{m.return_type}: #{m.return_type_detail}"
60
- end
61
- hash.sort.to_yaml
62
- end
63
-
64
- ###################################
65
- def bottom_edge
66
- assert_exists
67
- assert_enabled
68
- ole_object.getBoundingClientRect.bottom.to_i
69
- end
70
-
71
- ###################################
72
- def top_edge
73
- assert_exists
74
- assert_enabled
75
- ole_object.getBoundingClientRect.top.to_i
76
- end
77
-
78
- ###################################
79
- def top_edge_absolute
80
- top_edge + page_container.document.parentWindow.screenTop.to_i
81
- end
82
-
83
- ###################################
84
- def left_edge
85
- assert_exists
86
- assert_enabled
87
- ole_object.getBoundingClientRect.left.to_i
88
- end
89
-
90
- ###################################
91
- def right_edge
92
- assert_exists
93
- assert_enabled
94
- ole_object.getBoundingClientRect.right.to_i
95
- end
96
-
97
- ###################################
98
- def left_edge_absolute
99
- left_edge + page_container.document.parentWindow.screenLeft.to_i
100
- end
101
-
102
- ###################################
103
- def dimensions
104
- assert_exists
105
- assert_enabled
106
- x = ole_object.getBoundingClientRect.right.to_i - left_edge
107
- y = ole_object.getBoundingClientRect.bottom.to_i - top_edge
108
- [x, y]
109
- end
110
-
111
- ###################################
112
- def screen_offset
113
- [left_edge_absolute, top_edge_absolute]
114
- end
115
-
116
- ###################################
117
- def client_offset
118
- [left_edge, top_edge]
119
- end
120
-
121
- ###################################
122
- def client_center
123
- client_offset + dimensions.map { |dim| dim/2 }
124
- # x, y = client_offset
125
- # w, h = dimensions
126
- # cx = x + ( w / 2 ).to_i
127
- # cy = y + ( h / 2 ).to_i
128
- # [cx, cy]
129
- end
130
-
131
- ###################################
132
- def screen_center
133
- x, y = screen_offset
134
- w, h = dimensions
135
- cx = x + (w / 2).to_i
136
- cy = y + (h / 2).to_i
137
- [cx, cy]
138
- end
139
-
140
- ###################################
141
- def client_lower_right
142
- x, y = client_offset
143
- w, h = dimensions
144
- lrx = x + w
145
- lry = y + h
146
- [lrx, lry]
147
- end
148
-
149
- ###################################
150
- def screen_lower_right
151
- x, y = screen_offset
152
- w, h = dimensions
153
- lrx = x + w
154
- lry = y + h
155
- [lrx, lry]
156
- end
157
-
158
- ###################################
159
- def bounding_rectangle_offsets
160
- l, t = client_offset
161
- r = ole_object.getBoundingClientRect.right.to_i
162
- b = ole_object.getBoundingClientRect.bottom.to_i
163
- [t, b, l, r]
164
- end
165
-
166
-
167
- end
168
-
169
- #class NonControlElement
170
- # class Ol < NonControlElement
171
- # TAG = 'OL'
172
- # end
173
- #end
174
-
175
- end
1
+ module Watir
2
+
3
+ class IE
4
+
5
+ ###################################
6
+ def browser_screen_offset(browser)
7
+ parent = page_container.document.parentWindow
8
+ [parent.screenLeft.to_i,
9
+ parent.screenTop.to_i]
10
+ end
11
+
12
+ end
13
+
14
+ class Element
15
+ # for watir element returns array of arrays where each element is a [name, value] as long as value is other than null or blank
16
+ def get_attributes
17
+ attrs = []
18
+ self.document.attributes.each do |atr|
19
+ k= []
20
+ next if (atr.value == 'null') || (atr.value == '')
21
+ k << atr.name << atr.value
22
+ attrs << k
23
+ end
24
+ attrs.sort
25
+ end
26
+
27
+ ###################################
28
+ def attribute_values
29
+ hash = Hash.new
30
+ ['id', # 'offsetParent', 'style', 'currentstyle',
31
+ 'offsetHeight', 'offsetWidth', 'offsetLeft', 'offsetTop',
32
+ 'clientHeight', 'clientWidth', 'clientLeft', 'clientTop',
33
+ 'scrollHeight', 'scrollWidth', 'scrollLeft', 'scrollTop',
34
+ 'className', 'resizable',
35
+ 'visible', 'sourceIndex'].each do |attr|
36
+ value = attribute_value(attr)
37
+ myClass = value.class
38
+ if myClass =~ /WIN32OLE/i or value.is_a?(WIN32OLE)
39
+ meths = Hash.new
40
+ value.ole_methods.each do |m|
41
+ meths[m.name] = m.helpstring
42
+ end
43
+ hash[attr] = meths.sort
44
+ else
45
+ hash[attr] = value
46
+ end
47
+ end
48
+ hash
49
+ end
50
+
51
+ ###################################
52
+ def fetch_attributes
53
+ assert_exists
54
+ assert_enabled
55
+ obj = ole_object
56
+ hash = Hash.new
57
+ methods = obj.ole_methods
58
+ methods.each do |m|
59
+ hash[m.name] = "visible: #{m.visible?}: #{m.helpstring}: #{m.invoke_kind}: #{m.params}: #{m.return_type}: #{m.return_type_detail}"
60
+ end
61
+ hash.sort.to_yaml
62
+ end
63
+
64
+ ###################################
65
+ def bottom_edge
66
+ assert_exists
67
+ assert_enabled
68
+ ole_object.getBoundingClientRect.bottom.to_i
69
+ end
70
+
71
+ ###################################
72
+ def top_edge
73
+ assert_exists
74
+ assert_enabled
75
+ ole_object.getBoundingClientRect.top.to_i
76
+ end
77
+
78
+ ###################################
79
+ def top_edge_absolute
80
+ top_edge + page_container.document.parentWindow.screenTop.to_i
81
+ end
82
+
83
+ ###################################
84
+ def left_edge
85
+ assert_exists
86
+ assert_enabled
87
+ ole_object.getBoundingClientRect.left.to_i
88
+ end
89
+
90
+ ###################################
91
+ def right_edge
92
+ assert_exists
93
+ assert_enabled
94
+ ole_object.getBoundingClientRect.right.to_i
95
+ end
96
+
97
+ ###################################
98
+ def left_edge_absolute
99
+ left_edge + page_container.document.parentWindow.screenLeft.to_i
100
+ end
101
+
102
+ ###################################
103
+ def dimensions
104
+ assert_exists
105
+ assert_enabled
106
+ x = ole_object.getBoundingClientRect.right.to_i - left_edge
107
+ y = ole_object.getBoundingClientRect.bottom.to_i - top_edge
108
+ [x, y]
109
+ end
110
+
111
+ ###################################
112
+ def screen_offset
113
+ [left_edge_absolute, top_edge_absolute]
114
+ end
115
+
116
+ ###################################
117
+ def client_offset
118
+ [left_edge, top_edge]
119
+ end
120
+
121
+ ###################################
122
+ def client_center
123
+ client_offset + dimensions.map { |dim| dim/2 }
124
+ # x, y = client_offset
125
+ # w, h = dimensions
126
+ # cx = x + ( w / 2 ).to_i
127
+ # cy = y + ( h / 2 ).to_i
128
+ # [cx, cy]
129
+ end
130
+
131
+ ###################################
132
+ def screen_center
133
+ x, y = screen_offset
134
+ w, h = dimensions
135
+ cx = x + (w / 2).to_i
136
+ cy = y + (h / 2).to_i
137
+ [cx, cy]
138
+ end
139
+
140
+ ###################################
141
+ def client_lower_right
142
+ x, y = client_offset
143
+ w, h = dimensions
144
+ lrx = x + w
145
+ lry = y + h
146
+ [lrx, lry]
147
+ end
148
+
149
+ ###################################
150
+ def screen_lower_right
151
+ x, y = screen_offset
152
+ w, h = dimensions
153
+ lrx = x + w
154
+ lry = y + h
155
+ [lrx, lry]
156
+ end
157
+
158
+ ###################################
159
+ def bounding_rectangle_offsets
160
+ l, t = client_offset
161
+ r = ole_object.getBoundingClientRect.right.to_i
162
+ b = ole_object.getBoundingClientRect.bottom.to_i
163
+ [t, b, l, r]
164
+ end
165
+
166
+
167
+ end
168
+
169
+ #class NonControlElement
170
+ # class Ol < NonControlElement
171
+ # TAG = 'OL'
172
+ # end
173
+ #end
174
+
175
+ end
data/lib/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Awetestlib
2
- VERSION = "0.1.28"
3
- VERSION_DATE = "2013-03-05"
2
+ VERSION = "0.1.29pre1"
3
+ VERSION_DATE = "2013-03-21"
4
4
  end
data/license.txt CHANGED
@@ -1,14 +1,14 @@
1
- Copyright (C) 2012 3Qi Labs
2
-
3
- This program is free software: you can redistribute it and/or modify
4
- it under the terms of the GNU General Public License as published by
5
- the Free Software Foundation, either version 3 of the License, or
6
- (at your option) any later version.
7
-
8
- This program is distributed in the hope that it will be useful,
9
- but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
- GNU General Public License for more details.
12
-
13
- You should have received a copy of the GNU General Public License
1
+ Copyright (C) 2012 3Qi Labs
2
+
3
+ This program is free software: you can redistribute it and/or modify
4
+ it under the terms of the GNU General Public License as published by
5
+ the Free Software Foundation, either version 3 of the License, or
6
+ (at your option) any later version.
7
+
8
+ This program is distributed in the hope that it will be useful,
9
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ GNU General Public License for more details.
12
+
13
+ You should have received a copy of the GNU General Public License
14
14
  along with this program. If not, see <http://www.gnu.org/licenses/>.
data/netbeans_setup.md CHANGED
@@ -1,30 +1,30 @@
1
- Netbeans IDE Setup
2
- =======
3
- ------------
4
- <br>
5
- 1. If you ran the `awetestlib netbeans_setup` command, you should now have a folder called "sample_netbeans" in the directory you ran the command in. Open Netbeans and go to Open Project.
6
-
7
- ![netbeans1](https://raw.github.com/anthonywoo/awetestlib/develop/images/netbeans1.jpg "netbeans1")
8
-
9
- <br>
10
- 2. Select the "sample_netbeans" folder that was created and click "Open Project". Your project is now loaded into Netbeans.
11
- NOTE: Depending on the version of Netbeans you have, you may need to install the Ruby and Rails plugin.
12
-
13
- ![netbeans2](https://raw.github.com/anthonywoo/awetestlib/develop/images/netbeans2.jpg "netbeans2")
14
-
15
- <br>
16
- 3. You can view the different configurations from the config dropdown. We have provided a sample "Demo" config which runs the demo.rb script. To create your own, go to "Customize..."
17
-
18
- ![netbeans3](https://raw.github.com/anthonywoo/awetestlib/develop/images/netbeans3.jpg "netbeans3")
19
-
20
- <br>
21
- 4. In the configuration window, you can see the arguments for the Demo configuration. To create your own, go to "New". All the arguments (Main Script, Arguments, and Ruby Options) would be the same as the Demo configuration, the only difference would be the path to the script you want to run.
22
-
23
- ![netbeans5](https://raw.github.com/anthonywoo/awetestlib/develop/images/netbeans5.jpg "netbeans5")
24
-
25
- <br>
26
- 5. Once you have the script configurations set, you can select the config you want to run from the dropdown and hit the Play button. The script will now start to run within the IDE.
27
-
28
- ![netbeans4](https://raw.github.com/anthonywoo/awetestlib/develop/images/netbeans4.jpg "netbeans4")
29
-
1
+ Netbeans IDE Setup
2
+ =======
3
+ ------------
4
+ <br>
5
+ 1. If you ran the `awetestlib netbeans_setup` command, you should now have a folder called "sample_netbeans" in the directory you ran the command in. Open Netbeans and go to Open Project.
6
+
7
+ ![netbeans1](https://raw.github.com/anthonywoo/awetestlib/develop/images/netbeans1.jpg "netbeans1")
8
+
9
+ <br>
10
+ 2. Select the "sample_netbeans" folder that was created and click "Open Project". Your project is now loaded into Netbeans.
11
+ NOTE: Depending on the version of Netbeans you have, you may need to install the Ruby and Rails plugin.
12
+
13
+ ![netbeans2](https://raw.github.com/anthonywoo/awetestlib/develop/images/netbeans2.jpg "netbeans2")
14
+
15
+ <br>
16
+ 3. You can view the different configurations from the config dropdown. We have provided a sample "Demo" config which runs the demo.rb script. To create your own, go to "Customize..."
17
+
18
+ ![netbeans3](https://raw.github.com/anthonywoo/awetestlib/develop/images/netbeans3.jpg "netbeans3")
19
+
20
+ <br>
21
+ 4. In the configuration window, you can see the arguments for the Demo configuration. To create your own, go to "New". All the arguments (Main Script, Arguments, and Ruby Options) would be the same as the Demo configuration, the only difference would be the path to the script you want to run.
22
+
23
+ ![netbeans5](https://raw.github.com/anthonywoo/awetestlib/develop/images/netbeans5.jpg "netbeans5")
24
+
25
+ <br>
26
+ 5. Once you have the script configurations set, you can select the config you want to run from the dropdown and hit the Play button. The script will now start to run within the IDE.
27
+
28
+ ![netbeans4](https://raw.github.com/anthonywoo/awetestlib/develop/images/netbeans4.jpg "netbeans4")
29
+
30
30
  <br>
data/rdoc_test.bat CHANGED
@@ -1 +1 @@
1
- rdoc --force-update -o c:/docs/rdoc_test --force-output lib/regression
1
+ rdoc --force-update -o c:/docs/rdoc_test --force-output lib/regression
data/rubymine_setup.md CHANGED
@@ -1,24 +1,24 @@
1
- Rubymine IDE Setup
2
- =======
3
- ------------
4
- <br>
5
- 1. If you ran the `awetestlib rubymine_setup` command, you should now have a folder called "sample_rubymine" in the directory you ran the command in. Open Rubymine and go to Open Directory...
6
-
7
- ![rubymine1](https://raw.github.com/anthonywoo/awetestlib/develop/images/rubymine1.jpg "rubymine1")
8
-
9
- <br>
10
- 2. You can view the different configurations from the config dropdown. We have provided a sample "Demo" config which runs the demo.rb script. To create new configurations, go to Edit Configurations...
11
-
12
- ![rubymine2](https://raw.github.com/anthonywoo/awetestlib/develop/images/rubymine2.jpg "rubymine2")
13
-
14
- <br>
15
- 3. In the configuration window, you can see the arguments for the Demo configuration. To create a new configuration for a new script, simply copy the Demo configuration and change the path to the script you want to run in the "Script arguments:" section.
16
-
17
- ![rubymine3](https://raw.github.com/anthonywoo/awetestlib/develop/images/rubymine3.jpg "rubymine3")
18
-
19
- <br>
20
- 4. Once you have the script configurations set, you can select the config you want to run from the dropdown and hit the Play button. The script will now start to run within the IDE.
21
-
22
- ![rubymine4](https://raw.github.com/anthonywoo/awetestlib/develop/images/rubymine4.jpg "rubymine4")
23
-
1
+ Rubymine IDE Setup
2
+ =======
3
+ ------------
4
+ <br>
5
+ 1. If you ran the `awetestlib rubymine_setup` command, you should now have a folder called "sample_rubymine" in the directory you ran the command in. Open Rubymine and go to Open Directory...
6
+
7
+ ![rubymine1](https://raw.github.com/anthonywoo/awetestlib/develop/images/rubymine1.jpg "rubymine1")
8
+
9
+ <br>
10
+ 2. You can view the different configurations from the config dropdown. We have provided a sample "Demo" config which runs the demo.rb script. To create new configurations, go to Edit Configurations...
11
+
12
+ ![rubymine2](https://raw.github.com/anthonywoo/awetestlib/develop/images/rubymine2.jpg "rubymine2")
13
+
14
+ <br>
15
+ 3. In the configuration window, you can see the arguments for the Demo configuration. To create a new configuration for a new script, simply copy the Demo configuration and change the path to the script you want to run in the "Script arguments:" section.
16
+
17
+ ![rubymine3](https://raw.github.com/anthonywoo/awetestlib/develop/images/rubymine3.jpg "rubymine3")
18
+
19
+ <br>
20
+ 4. Once you have the script configurations set, you can select the config you want to run from the dropdown and hit the Play button. The script will now start to run within the IDE.
21
+
22
+ ![rubymine4](https://raw.github.com/anthonywoo/awetestlib/develop/images/rubymine4.jpg "rubymine4")
23
+
24
24
  <br>
@@ -1,6 +1,6 @@
1
- Feature: I want to test my android setup
2
-
3
- Scenario: I want to launch my app and test a few interactions
4
- Given I see "Rotating at anchor"
5
- Then I long press "Rotating at anchor"
1
+ Feature: I want to test my android setup
2
+
3
+ Scenario: I want to launch my app and test a few interactions
4
+ Given I see "Rotating at anchor"
5
+ Then I long press "Rotating at anchor"
6
6
  Then I enter "2" into "Enter Range"
@@ -1,2 +1,2 @@
1
- require 'calabash-android/cucumber'
1
+ require 'calabash-android/cucumber'
2
2
  require 'calabash-android/calabash_steps'
@@ -1,36 +1,36 @@
1
- require 'calabash-android/management/app_installation'
2
-
3
- AfterConfiguration do |config|
4
- FeatureNameMemory.feature_name = nil
5
- end
6
-
7
- Before do |scenario|
8
- @scenario_is_outline = (scenario.class == Cucumber::Ast::OutlineTable::ExampleRow)
9
- if @scenario_is_outline
10
- scenario = scenario.scenario_outline
11
- end
12
-
13
- feature_name = scenario.feature.title
14
- if FeatureNameMemory.feature_name != feature_name \
15
- or ENV["RESET_BETWEEN_SCENARIOS"] == "1"
16
- if ENV["RESET_BETWEEN_SCENARIOS"] == "1"
17
- log "New scenario - reinstalling apps"
18
- else
19
- log "First scenario in feature - reinstalling apps"
20
- end
21
-
22
- uninstall_apps
23
- install_app(ENV["TEST_APP_PATH"])
24
- install_app(ENV["APP_PATH"])
25
- FeatureNameMemory.feature_name = feature_name
26
- FeatureNameMemory.invocation = 1
27
- else
28
- FeatureNameMemory.invocation += 1
29
- end
30
- end
31
-
32
- FeatureNameMemory = Class.new
33
- class << FeatureNameMemory
34
- @feature_name = nil
35
- attr_accessor :feature_name, :invocation
36
- end
1
+ require 'calabash-android/management/app_installation'
2
+
3
+ AfterConfiguration do |config|
4
+ FeatureNameMemory.feature_name = nil
5
+ end
6
+
7
+ Before do |scenario|
8
+ @scenario_is_outline = (scenario.class == Cucumber::Ast::OutlineTable::ExampleRow)
9
+ if @scenario_is_outline
10
+ scenario = scenario.scenario_outline
11
+ end
12
+
13
+ feature_name = scenario.feature.title
14
+ if FeatureNameMemory.feature_name != feature_name \
15
+ or ENV["RESET_BETWEEN_SCENARIOS"] == "1"
16
+ if ENV["RESET_BETWEEN_SCENARIOS"] == "1"
17
+ log "New scenario - reinstalling apps"
18
+ else
19
+ log "First scenario in feature - reinstalling apps"
20
+ end
21
+
22
+ uninstall_apps
23
+ install_app(ENV["TEST_APP_PATH"])
24
+ install_app(ENV["APP_PATH"])
25
+ FeatureNameMemory.feature_name = feature_name
26
+ FeatureNameMemory.invocation = 1
27
+ else
28
+ FeatureNameMemory.invocation += 1
29
+ end
30
+ end
31
+
32
+ FeatureNameMemory = Class.new
33
+ class << FeatureNameMemory
34
+ @feature_name = nil
35
+ attr_accessor :feature_name, :invocation
36
+ end
@@ -1,15 +1,15 @@
1
- require 'calabash-android/management/adb'
2
- require 'calabash-android/operations'
3
- include Calabash::Android::Operations
4
-
5
- AfterConfiguration do |config|
6
- wake_up unless config.dry_run?
7
- end
8
-
9
- Before do |scenario|
10
- start_test_server_in_background
11
- end
12
-
13
- After do
14
- shutdown_test_server
1
+ require 'calabash-android/management/adb'
2
+ require 'calabash-android/operations'
3
+ include Calabash::Android::Operations
4
+
5
+ AfterConfiguration do |config|
6
+ wake_up unless config.dry_run?
7
+ end
8
+
9
+ Before do |scenario|
10
+ start_test_server_in_background
11
+ end
12
+
13
+ After do
14
+ shutdown_test_server
15
15
  end