calabash 1.2.1 → 1.9.9.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +39 -0
  3. data/LICENSE +204 -21
  4. data/README.md +36 -6
  5. data/VERSIONING.md +16 -0
  6. data/bin/calabash +95 -0
  7. data/lib/calabash.rb +185 -1
  8. data/lib/calabash/android.rb +64 -0
  9. data/lib/calabash/android/adb.rb +277 -0
  10. data/lib/calabash/android/application.rb +110 -0
  11. data/lib/calabash/android/build.rb +12 -0
  12. data/lib/calabash/android/build/application.rb +13 -0
  13. data/lib/calabash/android/build/build_error.rb +11 -0
  14. data/lib/calabash/android/build/builder.rb +119 -0
  15. data/lib/calabash/android/build/java_keystore.rb +177 -0
  16. data/lib/calabash/android/build/resigner.rb +56 -0
  17. data/lib/calabash/android/build/test_server.rb +27 -0
  18. data/lib/calabash/android/console_helpers.rb +44 -0
  19. data/lib/calabash/android/cucumber.rb +3 -0
  20. data/lib/calabash/android/device.rb +965 -0
  21. data/lib/calabash/android/environment.rb +470 -0
  22. data/lib/calabash/android/gestures.rb +369 -0
  23. data/lib/calabash/android/interactions.rb +45 -0
  24. data/lib/calabash/android/lib/.irbrc +55 -0
  25. data/lib/calabash/android/lib/AndroidManifest.xml +51 -0
  26. data/lib/calabash/android/lib/TestServer.apk +0 -0
  27. data/lib/calabash/android/lib/calmd5/arm64-v8a/calmd5 +0 -0
  28. data/lib/calabash/android/lib/calmd5/arm64-v8a/calmd5-pie +0 -0
  29. data/lib/calabash/android/lib/calmd5/armeabi-v7a/calmd5 +0 -0
  30. data/lib/calabash/android/lib/calmd5/armeabi-v7a/calmd5-pie +0 -0
  31. data/lib/calabash/android/lib/calmd5/armeabi/calmd5 +0 -0
  32. data/lib/calabash/android/lib/calmd5/armeabi/calmd5-pie +0 -0
  33. data/lib/calabash/android/lib/calmd5/mips/calmd5 +0 -0
  34. data/lib/calabash/android/lib/calmd5/mips/calmd5-pie +0 -0
  35. data/lib/calabash/android/lib/calmd5/mips64/calmd5 +0 -0
  36. data/lib/calabash/android/lib/calmd5/mips64/calmd5-pie +0 -0
  37. data/lib/calabash/android/lib/calmd5/x86/calmd5 +0 -0
  38. data/lib/calabash/android/lib/calmd5/x86/calmd5-pie +0 -0
  39. data/lib/calabash/android/lib/calmd5/x86_64/calmd5 +0 -0
  40. data/lib/calabash/android/lib/calmd5/x86_64/calmd5-pie +0 -0
  41. data/lib/calabash/android/lib/screenshot_taker.jar +0 -0
  42. data/lib/calabash/android/life_cycle.rb +37 -0
  43. data/lib/calabash/android/orientation.rb +30 -0
  44. data/lib/calabash/android/physical_buttons.rb +39 -0
  45. data/lib/calabash/android/screenshot.rb +9 -0
  46. data/lib/calabash/android/scroll.rb +5 -0
  47. data/lib/calabash/android/server.rb +10 -0
  48. data/lib/calabash/android/text.rb +54 -0
  49. data/lib/calabash/application.rb +74 -0
  50. data/lib/calabash/cli.rb +12 -0
  51. data/lib/calabash/cli/build.rb +33 -0
  52. data/lib/calabash/cli/console.rb +90 -0
  53. data/lib/calabash/cli/generate.rb +110 -0
  54. data/lib/calabash/cli/helpers.rb +130 -0
  55. data/lib/calabash/cli/resign.rb +33 -0
  56. data/lib/calabash/cli/run.rb +99 -0
  57. data/lib/calabash/cli/setup_keystore.rb +39 -0
  58. data/lib/calabash/color.rb +32 -0
  59. data/lib/calabash/console_helpers.rb +90 -0
  60. data/lib/calabash/defaults.rb +56 -0
  61. data/lib/calabash/device.rb +401 -0
  62. data/lib/calabash/environment.rb +75 -0
  63. data/lib/calabash/gestures.rb +384 -0
  64. data/lib/calabash/http.rb +8 -0
  65. data/lib/calabash/http/error.rb +15 -0
  66. data/lib/calabash/http/request.rb +42 -0
  67. data/lib/calabash/http/retriable_client.rb +156 -0
  68. data/lib/calabash/interactions.rb +105 -0
  69. data/lib/calabash/ios.rb +37 -0
  70. data/lib/calabash/ios/application.rb +119 -0
  71. data/lib/calabash/ios/conditions.rb +79 -0
  72. data/lib/calabash/ios/console_helpers.rb +72 -0
  73. data/lib/calabash/ios/device.rb +24 -0
  74. data/lib/calabash/ios/device/device_implementation.rb +779 -0
  75. data/lib/calabash/ios/device/gestures_mixin.rb +167 -0
  76. data/lib/calabash/ios/device/keyboard_mixin.rb +133 -0
  77. data/lib/calabash/ios/device/physical_device_mixin.rb +266 -0
  78. data/lib/calabash/ios/device/rotation_mixin.rb +124 -0
  79. data/lib/calabash/ios/device/routes/backdoor_route_mixin.rb +86 -0
  80. data/lib/calabash/ios/device/routes/condition_route_mixin.rb +62 -0
  81. data/lib/calabash/ios/device/routes/error.rb +8 -0
  82. data/lib/calabash/ios/device/routes/handle_route_mixin.rb +102 -0
  83. data/lib/calabash/ios/device/routes/map_route_mixin.rb +38 -0
  84. data/lib/calabash/ios/device/routes/playback_route_mixin.rb +70 -0
  85. data/lib/calabash/ios/device/routes/response_parser.rb +48 -0
  86. data/lib/calabash/ios/device/routes/uia_route_mixin.rb +238 -0
  87. data/lib/calabash/ios/device/runtime_attributes.rb +184 -0
  88. data/lib/calabash/ios/device/status_bar_mixin.rb +17 -0
  89. data/lib/calabash/ios/device/text_mixin.rb +19 -0
  90. data/lib/calabash/ios/device/uia_keyboard_mixin.rb +188 -0
  91. data/lib/calabash/ios/device/uia_mixin.rb +12 -0
  92. data/lib/calabash/ios/environment.rb +41 -0
  93. data/lib/calabash/ios/interactions.rb +10 -0
  94. data/lib/calabash/ios/lib/.irbrc +55 -0
  95. data/lib/calabash/ios/lib/recordings/rotate_left_home_down_ipad.base64 +2 -0
  96. data/lib/calabash/ios/lib/recordings/rotate_left_home_down_iphone.base64 +2 -0
  97. data/lib/calabash/ios/lib/recordings/rotate_left_home_left_ipad.base64 +2 -0
  98. data/lib/calabash/ios/lib/recordings/rotate_left_home_left_iphone.base64 +2 -0
  99. data/lib/calabash/ios/lib/recordings/rotate_left_home_right_ipad.base64 +2 -0
  100. data/lib/calabash/ios/lib/recordings/rotate_left_home_right_iphone.base64 +2 -0
  101. data/lib/calabash/ios/lib/recordings/rotate_left_home_up_ipad.base64 +2 -0
  102. data/lib/calabash/ios/lib/recordings/rotate_left_home_up_iphone.base64 +2 -0
  103. data/lib/calabash/ios/lib/recordings/rotate_right_home_down_ipad.base64 +2 -0
  104. data/lib/calabash/ios/lib/recordings/rotate_right_home_down_iphone.base64 +2 -0
  105. data/lib/calabash/ios/lib/recordings/rotate_right_home_left_ipad.base64 +2 -0
  106. data/lib/calabash/ios/lib/recordings/rotate_right_home_left_iphone.base64 +2 -0
  107. data/lib/calabash/ios/lib/recordings/rotate_right_home_right_ipad.base64 +2 -0
  108. data/lib/calabash/ios/lib/recordings/rotate_right_home_right_iphone.base64 +2 -0
  109. data/lib/calabash/ios/lib/recordings/rotate_right_home_up_ipad.base64 +2 -0
  110. data/lib/calabash/ios/lib/recordings/rotate_right_home_up_iphone.base64 +2 -0
  111. data/lib/calabash/ios/orientation.rb +117 -0
  112. data/lib/calabash/ios/scroll.rb +504 -0
  113. data/lib/calabash/ios/server.rb +73 -0
  114. data/lib/calabash/ios/text.rb +248 -0
  115. data/lib/calabash/ios/uia.rb +24 -0
  116. data/lib/calabash/lib/skeleton/config/cucumber.yml +6 -0
  117. data/lib/calabash/lib/skeleton/features/sample.feature +5 -0
  118. data/lib/calabash/lib/skeleton/features/step_definitions/calabash_steps.rb +29 -0
  119. data/lib/calabash/lib/skeleton/features/support/env.rb +54 -0
  120. data/lib/calabash/lib/skeleton/features/support/hooks.rb +83 -0
  121. data/lib/calabash/life_cycle.rb +111 -0
  122. data/lib/calabash/location.rb +51 -0
  123. data/lib/calabash/logger.rb +87 -0
  124. data/lib/calabash/orientation.rb +84 -0
  125. data/lib/calabash/page.rb +35 -0
  126. data/lib/calabash/patch.rb +14 -0
  127. data/lib/calabash/patch/array.rb +16 -0
  128. data/lib/calabash/patch/run_loop.rb +90 -0
  129. data/lib/calabash/query.rb +160 -0
  130. data/lib/calabash/query_result.rb +85 -0
  131. data/lib/calabash/screenshot.rb +89 -0
  132. data/lib/calabash/server.rb +16 -0
  133. data/lib/calabash/text.rb +76 -0
  134. data/lib/calabash/utility.rb +58 -0
  135. data/lib/calabash/version.rb +3 -1
  136. data/lib/calabash/wait.rb +474 -0
  137. metadata +462 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ee016ed68b6bfe5aceb636f863346c03eebffb6
4
- data.tar.gz: dd7e895f088e3a4385f2e36cfb7091a05834bb25
3
+ metadata.gz: 994996bafe7d310ab1068d4784c48fce9541c1c7
4
+ data.tar.gz: 7d3918c947af930be40caea37dee45320d76a817
5
5
  SHA512:
6
- metadata.gz: 4ae9113569f311a1d4116f284f8479a771bda25d67bc5347e02248f096e54dc3c05ad793cc8944a0eefd04167eba3afd6a8c9463f2885292c198d63c4e8e7d8e
7
- data.tar.gz: 878e7d5b81921fdbd8200dcecd104230ae7979880e4231ab3033c21f10f9e47937a68fbe72813f4bad9a12b8991fe68323f7d60c3aa6bc6f291eab2f9771d6e3
6
+ metadata.gz: 0041eda36898e5eca293981ff2fd6c6ee3ad609b9a1a55efe5b552c3e74857de1b8101acf7a6fedd3777d150f533c15b99782686ee042f63877250132c5b7dde
7
+ data.tar.gz: db96e189f2cf24bc6543f85cd3e52856d09edf10ec3c1be8e5181df63dc9a2251e695bdaa58bc992c6897e565756a4b71d7092dc6ac91653a9e3833eeca007f5
@@ -0,0 +1,39 @@
1
+ ## Contributing
2
+
3
+ ***All pull requests should be based off the `develop` branch.***
4
+
5
+ The Calabash Toolchain uses git-flow.
6
+
7
+ See these links for information about git-flow and git best practices.
8
+
9
+ ##### Git Flow Step-by-Step guide
10
+
11
+ * https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow
12
+
13
+ ##### Git Best Practices
14
+
15
+ * http://justinhileman.info/article/changing-history/
16
+
17
+ ##### git-flow command line tool
18
+
19
+ We don't use the git-flow tools, but this is useful anyway.
20
+
21
+ * http://danielkummer.github.io/git-flow-cheatsheet/
22
+
23
+ ## Start a Feature
24
+
25
+ Start your work on a feature branch based off develop.
26
+
27
+ ```
28
+ # If you don't already have the develop branch
29
+ $ git fetch origin
30
+ $ git co -t origin/develop
31
+
32
+ # If you already have the develop branch
33
+ $ git co develop
34
+ $ git pull origin develop
35
+ $ git co -b feature/my-new-feature
36
+
37
+ # Publish your branch and make a pull-request on `develop`
38
+ $ git push -u origin feature/my-new-feature
39
+ ```
data/LICENSE CHANGED
@@ -1,21 +1,204 @@
1
- calabash
2
-
3
- Copyright (c) 2013 Xamarin (http://www.xamarin.com). All rights reserved.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ Eclipse Public License - v 1.0
2
+
3
+ THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
4
+ LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
5
+ CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
6
+
7
+ 1. DEFINITIONS
8
+
9
+ "Contribution" means:
10
+
11
+ a) in the case of the initial Contributor, the initial code and documentation
12
+ distributed under this Agreement, and
13
+ b) in the case of each subsequent Contributor:
14
+ i) changes to the Program, and
15
+ ii) additions to the Program;
16
+
17
+ where such changes and/or additions to the Program originate from and are
18
+ distributed by that particular Contributor. A Contribution 'originates'
19
+ from a Contributor if it was added to the Program by such Contributor
20
+ itself or anyone acting on such Contributor's behalf. Contributions do not
21
+ include additions to the Program which: (i) are separate modules of
22
+ software distributed in conjunction with the Program under their own
23
+ license agreement, and (ii) are not derivative works of the Program.
24
+
25
+ "Contributor" means any person or entity that distributes the Program.
26
+
27
+ "Licensed Patents" mean patent claims licensable by a Contributor which are
28
+ necessarily infringed by the use or sale of its Contribution alone or when
29
+ combined with the Program.
30
+
31
+ "Program" means the Contributions distributed in accordance with this
32
+ Agreement.
33
+
34
+ "Recipient" means anyone who receives the Program under this Agreement,
35
+ including all Contributors.
36
+
37
+ 2. GRANT OF RIGHTS
38
+ a) Subject to the terms of this Agreement, each Contributor hereby grants
39
+ Recipient a non-exclusive, worldwide, royalty-free copyright license to
40
+ reproduce, prepare derivative works of, publicly display, publicly
41
+ perform, distribute and sublicense the Contribution of such Contributor,
42
+ if any, and such derivative works, in source code and object code form.
43
+ b) Subject to the terms of this Agreement, each Contributor hereby grants
44
+ Recipient a non-exclusive, worldwide, royalty-free patent license under
45
+ Licensed Patents to make, use, sell, offer to sell, import and otherwise
46
+ transfer the Contribution of such Contributor, if any, in source code and
47
+ object code form. This patent license shall apply to the combination of
48
+ the Contribution and the Program if, at the time the Contribution is
49
+ added by the Contributor, such addition of the Contribution causes such
50
+ combination to be covered by the Licensed Patents. The patent license
51
+ shall not apply to any other combinations which include the Contribution.
52
+ No hardware per se is licensed hereunder.
53
+ c) Recipient understands that although each Contributor grants the licenses
54
+ to its Contributions set forth herein, no assurances are provided by any
55
+ Contributor that the Program does not infringe the patent or other
56
+ intellectual property rights of any other entity. Each Contributor
57
+ disclaims any liability to Recipient for claims brought by any other
58
+ entity based on infringement of intellectual property rights or
59
+ otherwise. As a condition to exercising the rights and licenses granted
60
+ hereunder, each Recipient hereby assumes sole responsibility to secure
61
+ any other intellectual property rights needed, if any. For example, if a
62
+ third party patent license is required to allow Recipient to distribute
63
+ the Program, it is Recipient's responsibility to acquire that license
64
+ before distributing the Program.
65
+ d) Each Contributor represents that to its knowledge it has sufficient
66
+ copyright rights in its Contribution, if any, to grant the copyright
67
+ license set forth in this Agreement.
68
+
69
+ 3. REQUIREMENTS
70
+
71
+ A Contributor may choose to distribute the Program in object code form under
72
+ its own license agreement, provided that:
73
+
74
+ a) it complies with the terms and conditions of this Agreement; and
75
+ b) its license agreement:
76
+ i) effectively disclaims on behalf of all Contributors all warranties
77
+ and conditions, express and implied, including warranties or
78
+ conditions of title and non-infringement, and implied warranties or
79
+ conditions of merchantability and fitness for a particular purpose;
80
+ ii) effectively excludes on behalf of all Contributors all liability for
81
+ damages, including direct, indirect, special, incidental and
82
+ consequential damages, such as lost profits;
83
+ iii) states that any provisions which differ from this Agreement are
84
+ offered by that Contributor alone and not by any other party; and
85
+ iv) states that source code for the Program is available from such
86
+ Contributor, and informs licensees how to obtain it in a reasonable
87
+ manner on or through a medium customarily used for software exchange.
88
+
89
+ When the Program is made available in source code form:
90
+
91
+ a) it must be made available under this Agreement; and
92
+ b) a copy of this Agreement must be included with each copy of the Program.
93
+ Contributors may not remove or alter any copyright notices contained
94
+ within the Program.
95
+
96
+ Each Contributor must identify itself as the originator of its Contribution,
97
+ if
98
+ any, in a manner that reasonably allows subsequent Recipients to identify the
99
+ originator of the Contribution.
100
+
101
+ 4. COMMERCIAL DISTRIBUTION
102
+
103
+ Commercial distributors of software may accept certain responsibilities with
104
+ respect to end users, business partners and the like. While this license is
105
+ intended to facilitate the commercial use of the Program, the Contributor who
106
+ includes the Program in a commercial product offering should do so in a manner
107
+ which does not create potential liability for other Contributors. Therefore,
108
+ if a Contributor includes the Program in a commercial product offering, such
109
+ Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
110
+ every other Contributor ("Indemnified Contributor") against any losses,
111
+ damages and costs (collectively "Losses") arising from claims, lawsuits and
112
+ other legal actions brought by a third party against the Indemnified
113
+ Contributor to the extent caused by the acts or omissions of such Commercial
114
+ Contributor in connection with its distribution of the Program in a commercial
115
+ product offering. The obligations in this section do not apply to any claims
116
+ or Losses relating to any actual or alleged intellectual property
117
+ infringement. In order to qualify, an Indemnified Contributor must:
118
+ a) promptly notify the Commercial Contributor in writing of such claim, and
119
+ b) allow the Commercial Contributor to control, and cooperate with the
120
+ Commercial Contributor in, the defense and any related settlement
121
+ negotiations. The Indemnified Contributor may participate in any such claim at
122
+ its own expense.
123
+
124
+ For example, a Contributor might include the Program in a commercial product
125
+ offering, Product X. That Contributor is then a Commercial Contributor. If
126
+ that Commercial Contributor then makes performance claims, or offers
127
+ warranties related to Product X, those performance claims and warranties are
128
+ such Commercial Contributor's responsibility alone. Under this section, the
129
+ Commercial Contributor would have to defend claims against the other
130
+ Contributors related to those performance claims and warranties, and if a
131
+ court requires any other Contributor to pay any damages as a result, the
132
+ Commercial Contributor must pay those damages.
133
+
134
+ 5. NO WARRANTY
135
+
136
+ EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN
137
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
138
+ IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
139
+ NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each
140
+ Recipient is solely responsible for determining the appropriateness of using
141
+ and distributing the Program and assumes all risks associated with its
142
+ exercise of rights under this Agreement , including but not limited to the
143
+ risks and costs of program errors, compliance with applicable laws, damage to
144
+ or loss of data, programs or equipment, and unavailability or interruption of
145
+ operations.
146
+
147
+ 6. DISCLAIMER OF LIABILITY
148
+
149
+ EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
150
+ CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
151
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION
152
+ LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
153
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
154
+ ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
155
+ EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY
156
+ OF SUCH DAMAGES.
157
+
158
+ 7. GENERAL
159
+
160
+ If any provision of this Agreement is invalid or unenforceable under
161
+ applicable law, it shall not affect the validity or enforceability of the
162
+ remainder of the terms of this Agreement, and without further action by the
163
+ parties hereto, such provision shall be reformed to the minimum extent
164
+ necessary to make such provision valid and enforceable.
165
+
166
+ If Recipient institutes patent litigation against any entity (including a
167
+ cross-claim or counterclaim in a lawsuit) alleging that the Program itself
168
+ (excluding combinations of the Program with other software or hardware)
169
+ infringes such Recipient's patent(s), then such Recipient's rights granted
170
+ under Section 2(b) shall terminate as of the date such litigation is filed.
171
+
172
+ All Recipient's rights under this Agreement shall terminate if it fails to
173
+ comply with any of the material terms or conditions of this Agreement and does
174
+ not cure such failure in a reasonable period of time after becoming aware of
175
+ such noncompliance. If all Recipient's rights under this Agreement terminate,
176
+ Recipient agrees to cease use and distribution of the Program as soon as
177
+ reasonably practicable. However, Recipient's obligations under this Agreement
178
+ and any licenses granted by Recipient relating to the Program shall continue
179
+ and survive.
180
+
181
+ Everyone is permitted to copy and distribute copies of this Agreement, but in
182
+ order to avoid inconsistency the Agreement is copyrighted and may only be
183
+ modified in the following manner. The Agreement Steward reserves the right to
184
+ publish new versions (including revisions) of this Agreement from time to
185
+ time. No one other than the Agreement Steward has the right to modify this
186
+ Agreement. The Eclipse Foundation is the initial Agreement Steward. The
187
+ Eclipse Foundation may assign the responsibility to serve as the Agreement
188
+ Steward to a suitable separate entity. Each new version of the Agreement will
189
+ be given a distinguishing version number. The Program (including
190
+ Contributions) may always be distributed subject to the version of the
191
+ Agreement under which it was received. In addition, after a new version of the
192
+ Agreement is published, Contributor may elect to distribute the Program
193
+ (including its Contributions) under the new version. Except as expressly
194
+ stated in Sections 2(a) and 2(b) above, Recipient receives no rights or
195
+ licenses to the intellectual property of any Contributor under this Agreement,
196
+ whether expressly, by implication, estoppel or otherwise. All rights in the
197
+ Program not expressly granted under this Agreement are reserved.
198
+
199
+ This Agreement is governed by the laws of the State of New York and the
200
+ intellectual property laws of the United States of America. No party to this
201
+ Agreement will bring a legal action under this Agreement more than one year
202
+ after the cause of action arose. Each party waives its rights to a jury trial in
203
+ any resulting litigation.
204
+
data/README.md CHANGED
@@ -1,7 +1,37 @@
1
- What?
2
- =====
3
- Wrapper gem for Calabash iOS, Android and Xamarin Test Cloud
1
+ | master | develop | [versioning](VERSIONING.md) | [license](LICENSE) | [contributing](CONTRIBUTING.md)|
2
+ |---------|---------|-----------------------------|--------------------|--------------------------------|
3
+ |[![Build Status](https://travis-ci.org/calabash/calabash.svg?branch=master)](https://travis-ci.org/calabash/calabash)| [![Build Status](https://travis-ci.org/calabash/calabash.svg?branch=develop)](https://travis-ci.org/calabash/calabash)| [![GitHub version](https://badge.fury.io/gh/calabash%2Fcalabash.svg)](http://badge.fury.io/gh/calabash%2Fcalabash) |[![License](https://img.shields.io/badge/licence-Eclipse-blue.svg)](http://opensource.org/licenses/EPL-1.0) | [![Contributing](https://img.shields.io/badge/contrib-gitflow-orange.svg)](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow/)|
4
4
 
5
- License
6
- =======
7
- calabash the wrapper gem is available under the MIT license. See the LICENSE file for more info.
5
+ ## Calabash
6
+
7
+ Automated Acceptance Testing for Mobile Apps
8
+
9
+ ## Initial workflow
10
+
11
+ **TL;DR**
12
+
13
+ ```
14
+ $ cd calabash
15
+ $ ./copy_repos.sh
16
+ $ ./changing_old_files.sh
17
+ ```
18
+
19
+ Before Calabash is ready to be released, the old gems will exist outside version control. To make a change run the script `copy_repos.sh`. This will copy the Android and iOS repositories and extract them as files in the directory `old`. Then execute `changing_old_files.sh`. This script will move old files into their new directories. To make changes to "old files" e.g. move them, add your steps to `changing_old_files.sh` and execute it. To make code changes to old files, change them locally first to ensure they work. Then copy the change to the branch `united` on either iOS or Android. Commit the changes and push them upstream. `copy_repos.sh` will always download the newest files.
20
+
21
+ ## Testing
22
+
23
+ ### rspec
24
+
25
+ ```
26
+ $ be rake unit # All unit tests.
27
+ $ be rake spec # All tests. Launches iOS Simulators, etc.
28
+ $ be guard # Run unit tests as you develop.
29
+ ```
30
+
31
+ ### cucumber
32
+
33
+ ```
34
+ $ cd cucumber/ios
35
+ $ bundle update
36
+ $ be cucumber
37
+ ```
@@ -0,0 +1,16 @@
1
+ ## Versioning
2
+
3
+ Calabash tries very hard to comply with Semantic Versioning [1] rules.
4
+
5
+ However, the semantic versioning spec is incompatible with RubyGem's patterns for pre-release gems.
6
+
7
+ > "But returning to the practical: No release version of SemVer is compatible with Rubygems." - _David Kellum_ [2]
8
+
9
+ Calabash version numbers will be in this form:
10
+
11
+ ```
12
+ <major>.<minor>.<patch>[.pre<N>]
13
+ ```
14
+
15
+ - [1] http://semver.org/
16
+ - [2] http://gravitext.com/2012/07/22/versioning.html
@@ -0,0 +1,95 @@
1
+ #!/usr/bin/env ruby
2
+ require 'calabash'
3
+
4
+ module Calabash
5
+ module CLI
6
+ require 'calabash/cli'
7
+
8
+ class CLI
9
+ include Calabash::CLI::Helpers
10
+ include Calabash::CLI::Build
11
+ include Calabash::CLI::Console
12
+ include Calabash::CLI::Generate
13
+ include Calabash::CLI::Resign
14
+ include Calabash::CLI::Run
15
+ include Calabash::CLI::SetupKeystore
16
+
17
+ def initialize(arguments)
18
+ @arguments = arguments.dup
19
+ @original_arguments = @arguments.dup
20
+ @options = {verbose: false}
21
+ @platform = nil
22
+ end
23
+
24
+ def evaluate
25
+ parse_arguments!
26
+ end
27
+
28
+ def set_platform!(platform)
29
+ if @platform.nil?
30
+ case platform
31
+ when :android
32
+ require 'calabash/android'
33
+ when :ios
34
+ require 'calabash/ios'
35
+ else
36
+ raise "Invalid platform '#{platform}'"
37
+ end
38
+
39
+ @platform = platform
40
+ elsif @platform != platform
41
+ raise "Cannot change platform from '#{@platform}' to '#{platform}'"
42
+ end
43
+ end
44
+
45
+ private
46
+
47
+ def parse_arguments!
48
+ argument = @arguments.shift
49
+
50
+ case argument
51
+ when '-v', '--verbose'
52
+ @options[:verbose] = true
53
+ Logger.log_levels += [:debug]
54
+ parse_arguments!
55
+ when '--platform'
56
+ platform = @arguments.shift.downcase
57
+
58
+ fail("Invalid specified platform '#{platform}'") unless platform == 'android' || platform == 'ios'
59
+
60
+ set_platform!(platform.to_sym)
61
+
62
+ parse_arguments!
63
+ when 'version'
64
+ puts Calabash::VERSION
65
+ when 'build'
66
+ parse_build_arguments!
67
+ when 'resign'
68
+ parse_resign_arguments!
69
+ when 'console'
70
+ parse_console_arguments!
71
+ when 'gen'
72
+ parse_generate_arguments!
73
+ when 'run'
74
+ parse_run_arguments!
75
+ when 'setup-keystore'
76
+ parse_setup_keystore_arguments!
77
+ when 'help'
78
+ argument = @arguments.shift
79
+
80
+ if argument.nil?
81
+ print_usage
82
+ else
83
+ print_usage_for(key_for_command(argument))
84
+ end
85
+ when nil
86
+ print_usage
87
+ else
88
+ fail("Invalid argument #{argument}.\n For help use 'calabash help'")
89
+ end
90
+ end
91
+ end
92
+ end
93
+ end
94
+
95
+ Calabash::CLI::CLI.new(ARGV).evaluate
@@ -1 +1,185 @@
1
- require 'calabash/version'
1
+ # Calabash is a Behavior-driven development (BDD) framework for Android and
2
+ # iOS. It supports both native and hybrid app testing.
3
+ #
4
+ # It is developed and maintained by Xamarin and is released under the Eclipse
5
+ # Public License.
6
+ module Calabash
7
+ require 'calabash/patch/run_loop'
8
+ require 'calabash/version'
9
+ require 'calabash/environment'
10
+ require 'calabash/logger'
11
+ require 'calabash/color'
12
+ require 'calabash/utility'
13
+ require 'calabash/application'
14
+ require 'calabash/device'
15
+ require 'calabash/http'
16
+ require 'calabash/server'
17
+ require 'calabash/wait'
18
+ require 'calabash/query'
19
+ require 'calabash/query_result'
20
+ require 'calabash/screenshot'
21
+ require 'calabash/gestures'
22
+ require 'calabash/life_cycle'
23
+ require 'calabash/location'
24
+ require 'calabash/orientation'
25
+ require 'calabash/query'
26
+ require 'calabash/text'
27
+ require 'calabash/interactions'
28
+ require 'calabash/defaults'
29
+ require 'calabash/console_helpers'
30
+
31
+
32
+ require 'calabash/patch'
33
+ Calabash::Patch.apply_patches!
34
+
35
+
36
+ include Utility
37
+ include Calabash::Wait
38
+ include Calabash::Screenshot
39
+ include Calabash::Gestures
40
+ include Calabash::LifeCycle
41
+ include Calabash::Location
42
+ include Calabash::Orientation
43
+ include Calabash::Text
44
+ include Calabash::Interactions
45
+ extend Calabash::Defaults
46
+
47
+ require 'calabash/page'
48
+
49
+ # Instantiate a page object.
50
+ #
51
+ # @example
52
+ # # android/pages/login_page.rb
53
+ # class Android::LoginPage < Calabash::Page
54
+ # include Calabash::Android
55
+ #
56
+ # [...]
57
+ # end
58
+ #
59
+ # # step definition
60
+ # Given([...]) do
61
+ # # Calabash will determine your platform and pick the Android page.
62
+ # page(LoginPage).method
63
+ # end
64
+ #
65
+ # @param [Class] The page to instantiate
66
+ # @return [Calabash::Page] An instance of the page class
67
+ def page(page_class)
68
+ platform_module = if Device.default.is_a?(Android::Device)
69
+ Object.const_get(:Android)
70
+ elsif Device.default.is_a?(IOS::Device)
71
+ Object.const_get(:IOS)
72
+ else
73
+ raise 'Cannot detect running platform'
74
+ end
75
+
76
+ unless page_class.is_a?(Class)
77
+ raise ArgumentError, "Expected a 'Class', got '#{page_class.class}'"
78
+ end
79
+
80
+ page_name = page_class.name.split('::').last
81
+
82
+ if platform_module.const_defined?(page_name, false)
83
+ page_class = platform_module.const_get(page_name, false)
84
+
85
+ if page_class.is_a?(Class)
86
+ page = page_class.send(:new, self)
87
+
88
+ if page.is_a?(Calabash::Page)
89
+ page
90
+ else
91
+ raise "Page '#{page_class}' is not a Calabash::Page"
92
+ end
93
+ else
94
+ raise "Page '#{page_class}' is not a class"
95
+ end
96
+ else
97
+ raise "No such page defined '#{platform_module}::#{page_name}'"
98
+ end
99
+ end
100
+
101
+ def self.new_embed_method!(method)
102
+ EmbeddingContext.new_embed_method(method)
103
+ end
104
+
105
+ # @!visibility private
106
+ def self.add_embed_method(base, method)
107
+ # These methods will be invoked **before** the base module is mutated.
108
+ # This means that no methods defined in the base module stem from Calabash
109
+ # yet.
110
+ unless base.respond_to?(:embed)
111
+ # The 'embed' method was not defined in the including base module. We
112
+ # don't want to define embed as Calabash's own method, as Calabash should
113
+ # not be globally mutated because of this include/extend. Notice that the
114
+ # embedding context might be mutated. e.g. when Calabash detects it is
115
+ # running in the context of Cucumber. Ruby acknowledges this change in
116
+ # all modules that include/extend the EmbeddingContext module.
117
+ base.send(method, EmbeddingContext)
118
+ end
119
+ end
120
+
121
+ # @!visibility private
122
+ def self.included(base)
123
+ if base.to_s == 'Calabash::Android' || base.to_s == 'Calabash::IOS'
124
+ return
125
+ end
126
+
127
+ add_embed_method(base, :include)
128
+ end
129
+
130
+ # @!visibility private
131
+ def self.extended(base)
132
+ # We would like to use Cucumber's embed method if possible.
133
+ # This is a hook to obtain this method
134
+ if base.singleton_class.included_modules.map(&:to_s).include?('Cucumber::RbSupport::RbWorld')
135
+ on_cucumber_context(base)
136
+ else
137
+ add_embed_method(base, :extend)
138
+ end
139
+ end
140
+
141
+ private
142
+
143
+ # @!visibility private
144
+ def self.on_new_context(base)
145
+ cucumber_embed = base.method(:embed)
146
+
147
+ unless EmbeddingContext.embedding_context_set?
148
+ new_embed_method!(cucumber_embed)
149
+ end
150
+ end
151
+
152
+ # @!visibility private
153
+ def self.on_cucumber_context(base)
154
+ on_new_context(base)
155
+ end
156
+
157
+ # @!visibility private
158
+ module EmbeddingContext
159
+ @@has_set_embedding_context ||= false
160
+
161
+ def self.embedding_context_set?
162
+ @@has_set_embedding_context
163
+ end
164
+
165
+ def self.new_embed_method(method)
166
+ define_method(:embed) do |*args|
167
+ method.call(*args)
168
+ end
169
+
170
+ @@has_set_embedding_context = true
171
+ end
172
+
173
+ def embed(*_)
174
+ Logger.warn 'Embed is not available in this context. Will not embed.'
175
+ end
176
+ end
177
+ end
178
+
179
+ unless Object.const_defined?(:Android)
180
+ Object.const_set(:Android, Module.new)
181
+ end
182
+
183
+ unless Object.const_defined?(:IOS)
184
+ Object.const_set(:IOS, Module.new)
185
+ end