test-factory 0.2.9 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OTJlNTAzODM2NTgwMDJhYWI2NDY5ZDZmMDJiM2EwYTAyOWMwY2QxOQ==
5
+ data.tar.gz: !binary |-
6
+ MzM3ODY1ODZjMWZkYzY2ODJmMGJkNzE5M2MxMDAzZGU1NDVlYWNmNw==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NjdhNzY2NThiN2RjZmM2YjMxMWFiY2E0ZmM2NmMyNjQ0ZmQ0ZWU2MmUyNDNk
10
+ YTFkYzVjMjY2MTAyOWQxM2FmOTQxYTlkMDE3Y2MxNWNhMGM4YzQ3M2EzNTNh
11
+ NDVhNTNiZmEwYTUwZmI5OWU2MTg1NzBhNWQwOGI3ODg5MTdjZWI=
12
+ data.tar.gz: !binary |-
13
+ MjYwNTYwZWVkYTVmNDhhZjgyNmUxNTVjOTVkMDU0NDQ2OGNiMTY0ZjYwZWI2
14
+ MDkwNDY1MjAxYzVhNzRhODU4M2E2ZGZlYzM3OTRjN2ViMGE4ZWMzOWQ2ZTlh
15
+ Zjg5YTAzMjVjNWZmYzI0MDZlMjM1NGJiZjgzYWNjZWJiNWFhMDA=
data/COPYING ADDED
@@ -0,0 +1,68 @@
1
+ Apache License, Version 2.0
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
13
+
14
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
15
+
16
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
17
+
18
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
19
+
20
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
21
+
22
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
23
+
24
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
25
+
26
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
27
+
28
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
29
+
30
+ 2. Grant of Copyright License.
31
+
32
+ Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
33
+
34
+ 3. Grant of Patent License.
35
+
36
+ Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
37
+
38
+ 4. Redistribution.
39
+
40
+ You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
41
+
42
+ You must give any other recipients of the Work or Derivative Works a copy of this License; and
43
+ You must cause any modified files to carry prominent notices stating that You changed the files; and
44
+ You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
45
+ If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
46
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
47
+
48
+ 5. Submission of Contributions.
49
+
50
+ Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
51
+
52
+ 6. Trademarks.
53
+
54
+ This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
55
+
56
+ 7. Disclaimer of Warranty.
57
+
58
+ Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
59
+
60
+ 8. Limitation of Liability.
61
+
62
+ In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
63
+
64
+ 9. Accepting Warranty or Additional Liability.
65
+
66
+ While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
67
+
68
+ END OF TERMS AND CONDITIONS
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- test-factory (0.2.9)
4
+ test-factory (0.2.7)
5
5
  watir-webdriver (>= 0.6.2)
6
6
 
7
7
  GEM
data/LICENSE ADDED
@@ -0,0 +1,68 @@
1
+ Apache License, Version 2.0
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
13
+
14
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
15
+
16
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
17
+
18
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
19
+
20
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
21
+
22
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
23
+
24
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
25
+
26
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
27
+
28
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
29
+
30
+ 2. Grant of Copyright License.
31
+
32
+ Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
33
+
34
+ 3. Grant of Patent License.
35
+
36
+ Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
37
+
38
+ 4. Redistribution.
39
+
40
+ You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
41
+
42
+ You must give any other recipients of the Work or Derivative Works a copy of this License; and
43
+ You must cause any modified files to carry prominent notices stating that You changed the files; and
44
+ You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
45
+ If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
46
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
47
+
48
+ 5. Submission of Contributions.
49
+
50
+ Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
51
+
52
+ 6. Trademarks.
53
+
54
+ This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
55
+
56
+ 7. Disclaimer of Warranty.
57
+
58
+ Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
59
+
60
+ 8. Limitation of Liability.
61
+
62
+ In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
63
+
64
+ 9. Accepting Warranty or Additional Liability.
65
+
66
+ While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
67
+
68
+ END OF TERMS AND CONDITIONS
data/README.md CHANGED
@@ -241,12 +241,3 @@ end
241
241
  * See the gem_ext.rb file's discussion of the Watir `#fit` method for additional
242
242
  design pattern rules to follow (If you're reading this on rubydoc.info then click the Watir module link)
243
243
  * Please make an effort to follow the [Ruby Style Guidelines](http://www.caliban.org/ruby/rubyguide.shtml#style).
244
-
245
- Notice
246
- ------
247
-
248
- Copyright 2013 rSmart, Inc., Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
249
-
250
- [http://www.osedu.org/licenses/ECL-2.0](http://www.osedu.org/licenses/ECL-2.0)
251
-
252
- Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
@@ -0,0 +1,35 @@
1
+ # Copyright 2012-2013 The rSmart Group, Inc.
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ #
15
+ # =================
16
+ # CollectionFactory
17
+ # =================
18
+ #
19
+ # Use this as the superclass for your data object collection classes.
20
+ class CollectionsFactory < Array
21
+
22
+ # Creates a method called "add" that will create the specified data
23
+ # object and then add it as an item in the collection.
24
+ #
25
+ # Note that it's assumed that the target data object will have a
26
+ # create method defined. If not, this will not work properly.
27
+ def self.method_to_add klass
28
+ define_method 'add' do |browser, opts|
29
+ element = klass.new browser, opts
30
+ element.create
31
+ self << element
32
+ end
33
+ end
34
+
35
+ end
@@ -1,3 +1,17 @@
1
+ # Copyright 2012-2013 The rSmart Group, Inc.
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  class Time
2
16
 
3
17
  # Using the :year_range option (or no option), this method creates a
@@ -105,7 +119,5 @@ class Numeric
105
119
  end
106
120
  int.reverse + dec
107
121
  end
108
- alias_method :add_commas, :commas
109
- alias_method :to_string_with_commas, :commas
110
122
 
111
- end # Numeric
123
+ end # Numeric
@@ -1,3 +1,17 @@
1
+ # Copyright 2012-2013 The rSmart Group, Inc.
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  # Provides a set of tools used to create your Data Object classes.
2
16
  module DataFactory
3
17
 
@@ -1,3 +1,17 @@
1
+ # Copyright 2012-2013 The rSmart Group, Inc.
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  # Some date and time helper functions....
2
16
  module DateFactory
3
17
 
@@ -10,25 +24,25 @@ module DateFactory
10
24
  #
11
25
  def date_factory(time_object)
12
26
  {
13
- sakai: make_date(time_object),
14
- sakai_rounded: make_date(time_object).gsub!(/:\d+/, ":#{Time.at(time_object.to_i/(5*60)*(5*60)).strftime("%M")}"), # Date with time rounded to nearest 5-minute mark.
15
- short_date: time_object.strftime("%b %-d, %Y"), # => "Oct 18, 2013"
16
- samigo: time_object.strftime("%m/%d/%Y %I:%M:%S %p"), # => "10/30/2012 07:02:05 AM"
17
- MON: time_object.strftime("%^b"), # => "DEC"
18
- Mon: time_object.strftime("%b"), # => "Jan"
19
- Month: time_object.strftime("%B"), # => "February"
20
- month_int: time_object.month, # => 3
21
- day_of_month: time_object.day, # => 17 Note this is not zero-padded
22
- weekday: time_object.strftime("%A"), # => "Monday"
23
- wkdy: time_object.strftime("%a"), # => "Tue"
24
- year: time_object.year, # => 2013
25
- hour: time_object.strftime("%I").to_i, # => "07" Zero-padded, 12-hour clock
26
- minute: time_object.strftime("%M"), # => "02" Zero-padded
27
- minute_rounded: (Time.at(time_object.to_i/(5*60)*(5*60))).strftime("%M"), # => "05" Zero-padded, rounded to 5-minute increments
28
- meridian: time_object.strftime("%P"), # => "pm"
29
- MERIDIAN: time_object.strftime("%p"), # => "AM"
30
- date_w_slashes: time_object.strftime("%m/%d/%Y"), # => 02/08/2013
31
- custom: time_object # => Allows creation of a custom date string using the passed time value.
27
+ sakai: make_date(time_object),
28
+ sakai_rounded: make_date(time_object).gsub!(/:\d+/, ":#{Time.at(time_object.to_i/(5*60)*(5*60)).strftime("%M")}"), # Date with time rounded to nearest 5-minute mark.
29
+ short_date: time_object.strftime("%b %-d, %Y"), # => "Oct 18, 2013"
30
+ samigo: time_object.strftime("%m/%d/%Y %I:%M:%S %p"), # => "10/30/2012 07:02:05 AM"
31
+ MON: time_object.strftime("%^b"), # => "DEC"
32
+ Mon: time_object.strftime("%b"), # => "Jan"
33
+ Month: time_object.strftime("%B"), # => "February"
34
+ month_int: time_object.month, # => 3
35
+ day_of_month: time_object.day, # => 17 Note this is not zero-padded
36
+ weekday: time_object.strftime("%A"), # => "Monday"
37
+ wkdy: time_object.strftime("%a"), # => "Tue"
38
+ year: time_object.year, # => 2013
39
+ hour: time_object.strftime("%I").to_i, # => "07" Zero-padded, 12-hour clock
40
+ minute: time_object.strftime("%M"), # => "02" Zero-padded
41
+ minute_rounded: (Time.at(time_object.to_i/(5*60)*(5*60))).strftime("%M"), # => "05" Zero-padded, rounded to 5-minute increments
42
+ meridian: time_object.strftime("%P"), # => "pm"
43
+ MERIDIAN: time_object.strftime("%p"), # => "AM"
44
+ date_w_slashes: time_object.strftime("%m/%d/%Y"), # => 02/08/2013
45
+ custom: time_object # => Allows creation of a custom date string using the passed time value.
32
46
  }
33
47
  end
34
48
 
@@ -1,3 +1,17 @@
1
+ # Copyright 2012-2013 The rSmart Group, Inc.
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  # This module provides methods that instantiate the page and data classes.
2
16
  module Foundry
3
17
 
@@ -1,3 +1,17 @@
1
+ # Copyright 2012-2013 The rSmart Group, Inc.
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  # We are extending Watir's element methods here with the #fit method,
2
16
  # which can be used with text fields, select lists, radio buttons,
3
17
  # and checkboxes.
@@ -1,3 +1,17 @@
1
+ # Copyright 2012-2013 The rSmart Group, Inc.
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  # The PageFactory class provides a set of methods that allow the rapid creation of page element definitions--known
2
16
  # colloquially as "page objects". These elements are defined using Watir syntax. Please see www.watir.com if you are
3
17
  # not familiar with Watir.
@@ -1,3 +1,17 @@
1
+ # Copyright 2012-2013 The rSmart Group, Inc.
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  # coding: UTF-8
2
16
  module StringFactory
3
17
 
@@ -71,16 +85,6 @@ module StringFactory
71
85
  s.to_s
72
86
  end
73
87
 
74
- # Returns a String containing a number with two decimal places, for creation
75
- # of dollar values.
76
- # @param max [Integer] The highest allowable dollar amount
77
- # @example
78
- # random_dollar_value(100) => '44.89'
79
- #
80
- def random_dollar_value(max)
81
- "#{rand(max)}.#{rand(99)}"
82
- end
83
-
84
88
  # Returns a block of text (of the specified type, see below) containing
85
89
  # the specified number of "words" (each containing between 1 and 16 chars)
86
90
  # randomly spread across the specified number of lines (note that
data/lib/test-factory.rb CHANGED
@@ -1,2 +1,16 @@
1
+ # Copyright 2012-2013 The rSmart Group, Inc.
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  require 'watir-webdriver'
2
16
  Dir["#{File.dirname(__FILE__)}/test-factory/*.rb"].each {|f| require f }
data/test-factory.gemspec CHANGED
@@ -1,13 +1,13 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'test-factory'
3
- s.version = '0.2.9'
3
+ s.version = '0.3.0'
4
4
  s.summary = %q{rSmart's framework for creating automated testing scripts}
5
5
  s.description = %q{This gem provides a set of modules and methods to help quickly and DRYly create a test automation framework using Ruby and Watir (or watir-webdriver).}
6
6
  s.files = Dir.glob("**/**/**")
7
7
  s.test_files = Dir.glob("test/*test_rb")
8
8
  s.authors = ["Abraham Heward"]
9
9
  s.email = %w{"aheward@rsmart.com"}
10
- s.homepage = 'https://github.com/rSmart/TestFactory'
10
+ s.homepage = 'https://github.com/rSmart'
11
11
  s.add_dependency 'watir-webdriver', '>= 0.6.2'
12
12
  s.required_ruby_version = '>= 1.9.2'
13
13
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test-factory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
5
- prerelease:
4
+ version: 0.3.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Abraham Heward
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-06-25 00:00:00.000000000 Z
11
+ date: 2013-09-04 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: watir-webdriver
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ! '>='
28
25
  - !ruby/object:Gem::Version
@@ -35,9 +32,10 @@ executables: []
35
32
  extensions: []
36
33
  extra_rdoc_files: []
37
34
  files:
38
- - chromedriver.log
35
+ - COPYING
39
36
  - Gemfile
40
37
  - Gemfile.lock
38
+ - lib/test-factory/collections_factory.rb
41
39
  - lib/test-factory/core_ext.rb
42
40
  - lib/test-factory/data_factory.rb
43
41
  - lib/test-factory/date_factory.rb
@@ -46,30 +44,30 @@ files:
46
44
  - lib/test-factory/page_factory.rb
47
45
  - lib/test-factory/string_factory.rb
48
46
  - lib/test-factory.rb
47
+ - LICENSE
49
48
  - README.md
50
49
  - test-factory.gemspec
51
- homepage: https://github.com/rSmart/TestFactory
50
+ homepage: https://github.com/rSmart
52
51
  licenses: []
52
+ metadata: {}
53
53
  post_install_message:
54
54
  rdoc_options: []
55
55
  require_paths:
56
56
  - lib
57
57
  required_ruby_version: !ruby/object:Gem::Requirement
58
- none: false
59
58
  requirements:
60
59
  - - ! '>='
61
60
  - !ruby/object:Gem::Version
62
61
  version: 1.9.2
63
62
  required_rubygems_version: !ruby/object:Gem::Requirement
64
- none: false
65
63
  requirements:
66
64
  - - ! '>='
67
65
  - !ruby/object:Gem::Version
68
66
  version: '0'
69
67
  requirements: []
70
68
  rubyforge_project:
71
- rubygems_version: 1.8.24
69
+ rubygems_version: 2.0.6
72
70
  signing_key:
73
- specification_version: 3
71
+ specification_version: 4
74
72
  summary: rSmart's framework for creating automated testing scripts
75
73
  test_files: []
data/chromedriver.log DELETED
@@ -1,131 +0,0 @@
1
- [0.008][INFO]: ChromeDriver 26.0.1383.0 /opt/local/bin/chromedriver
2
- [0.216][FINE]: Initializing session with capabilities {
3
- "browserName": "chrome",
4
- "chrome.detach": true,
5
- "chromeOptions": {
6
- "detach": true
7
- },
8
- "cssSelectorsEnabled": true,
9
- "javascriptEnabled": true,
10
- "nativeEvents": false,
11
- "platform": "ANY",
12
- "rotatable": false,
13
- "takesScreenshot": false,
14
- "version": ""
15
- }
16
-
17
- [0.218][INFO]: Using named testing interface
18
- [4.939][INFO]: Connected to Chrome successfully. Version: 27.0.1453.93
19
- [4.943][FINE]: Command received (/session/1f9417409e0f9321d37fc7b61a0d9ef5)
20
- [4.943][FINE]: Command finished (/session/1f9417409e0f9321d37fc7b61a0d9ef5) with response {
21
- "sessionId": "1f9417409e0f9321d37fc7b61a0d9ef5",
22
- "status": 0,
23
- "value": {
24
- "acceptSslCerts": false,
25
- "applicationCacheEnabled": false,
26
- "browserConnectionEnabled": false,
27
- "browserName": "chrome",
28
- "chrome.chromedriverVersion": "26.0.1383.0",
29
- "cssSelectorsEnabled": true,
30
- "databaseEnabled": false,
31
- "handlesAlerts": true,
32
- "javascriptEnabled": true,
33
- "locationContextEnabled": false,
34
- "nativeEvents": true,
35
- "platform": "mac",
36
- "rotatable": false,
37
- "takesScreenshot": true,
38
- "version": "27.0.1453.93",
39
- "webStorageEnabled": true
40
- }
41
- }
42
-
43
- [4.944][FINE]: Command received (/session/1f9417409e0f9321d37fc7b61a0d9ef5/url)
44
- [4.944][FINER]: Waiting for all views to stop loading...
45
- [4.944][FINER]: Done waiting for all views to stop loading
46
- [5.012][FINER]: Waiting for all views to stop loading...
47
- [5.012][FINER]: Done waiting for all views to stop loading
48
- [5.012][FINE]: Command finished (/session/1f9417409e0f9321d37fc7b61a0d9ef5/url) with response {
49
- "sessionId": "1f9417409e0f9321d37fc7b61a0d9ef5",
50
- "status": 0,
51
- "value": "about:blank"
52
- }
53
-
54
- [5.014][FINE]: Command received (/session/1f9417409e0f9321d37fc7b61a0d9ef5/title)
55
- [5.014][FINER]: Waiting for all views to stop loading...
56
- [5.014][FINER]: Done waiting for all views to stop loading
57
- [5.017][FINER]: Waiting for all views to stop loading...
58
- [5.017][FINER]: Done waiting for all views to stop loading
59
- [5.017][FINE]: Command finished (/session/1f9417409e0f9321d37fc7b61a0d9ef5/title) with response {
60
- "sessionId": "1f9417409e0f9321d37fc7b61a0d9ef5",
61
- "status": 0,
62
- "value": "about:blank"
63
- }
64
-
65
- [57.265][FINE]: Command received (/session/1f9417409e0f9321d37fc7b61a0d9ef5/window_handles)
66
- [57.265][FINER]: Waiting for all views to stop loading...
67
- [57.265][FINER]: Done waiting for all views to stop loading
68
- [57.265][FINER]: Waiting for all views to stop loading...
69
- [57.266][FINER]: Done waiting for all views to stop loading
70
- [57.266][FINE]: Command finished (/session/1f9417409e0f9321d37fc7b61a0d9ef5/window_handles) with response {
71
- "sessionId": "1f9417409e0f9321d37fc7b61a0d9ef5",
72
- "status": 0,
73
- "value": [ "f1-2", "f1-4" ]
74
- }
75
-
76
- [57.266][FINE]: Command received (/session/1f9417409e0f9321d37fc7b61a0d9ef5/window) with params {
77
- "name": "f1-4"
78
- }
79
-
80
- [57.267][FINE]: Command finished (/session/1f9417409e0f9321d37fc7b61a0d9ef5/window) with response {
81
- "sessionId": "1f9417409e0f9321d37fc7b61a0d9ef5",
82
- "status": 0,
83
- "value": {
84
-
85
- }
86
- }
87
-
88
- [242.542][FINE]: Command received (/session/1f9417409e0f9321d37fc7b61a0d9ef5/frame) with params {
89
- "id": null
90
- }
91
-
92
- [242.542][FINER]: Waiting for all views to stop loading...
93
- [242.542][FINER]: Done waiting for all views to stop loading
94
- [242.542][FINER]: Waiting for all views to stop loading...
95
- [242.542][FINER]: Done waiting for all views to stop loading
96
- [242.542][FINE]: Command finished (/session/1f9417409e0f9321d37fc7b61a0d9ef5/frame) with response {
97
- "sessionId": "1f9417409e0f9321d37fc7b61a0d9ef5",
98
- "status": 0,
99
- "value": {
100
-
101
- }
102
- }
103
-
104
- [242.544][FINE]: Command received (/session/1f9417409e0f9321d37fc7b61a0d9ef5/element) with params {
105
- "using": "id",
106
- "value": "tab-PersonnelDetailPeriod1-div"
107
- }
108
-
109
- [242.544][FINER]: Waiting for all views to stop loading...
110
- [242.544][FINER]: Done waiting for all views to stop loading
111
- [242.563][FINER]: Waiting for all views to stop loading...
112
- [242.563][FINER]: Done waiting for all views to stop loading
113
- [242.563][FINE]: Command finished (/session/1f9417409e0f9321d37fc7b61a0d9ef5/element) with response {
114
- "sessionId": "1f9417409e0f9321d37fc7b61a0d9ef5",
115
- "status": 0,
116
- "value": {
117
- "ELEMENT": ":wdc:1369172957736"
118
- }
119
- }
120
-
121
- [242.566][FINE]: Command received (/session/1f9417409e0f9321d37fc7b61a0d9ef5/element/:wdc:1369172957736/name)
122
- [242.566][FINER]: Waiting for all views to stop loading...
123
- [242.566][FINER]: Done waiting for all views to stop loading
124
- [242.570][FINER]: Waiting for all views to stop loading...
125
- [242.570][FINER]: Done waiting for all views to stop loading
126
- [242.570][FINE]: Command finished (/session/1f9417409e0f9321d37fc7b61a0d9ef5/element/:wdc:1369172957736/name) with response {
127
- "sessionId": "1f9417409e0f9321d37fc7b61a0d9ef5",
128
- "status": 0,
129
- "value": "div"
130
- }
131
-