capybara-webkit 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +16 -0
- data/Gemfile.lock +1 -1
- data/NEWS.md +6 -0
- data/README.md +7 -3
- data/Rakefile +8 -3
- data/lib/capybara/driver/webkit/version.rb +1 -1
- data/lib/capybara_webkit_builder.rb +2 -2
- data/spec/driver_spec.rb +30 -0
- data/src/capybara.js +1 -1
- metadata +17 -17
data/ChangeLog
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
2012-03-02 Matthew Mongeau <halogenandtoast@gmail.com>
|
2
|
+
* capybara_webkit_builder.rb:
|
3
|
+
set LANG to en_US.UTF-8 to prevent string encoding issues during install
|
4
|
+
|
5
|
+
2012-03-02 Marc Schwieterman
|
6
|
+
* Rakefile: pro, find_command, and CommandFactory are more structured
|
7
|
+
|
8
|
+
2012-02-27 Joe Ferris <jferris@thoughtbot.com>
|
9
|
+
* README.md: Fixed broken wiki link
|
10
|
+
|
11
|
+
2012-02-24 Joe Ferris <jferris@thoughtbot.com>
|
12
|
+
* README.md: Update instructions for platform specific installation issues
|
13
|
+
|
14
|
+
2012-02-17 Matthew Mongeau <halogenandtoast@gmail.com>
|
15
|
+
* driver_spec.rb, capybara.js: Send proper keycode during keypress event
|
16
|
+
|
1
17
|
2012-02-17 Matthew Mongeau <halogenandtoast@gmail.com>
|
2
18
|
* ChangeLog, version.rb:
|
3
19
|
Bump to 0.10.0
|
data/Gemfile.lock
CHANGED
data/NEWS.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
New for 0.10.1:
|
2
|
+
* LANG environment variable is set to en_US.UTF-8 in order to avoid string encoding issues from qmake.
|
3
|
+
* pro, find_command, and CommandFactory are more structured.
|
4
|
+
* Changed wiki link and directing platform specific issues to the google group.
|
5
|
+
* Pass proper keycode value for keypress events.
|
6
|
+
|
1
7
|
New for 0.10.0:
|
2
8
|
|
3
9
|
* current_url now more closely matches the behavior of Selenium
|
data/README.md
CHANGED
@@ -3,13 +3,13 @@ capybara-webkit
|
|
3
3
|
|
4
4
|
A [capybara](https://github.com/jnicklas/capybara) driver that uses [WebKit](http://webkit.org) via [QtWebKit](http://doc.qt.nokia.com/4.7/qtwebkit.html).
|
5
5
|
|
6
|
-
Qt Dependency
|
6
|
+
Qt Dependency and Installation Issues
|
7
7
|
-------------
|
8
8
|
|
9
9
|
capybara-webkit depends on a WebKit implementation from Qt, a cross-platform
|
10
10
|
development toolkit. You'll need to download the Qt libraries to build and
|
11
11
|
install the gem. You can find instructions for downloading and installing QT on
|
12
|
-
the [capybara-webkit wiki](https://github.com/thoughtbot/capybara-webkit/wiki/Installing-
|
12
|
+
the [capybara-webkit wiki](https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit)
|
13
13
|
|
14
14
|
Reporting Issues
|
15
15
|
----------------
|
@@ -20,7 +20,11 @@ log of what happened during each test. Before filing a crash bug, please see
|
|
20
20
|
[Reporting Crashes](https://github.com/thoughtbot/capybara-webkit/wiki/Reporting-Crashes).
|
21
21
|
You're much more likely to get a fix if you follow those instructions.
|
22
22
|
|
23
|
-
If you are having compiling issues please
|
23
|
+
If you are having compiling issues please check out the
|
24
|
+
[capybara-webkit wiki](https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit).
|
25
|
+
If you don't have any luck there, please post to the
|
26
|
+
[mailing list](http://groups.google.com/group/capybara-webkit). Please don't
|
27
|
+
open a Github issue for a system-specific compiler issue.
|
24
28
|
|
25
29
|
CI
|
26
30
|
--
|
data/Rakefile
CHANGED
@@ -49,12 +49,17 @@ task :generate_command do
|
|
49
49
|
|
50
50
|
Dir.glob("src/*.pro").each do |project_file_name|
|
51
51
|
project = IO.read(project_file_name)
|
52
|
-
project.gsub!(/^(HEADERS = .*)/, "\\1
|
53
|
-
project.gsub!(/^(SOURCES = .*)/, "\\1
|
52
|
+
project.gsub!(/^(HEADERS = .*)/, "\\1\n #{name}.h \\")
|
53
|
+
project.gsub!(/^(SOURCES = .*)/, "\\1\n #{name}.cpp \\")
|
54
54
|
File.open(project_file_name, "w") { |file| file.write(project) }
|
55
55
|
end
|
56
56
|
|
57
57
|
File.open("src/find_command.h", "a") do |file|
|
58
|
-
file.write("CHECK_COMMAND(#{name})")
|
58
|
+
file.write("CHECK_COMMAND(#{name})\n")
|
59
59
|
end
|
60
|
+
|
61
|
+
command_factory_file_name = "src/CommandFactory.cpp"
|
62
|
+
command_factory = IO.read(command_factory_file_name)
|
63
|
+
command_factory.sub!(/^$/, "#include \"#{name}.h\"\n")
|
64
|
+
File.open(command_factory_file_name, "w") { |file| file.write(command_factory) }
|
60
65
|
end
|
@@ -28,11 +28,11 @@ module CapybaraWebkitBuilder
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def makefile
|
31
|
-
system("#{qmake_bin} -spec #{spec}")
|
31
|
+
system("LANG='en_US.UTF-8' #{qmake_bin} -spec #{spec}")
|
32
32
|
end
|
33
33
|
|
34
34
|
def qmake
|
35
|
-
system("#{make_bin} qmake")
|
35
|
+
system("LANG='en_US.UTF-8' #{make_bin} qmake")
|
36
36
|
end
|
37
37
|
|
38
38
|
def build
|
data/spec/driver_spec.rb
CHANGED
@@ -1408,4 +1408,34 @@ describe Capybara::Driver::Webkit do
|
|
1408
1408
|
subject.body.should include "Congrats"
|
1409
1409
|
end
|
1410
1410
|
end
|
1411
|
+
|
1412
|
+
context "keypress app" do
|
1413
|
+
before(:all) do
|
1414
|
+
@app = lambda do |env|
|
1415
|
+
body = <<-HTML
|
1416
|
+
<html>
|
1417
|
+
<head><title>Form</title></head>
|
1418
|
+
<body>
|
1419
|
+
<div id="charcode_value"></div>
|
1420
|
+
<input type="text" id="charcode" name="charcode" onkeypress="setcharcode" />
|
1421
|
+
<script type="text/javascript">
|
1422
|
+
var element = document.getElementById("charcode")
|
1423
|
+
element.addEventListener("keypress", setcharcode);
|
1424
|
+
function setcharcode(event) {
|
1425
|
+
var element = document.getElementById("charcode_value");
|
1426
|
+
element.innerHTML = event.charCode;
|
1427
|
+
}
|
1428
|
+
</script>
|
1429
|
+
</body>
|
1430
|
+
</html>
|
1431
|
+
HTML
|
1432
|
+
[200, { 'Content-Type' => 'text/html', 'Content-Length' => body.length.to_s }, [body]]
|
1433
|
+
end
|
1434
|
+
end
|
1435
|
+
|
1436
|
+
it "returns the charCode for the keypressed" do
|
1437
|
+
subject.find("//input")[0].set("a")
|
1438
|
+
subject.find("//div")[0].text.should == "97"
|
1439
|
+
end
|
1440
|
+
end
|
1411
1441
|
end
|
data/src/capybara.js
CHANGED
@@ -174,7 +174,7 @@ Capybara = {
|
|
174
174
|
for (strindex = 0; strindex < length; strindex++) {
|
175
175
|
node.value += value[strindex];
|
176
176
|
this.trigger(index, "keydown");
|
177
|
-
this.keypress(index, false, false, false, false, 0, value
|
177
|
+
this.keypress(index, false, false, false, false, 0, value.charCodeAt(strindex));
|
178
178
|
this.trigger(index, "keyup");
|
179
179
|
}
|
180
180
|
this.trigger(index, "change");
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capybara-webkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,11 +13,11 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2012-02
|
16
|
+
date: 2012-03-02 00:00:00.000000000Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: capybara
|
20
|
-
requirement: &
|
20
|
+
requirement: &2153762820 !ruby/object:Gem::Requirement
|
21
21
|
none: false
|
22
22
|
requirements:
|
23
23
|
- - ! '>='
|
@@ -28,10 +28,10 @@ dependencies:
|
|
28
28
|
version: '1.2'
|
29
29
|
type: :runtime
|
30
30
|
prerelease: false
|
31
|
-
version_requirements: *
|
31
|
+
version_requirements: *2153762820
|
32
32
|
- !ruby/object:Gem::Dependency
|
33
33
|
name: json
|
34
|
-
requirement: &
|
34
|
+
requirement: &2156481880 !ruby/object:Gem::Requirement
|
35
35
|
none: false
|
36
36
|
requirements:
|
37
37
|
- - ! '>='
|
@@ -39,10 +39,10 @@ dependencies:
|
|
39
39
|
version: '0'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
|
-
version_requirements: *
|
42
|
+
version_requirements: *2156481880
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: rspec
|
45
|
-
requirement: &
|
45
|
+
requirement: &2156481340 !ruby/object:Gem::Requirement
|
46
46
|
none: false
|
47
47
|
requirements:
|
48
48
|
- - ~>
|
@@ -50,10 +50,10 @@ dependencies:
|
|
50
50
|
version: 2.6.0
|
51
51
|
type: :development
|
52
52
|
prerelease: false
|
53
|
-
version_requirements: *
|
53
|
+
version_requirements: *2156481340
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
55
|
name: sinatra
|
56
|
-
requirement: &
|
56
|
+
requirement: &2156480920 !ruby/object:Gem::Requirement
|
57
57
|
none: false
|
58
58
|
requirements:
|
59
59
|
- - ! '>='
|
@@ -61,10 +61,10 @@ dependencies:
|
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
|
-
version_requirements: *
|
64
|
+
version_requirements: *2156480920
|
65
65
|
- !ruby/object:Gem::Dependency
|
66
66
|
name: mini_magick
|
67
|
-
requirement: &
|
67
|
+
requirement: &2156480460 !ruby/object:Gem::Requirement
|
68
68
|
none: false
|
69
69
|
requirements:
|
70
70
|
- - ! '>='
|
@@ -72,10 +72,10 @@ dependencies:
|
|
72
72
|
version: '0'
|
73
73
|
type: :development
|
74
74
|
prerelease: false
|
75
|
-
version_requirements: *
|
75
|
+
version_requirements: *2156480460
|
76
76
|
- !ruby/object:Gem::Dependency
|
77
77
|
name: rake
|
78
|
-
requirement: &
|
78
|
+
requirement: &2156480040 !ruby/object:Gem::Requirement
|
79
79
|
none: false
|
80
80
|
requirements:
|
81
81
|
- - ! '>='
|
@@ -83,10 +83,10 @@ dependencies:
|
|
83
83
|
version: '0'
|
84
84
|
type: :development
|
85
85
|
prerelease: false
|
86
|
-
version_requirements: *
|
86
|
+
version_requirements: *2156480040
|
87
87
|
- !ruby/object:Gem::Dependency
|
88
88
|
name: appraisal
|
89
|
-
requirement: &
|
89
|
+
requirement: &2156479540 !ruby/object:Gem::Requirement
|
90
90
|
none: false
|
91
91
|
requirements:
|
92
92
|
- - ~>
|
@@ -94,7 +94,7 @@ dependencies:
|
|
94
94
|
version: 0.4.0
|
95
95
|
type: :development
|
96
96
|
prerelease: false
|
97
|
-
version_requirements: *
|
97
|
+
version_requirements: *2156479540
|
98
98
|
description:
|
99
99
|
email: support@thoughtbot.com
|
100
100
|
executables: []
|
@@ -231,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
231
231
|
version: '0'
|
232
232
|
requirements: []
|
233
233
|
rubyforge_project:
|
234
|
-
rubygems_version: 1.8.
|
234
|
+
rubygems_version: 1.8.17
|
235
235
|
signing_key:
|
236
236
|
specification_version: 3
|
237
237
|
summary: Headless Webkit driver for Capybara
|