statt 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +9 -1
- data/lib/selenium-grid/grid_configuration.yml +1 -1
- data/lib/statt.rb +1 -4
- data/lib/statt/client.rb +31 -22
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -1,17 +1,25 @@
|
|
1
1
|
= statt
|
2
|
+
|
2
3
|
Statt is Selenium Testing All The Time. It's being built as a replacement for Webrat using Selenium servers organized in a grid, to speed up testing with multiple servers.
|
3
4
|
|
4
5
|
== Progress
|
5
6
|
|
6
|
-
|
7
|
+
As of version 0.0.4:
|
7
8
|
- You can spawn a Hub, which stands in for the Remote Control server in a grid setup. This can only be started locally to minimize network latency contributing to slowing down the tests.
|
8
9
|
- You can spawn one to as many RC servers you need to do the job. In the future, you'll be able to specify the location of servers that are non-local, though you'll have to start them up yourself.
|
10
|
+
- You can start a client, spawn a browser session, and start sending commands to the hub.
|
9
11
|
|
10
12
|
== TODO
|
11
13
|
|
14
|
+
<del>- set up the client to talk to the hub.</del>
|
12
15
|
- setting up the api for the selenium client, with the goal of replacing Webrat steps.
|
16
|
+
- methods to locate links, buttons, etc. by their text.
|
17
|
+
- construct statt_steps.rb for inclusion in cucumber steps dir.
|
18
|
+
- remove webrat steps and place statt steps in features/steps dir using an executable.
|
19
|
+
- undo parameter for executable to restore webrat steps.
|
13
20
|
- algorithm for dealing with features that modify the database to ensure a clean state for tests that need it.
|
14
21
|
- cucumber integration (setup, teardown, tagging, database concurrency)
|
22
|
+
- set up hub to communicate with multiple non-local RC servers.
|
15
23
|
- minimize gem size (~7.8MB)
|
16
24
|
- wiki on how to set things up (Cucumber, DatabaseCleaner, Machinist).
|
17
25
|
- optimizations for speed.
|
data/lib/statt.rb
CHANGED
data/lib/statt/client.rb
CHANGED
@@ -1,35 +1,44 @@
|
|
1
1
|
#!/usr/local/bin/ruby -w
|
2
2
|
|
3
|
-
# require "selenium"
|
4
|
-
# require "test/unit"
|
5
|
-
# require "selenium/server_manager"
|
6
|
-
# require "selenium/selenium_server"
|
7
|
-
# require "selenium/client/driver"
|
8
|
-
|
9
3
|
module Statt
|
10
|
-
class Client
|
11
|
-
attr_accessor :selenium, :host, :port, :timeout, :browser, :url
|
4
|
+
class Client < Selenium::Client::Driver
|
12
5
|
def initialize(options = {})
|
13
6
|
options = { :host => "localhost",
|
14
7
|
:port => 4444,
|
15
|
-
:timeout =>
|
8
|
+
:timeout => 300,
|
16
9
|
:browser => "*firefox",
|
17
10
|
:url => "http://localhost:3000"}.merge(options)
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
11
|
+
super(options)
|
12
|
+
end
|
13
|
+
|
14
|
+
def start
|
15
|
+
start_new_browser_session
|
16
|
+
end
|
17
|
+
|
18
|
+
def stop
|
19
|
+
close_current_browser_session
|
20
|
+
end
|
21
|
+
|
22
|
+
def click_button_by_text(value)
|
23
|
+
click "xpath=//input[@value='#{value}']"
|
24
|
+
end
|
25
|
+
|
26
|
+
def click_link_by_text(value)
|
27
|
+
begin
|
28
|
+
click "xpath=//a[text()='#{value}']"
|
29
|
+
rescue Exception => msg
|
30
|
+
begin
|
31
|
+
click "xpath=//a/*[text()='#{value}']"
|
32
|
+
rescue Exception => msg
|
33
|
+
puts "Couldn\'t locate '#{value}' #{msg}"
|
34
|
+
end
|
35
|
+
end
|
25
36
|
end
|
26
37
|
|
27
|
-
def
|
28
|
-
|
29
|
-
@selenium.open "/"
|
30
|
-
@selenium.type "q", "Selenium seleniumhq"
|
31
|
-
@selenium.click "btnG", :wait_for => :page_to_load
|
32
|
-
@selenium.close_current_browser_session
|
38
|
+
def source
|
39
|
+
|
33
40
|
end
|
34
41
|
end
|
42
|
+
|
43
|
+
|
35
44
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: statt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- davidtrogers
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10-
|
12
|
+
date: 2009-10-27 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|