capybara-webkit 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +13 -0
- data/.rspec +2 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +55 -0
- data/LICENSE +19 -0
- data/README.md +37 -0
- data/Rakefile +76 -0
- data/capybara-webkit.gemspec +15 -0
- data/extconf.rb +2 -0
- data/lib/capybara-webkit.rb +7 -0
- data/lib/capybara/driver/webkit.rb +84 -0
- data/lib/capybara/driver/webkit/browser.rb +86 -0
- data/lib/capybara/driver/webkit/node.rb +87 -0
- data/spec/driver_spec.rb +465 -0
- data/spec/integration/driver_spec.rb +21 -0
- data/spec/integration/session_spec.rb +12 -0
- data/spec/spec_helper.rb +22 -0
- data/spec/support/socket_debugger.rb +42 -0
- data/src/Command.cpp +15 -0
- data/src/Command.h +28 -0
- data/src/Connection.cpp +130 -0
- data/src/Connection.h +36 -0
- data/src/Evaluate.cpp +84 -0
- data/src/Evaluate.h +22 -0
- data/src/Execute.cpp +17 -0
- data/src/Execute.h +12 -0
- data/src/Find.cpp +20 -0
- data/src/Find.h +13 -0
- data/src/JavascriptInvocation.cpp +14 -0
- data/src/JavascriptInvocation.h +19 -0
- data/src/Node.cpp +14 -0
- data/src/Node.h +13 -0
- data/src/Reset.cpp +16 -0
- data/src/Reset.h +12 -0
- data/src/Server.cpp +21 -0
- data/src/Server.h +20 -0
- data/src/Source.cpp +14 -0
- data/src/Source.h +12 -0
- data/src/Url.cpp +14 -0
- data/src/Url.h +12 -0
- data/src/Visit.cpp +20 -0
- data/src/Visit.h +16 -0
- data/src/WebPage.cpp +81 -0
- data/src/WebPage.h +29 -0
- data/src/capybara.js +98 -0
- data/src/find_command.h +13 -0
- data/src/main.cpp +20 -0
- data/src/webkit_server.pro +9 -0
- data/src/webkit_server.qrc +5 -0
- data/templates/Command.cpp +10 -0
- data/templates/Command.h +12 -0
- data/webkit_server.pro +4 -0
- metadata +140 -0
data/src/find_command.h
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
#define CHECK_COMMAND(expectedName) \
|
2
|
+
if (strcmp(#expectedName, name) == 0) { \
|
3
|
+
return new expectedName(m_page, this); \
|
4
|
+
}
|
5
|
+
|
6
|
+
CHECK_COMMAND(Visit)
|
7
|
+
CHECK_COMMAND(Find)
|
8
|
+
CHECK_COMMAND(Reset)
|
9
|
+
CHECK_COMMAND(Node)
|
10
|
+
CHECK_COMMAND(Url)
|
11
|
+
CHECK_COMMAND(Source)
|
12
|
+
CHECK_COMMAND(Evaluate)
|
13
|
+
CHECK_COMMAND(Execute)
|
data/src/main.cpp
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
#include "Server.h"
|
2
|
+
#include <QtGui>
|
3
|
+
#include <iostream>
|
4
|
+
|
5
|
+
int main(int argc, char **argv) {
|
6
|
+
QApplication app(argc, argv);
|
7
|
+
app.setApplicationName("capybara-webkit");
|
8
|
+
app.setOrganizationName("thoughtbot, inc");
|
9
|
+
app.setOrganizationDomain("thoughtbot.com");
|
10
|
+
|
11
|
+
Server server;
|
12
|
+
|
13
|
+
if (server.start()) {
|
14
|
+
return app.exec();
|
15
|
+
} else {
|
16
|
+
std::cerr << "Couldn't start server" << std::endl;
|
17
|
+
return 1;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
TEMPLATE = app
|
2
|
+
TARGET = webkit_server
|
3
|
+
DESTDIR = .
|
4
|
+
HEADERS = WebPage.h Server.h Connection.h Command.h Visit.h Find.h Reset.h Node.h JavascriptInvocation.h Url.h Source.h Evaluate.h Execute.h
|
5
|
+
SOURCES = main.cpp WebPage.cpp Server.cpp Connection.cpp Command.cpp Visit.cpp Find.cpp Reset.cpp Node.cpp JavascriptInvocation.cpp Url.cpp Source.cpp Evaluate.cpp Execute.cpp
|
6
|
+
RESOURCES = webkit_server.qrc
|
7
|
+
QT += network webkit
|
8
|
+
CONFIG += console
|
9
|
+
|
data/templates/Command.h
ADDED
data/webkit_server.pro
ADDED
metadata
ADDED
@@ -0,0 +1,140 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capybara-webkit
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- thoughtbot
|
14
|
+
- Joe Ferris
|
15
|
+
- Jason Morrison
|
16
|
+
- Tristan Dunn
|
17
|
+
autorequire:
|
18
|
+
bindir: bin
|
19
|
+
cert_chain: []
|
20
|
+
|
21
|
+
date: 2011-04-06 00:00:00 -04:00
|
22
|
+
default_executable:
|
23
|
+
dependencies:
|
24
|
+
- !ruby/object:Gem::Dependency
|
25
|
+
type: :runtime
|
26
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
28
|
+
requirements:
|
29
|
+
- - ~>
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
hash: 13
|
32
|
+
segments:
|
33
|
+
- 0
|
34
|
+
- 4
|
35
|
+
- 1
|
36
|
+
version: 0.4.1
|
37
|
+
version_requirements: *id001
|
38
|
+
name: capybara
|
39
|
+
prerelease: false
|
40
|
+
description:
|
41
|
+
email: support@thoughtbot.com
|
42
|
+
executables: []
|
43
|
+
|
44
|
+
extensions:
|
45
|
+
- extconf.rb
|
46
|
+
extra_rdoc_files: []
|
47
|
+
|
48
|
+
files:
|
49
|
+
- .gitignore
|
50
|
+
- .rspec
|
51
|
+
- Gemfile
|
52
|
+
- Gemfile.lock
|
53
|
+
- LICENSE
|
54
|
+
- README.md
|
55
|
+
- Rakefile
|
56
|
+
- capybara-webkit.gemspec
|
57
|
+
- extconf.rb
|
58
|
+
- lib/capybara-webkit.rb
|
59
|
+
- lib/capybara/driver/webkit.rb
|
60
|
+
- lib/capybara/driver/webkit/browser.rb
|
61
|
+
- lib/capybara/driver/webkit/node.rb
|
62
|
+
- spec/driver_spec.rb
|
63
|
+
- spec/integration/driver_spec.rb
|
64
|
+
- spec/integration/session_spec.rb
|
65
|
+
- spec/spec_helper.rb
|
66
|
+
- spec/support/socket_debugger.rb
|
67
|
+
- src/Command.cpp
|
68
|
+
- src/Command.h
|
69
|
+
- src/Connection.cpp
|
70
|
+
- src/Connection.h
|
71
|
+
- src/Evaluate.cpp
|
72
|
+
- src/Evaluate.h
|
73
|
+
- src/Execute.cpp
|
74
|
+
- src/Execute.h
|
75
|
+
- src/Find.cpp
|
76
|
+
- src/Find.h
|
77
|
+
- src/JavascriptInvocation.cpp
|
78
|
+
- src/JavascriptInvocation.h
|
79
|
+
- src/Node.cpp
|
80
|
+
- src/Node.h
|
81
|
+
- src/Reset.cpp
|
82
|
+
- src/Reset.h
|
83
|
+
- src/Server.cpp
|
84
|
+
- src/Server.h
|
85
|
+
- src/Source.cpp
|
86
|
+
- src/Source.h
|
87
|
+
- src/Url.cpp
|
88
|
+
- src/Url.h
|
89
|
+
- src/Visit.cpp
|
90
|
+
- src/Visit.h
|
91
|
+
- src/WebPage.cpp
|
92
|
+
- src/WebPage.h
|
93
|
+
- src/capybara.js
|
94
|
+
- src/find_command.h
|
95
|
+
- src/main.cpp
|
96
|
+
- src/webkit_server.pro
|
97
|
+
- src/webkit_server.qrc
|
98
|
+
- templates/Command.cpp
|
99
|
+
- templates/Command.h
|
100
|
+
- webkit_server.pro
|
101
|
+
has_rdoc: true
|
102
|
+
homepage: http://github.com/thoughtbot/capybara-webkit
|
103
|
+
licenses: []
|
104
|
+
|
105
|
+
post_install_message:
|
106
|
+
rdoc_options: []
|
107
|
+
|
108
|
+
require_paths:
|
109
|
+
- lib
|
110
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
111
|
+
none: false
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
hash: 3
|
116
|
+
segments:
|
117
|
+
- 0
|
118
|
+
version: "0"
|
119
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
|
+
none: false
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
hash: 3
|
125
|
+
segments:
|
126
|
+
- 0
|
127
|
+
version: "0"
|
128
|
+
requirements: []
|
129
|
+
|
130
|
+
rubyforge_project:
|
131
|
+
rubygems_version: 1.6.1
|
132
|
+
signing_key:
|
133
|
+
specification_version: 3
|
134
|
+
summary: Headless Webkit driver for Capybara
|
135
|
+
test_files:
|
136
|
+
- spec/driver_spec.rb
|
137
|
+
- spec/integration/driver_spec.rb
|
138
|
+
- spec/integration/session_spec.rb
|
139
|
+
- spec/spec_helper.rb
|
140
|
+
- spec/support/socket_debugger.rb
|