symbiont 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +0 -1
- data/Gemfile.lock +46 -0
- data/HISTORY.md +6 -0
- data/README.md +1 -1
- data/app/views/test_events.erb +8 -1
- data/app/views/test_page.erb +7 -2
- data/lib/symbiont/enclosers.rb +12 -0
- data/lib/symbiont/locators.rb +43 -0
- data/lib/symbiont/platform_watir/platform_object.rb +28 -0
- data/lib/symbiont/version.rb +1 -1
- data/lib/symbiont/web_objects/table.rb +11 -1
- data/lib/symbiont/web_objects/table_row.rb +13 -1
- data/lib/symbiont.rb +2 -0
- data/spec/symbiont/enclosers_spec.rb +21 -0
- data/spec/symbiont/locators_spec.rb +68 -0
- data/spec/symbiont/web_objects/table_row_spec.rb +10 -0
- data/spec/symbiont/web_objects/table_spec.rb +7 -0
- data/specs/definitions/pages.rb +4 -0
- data/specs/events.feature +11 -0
- data/specs/locators.feature +17 -0
- data/specs/support/test_steps/action_steps_events.rb +37 -0
- data/specs/support/test_steps/action_steps_locators.rb +44 -0
- data/specs/support/test_steps/action_steps_tables.rb +4 -0
- data/specs/table.feature +4 -0
- data/symbiont.gemspec +8 -8
- metadata +33 -13
data/.gitignore
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
symbiont (0.1.0)
|
5
|
+
watir-webdriver (= 0.5.8)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: http://rubygems.org/
|
9
|
+
specs:
|
10
|
+
addressable (2.2.8)
|
11
|
+
childprocess (0.3.2)
|
12
|
+
ffi (~> 1.0.6)
|
13
|
+
diff-lcs (1.1.3)
|
14
|
+
ffi (1.0.11)
|
15
|
+
libwebsocket (0.1.3)
|
16
|
+
addressable
|
17
|
+
multi_json (1.3.5)
|
18
|
+
rspec (2.10.0)
|
19
|
+
rspec-core (~> 2.10.0)
|
20
|
+
rspec-expectations (~> 2.10.0)
|
21
|
+
rspec-mocks (~> 2.10.0)
|
22
|
+
rspec-core (2.10.0)
|
23
|
+
rspec-expectations (2.10.0)
|
24
|
+
diff-lcs (~> 1.1.3)
|
25
|
+
rspec-mocks (2.10.1)
|
26
|
+
rubyzip (0.9.8)
|
27
|
+
selenium-webdriver (2.21.2)
|
28
|
+
childprocess (>= 0.2.5)
|
29
|
+
ffi (~> 1.0)
|
30
|
+
libwebsocket (~> 0.1.3)
|
31
|
+
multi_json (~> 1.0)
|
32
|
+
rubyzip
|
33
|
+
simplecov (0.6.4)
|
34
|
+
multi_json (~> 1.0)
|
35
|
+
simplecov-html (~> 0.5.3)
|
36
|
+
simplecov-html (0.5.3)
|
37
|
+
watir-webdriver (0.5.8)
|
38
|
+
selenium-webdriver (>= 2.18.0)
|
39
|
+
|
40
|
+
PLATFORMS
|
41
|
+
x86-mingw32
|
42
|
+
|
43
|
+
DEPENDENCIES
|
44
|
+
rspec (= 2.10.0)
|
45
|
+
simplecov (= 0.6.4)
|
46
|
+
symbiont!
|
data/HISTORY.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
Change Log and History
|
2
2
|
======================
|
3
3
|
|
4
|
+
Version 0.1.2 / 2012-06-06
|
5
|
+
--------------------------
|
6
|
+
|
7
|
+
This release provides a new Locators module. The idea behind locators is that undeclared web objects can be used by providing a direct locator reference. Also new in this release is the ability to handle JavaScript alert, confirmation, and prompt message boxes. Finally, table logic was enhanced to allow tables to be enumerated as well as to allow text cells to be referenced by named columns and rows.
|
8
|
+
|
9
|
+
|
4
10
|
Version 0.1.1 / 2012-05-30
|
5
11
|
--------------------------
|
6
12
|
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Symbiont [![Build Status](https://secure.travis-ci.org/jnyman/symbiont.png)](http://travis-ci.org/jnyman/symbiont) [![Dependency Status](https://gemnasium.com/jnyman/symbiont.png)](
|
1
|
+
Symbiont [![Build Status](https://secure.travis-ci.org/jnyman/symbiont.png)](http://travis-ci.org/jnyman/symbiont) [![Dependency Status](https://gemnasium.com/jnyman/symbiont.png)](https://gemnasium.com/jnyman/symbiont)
|
2
2
|
========
|
3
3
|
|
4
4
|
Description
|
data/app/views/test_events.erb
CHANGED
@@ -41,4 +41,11 @@
|
|
41
41
|
<div id="created">
|
42
42
|
</div>
|
43
43
|
</div>
|
44
|
-
|
44
|
+
|
45
|
+
<h3>JavaScript Events:</h3>
|
46
|
+
<div class="group">
|
47
|
+
<input id="alertButton" type="button" onclick="alert('Alert Message Received')" value="Alert">
|
48
|
+
<input id="confirmButton" type="button" onclick="this.value = confirm('Confirmation Message Received')" value="Confirm">
|
49
|
+
<input id="promptButton" type="button" onclick='this.value = prompt("Favorite Sith Lord", "Darth Bane")' value="Prompt">
|
50
|
+
</div>
|
51
|
+
</section>
|
data/app/views/test_page.erb
CHANGED
@@ -13,8 +13,8 @@
|
|
13
13
|
<p><a href="success_1">Justice League Unite</a><br />
|
14
14
|
<a href="success_2">Justice League Unite</a></p>
|
15
15
|
|
16
|
-
<p>Here is a link that has
|
17
|
-
<p><a href="success_1">"in the brightest day; in the darkest night"</a></p>
|
16
|
+
<p>Here is a link that has locators but will be undeclared.</p>
|
17
|
+
<p><a id="oath" href="success_1">"in the brightest day; in the darkest night"</a></p>
|
18
18
|
</div>
|
19
19
|
|
20
20
|
<h3>Standalone Form Elements</h3>
|
@@ -27,6 +27,11 @@
|
|
27
27
|
<br/>
|
28
28
|
<input id="cantclickmeID" class="cantclickmeClass" name="cantclickmeName" disabled="disabled" type="submit" value="Can't Click Me">
|
29
29
|
</form>
|
30
|
+
|
31
|
+
<p> Below is a button that will be undeclared.</p>
|
32
|
+
<form action="success_1" method="get">
|
33
|
+
<input id="nostalgic" type="submit" value="All Your Base Are Belong To Us">
|
34
|
+
</form>
|
30
35
|
</div>
|
31
36
|
|
32
37
|
<div class="group">
|
data/lib/symbiont/enclosers.rb
CHANGED
@@ -39,5 +39,17 @@ module Symbiont
|
|
39
39
|
@platform.wait_for(timeout, message, &block)
|
40
40
|
end
|
41
41
|
|
42
|
+
def will_alert(&block)
|
43
|
+
@platform.will_alert(&block)
|
44
|
+
end
|
45
|
+
|
46
|
+
def will_confirm(response, &block)
|
47
|
+
@platform.will_confirm(response, &block)
|
48
|
+
end
|
49
|
+
|
50
|
+
def will_prompt(response, &block)
|
51
|
+
@platform.will_prompt(response, &block)
|
52
|
+
end
|
53
|
+
|
42
54
|
end # module: Enclosers
|
43
55
|
end # module: Symbiont
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Symbiont
|
2
|
+
module Locators
|
3
|
+
def link_object(locator)
|
4
|
+
@platform.get_link_for(locator)
|
5
|
+
end
|
6
|
+
|
7
|
+
def button_object(locator)
|
8
|
+
@platform.get_button_for(locator)
|
9
|
+
end
|
10
|
+
|
11
|
+
def text_field_object(locator)
|
12
|
+
@platform.get_text_field_for(locator)
|
13
|
+
end
|
14
|
+
|
15
|
+
def select_list_object(locator)
|
16
|
+
@platform.get_select_list_for(locator)
|
17
|
+
end
|
18
|
+
|
19
|
+
def checkbox_object(locator)
|
20
|
+
@platform.get_checkbox_for(locator)
|
21
|
+
end
|
22
|
+
|
23
|
+
def radio_object(locator)
|
24
|
+
@platform.get_radio_for(locator)
|
25
|
+
end
|
26
|
+
|
27
|
+
def div_object(locator)
|
28
|
+
@platform.get_div_for(locator)
|
29
|
+
end
|
30
|
+
|
31
|
+
def span_object(locator)
|
32
|
+
@platform.get_span_for(locator)
|
33
|
+
end
|
34
|
+
|
35
|
+
def table_object(locator)
|
36
|
+
@platform.get_table_for(locator)
|
37
|
+
end
|
38
|
+
|
39
|
+
def cell_object(locator)
|
40
|
+
@platform.get_table_cell_for(locator)
|
41
|
+
end
|
42
|
+
end # module: Locators
|
43
|
+
end # module: Symbiont
|
@@ -32,6 +32,34 @@ module Symbiont
|
|
32
32
|
@browser.wait_until(timeout, message, &block)
|
33
33
|
end
|
34
34
|
|
35
|
+
# Platform method to handle an alert message box.
|
36
|
+
# @see Symbiont::Enclosers#will_alert
|
37
|
+
def will_alert(&block)
|
38
|
+
@browser.wd.execute_script("window.alert = function(msg) { window.__lastWatirAlert=msg; }")
|
39
|
+
yield
|
40
|
+
value = @browser.wd.execute_script("return window.__lastWatirAlert")
|
41
|
+
value
|
42
|
+
end
|
43
|
+
|
44
|
+
# Platform method to handle a confirmation message box
|
45
|
+
# @see Symbiont::Enclosers#will_confirm
|
46
|
+
def will_confirm(response, &block)
|
47
|
+
@browser.wd.execute_script("window.confirm = function(msg) { window.__lastWatirConfirm=msg; return #{!!response} }")
|
48
|
+
yield
|
49
|
+
value = @browser.wd.execute_script("return window.__lastWatirConfirm")
|
50
|
+
value
|
51
|
+
end
|
52
|
+
|
53
|
+
# Platform method to handle a prompt message box.
|
54
|
+
# @see Symbiont::Enclosers#will_prompt
|
55
|
+
def will_prompt(response, &block)
|
56
|
+
@browser.wd.execute_script("window.prompt = function(text, value) { window.__lastWatirPrompt = { message: text, default_value: value }; return #{!!response}; }")
|
57
|
+
yield
|
58
|
+
result = @browser.wd.execute_script("return window.__lastWatirPrompt")
|
59
|
+
result && result.dup.each_key { |k| result[k.to_sym] = result.delete(k) }
|
60
|
+
result
|
61
|
+
end
|
62
|
+
|
35
63
|
## Generator Methods ##
|
36
64
|
|
37
65
|
# Platform method to return a link object.
|
data/lib/symbiont/version.rb
CHANGED
@@ -2,10 +2,14 @@ module Symbiont
|
|
2
2
|
module WebObjects
|
3
3
|
|
4
4
|
class Table < WebObject
|
5
|
+
include Enumerable
|
5
6
|
|
6
|
-
# This method is used to return a TableRow object based on the index provided.
|
7
|
+
# This method is used to return a TableRow object based on the index provided. When
|
8
|
+
# the index provided is a string, the text will be matched with the text from the first
|
9
|
+
# column.
|
7
10
|
# @return [Symbiont::WebObjects::TableRow]
|
8
11
|
def [](index)
|
12
|
+
index = find_by_title(index) if index.kind_of?(String)
|
9
13
|
Object::Symbiont::WebObjects::TableRow.new(@web_object[index])
|
10
14
|
end
|
11
15
|
|
@@ -41,6 +45,12 @@ module Symbiont
|
|
41
45
|
".//child::tr"
|
42
46
|
end
|
43
47
|
|
48
|
+
private
|
49
|
+
|
50
|
+
def find_by_title(row_text)
|
51
|
+
@web_object.rows.find_index {|row| row[0].text == row_text}
|
52
|
+
end
|
53
|
+
|
44
54
|
end # class: Table
|
45
55
|
|
46
56
|
end # module: WebObjects
|
@@ -2,10 +2,14 @@ module Symbiont
|
|
2
2
|
module WebObjects
|
3
3
|
|
4
4
|
class TableRow < WebObject
|
5
|
+
include Enumerable
|
5
6
|
|
6
|
-
# This method is used to return a TableCell object based on the index provided.
|
7
|
+
# This method is used to return a TableCell object based on the index provided. When
|
8
|
+
# the index provided is a string, the text will be matched with the text from the
|
9
|
+
# columns in the first row.
|
7
10
|
# @return [Symbiont::WebObjects::TableCell]
|
8
11
|
def [](index)
|
12
|
+
index = find_by_title(index) if index.kind_of?(String)
|
9
13
|
Object::Symbiont::WebObjects::TableCell.new(@web_object[index])
|
10
14
|
end
|
11
15
|
|
@@ -29,6 +33,14 @@ module Symbiont
|
|
29
33
|
".//child::td|th"
|
30
34
|
end
|
31
35
|
|
36
|
+
private
|
37
|
+
|
38
|
+
def find_by_title(column_text)
|
39
|
+
table = @web_object.parent
|
40
|
+
first_row = table[0]
|
41
|
+
first_row.cells.find_index {|column| column.text == column_text}
|
42
|
+
end
|
43
|
+
|
32
44
|
end # class: TableRow
|
33
45
|
|
34
46
|
end # module: WebObjects
|
data/lib/symbiont.rb
CHANGED
@@ -4,11 +4,13 @@ require 'symbiont/platforms'
|
|
4
4
|
require 'symbiont/generators'
|
5
5
|
require 'symbiont/enclosers'
|
6
6
|
require 'symbiont/evaluators'
|
7
|
+
require 'symbiont/locators'
|
7
8
|
|
8
9
|
module Symbiont
|
9
10
|
include Platforms
|
10
11
|
include Enclosers
|
11
12
|
include Evaluators
|
13
|
+
include Locators
|
12
14
|
|
13
15
|
# Used to make a platform object accessible. Will hold object
|
14
16
|
# references like these:
|
@@ -17,5 +17,26 @@ describe Symbiont::Enclosers do
|
|
17
17
|
watir_browser.should_receive(:wait_until).with(5, "not quick enough")
|
18
18
|
watir_definition.wait_for(5, "not quick enough")
|
19
19
|
end
|
20
|
+
|
21
|
+
it "should handle alert message boxes" do
|
22
|
+
watir_browser.should_receive(:wd).twice.and_return(watir_browser)
|
23
|
+
watir_browser.should_receive(:execute_script).twice
|
24
|
+
watir_definition.will_alert do
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should handle confirmation message boxes" do
|
29
|
+
watir_browser.should_receive(:wd).twice.and_return(watir_browser)
|
30
|
+
watir_browser.should_receive(:execute_script).twice
|
31
|
+
watir_definition.will_confirm(true) do
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should handle prompt message boxes" do
|
36
|
+
watir_browser.should_receive(:wd).twice.and_return(watir_browser)
|
37
|
+
watir_browser.should_receive(:execute_script).twice
|
38
|
+
watir_definition.will_prompt("Question") do
|
39
|
+
end
|
40
|
+
end
|
20
41
|
end
|
21
42
|
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Symbiont::Locators do
|
4
|
+
let(:watir_browser) { mock_browser_for_watir }
|
5
|
+
let(:watir_definition) { DefinitionTest.new(watir_browser) }
|
6
|
+
|
7
|
+
context "a definition using watir-webdriver" do
|
8
|
+
it "should locate a link web object" do
|
9
|
+
watir_browser.should_receive(:link).with(text: 'test').and_return(watir_browser)
|
10
|
+
web_object = watir_definition.link_object(text: 'test')
|
11
|
+
web_object.should be_instance_of Symbiont::WebObjects::Link
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should locate a button web object" do
|
15
|
+
watir_browser.should_receive(:button).with(value: 'test').and_return(watir_browser)
|
16
|
+
web_object = watir_definition.button_object(value: 'test')
|
17
|
+
web_object.should be_instance_of Symbiont::WebObjects::Button
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should locate a text field web object" do
|
21
|
+
watir_browser.should_receive(:text_field).with(id: 'test').and_return(watir_browser)
|
22
|
+
web_object = watir_definition.text_field_object(id: 'test')
|
23
|
+
web_object.should be_instance_of Symbiont::WebObjects::TextField
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should locate a select list web object" do
|
27
|
+
watir_browser.should_receive(:select_list).with(class: 'test').and_return(watir_browser)
|
28
|
+
web_object = watir_definition.select_list_object(class: 'test')
|
29
|
+
web_object.should be_instance_of Symbiont::WebObjects::SelectList
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should locate a checkbox web object" do
|
33
|
+
watir_browser.should_receive(:checkbox).with(id: 'test').and_return(watir_browser)
|
34
|
+
web_object = watir_definition.checkbox_object(id: 'test')
|
35
|
+
web_object.should be_instance_of Symbiont::WebObjects::CheckBox
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should locate a radio web object" do
|
39
|
+
watir_browser.should_receive(:radio).with(id: 'test').and_return(watir_browser)
|
40
|
+
web_object = watir_definition.radio_object(id: 'test')
|
41
|
+
web_object.should be_instance_of Symbiont::WebObjects::Radio
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should locate a div web object" do
|
45
|
+
watir_browser.should_receive(:div).with(id: 'test').and_return(watir_browser)
|
46
|
+
web_object = watir_definition.div_object(id: 'test')
|
47
|
+
web_object.should be_instance_of Symbiont::WebObjects::Div
|
48
|
+
end
|
49
|
+
|
50
|
+
it "should locate a span object" do
|
51
|
+
watir_browser.should_receive(:span).with(id: 'test').and_return(watir_browser)
|
52
|
+
web_object = watir_definition.span_object(id: 'test')
|
53
|
+
web_object.should be_instance_of Symbiont::WebObjects::Span
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should locate a table web object" do
|
57
|
+
watir_browser.should_receive(:table).with(id: 'test').and_return(watir_browser)
|
58
|
+
web_object = watir_definition.table_object(id: 'test')
|
59
|
+
web_object.should be_instance_of Symbiont::WebObjects::Table
|
60
|
+
end
|
61
|
+
|
62
|
+
it "should locate a table cell web object" do
|
63
|
+
watir_browser.should_receive(:td).with(id: 'test').and_return(watir_browser)
|
64
|
+
web_object = watir_definition.cell_object(id: 'test')
|
65
|
+
web_object.should be_instance_of Symbiont::WebObjects::TableCell
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -28,6 +28,16 @@ describe Symbiont::WebObjects::TableRow do
|
|
28
28
|
table_row.each { |e| count += 1 }
|
29
29
|
count.should == 2
|
30
30
|
end
|
31
|
+
|
32
|
+
it "should return a row using text from the first row" do
|
33
|
+
table_row = Symbiont::WebObjects::TableRow.new(table_row_object)
|
34
|
+
table_row_object.should_receive(:[]).with("column_text").and_return(table_row_object)
|
35
|
+
table_row_object.should_receive(:[]).with(0).and_return(table_row_object)
|
36
|
+
table_row_object.should_receive(:parent).and_return(table_row_object)
|
37
|
+
table_row_object.should_receive(:cells).and_return(table_row_object)
|
38
|
+
table_row_object.should_receive(:find_index).and_return("column_text")
|
39
|
+
table_row["column_text"].should be_instance_of Symbiont::WebObjects::TableCell
|
40
|
+
end
|
31
41
|
end
|
32
42
|
end
|
33
43
|
end
|
@@ -22,6 +22,13 @@ describe Symbiont::WebObjects::Table do
|
|
22
22
|
watir_table.last_row.should be_instance_of Symbiont::WebObjects::TableRow
|
23
23
|
end
|
24
24
|
|
25
|
+
it "should return a row using text from the first column" do
|
26
|
+
table_object.stub(:[]).with("row_text").and_return(table_object)
|
27
|
+
table_object.should_receive(:rows).and_return(table_object)
|
28
|
+
table_object.should_receive(:find_index).and_return("row_text")
|
29
|
+
watir_table["row_text"].should be_instance_of Symbiont::WebObjects::TableRow
|
30
|
+
end
|
31
|
+
|
25
32
|
it "should return the number of rows" do
|
26
33
|
table_object.should_receive(:wd).and_return(table_object)
|
27
34
|
table_object.should_receive(:find_elements).with(:xpath, ".//child::tr").and_return(table_object)
|
data/specs/definitions/pages.rb
CHANGED
@@ -106,6 +106,10 @@ class SimpleEventsPage
|
|
106
106
|
button :revealButton, value: "Reveal Button"
|
107
107
|
button :createButton, value: "Create Button"
|
108
108
|
button :removeButton, value: "Remove Button"
|
109
|
+
|
110
|
+
button :alert, id: "alertButton"
|
111
|
+
button :confirm, id: "confirmButton"
|
112
|
+
button :prompt, id: "promptButton"
|
109
113
|
end
|
110
114
|
|
111
115
|
class LoggingIn
|
data/specs/events.feature
CHANGED
@@ -16,4 +16,15 @@ Feature: Ability to Handle Events or Time-Based Situations
|
|
16
16
|
And the conditional button is revealed
|
17
17
|
Then the test will wait until the conditional button is visible before clicking it
|
18
18
|
|
19
|
+
Scenario: Dealing with alert message boxes
|
20
|
+
When the alert message box appears
|
21
|
+
Then the alert message should be "Alert Message Received"
|
19
22
|
|
23
|
+
Scenario: Dealing with confirmation message boxes
|
24
|
+
When the confirmation message box appears
|
25
|
+
Then the confirmation message should be "Confirmation Message Received"
|
26
|
+
|
27
|
+
Scenario: Dealing with prompt message boxes
|
28
|
+
When the prompt message box appears
|
29
|
+
Then the prompt message should be "Favorite Sith Lord"
|
30
|
+
And the prompt default value should be "Darth Bane"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
Feature: Ability to Reference and Use Undeclared Web Objects
|
2
|
+
|
3
|
+
Scenario: Undeclared links
|
4
|
+
When the test needs to utilize the oath link
|
5
|
+
Then the oath link can be referenced
|
6
|
+
And the oath link can be clicked
|
7
|
+
|
8
|
+
Scenario: Undeclared buttons
|
9
|
+
When the test needs to utilize the nostalgic button
|
10
|
+
Then the nostalgic button can be referenced
|
11
|
+
And the nostalgic button can be clicked
|
12
|
+
|
13
|
+
Scenario: Undeclared text fields
|
14
|
+
When the test needs to utilize the book summary text field
|
15
|
+
Then the book summary text field can be referenced
|
16
|
+
And the book summary text field can be set to "A How-To Guide for Sith Inquisitors"
|
17
|
+
And the book summary should be "A How-To Guide for Sith Inquisitors"
|
@@ -16,6 +16,27 @@ When (/^the conditional button on the events test page is invisible$/) do
|
|
16
16
|
step %{the conditional button is hidden}
|
17
17
|
end
|
18
18
|
|
19
|
+
When (/^the alert message box appears$/) do
|
20
|
+
step %{on the events test page}
|
21
|
+
@message = @page.will_alert do
|
22
|
+
@page.alert
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
When (/^the confirmation message box appears$/) do
|
27
|
+
step %{on the events test page}
|
28
|
+
@message = @page.will_confirm(true) do
|
29
|
+
@page.confirm
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
When (/^the prompt message box appears$/) do
|
34
|
+
step %{on the events test page}
|
35
|
+
@response = @page.will_prompt("Darth Bane") do
|
36
|
+
@page.prompt
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
19
40
|
Then (/^the test should wait for a success page$/) do
|
20
41
|
@page.wait_for(10, "success page did not come up in time") do
|
21
42
|
@page.text.include? 'Success'
|
@@ -38,3 +59,19 @@ Then (/^the test will wait until the conditional button is visible before clicki
|
|
38
59
|
@page.conditional_button.when_visible
|
39
60
|
@page.conditional
|
40
61
|
end
|
62
|
+
|
63
|
+
Then (/^the alert message should be "([^"]*)"$/) do |text|
|
64
|
+
@message.should == text
|
65
|
+
end
|
66
|
+
|
67
|
+
Then (/^the confirmation message should be "([^"]*)"$/) do |text|
|
68
|
+
@message.should == text
|
69
|
+
end
|
70
|
+
|
71
|
+
Then (/^the prompt message should be "([^"]*)"$/) do |text|
|
72
|
+
@response[:message].should == text
|
73
|
+
end
|
74
|
+
|
75
|
+
Then (/^the prompt default value should be "([^"]*)"$/) do |value|
|
76
|
+
@response[:default_value].should == value
|
77
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
When (/^the test needs to utilize the oath link$/) do
|
2
|
+
step %{on the object test page}
|
3
|
+
@link = @page.link_object(id: "oath")
|
4
|
+
end
|
5
|
+
|
6
|
+
When (/^the test needs to utilize the nostalgic button$/) do
|
7
|
+
step %{on the object test page}
|
8
|
+
@button = @page.button_object(value: "All Your Base Are Belong To Us")
|
9
|
+
end
|
10
|
+
|
11
|
+
When (/^the test needs to utilize the book summary text field$/) do
|
12
|
+
step %{on the object test page}
|
13
|
+
@text_field = @page.text_field_object(id: "bookSummaryID")
|
14
|
+
end
|
15
|
+
|
16
|
+
Then (/^the oath link can be referenced$/) do
|
17
|
+
@link.should be_instance_of Symbiont::WebObjects::Link
|
18
|
+
end
|
19
|
+
|
20
|
+
Then (/^the oath link can be clicked$/) do
|
21
|
+
@link.click
|
22
|
+
step %{the first success page appears}
|
23
|
+
end
|
24
|
+
|
25
|
+
Then (/^the nostalgic button can be referenced$/) do
|
26
|
+
@button.should be_instance_of Symbiont::WebObjects::Button
|
27
|
+
end
|
28
|
+
|
29
|
+
Then (/^the nostalgic button can be clicked$/) do
|
30
|
+
@button.click
|
31
|
+
step %{the first success page appears}
|
32
|
+
end
|
33
|
+
|
34
|
+
Then (/^the book summary text field can be referenced$/) do
|
35
|
+
@text_field.should be_instance_of Symbiont::WebObjects::TextField
|
36
|
+
end
|
37
|
+
|
38
|
+
Then (/^the book summary text field can be set to "([^"]*)"$/) do |text|
|
39
|
+
@text_field = text
|
40
|
+
end
|
41
|
+
|
42
|
+
Then (/^the book summary should be "([^"]*)"$/) do |text|
|
43
|
+
@text_field.should == text
|
44
|
+
end
|
@@ -67,3 +67,7 @@ Then (/^the data for the last row should be "([^"]*)", "([^"]*)", and "([^"]*)"$
|
|
67
67
|
@object.last_row[1].text.should == col2
|
68
68
|
@object.last_row[2].text.should == col3
|
69
69
|
end
|
70
|
+
|
71
|
+
Then (/^the symbol for carbon should be "([^"]*)"$/) do |text|
|
72
|
+
@page.atomicTable_object["Carbon"]["Symbol"].text.should == text
|
73
|
+
end
|
data/specs/table.feature
CHANGED
@@ -25,3 +25,7 @@ Feature: Ability to Support Table Web Objects
|
|
25
25
|
And row "1" should have "3" columns
|
26
26
|
And the data for the first row should be "Element", "Symbol", and "Atomic Number"
|
27
27
|
And the data for the last row should be "Xenon", "Xe", and "54"
|
28
|
+
|
29
|
+
Scenario: Get information from a table by named column and row
|
30
|
+
When getting information from the atomic elements table
|
31
|
+
Then the symbol for carbon should be "C"
|
data/symbiont.gemspec
CHANGED
@@ -9,19 +9,19 @@ Gem::Specification.new do |gem|
|
|
9
9
|
gem.authors = ["Jeff Nyman"]
|
10
10
|
gem.email = ["jeffnyman@gmail.com"]
|
11
11
|
gem.homepage = "https://github.com/jnyman/symbiont"
|
12
|
-
gem.summary =
|
13
|
-
gem.description =
|
12
|
+
gem.summary = gem.description
|
13
|
+
gem.description = "An endosymbiotic facultative library for web application testing."
|
14
|
+
|
15
|
+
gem.add_development_dependency "rspec", "2.10.0"
|
16
|
+
gem.add_development_dependency "simplecov", "0.6.4"
|
17
|
+
|
18
|
+
gem.add_runtime_dependency "watir-webdriver", "0.5.8"
|
14
19
|
|
15
20
|
gem.required_ruby_version = '>= 1.9.2'
|
16
21
|
gem.rubyforge_project = "symbiont"
|
17
|
-
|
22
|
+
|
18
23
|
gem.files = `git ls-files`.split("\n")
|
19
24
|
gem.test_files = `git ls-files -- {test,spec,specs,features}/*`.split("\n")
|
20
25
|
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
21
26
|
gem.require_paths = ["lib"]
|
22
|
-
|
23
|
-
gem.add_development_dependency('rspec', ['2.10.0'])
|
24
|
-
gem.add_development_dependency('simplecov', ['0.6.4'])
|
25
|
-
|
26
|
-
gem.add_runtime_dependency('watir-webdriver', ['0.5.8'])
|
27
27
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: symbiont
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,41 +9,56 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-06-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- - =
|
19
|
+
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: 2.10.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - '='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.10.0
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: simplecov
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
|
-
- - =
|
35
|
+
- - '='
|
31
36
|
- !ruby/object:Gem::Version
|
32
37
|
version: 0.6.4
|
33
38
|
type: :development
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - '='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.6.4
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: watir-webdriver
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
|
-
- - =
|
51
|
+
- - '='
|
42
52
|
- !ruby/object:Gem::Version
|
43
53
|
version: 0.5.8
|
44
54
|
type: :runtime
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - '='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.5.8
|
47
62
|
description: An endosymbiotic facultative library for web application testing.
|
48
63
|
email:
|
49
64
|
- jeffnyman@gmail.com
|
@@ -54,6 +69,7 @@ files:
|
|
54
69
|
- .gitignore
|
55
70
|
- .travis.yml
|
56
71
|
- Gemfile
|
72
|
+
- Gemfile.lock
|
57
73
|
- HISTORY.md
|
58
74
|
- LICENSE
|
59
75
|
- README.md
|
@@ -89,6 +105,7 @@ files:
|
|
89
105
|
- lib/symbiont/evaluators.rb
|
90
106
|
- lib/symbiont/factory.rb
|
91
107
|
- lib/symbiont/generators.rb
|
108
|
+
- lib/symbiont/locators.rb
|
92
109
|
- lib/symbiont/logger.rb
|
93
110
|
- lib/symbiont/platform_watir.rb
|
94
111
|
- lib/symbiont/platform_watir/platform_object.rb
|
@@ -121,6 +138,7 @@ files:
|
|
121
138
|
- spec/symbiont/generators/table_generators_spec.rb
|
122
139
|
- spec/symbiont/generators/text_field_generators_spec.rb
|
123
140
|
- spec/symbiont/generators_spec.rb
|
141
|
+
- spec/symbiont/locators_spec.rb
|
124
142
|
- spec/symbiont/platform_object_spec.rb
|
125
143
|
- spec/symbiont/symbiont_spec.rb
|
126
144
|
- spec/symbiont/web_object_spec.rb
|
@@ -134,6 +152,7 @@ files:
|
|
134
152
|
- specs/events.feature
|
135
153
|
- specs/frame.feature
|
136
154
|
- specs/link.feature
|
155
|
+
- specs/locators.feature
|
137
156
|
- specs/radio.feature
|
138
157
|
- specs/select_list.feature
|
139
158
|
- specs/simple_test.feature
|
@@ -147,6 +166,7 @@ files:
|
|
147
166
|
- specs/support/test_steps/action_steps_events.rb
|
148
167
|
- specs/support/test_steps/action_steps_frames.rb
|
149
168
|
- specs/support/test_steps/action_steps_links.rb
|
169
|
+
- specs/support/test_steps/action_steps_locators.rb
|
150
170
|
- specs/support/test_steps/action_steps_navigate.rb
|
151
171
|
- specs/support/test_steps/action_steps_radios.rb
|
152
172
|
- specs/support/test_steps/action_steps_select_lists.rb
|
@@ -180,9 +200,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
200
|
version: '0'
|
181
201
|
requirements: []
|
182
202
|
rubyforge_project: symbiont
|
183
|
-
rubygems_version: 1.8.
|
203
|
+
rubygems_version: 1.8.24
|
184
204
|
signing_key:
|
185
205
|
specification_version: 3
|
186
|
-
summary:
|
206
|
+
summary: ''
|
187
207
|
test_files: []
|
188
208
|
has_rdoc:
|