bewildr 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ require 'cucumber/rake/task'
10
10
 
11
11
  spec = Gem::Specification.new do |s|
12
12
  s.name = 'bewildr'
13
- s.version = '0.1.7'
13
+ s.version = '0.1.8'
14
14
  s.has_rdoc = true
15
15
  s.extra_rdoc_files = ['README.rdoc', 'LICENSE']
16
16
  s.summary = 'Test WPF UI apps with IronRuby'
@@ -13,12 +13,13 @@ module Bewildr
13
13
  item_array.to_a.collect {|item| Bewildr::Element.new(item)}
14
14
  end
15
15
 
16
- def can_select_multiple?
16
+ def multi_selectable?
17
17
  @automation_element.get_current_pattern(System::Windows::Automation::SelectionPattern.pattern).current.can_select_multiple
18
18
  end
19
+ alias :can_select_multiple? :multi_selectable?
19
20
 
20
21
  def selected
21
- can_select_multiple? ? get_selection : get_selection.first
22
+ multi_selectable? ? get_selection : get_selection.first
22
23
  end
23
24
  end
24
25
  end
@@ -8,7 +8,7 @@ module Bewildr
8
8
  @@control_type_map.index(input_control_type_enum)
9
9
  end
10
10
 
11
- def class_for_symbol(input_symbol)
11
+ def enum_for_symbol(input_symbol)
12
12
  raise "Unknown control type: #{input_symbol}" unless @@control_type_map.key?(input_symbol)
13
13
  @@control_type_map[input_symbol]
14
14
  end
@@ -38,6 +38,11 @@ module Bewildr
38
38
  end
39
39
  alias :exist? :exists?
40
40
 
41
+ def visible?
42
+ existence_check
43
+ !@automation_element.current.is_offscreen
44
+ end
45
+
41
46
  def contains?(condition_hash)
42
47
  get(condition_hash).exists?
43
48
  end
@@ -58,7 +58,7 @@ module Bewildr
58
58
  end
59
59
 
60
60
  def type_condition(condition_hash)
61
- value = Bewildr::ControlType.class_for_symbol(condition_hash[:type])
61
+ value = Bewildr::ControlType.enum_for_symbol(condition_hash[:type])
62
62
  System::Windows::Automation::PropertyCondition.new(System::Windows::Automation::AutomationElement.control_type_property, value)
63
63
  end
64
64
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bewildr
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 7
10
- version: 0.1.7
9
+ - 8
10
+ version: 0.1.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Nat Ritmeyer
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-27 00:00:00 +00:00
18
+ date: 2010-12-08 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -36,7 +36,6 @@ files:
36
36
  - lib/bewildr/bewildr_helpers.rb
37
37
  - lib/bewildr/control_patterns/expand_collapse_pattern.rb
38
38
  - lib/bewildr/control_patterns/grid_pattern.rb
39
- - lib/bewildr/control_patterns/invoke_pattern.rb
40
39
  - lib/bewildr/control_patterns/range_value_pattern.rb
41
40
  - lib/bewildr/control_patterns/scroll_pattern.rb
42
41
  - lib/bewildr/control_patterns/selection_item_pattern.rb
@@ -1,11 +0,0 @@
1
- #Copyright (c) 2010, Nathaniel Ritmeyer. All rights reserved.
2
-
3
- #module Bewildr
4
- # module ControlPatterns
5
- # module InvokePattern
6
- # def click
7
- # @automation_element.get_current_pattern(System::Windows::Automation::InvokePattern.pattern).invoke
8
- # end
9
- # end
10
- # end
11
- #end