akephalos 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,14 +17,7 @@ class Capybara::Driver::Akephalos < Capybara::Driver::Base
17
17
  end
18
18
 
19
19
  def value
20
- if tag_name == "select" && self[:multiple]
21
- node.selected_options.map { |option| option.text }
22
- elsif tag_name == "select"
23
- selected_option = node.selected_options.first
24
- selected_option ? selected_option.text : nil
25
- else
26
- self[:value]
27
- end
20
+ node.value
28
21
  end
29
22
 
30
23
  def set(value)
@@ -136,10 +129,14 @@ class Capybara::Driver::Akephalos < Capybara::Driver::Base
136
129
  nodes
137
130
  end
138
131
 
139
- def evaluate_script(script)
132
+ def execute_script(script)
140
133
  page.execute_script script
141
134
  end
142
135
 
136
+ def evaluate_script(script)
137
+ page.evaluate_script script
138
+ end
139
+
143
140
  def page
144
141
  browser.page
145
142
  end
@@ -17,6 +17,22 @@ module Akephalos
17
17
  @_node.hasAttribute(name.to_s) ? @_node.getAttribute(name.to_s) : nil
18
18
  end
19
19
 
20
+ def value
21
+ case tag_name
22
+ when "select"
23
+ if self[:multiple]
24
+ @_node.selected_options.map { |option| option.text }
25
+ else
26
+ selected_option = @_node.selected_options.first
27
+ selected_option ? selected_option.text : nil
28
+ end
29
+ when "textarea"
30
+ @_node.getText
31
+ else
32
+ self[:value]
33
+ end
34
+ end
35
+
20
36
  def value=(value)
21
37
  case tag_name
22
38
  when "textarea"
@@ -24,6 +24,11 @@ module Akephalos
24
24
  end
25
25
 
26
26
  def execute_script(script)
27
+ @_page.executeJavaScript(script)
28
+ nil
29
+ end
30
+
31
+ def evaluate_script(script)
27
32
  @_page.executeJavaScript(script).getJavaScriptResult
28
33
  end
29
34
 
@@ -1,3 +1,3 @@
1
1
  module Akephalos #:nodoc
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 1
7
+ - 2
8
8
  - 0
9
- version: 0.1.0
9
+ version: 0.2.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Bernerd Schaefer
@@ -22,7 +22,7 @@ dependencies:
22
22
  prerelease: false
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - "="
25
+ - - ~>
26
26
  - !ruby/object:Gem::Version
27
27
  segments:
28
28
  - 0
@@ -64,8 +64,9 @@ dependencies:
64
64
  - !ruby/object:Gem::Version
65
65
  segments:
66
66
  - 1
67
- - 30
68
- version: "1.30"
67
+ - 3
68
+ - 0
69
+ version: 1.3.0
69
70
  type: :development
70
71
  version_requirements: *id004
71
72
  description: Headless Browser for Integration Testing with Capybara