kendo-page-object-widgets 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 720d68e19fcae0c6ef3ef04767dbdf99bc743c6b
4
- data.tar.gz: 87d775b248deeaef06c423d8105f315b7e1e43f4
3
+ metadata.gz: d4e379c83d58d445850a33c66297011e221b58af
4
+ data.tar.gz: cb025fb58821b81e7487bc1c1c37c831a1319eba
5
5
  SHA512:
6
- metadata.gz: 8e34dd738584db4c45ac4de1acf081fd1dcb3e94e7fa4d4f72322e1acba08d2e600d1363e8cfa9d31787f8330f73c095865076fad2c429bddd3decddf0a7c877
7
- data.tar.gz: d67ba86adbc79af197f8745666d5339ea2238d2d6b19dee93c66e1b1fb4538bd48114907f3eebb69195ce848a84fa9751f88a0793cd3645e5357aec3af70105a
6
+ metadata.gz: a563645e646c31e6c4637dada3ebe5e3316d14cdefcef3c25b7825b92705853d6a1eeb0c63e0a79f07f0c580225363c1b56a668a931c0f5725844930db2ea43b
7
+ data.tar.gz: d3b14dd52a7d52809ebeb5b0155033be2b13a41ee46d9513a7a3dbdc0e9540083e6302e0e30090e9fd8a587c5138d878df465d4699db267715c900fcb60f991d
@@ -9,10 +9,6 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Mosaic Team"]
10
10
  spec.email = ["mosaic.development@sherwin.com"]
11
11
 
12
- if spec.respond_to?(:metadata)
13
- spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com' to prevent pushes to rubygems.org, or delete to allow pushes to any server."
14
- end
15
-
16
12
  spec.summary = %q{Kendo Widgets}
17
13
  spec.description = %q{This gem adds kendo widgets to your page-objects}
18
14
  spec.homepage = "http://github.sherwin.com/kxm827/kendo-page-object-widgets"
@@ -25,7 +21,7 @@ Gem::Specification.new do |spec|
25
21
 
26
22
  spec.add_development_dependency "bundler", "~> 1.8"
27
23
  spec.add_development_dependency "rake", "~> 10.0"
28
- spec.add_development_dependency "cucumber", "=1.3"
24
+ spec.add_development_dependency "cucumber"
29
25
  spec.add_development_dependency "rspec"
30
26
  spec.add_dependency "page-object"
31
27
  spec.add_dependency "require_all"
@@ -4,10 +4,12 @@ require_relative 'widgets/kendo_auto_complete_input'
4
4
  require_relative 'widgets/kendo_combobox_auto_complete'
5
5
  require_relative 'widgets/kendo_cascading_select_list'
6
6
  require_relative 'widgets/kendo_select_list'
7
+ require_relative 'widgets/kendo_multi_select_combo_box'
7
8
 
8
9
  module KendoPageObjectWidgets
9
10
  PageObject.register_widget(:auto_complete_input, Widgets::KendoAutoCompleteInput, 'text_field')
10
11
  PageObject.register_widget(:combobox_auto_complete, Widgets::KendoComboboxAutoComplete, 'text_field')
11
12
  PageObject.register_widget(:cascading_drop_down, Widgets::KendoCascadingSelectList, 'text_field')
12
13
  PageObject.register_widget(:kendo_select_list, Widgets::KendoSelectList, 'text_field')
14
+ PageObject.register_widget(:multi_select_combo_box, Widgets::KendoMultiSelectComboBox, 'text_field')
13
15
  end
@@ -1,3 +1,3 @@
1
1
  module KendoPageObjectWidgets
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -0,0 +1,67 @@
1
+ module KendoPageObjectWidgets
2
+ module Widgets
3
+ class KendoMultiSelectComboBox < PageObject::Elements::TextField
4
+
5
+ def clear_all
6
+ self.parent.click
7
+ KendoMultiSelectComboBox.clear_values(self)
8
+ end
9
+
10
+ def set(values)
11
+ values.each do |value|
12
+ unless value.empty?
13
+ self.parent.click
14
+ self.append(value.strip)
15
+ sleep 0.5
16
+ self.send_keys :enter
17
+ end
18
+ end
19
+ end
20
+
21
+ def self.clear_values(base)
22
+ list_elements = base.parent.span_elements(:class => 'k-delete')
23
+ list_elements.map { |item| item }.each { |li| li.click }
24
+ end
25
+
26
+ def self.accessor_methods(accessor, name)
27
+
28
+ accessor.send :define_method, "#{name}_option_text" do
29
+ self.send("open_#{name}")
30
+ self.send("#{name}_listbox").when_visible
31
+ self.send("#{name}_listbox").text
32
+ end
33
+
34
+ accessor.send :define_method, "clear_#{name}" do
35
+ self.send("open_#{name}")
36
+ KendoMultiSelectComboBox.clear_values(self.send("#{name}_element"))
37
+ end
38
+
39
+ accessor.send :define_method, "#{name}=" do |values|
40
+ values.each do |new_value|
41
+ unless new_value.empty?
42
+ send("open_#{name}")
43
+ list_item = send("#{name}_listbox").list_item_element(text: new_value.strip)
44
+ list_item.click if list_item.when_present 5
45
+ end
46
+ end
47
+ end
48
+
49
+ #private
50
+
51
+ accessor.send :define_method, "open_#{name}" do
52
+ self.send("#{name}_element").parent.click
53
+ end
54
+
55
+ accessor.send :define_method, "#{name}_listbox" do
56
+ self.platform.unordered_list_for(:id => "#{self.send("#{name}_id")}_listbox")
57
+ end
58
+
59
+ accessor.send :define_method, "#{name}_id" do
60
+ self.send("#{name}_element").attribute('id')
61
+ end
62
+
63
+ accessor.send :private, "open_#{name}", "#{name}_listbox", "#{name}_id"
64
+ end
65
+ end
66
+ end
67
+ end
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kendo-page-object-widgets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mosaic Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-05-28 00:00:00.000000000 Z
11
+ date: 2015-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.8'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.8'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: cucumber
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.3'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '1.3'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: page-object
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: require_all
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description: This gem adds kendo widgets to your page-objects
@@ -101,44 +101,42 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
- - .gitignore
105
- - .rspec
106
- - .travis.yml
104
+ - ".gitignore"
105
+ - ".rspec"
106
+ - ".travis.yml"
107
107
  - Gemfile
108
108
  - LICENSE.txt
109
109
  - README.md
110
110
  - Rakefile
111
- - kendo-page-object-widgets-0.1.0.gem
112
111
  - kendo-page-object-widgets.gemspec
113
112
  - lib/kendo-page-object-widgets.rb
114
113
  - lib/version.rb
115
114
  - lib/widgets/kendo_auto_complete_input.rb
116
115
  - lib/widgets/kendo_cascading_select_list.rb
117
116
  - lib/widgets/kendo_combobox_auto_complete.rb
117
+ - lib/widgets/kendo_multi_select_combo_box.rb
118
118
  - lib/widgets/kendo_select_list.rb
119
119
  homepage: http://github.sherwin.com/kxm827/kendo-page-object-widgets
120
120
  licenses:
121
121
  - MIT
122
- metadata:
123
- allowed_push_host: 'TODO: Set to ''http://mygemserver.com'' to prevent pushes to
124
- rubygems.org, or delete to allow pushes to any server.'
122
+ metadata: {}
125
123
  post_install_message:
126
124
  rdoc_options: []
127
125
  require_paths:
128
126
  - lib
129
127
  required_ruby_version: !ruby/object:Gem::Requirement
130
128
  requirements:
131
- - - '>='
129
+ - - ">="
132
130
  - !ruby/object:Gem::Version
133
131
  version: '0'
134
132
  required_rubygems_version: !ruby/object:Gem::Requirement
135
133
  requirements:
136
- - - '>='
134
+ - - ">="
137
135
  - !ruby/object:Gem::Version
138
136
  version: '0'
139
137
  requirements: []
140
138
  rubyforge_project:
141
- rubygems_version: 2.0.14
139
+ rubygems_version: 2.4.5.1
142
140
  signing_key:
143
141
  specification_version: 4
144
142
  summary: Kendo Widgets