mohawk 0.2 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/Changelog CHANGED
@@ -1,3 +1,7 @@
1
+ === Version 0.2.1 / 2014-05-14
2
+ * Enhancements
3
+ * bumped uia dependency to make menu item selection faster
4
+
1
5
  === Version 0.2 / 2014-05-09
2
6
  * Enhancements
3
7
  * Swapped out the underlying driver to use the uia gem
@@ -5,43 +5,26 @@ module Mohawk
5
5
  class MenuItemNotFound < StandardError; end
6
6
 
7
7
  def select
8
- menu_item.as(:invoke).invoke
8
+ element.select_menu_item(*path)
9
9
  end
10
10
 
11
11
  def click
12
- menu_item.click_center
12
+ element.menu_item(*path).click_center
13
13
  end
14
14
 
15
15
  def exist?
16
- !!menu_item
17
- rescue MenuItemNotFound
18
- false
16
+ !!element.menu_item(*path)
19
17
  end
20
18
  alias_method :exists?, :exist?
21
19
 
22
20
  private
23
- def menu_item
24
- current_item = @parent
25
- path.each_with_index do |menu_item, index|
26
- current_item = current_item.filter(control_type: :menu_item, name: menu_item).first
27
- raise MenuItemNotFound, menu_item unless current_item
28
- try_to_expand current_item unless index == path.count - 1
29
- end
30
- current_item
21
+ def element
22
+ @parent.with(:menu_items)
31
23
  end
32
24
 
33
25
  def path
34
26
  [@locator[:path] || @locator[:text]].flatten
35
27
  end
36
-
37
- def try_to_expand(item)
38
- case
39
- when item.patterns.include?(:expand_collapse)
40
- item.as(:expand_collapse).expand
41
- else
42
- item.as(:invoke).invoke
43
- end
44
- end
45
28
  end
46
29
  end
47
30
  end
@@ -1,3 +1,3 @@
1
1
  module Mohawk
2
- VERSION = "0.2"
2
+ VERSION = "0.2.1"
3
3
  end
data/mohawk.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
18
18
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
19
  gem.require_paths = ["lib"]
20
20
 
21
- gem.add_dependency 'uia', '>= 0.3.1'
21
+ gem.add_dependency 'uia', '~> 0.4'
22
22
  gem.add_dependency 'require_all'
23
23
  gem.add_dependency 'page_navigation', '>= 0.7'
24
24
  gem.add_dependency 'childprocess', '~> 0.3.9'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mohawk
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,24 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-09 00:00:00.000000000 Z
12
+ date: 2014-05-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: uia
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ! '>='
19
+ - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 0.3.1
21
+ version: '0.4'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ! '>='
27
+ - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 0.3.1
29
+ version: '0.4'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: require_all
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -366,7 +366,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
366
366
  version: '0'
367
367
  segments:
368
368
  - 0
369
- hash: 1001197409
369
+ hash: 2622237
370
370
  required_rubygems_version: !ruby/object:Gem::Requirement
371
371
  none: false
372
372
  requirements:
@@ -375,7 +375,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
375
375
  version: '0'
376
376
  segments:
377
377
  - 0
378
- hash: 1001197409
378
+ hash: 2622237
379
379
  requirements: []
380
380
  rubyforge_project:
381
381
  rubygems_version: 1.8.28