rwebunit 0.9.4 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +228 -168
- data/MIT-LICENSE +1 -1
- data/README +32 -29
- data/Rakefile +5 -4
- data/lib/rspec_extensions.rb +10 -2
- data/lib/rwebunit.rb +8 -3
- data/lib/rwebunit/assert.rb +25 -24
- data/lib/rwebunit/clickJSDialog.rb +15 -0
- data/lib/rwebunit/context.rb +24 -24
- data/lib/rwebunit/driver.rb +297 -33
- data/lib/rwebunit/itest_plugin.rb +47 -0
- data/lib/rwebunit/matchers/contains_text.rb +37 -0
- data/lib/rwebunit/rspec_helper.rb +140 -128
- data/lib/rwebunit/test_utils.rb +98 -88
- data/lib/rwebunit/{web_tester.rb → web_browser.rb} +433 -510
- data/lib/rwebunit/web_page.rb +96 -99
- data/lib/rwebunit/web_testcase.rb +36 -36
- data/lib/watir_extensions.rb +65 -0
- data/test/mock_page.rb +8 -0
- data/test/setup.rb +10 -0
- data/test/test.html +129 -0
- data/test/test_assert.rb +64 -0
- data/test/test_driver.rb +23 -5
- metadata +24 -14
- data/sample/README.txt +0 -21
- data/sample/kangxi_home_webtest.rb +0 -37
- data/sample/kangxi_httpcaller_webtest.rb +0 -33
- data/sample/kangxi_pages.rb +0 -62
- data/sample/kangxi_xml_formatter_webtest.rb +0 -44
- data/sample/rwebunit_home_testcase.rb +0 -22
- data/sample/sample_rwebunit_test.rb +0 -15
- data/sample/sample_rwebunit_testcase.rb +0 -22
- data/sample/sample_watir_test.rb +0 -17
@@ -1,22 +0,0 @@
|
|
1
|
-
# the same test used in jWebUnit home page written in rWebUnit
|
2
|
-
require 'rwebunit'
|
3
|
-
|
4
|
-
class RWebUnitSearchExample < RWebUnit::WebTestCase
|
5
|
-
|
6
|
-
def initialize(name)
|
7
|
-
super(name)
|
8
|
-
end
|
9
|
-
|
10
|
-
def setup
|
11
|
-
getTestContext().setBaseUrl("http://www.google.com")
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_search()
|
15
|
-
beginAt("/")
|
16
|
-
setFormElement("q", "httpunit")
|
17
|
-
submit("btnG")
|
18
|
-
clickLinkWithText("HttpUnit Home")
|
19
|
-
assertTitleEquals("HttpUnit Home")
|
20
|
-
assertLinkPresentWithText("User's Manual")
|
21
|
-
end
|
22
|
-
end
|
data/sample/sample_watir_test.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
# a sample watir test check HttpUnit home page
|
2
|
-
require 'watir'
|
3
|
-
require 'test/unit'
|
4
|
-
|
5
|
-
class WatirSearchExample < Test::Unit::TestCase
|
6
|
-
|
7
|
-
def test_search
|
8
|
-
ie = Watir::IE.new
|
9
|
-
ie.goto("http://www.google.com")
|
10
|
-
ie.text_field(:name, "q").set("httpunit")
|
11
|
-
ie.button(:name, "btnG").click
|
12
|
-
ie.link(:text, "HttpUnit Home").click
|
13
|
-
assert_equal("HttpUnit Home", ie.document.title)
|
14
|
-
assert(ie.contains_text("User's Manual"))
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|