kendo-page-object-widgets 0.2.10 → 0.2.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +10 -10
- data/.rspec +2 -2
- data/.travis.yml +3 -3
- data/Gemfile +4 -4
- data/LICENSE.txt +21 -21
- data/README.md +39 -39
- data/Rakefile +6 -6
- data/kendo-page-object-widgets.gemspec +28 -28
- data/lib/kendo-page-object-widgets.rb +15 -15
- data/lib/version.rb +3 -3
- data/lib/widgets/kendo_auto_complete_input.rb +61 -61
- data/lib/widgets/kendo_cascading_select_list.rb +71 -65
- data/lib/widgets/kendo_combobox_auto_complete.rb +82 -79
- data/lib/widgets/kendo_multi_select_combo_box.rb +67 -67
- data/lib/widgets/kendo_select_list.rb +72 -72
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 555869242a9c9d5b6c2e3a13e0a4f46b6906c17b5c4e0b638143e9950591960b
|
4
|
+
data.tar.gz: 2d2f0edd1977c20f166ba2e0c72775c9210e90556508d715dad8242395e36cba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff8425cf4ac120183909bfc818e971b3128380b79c5450c5cd4e59cb1ac68efb6e53fe8dea912af9fd2f87df37e556eea0528c7e038cbad0cb680ebeef2e5d89
|
7
|
+
data.tar.gz: a04d98f792d095bfec68ee10028629804dbea9197186a407873164b9d1b7eaf8ff1f6109a5232c7d58921d910978765dcd85c94d102260017d1307e54efdab6d
|
data/.gitignore
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
/.bundle/
|
2
|
-
/.yardoc
|
3
|
-
/Gemfile.lock
|
4
|
-
/_yardoc/
|
5
|
-
/coverage/
|
6
|
-
/doc/
|
7
|
-
/pkg/
|
8
|
-
/spec/reports/
|
9
|
-
/tmp/
|
10
|
-
.idea/
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/Gemfile.lock
|
4
|
+
/_yardoc/
|
5
|
+
/coverage/
|
6
|
+
/doc/
|
7
|
+
/pkg/
|
8
|
+
/spec/reports/
|
9
|
+
/tmp/
|
10
|
+
.idea/
|
data/.rspec
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
--format documentation
|
2
|
-
--color
|
1
|
+
--format documentation
|
2
|
+
--color
|
data/.travis.yml
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 1.9.3
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 1.9.3
|
data/Gemfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
# Specify your gem's dependencies in kendo-page-object-widgets.gemspec
|
4
|
-
gemspec
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in kendo-page-object-widgets.gemspec
|
4
|
+
gemspec
|
data/LICENSE.txt
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2015 Kyle McKee
|
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
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Kyle McKee
|
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.
|
data/README.md
CHANGED
@@ -1,39 +1,39 @@
|
|
1
|
-
# Kendo::Page::Object::Widgets
|
2
|
-
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/kendo/page/object/widgets`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
|
-
|
7
|
-
## Installation
|
8
|
-
|
9
|
-
Add this line to your application's Gemfile:
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
gem 'kendo-page-object-widgets'
|
13
|
-
```
|
14
|
-
|
15
|
-
And then execute:
|
16
|
-
|
17
|
-
$ bundle
|
18
|
-
|
19
|
-
Or install it yourself as:
|
20
|
-
|
21
|
-
$ gem install kendo-page-object-widgets
|
22
|
-
|
23
|
-
## Usage
|
24
|
-
|
25
|
-
TODO: Write usage instructions here
|
26
|
-
|
27
|
-
## Development
|
28
|
-
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
-
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
-
|
33
|
-
## Contributing
|
34
|
-
|
35
|
-
1. Fork it ( https://github.com/[my-github-username]/kendo-page-object-widgets/fork )
|
36
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
37
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
38
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
39
|
-
5. Create a new Pull Request
|
1
|
+
# Kendo::Page::Object::Widgets
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/kendo/page/object/widgets`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'kendo-page-object-widgets'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install kendo-page-object-widgets
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
1. Fork it ( https://github.com/[my-github-username]/kendo-page-object-widgets/fork )
|
36
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
37
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
38
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
39
|
+
5. Create a new Pull Request
|
data/Rakefile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
require "bundler/gem_tasks"
|
2
|
-
require 'cucumber'
|
3
|
-
require 'cucumber/rake/task'
|
4
|
-
|
5
|
-
Cucumber::Rake::Task.new(:features) do |t|
|
6
|
-
t.cucumber_opts = "features --format pretty"
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require 'cucumber'
|
3
|
+
require 'cucumber/rake/task'
|
4
|
+
|
5
|
+
Cucumber::Rake::Task.new(:features) do |t|
|
6
|
+
t.cucumber_opts = "features --format pretty"
|
7
7
|
end
|
@@ -1,28 +1,28 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "kendo-page-object-widgets"
|
8
|
-
spec.version = KendoPageObjectWidgets::VERSION
|
9
|
-
spec.authors = ["Mosaic Team"]
|
10
|
-
spec.email = ["mosaic.development@sherwin.com"]
|
11
|
-
|
12
|
-
spec.summary = %q{Kendo Widgets}
|
13
|
-
spec.description = %q{This gem adds kendo widgets to your page-objects}
|
14
|
-
spec.homepage = "http://github.sherwin.com/kxm827/kendo-page-object-widgets"
|
15
|
-
spec.license = "MIT"
|
16
|
-
|
17
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
-
spec.bindir = "exe"
|
19
|
-
#spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
-
spec.require_paths = ["lib"]
|
21
|
-
|
22
|
-
spec.add_development_dependency "bundler", "~> 1.
|
23
|
-
spec.add_development_dependency "rake", "~>
|
24
|
-
spec.add_development_dependency "cucumber"
|
25
|
-
spec.add_development_dependency "rspec"
|
26
|
-
spec.add_dependency "page-object"
|
27
|
-
spec.add_dependency "require_all", "= 1.4"
|
28
|
-
end
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "kendo-page-object-widgets"
|
8
|
+
spec.version = KendoPageObjectWidgets::VERSION
|
9
|
+
spec.authors = ["Mosaic Team"]
|
10
|
+
spec.email = ["mosaic.development@sherwin.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Kendo Widgets}
|
13
|
+
spec.description = %q{This gem adds kendo widgets to your page-objects}
|
14
|
+
spec.homepage = "http://github.sherwin.com/kxm827/kendo-page-object-widgets"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = "exe"
|
19
|
+
#spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
23
|
+
spec.add_development_dependency "rake", "~> 12.3"
|
24
|
+
spec.add_development_dependency "cucumber"
|
25
|
+
spec.add_development_dependency "rspec"
|
26
|
+
spec.add_dependency "page-object"
|
27
|
+
spec.add_dependency "require_all", "= 1.4"
|
28
|
+
end
|
@@ -1,15 +1,15 @@
|
|
1
|
-
require 'version'
|
2
|
-
require 'page-object'
|
3
|
-
require_relative 'widgets/kendo_auto_complete_input'
|
4
|
-
require_relative 'widgets/kendo_combobox_auto_complete'
|
5
|
-
require_relative 'widgets/kendo_cascading_select_list'
|
6
|
-
require_relative 'widgets/kendo_select_list'
|
7
|
-
require_relative 'widgets/kendo_multi_select_combo_box'
|
8
|
-
|
9
|
-
module KendoPageObjectWidgets
|
10
|
-
PageObject.register_widget(:auto_complete_input, Widgets::KendoAutoCompleteInput, 'text_field')
|
11
|
-
PageObject.register_widget(:combobox_auto_complete, Widgets::KendoComboboxAutoComplete, 'text_field')
|
12
|
-
PageObject.register_widget(:cascading_drop_down, Widgets::KendoCascadingSelectList, 'text_field')
|
13
|
-
PageObject.register_widget(:kendo_select_list, Widgets::KendoSelectList, 'text_field')
|
14
|
-
PageObject.register_widget(:multi_select_combo_box, Widgets::KendoMultiSelectComboBox, 'text_field')
|
15
|
-
end
|
1
|
+
require 'version'
|
2
|
+
require 'page-object'
|
3
|
+
require_relative 'widgets/kendo_auto_complete_input'
|
4
|
+
require_relative 'widgets/kendo_combobox_auto_complete'
|
5
|
+
require_relative 'widgets/kendo_cascading_select_list'
|
6
|
+
require_relative 'widgets/kendo_select_list'
|
7
|
+
require_relative 'widgets/kendo_multi_select_combo_box'
|
8
|
+
|
9
|
+
module KendoPageObjectWidgets
|
10
|
+
PageObject.register_widget(:auto_complete_input, Widgets::KendoAutoCompleteInput, 'text_field')
|
11
|
+
PageObject.register_widget(:combobox_auto_complete, Widgets::KendoComboboxAutoComplete, 'text_field')
|
12
|
+
PageObject.register_widget(:cascading_drop_down, Widgets::KendoCascadingSelectList, 'text_field')
|
13
|
+
PageObject.register_widget(:kendo_select_list, Widgets::KendoSelectList, 'text_field')
|
14
|
+
PageObject.register_widget(:multi_select_combo_box, Widgets::KendoMultiSelectComboBox, 'text_field')
|
15
|
+
end
|
data/lib/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module KendoPageObjectWidgets
|
2
|
-
VERSION = "0.2.
|
3
|
-
end
|
1
|
+
module KendoPageObjectWidgets
|
2
|
+
VERSION = "0.2.11"
|
3
|
+
end
|
@@ -1,61 +1,61 @@
|
|
1
|
-
module KendoPageObjectWidgets
|
2
|
-
module Widgets
|
3
|
-
class KendoAutoCompleteInput < PageObject::Elements::TextField
|
4
|
-
|
5
|
-
def self.accessor_methods(accessor, name)
|
6
|
-
|
7
|
-
accessor.send :define_method, "#{name}" do
|
8
|
-
self.send("#{name}_element").value
|
9
|
-
end
|
10
|
-
|
11
|
-
accessor.send :define_method, "#{name}=" do |value|
|
12
|
-
self.send("#{name}_element").value= value
|
13
|
-
self.send("#{name}_options_container").
|
14
|
-
self.send("#{name}_element").send_keys :tab
|
15
|
-
end
|
16
|
-
|
17
|
-
accessor.send :define_method, "#{name}_text=" do |value|
|
18
|
-
self.send("#{name}_element").append(value)
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
options = self.send("#{name}_options_list")
|
28
|
-
options.map { |li| li.text }
|
29
|
-
end
|
30
|
-
|
31
|
-
accessor.send :define_method, "#{name}_select=" do |value|
|
32
|
-
container = self.send("#{name}_options_container")
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
list_item.
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
#private
|
42
|
-
|
43
|
-
accessor.send :define_method, "#{name}_options_list" do
|
44
|
-
self.platform.unordered_list_for(:id => "#{self.send("#{name}_id")}_listbox")
|
45
|
-
end
|
46
|
-
|
47
|
-
accessor.send :define_method, "#{name}_options_container" do
|
48
|
-
self.platform.div_for(:id => "#{self.send("#{name}_id")}-list")
|
49
|
-
end
|
50
|
-
|
51
|
-
accessor.send :define_method, "#{name}_id" do
|
52
|
-
self.send("#{name}_element").attribute('id')
|
53
|
-
end
|
54
|
-
|
55
|
-
accessor.send :private, "#{name}_options_container", "#{name}_id"
|
56
|
-
end
|
57
|
-
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
1
|
+
module KendoPageObjectWidgets
|
2
|
+
module Widgets
|
3
|
+
class KendoAutoCompleteInput < PageObject::Elements::TextField
|
4
|
+
|
5
|
+
def self.accessor_methods(accessor, name)
|
6
|
+
|
7
|
+
accessor.send :define_method, "#{name}" do
|
8
|
+
self.send("#{name}_element").value
|
9
|
+
end
|
10
|
+
|
11
|
+
accessor.send :define_method, "#{name}=" do |value|
|
12
|
+
self.send("#{name}_element").value= value
|
13
|
+
self.send("#{name}_options_container").when_present(10)
|
14
|
+
self.send("#{name}_element").send_keys :tab
|
15
|
+
end
|
16
|
+
|
17
|
+
accessor.send :define_method, "#{name}_text=" do |value|
|
18
|
+
self.send("#{name}_element").append(value)
|
19
|
+
end
|
20
|
+
|
21
|
+
accessor.send :define_method, "#{name}_valid?" do
|
22
|
+
!self.send("#{name}_element").attribute('class').include? 'input-validation-error'
|
23
|
+
end
|
24
|
+
|
25
|
+
accessor.send :define_method, "#{name}_suggestions" do
|
26
|
+
self.send("#{name}_options_container").when_present(10)
|
27
|
+
options = self.send("#{name}_options_list")
|
28
|
+
options.map { |li| li.text }
|
29
|
+
end
|
30
|
+
|
31
|
+
accessor.send :define_method, "#{name}_select=" do |value|
|
32
|
+
container = self.send("#{name}_options_container")
|
33
|
+
|
34
|
+
if container.when_present(10)
|
35
|
+
options = self.send("#{name}_options_list")
|
36
|
+
list_item = options.list_item_element(:text => value.strip)
|
37
|
+
list_item.click
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
#private
|
42
|
+
|
43
|
+
accessor.send :define_method, "#{name}_options_list" do
|
44
|
+
self.platform.unordered_list_for(:id => "#{self.send("#{name}_id")}_listbox")
|
45
|
+
end
|
46
|
+
|
47
|
+
accessor.send :define_method, "#{name}_options_container" do
|
48
|
+
self.platform.div_for(:id => "#{self.send("#{name}_id")}-list")
|
49
|
+
end
|
50
|
+
|
51
|
+
accessor.send :define_method, "#{name}_id" do
|
52
|
+
self.send("#{name}_element").attribute('id')
|
53
|
+
end
|
54
|
+
|
55
|
+
accessor.send :private, "#{name}_options_container", "#{name}_id"
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
@@ -1,65 +1,71 @@
|
|
1
|
-
module KendoPageObjectWidgets
|
2
|
-
module Widgets
|
3
|
-
class KendoCascadingSelectList < PageObject::Elements::TextField
|
4
|
-
|
5
|
-
def visible?
|
6
|
-
self.parent.present?
|
7
|
-
end
|
8
|
-
|
9
|
-
def self.accessor_methods(accessor, name)
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
end
|
1
|
+
module KendoPageObjectWidgets
|
2
|
+
module Widgets
|
3
|
+
class KendoCascadingSelectList < PageObject::Elements::TextField
|
4
|
+
|
5
|
+
def visible?
|
6
|
+
self.parent.present?
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.accessor_methods(accessor, name)
|
10
|
+
accessor.send :define_method, "#{name}=" do |value|
|
11
|
+
wait_until { self.send("is_#{name}_enabled?") }
|
12
|
+
self.send("click_opener_for_#{name}")
|
13
|
+
unless value.empty?
|
14
|
+
options = self.send("get_#{name}_options")
|
15
|
+
list_item = options.list_item_element(:text => value.strip)
|
16
|
+
list_item.click
|
17
|
+
end
|
18
|
+
#wait until animation closes
|
19
|
+
wait_until {
|
20
|
+
self.send("#{name}_options_hidden?")
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
accessor.send :define_method, "#{name}_options" do
|
25
|
+
options = self.send("get_#{name}_options")
|
26
|
+
options.map { |li| li.text }
|
27
|
+
end
|
28
|
+
|
29
|
+
#private
|
30
|
+
accessor.send :define_method, "get_#{name}_options" do
|
31
|
+
container = self.send("#{name}_options_container")
|
32
|
+
unless container.element.present?
|
33
|
+
self.send("click_opener_for_#{name}")
|
34
|
+
container.element.wait_until(&:present?)
|
35
|
+
end
|
36
|
+
self.send("#{name}_options_list")
|
37
|
+
end
|
38
|
+
|
39
|
+
accessor.send :define_method, "#{name}_options_container" do
|
40
|
+
self.element('div', :id => "#{self.send("#{name}_id")}-list")
|
41
|
+
end
|
42
|
+
|
43
|
+
accessor.send :define_method, "click_opener_for_#{name}" do
|
44
|
+
self.send("#{name}_element").parent.span_element(:class => 'k-select').click
|
45
|
+
end
|
46
|
+
|
47
|
+
accessor.send :define_method, "#{name}_options_list" do
|
48
|
+
self.platform.unordered_list_for(:id => "#{self.send("#{name}_id")}_listbox")
|
49
|
+
end
|
50
|
+
|
51
|
+
accessor.send :define_method, "#{name}_selected_value" do
|
52
|
+
self.send("#{name}_element").parent.span_element(:class => 'k-input').text
|
53
|
+
end
|
54
|
+
|
55
|
+
accessor.send :define_method, "#{name}_id" do
|
56
|
+
self.send("#{name}_element").attribute('id')
|
57
|
+
end
|
58
|
+
|
59
|
+
accessor.send :define_method, "is_#{name}_enabled?" do
|
60
|
+
self.send("#{name}_element").parent.attribute('aria-disabled') == "false"
|
61
|
+
end
|
62
|
+
|
63
|
+
accessor.send :define_method, "#{name}_options_hidden?" do
|
64
|
+
self.send("#{name}_options_list").attribute('aria-hidden') == "true"
|
65
|
+
end
|
66
|
+
|
67
|
+
accessor.send :private, "get_#{name}_options", "#{name}_options_list", "#{name}_options_container", "click_opener_for_#{name}", "#{name}_id", "is_#{name}_enabled?", "#{name}_options_hidden?"
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -1,79 +1,82 @@
|
|
1
|
-
module KendoPageObjectWidgets
|
2
|
-
module Widgets
|
3
|
-
class KendoComboboxAutoComplete < PageObject::Elements::TextField
|
4
|
-
|
5
|
-
def self.accessor_methods(accessor, name)
|
6
|
-
|
7
|
-
accessor.send :define_method, "#{name}_filter=" do |value|
|
8
|
-
self.send("#{name}_text_field").value = value
|
9
|
-
self.send("#{name}_options_container")
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
text_field
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
options
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
options
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
self.send("#{name}
|
48
|
-
container.
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
1
|
+
module KendoPageObjectWidgets
|
2
|
+
module Widgets
|
3
|
+
class KendoComboboxAutoComplete < PageObject::Elements::TextField
|
4
|
+
|
5
|
+
def self.accessor_methods(accessor, name)
|
6
|
+
|
7
|
+
accessor.send :define_method, "#{name}_filter=" do |value|
|
8
|
+
self.send("#{name}_text_field").value = value
|
9
|
+
container = self.send("#{name}_options_container")
|
10
|
+
container.element.wait_until(&:present?)
|
11
|
+
end
|
12
|
+
|
13
|
+
accessor.send :define_method, "#{name}_text=" do |text|
|
14
|
+
text_field = self.send("#{name}_text_field")
|
15
|
+
text_field.value = text
|
16
|
+
sleep 0.5
|
17
|
+
text_field.send_keys :tab
|
18
|
+
end
|
19
|
+
|
20
|
+
accessor.send :define_method, "#{name}=" do |value|
|
21
|
+
self.send("#{name}_filter=", value)
|
22
|
+
browser.li(:text, /#{value}/).click
|
23
|
+
end
|
24
|
+
|
25
|
+
accessor.send :define_method, "#{name}_valid?" do
|
26
|
+
!self.send("#{name}_text_field").attribute('class').include? 'input-validation-error'
|
27
|
+
end
|
28
|
+
|
29
|
+
accessor.send :define_method, "#{name}_options" do
|
30
|
+
self.send("#{name}_opener")
|
31
|
+
options = self.send("#{name}_options_list")
|
32
|
+
options.map { |li| li.text }
|
33
|
+
end
|
34
|
+
|
35
|
+
accessor.send :define_method, "#{name}_suggestions" do
|
36
|
+
options = self.send("#{name}_options_list")
|
37
|
+
options.map { |li| li.text }
|
38
|
+
end
|
39
|
+
|
40
|
+
accessor.send :define_method, "#{name}_text" do
|
41
|
+
self.send("#{name}_text_field").value
|
42
|
+
end
|
43
|
+
|
44
|
+
#private
|
45
|
+
|
46
|
+
accessor.send :define_method, "#{name}_opener" do
|
47
|
+
container = self.send("#{name}_options_container")
|
48
|
+
unless container.element.present?
|
49
|
+
self.send("#{name}_select_list_opener")
|
50
|
+
container.element.wait_until(&:present?)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
accessor.send :define_method, "#{name}_options_container" do
|
55
|
+
self.platform.div_for(:id => "#{self.send("#{name}_id")}-list")
|
56
|
+
end
|
57
|
+
|
58
|
+
accessor.send :define_method, "#{name}_options_list" do
|
59
|
+
self.platform.unordered_list_for(:id => "#{self.send("#{name}_id")}_listbox")
|
60
|
+
end
|
61
|
+
|
62
|
+
accessor.send :define_method, "#{name}_text_field" do
|
63
|
+
self.platform.text_field_for(:name => "#{self.send("#{name}_id")}_input")
|
64
|
+
end
|
65
|
+
|
66
|
+
accessor.send :define_method, "#{name}_select_list_opener" do
|
67
|
+
self.send("#{name}_element").parent.span_element(:class => 'k-select').click
|
68
|
+
end
|
69
|
+
|
70
|
+
accessor.send :define_method, "#{name}_id" do
|
71
|
+
id = self.send("#{name}_element").attribute('id')
|
72
|
+
return id if !id.empty?
|
73
|
+
self.send("#{name}_element").attribute('name').split('_')[0...-1].join('_')
|
74
|
+
end
|
75
|
+
|
76
|
+
accessor.send :private, "#{name}_text_field", "#{name}_id", "#{name}_select_list_opener", "#{name}_options_list", "#{name}_options_container", "#{name}_opener"
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -1,67 +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-i-close')
|
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").
|
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 10
|
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
|
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-i-close')
|
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_present(10)
|
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 10
|
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
|
@@ -1,72 +1,72 @@
|
|
1
|
-
module KendoPageObjectWidgets
|
2
|
-
module Widgets
|
3
|
-
class KendoSelectList < PageObject::Elements::TextField
|
4
|
-
|
5
|
-
def visible?
|
6
|
-
self.parent.visible?
|
7
|
-
end
|
8
|
-
|
9
|
-
def self.accessor_methods(accessor, name)
|
10
|
-
|
11
|
-
accessor.send :define_method, "#{name}_options" do
|
12
|
-
options = self.send("get_#{name}_options")
|
13
|
-
options.map { |li| li.text }
|
14
|
-
end
|
15
|
-
|
16
|
-
accessor.send :define_method, "#{name}=" do |value|
|
17
|
-
unless value.empty?
|
18
|
-
self.send("click_opener_for_#{name}")
|
19
|
-
options = self.send("get_#{name}_options")
|
20
|
-
list_item = options.list_item_element(:text => value.strip)
|
21
|
-
list_item.click
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
accessor.send :define_method, "#{name}" do
|
26
|
-
selected_option = self.send("#{name}_selected")
|
27
|
-
selected_option.text
|
28
|
-
end
|
29
|
-
|
30
|
-
accessor.send :define_method, "#{name}_valid?" do
|
31
|
-
!self.send("#{name}_text_field").attribute('class').include? 'input-validation-error'
|
32
|
-
end
|
33
|
-
|
34
|
-
#private
|
35
|
-
accessor.send :define_method, "get_#{name}_options" do
|
36
|
-
container = self.send("#{name}_options_container")
|
37
|
-
unless container.
|
38
|
-
self.send("click_opener_for_#{name}")
|
39
|
-
container.
|
40
|
-
end
|
41
|
-
self.send("#{name}_options_list")
|
42
|
-
end
|
43
|
-
|
44
|
-
accessor.send :define_method, "#{name}_options_container" do
|
45
|
-
self.element('div', :id => "#{self.send("#{name}_id")}-list")
|
46
|
-
end
|
47
|
-
|
48
|
-
accessor.send :define_method, "#{name}_options_list" do
|
49
|
-
self.platform.unordered_list_for(:id => "#{self.send("#{name}_id")}_listbox")
|
50
|
-
end
|
51
|
-
|
52
|
-
accessor.send :define_method, "click_opener_for_#{name}" do
|
53
|
-
self.send("#{name}_element").parent.span_element(:class => 'k-select').click
|
54
|
-
end
|
55
|
-
|
56
|
-
accessor.send :define_method, "#{name}_id" do
|
57
|
-
self.send("#{name}_element").attribute('id')
|
58
|
-
end
|
59
|
-
|
60
|
-
accessor.send :define_method, "#{name}_text_field" do
|
61
|
-
self.send("#{name}_element").parent.text_field_element
|
62
|
-
end
|
63
|
-
|
64
|
-
accessor.send :define_method, "#{name}_selected" do
|
65
|
-
self.send("#{name}_element").parent.span_element(:class => 'k-input')
|
66
|
-
end
|
67
|
-
|
68
|
-
accessor.send :private, "#{name}_selected", "#{name}_text_field", "#{name}_id", "click_opener_for_#{name}", "#{name}_options_list", "#{name}_options_container", "get_#{name}_options"
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
1
|
+
module KendoPageObjectWidgets
|
2
|
+
module Widgets
|
3
|
+
class KendoSelectList < PageObject::Elements::TextField
|
4
|
+
|
5
|
+
def visible?
|
6
|
+
self.parent.visible?
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.accessor_methods(accessor, name)
|
10
|
+
|
11
|
+
accessor.send :define_method, "#{name}_options" do
|
12
|
+
options = self.send("get_#{name}_options")
|
13
|
+
options.map { |li| li.text }
|
14
|
+
end
|
15
|
+
|
16
|
+
accessor.send :define_method, "#{name}=" do |value|
|
17
|
+
unless value.empty?
|
18
|
+
self.send("click_opener_for_#{name}")
|
19
|
+
options = self.send("get_#{name}_options")
|
20
|
+
list_item = options.list_item_element(:text => value.strip)
|
21
|
+
list_item.click
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
accessor.send :define_method, "#{name}" do
|
26
|
+
selected_option = self.send("#{name}_selected")
|
27
|
+
selected_option.text
|
28
|
+
end
|
29
|
+
|
30
|
+
accessor.send :define_method, "#{name}_valid?" do
|
31
|
+
!self.send("#{name}_text_field").attribute('class').include? 'input-validation-error'
|
32
|
+
end
|
33
|
+
|
34
|
+
#private
|
35
|
+
accessor.send :define_method, "get_#{name}_options" do
|
36
|
+
container = self.send("#{name}_options_container")
|
37
|
+
unless container.element.present?
|
38
|
+
self.send("click_opener_for_#{name}")
|
39
|
+
container.element.wait_until(&:present?)
|
40
|
+
end
|
41
|
+
self.send("#{name}_options_list")
|
42
|
+
end
|
43
|
+
|
44
|
+
accessor.send :define_method, "#{name}_options_container" do
|
45
|
+
self.element('div', :id => "#{self.send("#{name}_id")}-list")
|
46
|
+
end
|
47
|
+
|
48
|
+
accessor.send :define_method, "#{name}_options_list" do
|
49
|
+
self.platform.unordered_list_for(:id => "#{self.send("#{name}_id")}_listbox")
|
50
|
+
end
|
51
|
+
|
52
|
+
accessor.send :define_method, "click_opener_for_#{name}" do
|
53
|
+
self.send("#{name}_element").parent.span_element(:class => 'k-select').click
|
54
|
+
end
|
55
|
+
|
56
|
+
accessor.send :define_method, "#{name}_id" do
|
57
|
+
self.send("#{name}_element").attribute('id')
|
58
|
+
end
|
59
|
+
|
60
|
+
accessor.send :define_method, "#{name}_text_field" do
|
61
|
+
self.send("#{name}_element").parent.text_field_element
|
62
|
+
end
|
63
|
+
|
64
|
+
accessor.send :define_method, "#{name}_selected" do
|
65
|
+
self.send("#{name}_element").parent.span_element(:class => 'k-input')
|
66
|
+
end
|
67
|
+
|
68
|
+
accessor.send :private, "#{name}_selected", "#{name}_text_field", "#{name}_id", "click_opener_for_#{name}", "#{name}_options_list", "#{name}_options_container", "get_#{name}_options"
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kendo-page-object-widgets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mosaic Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.16'
|
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
|
-
version: '1.
|
26
|
+
version: '1.16'
|
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
|
-
version: '
|
33
|
+
version: '12.3'
|
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
|
-
version: '
|
40
|
+
version: '12.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: cucumber
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|