symbiont 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +6 -4
- data/HISTORY.md +8 -0
- data/Rakefile +8 -1
- data/app/views/test_page.erb +6 -1
- data/lib/symbiont/data_setter.rb +49 -0
- data/lib/symbiont/enclosers.rb +34 -0
- data/lib/symbiont/evaluators.rb +39 -1
- data/lib/symbiont/platform_watir/platform_object.rb +40 -0
- data/lib/symbiont/platforms.rb +3 -0
- data/lib/symbiont/version.rb +1 -1
- data/lib/symbiont/web_objects/_common.rb +4 -0
- data/lib/symbiont/web_objects/button.rb +4 -2
- data/lib/symbiont/web_objects/checkbox.rb +3 -1
- data/lib/symbiont/web_objects/div.rb +2 -0
- data/lib/symbiont/web_objects/link.rb +4 -2
- data/lib/symbiont/web_objects/radio.rb +2 -0
- data/lib/symbiont/web_objects/select_list.rb +2 -0
- data/lib/symbiont/web_objects/span.rb +2 -0
- data/lib/symbiont/web_objects/table.rb +2 -0
- data/lib/symbiont/web_objects/table_cell.rb +3 -0
- data/lib/symbiont/web_objects/table_row.rb +2 -0
- data/lib/symbiont/web_objects/text_field.rb +18 -3
- data/lib/symbiont/web_objects.rb +22 -0
- data/lib/symbiont.rb +2 -0
- data/spec/symbiont/data_setter_spec.rb +62 -0
- data/spec/symbiont/evaluators_spec.rb +35 -0
- data/spec/symbiont/web_object_spec.rb +5 -0
- data/spec/symbiont/web_objects/button_spec.rb +15 -0
- data/spec/symbiont/web_objects/checkbox_spec.rb +11 -0
- data/spec/symbiont/web_objects/div_spec.rb +11 -0
- data/spec/symbiont/web_objects/link_spec.rb +11 -0
- data/spec/symbiont/web_objects/radio_spec.rb +11 -0
- data/spec/symbiont/web_objects/select_list_spec.rb +11 -0
- data/spec/symbiont/web_objects/span_spec.rb +11 -0
- data/spec/symbiont/web_objects/table_cell_spec.rb +13 -0
- data/spec/symbiont/web_objects/table_row_spec.rb +4 -0
- data/spec/symbiont/web_objects/table_spec.rb +4 -0
- data/spec/symbiont/web_objects/text_field_spec.rb +31 -0
- data/specs/data_setter.feature +29 -0
- data/specs/definitions/pages.rb +23 -0
- data/specs/evaluators.feature +12 -0
- data/specs/link.feature +5 -1
- data/specs/support/test_steps/action_steps_data_setter.rb +56 -0
- data/specs/support/test_steps/action_steps_evaluators.rb +12 -0
- data/specs/support/test_steps/action_steps_links.rb +14 -0
- data/specs/support/test_steps/action_steps_navigate.rb +8 -2
- data/specs/support/test_steps/action_steps_text_fields.rb +40 -1
- data/specs/support/test_steps/action_steps_webobjects.rb +8 -2
- data/specs/text_field.feature +10 -0
- data/specs/web_object.feature +4 -0
- data/symbiont.gemspec +2 -1
- metadata +34 -4
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Symbiont::WebObjects::Link do
|
4
|
+
describe "implementation" do
|
5
|
+
let(:link_object) { double('link_object') }
|
6
|
+
|
7
|
+
it "should register with an anchor tag" do
|
8
|
+
::Symbiont::WebObjects.get_class_for(:a).should == ::Symbiont::WebObjects::Link
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Symbiont::WebObjects::Radio do
|
4
|
+
describe "implementation" do
|
5
|
+
let(:radio_object) { double('radio_object') }
|
6
|
+
|
7
|
+
it "should register with a radio type" do
|
8
|
+
::Symbiont::WebObjects.get_class_for(:input, :radio).should == ::Symbiont::WebObjects::Radio
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Symbiont::WebObjects::SelectList do
|
4
|
+
describe "implementation" do
|
5
|
+
let(:select_list_object) { double('select_list_object') }
|
6
|
+
|
7
|
+
it "should register with a select list tag" do
|
8
|
+
::Symbiont::WebObjects.get_class_for(:select).should == ::Symbiont::WebObjects::SelectList
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Symbiont::WebObjects::Span do
|
4
|
+
describe "implementation" do
|
5
|
+
let(:span_object) { double('span_object') }
|
6
|
+
|
7
|
+
it "should register with a span tag" do
|
8
|
+
::Symbiont::WebObjects.get_class_for(:span).should == ::Symbiont::WebObjects::Span
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Symbiont::WebObjects::TableCell do
|
4
|
+
describe "implementation" do
|
5
|
+
it "should register with a table definition tag" do
|
6
|
+
::Symbiont::WebObjects.get_class_for(:td).should == ::Symbiont::WebObjects::TableCell
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should register with a table header tag" do
|
10
|
+
::Symbiont::WebObjects.get_class_for(:th).should == ::Symbiont::WebObjects::TableCell
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -38,6 +38,10 @@ describe Symbiont::WebObjects::TableRow do
|
|
38
38
|
table_row_object.should_receive(:find_index).and_return("column_text")
|
39
39
|
table_row["column_text"].should be_instance_of Symbiont::WebObjects::TableCell
|
40
40
|
end
|
41
|
+
|
42
|
+
it "should register with a table row tag" do
|
43
|
+
::Symbiont::WebObjects.get_class_for(:tr).should == ::Symbiont::WebObjects::TableRow
|
44
|
+
end
|
41
45
|
end
|
42
46
|
end
|
43
47
|
end
|
@@ -43,6 +43,10 @@ describe Symbiont::WebObjects::Table do
|
|
43
43
|
watir_table.each { |e| count += 1 }
|
44
44
|
count.should == 2
|
45
45
|
end
|
46
|
+
|
47
|
+
it "should register with a table tag" do
|
48
|
+
::Symbiont::WebObjects.get_class_for(:table).should == ::Symbiont::WebObjects::Table
|
49
|
+
end
|
46
50
|
end
|
47
51
|
end
|
48
52
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Symbiont::WebObjects::TextField do
|
4
|
+
describe "implementation" do
|
5
|
+
let(:text_field_object) { double('text_field_object') }
|
6
|
+
let(:text_field_definition) { ::Symbiont::WebObjects::TextField.new(text_field_object) }
|
7
|
+
|
8
|
+
it "should get the value of a text field" do
|
9
|
+
text_field_object.should_receive(:value).and_return("testing")
|
10
|
+
text_field_definition.value.should == "testing"
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should set the value of a text field" do
|
14
|
+
text_field_object.should_receive(:set).with("testing")
|
15
|
+
text_field_definition.value = "testing"
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should append text to a text field" do
|
19
|
+
text_field_object.should_receive(:send_keys).with("testing")
|
20
|
+
text_field_definition.append "testing"
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should register with a text type" do
|
24
|
+
::Symbiont::WebObjects.get_class_for(:input, :text).should == ::Symbiont::WebObjects::TextField
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should register with a password type" do
|
28
|
+
::Symbiont::WebObjects.get_class_for(:input, :password).should == ::Symbiont::WebObjects::TextField
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
Feature: Ability to enter sets of data
|
2
|
+
|
3
|
+
Scenario: Enter data into form when definition has default data
|
4
|
+
When an administrator logs in
|
5
|
+
Then the users option should be available
|
6
|
+
|
7
|
+
Scenario: Enter data into form with modification of default data
|
8
|
+
When a clinical administrator logs in
|
9
|
+
Then the users option should not be available
|
10
|
+
|
11
|
+
Scenario: Enter data into a form using specific data
|
12
|
+
When a power user with a nonsecure password logs in to the beta client
|
13
|
+
Then the users option should not be available
|
14
|
+
|
15
|
+
Scenario: Enter data into a form using specific data from a table
|
16
|
+
When a user logs in with:
|
17
|
+
| server | client | loginName | loginPassword |
|
18
|
+
| dev | test | jnyman | Timef1ux81* |
|
19
|
+
Then the users option should not be available
|
20
|
+
|
21
|
+
Scenario: Enter data into a select list
|
22
|
+
When a totally fictitious concept is used
|
23
|
+
Then that concept should be selected
|
24
|
+
|
25
|
+
Scenario: Enter data into a check boxes and radios
|
26
|
+
When two futuristic technologies are chosen
|
27
|
+
And a way to vaporize is selected
|
28
|
+
Then those technologies should be checked
|
29
|
+
And that vaporization method should be selected
|
data/specs/definitions/pages.rb
CHANGED
@@ -55,6 +55,7 @@ class SimpleObjectPage
|
|
55
55
|
select_list :sithPowerID, id: "sithPowerID"
|
56
56
|
select_list :fake_select_list, id: "fake_select_list"
|
57
57
|
|
58
|
+
checkbox :neuralShunt, id: "neuralShuntID"
|
58
59
|
checkbox :organicCircuitry, id: "organicCircuitryID"
|
59
60
|
|
60
61
|
checkbox :kineticHarpoonID, id: "kineticHarpoonID"
|
@@ -116,6 +117,13 @@ class LoggingIn
|
|
116
117
|
include Symbiont
|
117
118
|
begin_at "http://localhost:4567/test_database"
|
118
119
|
|
120
|
+
LOGIN_DATA = {
|
121
|
+
'server' => 'Staging',
|
122
|
+
'client' => 'Test',
|
123
|
+
'loginName' => 'administrator',
|
124
|
+
'loginPassword' => 'p@ssWord!'
|
125
|
+
}
|
126
|
+
|
119
127
|
within_frame(id: "loginSection") do |frame|
|
120
128
|
text_field :server, id: "serverID", frame: frame
|
121
129
|
text_field :client, id: "clientID", frame: frame
|
@@ -123,4 +131,19 @@ class LoggingIn
|
|
123
131
|
text_field :loginPassword, id: "passwordID", frame: frame
|
124
132
|
button :login, id: "btnSubmit", frame: frame
|
125
133
|
end
|
134
|
+
|
135
|
+
def login_as(credentials = {})
|
136
|
+
credentials = LOGIN_DATA.merge(credentials)
|
137
|
+
self.server = credentials['server']
|
138
|
+
self.client = credentials['client']
|
139
|
+
self.loginName = credentials['loginName']
|
140
|
+
self.loginPassword = credentials['loginPassword']
|
141
|
+
self.login
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
class EntityList
|
146
|
+
include Symbiont
|
147
|
+
|
148
|
+
link :users, id: "users"
|
126
149
|
end
|
data/specs/evaluators.feature
CHANGED
@@ -3,3 +3,15 @@ Feature: Ability to handle browser and page actions.
|
|
3
3
|
Scenario: Getting web page text
|
4
4
|
When on the object test page
|
5
5
|
Then the page should contain the text "Multiphasic Temporal Convergence"
|
6
|
+
|
7
|
+
Scenario: Getting web page markup
|
8
|
+
When on the object test page
|
9
|
+
Then the page should contain the markup "<td>Carbon</td>"
|
10
|
+
|
11
|
+
Scenario: Getting web page title
|
12
|
+
When on the object test page
|
13
|
+
Then the page should have the title "Simple Object Page | Test Application"
|
14
|
+
|
15
|
+
Scenario: Getting the web page url
|
16
|
+
When on the object test page
|
17
|
+
Then the page url should be "http://localhost:4567/test_page"
|
data/specs/link.feature
CHANGED
@@ -18,7 +18,11 @@ Feature: Ability to Support Link Web Objects
|
|
18
18
|
When on the landing page
|
19
19
|
Then the fake link should not exist
|
20
20
|
But the fake link should be a link object
|
21
|
-
|
21
|
+
|
22
|
+
Scenario: Handling a non-declared text field
|
23
|
+
When the oath link on the object test page is clicked
|
24
|
+
Then the first success page appears
|
25
|
+
|
22
26
|
Scenario Outline: Finding links with locators
|
23
27
|
When the avengers link on the object test page is clicked by "<locator>"
|
24
28
|
Then the first success page appears
|
@@ -0,0 +1,56 @@
|
|
1
|
+
When (/^an administrator logs in$/) do
|
2
|
+
@page = LoggingIn.new(@browser, true)
|
3
|
+
@page.login_as
|
4
|
+
end
|
5
|
+
|
6
|
+
When (/^a clinical administrator logs in$/) do
|
7
|
+
@page = LoggingIn.new(@browser, true)
|
8
|
+
@page.login_as('loginName' => 'clinicaladmin')
|
9
|
+
end
|
10
|
+
|
11
|
+
When (/^a power user with a nonsecure password logs in to the beta client$/) do
|
12
|
+
@page = LoggingIn.new(@browser, true)
|
13
|
+
@page.using(:client => 'beta', :loginName => 'poweruser', :loginPassword => '1234')
|
14
|
+
end
|
15
|
+
|
16
|
+
When (/^a user logs in with:$/) do |table|
|
17
|
+
@page = LoggingIn.new(@browser, true)
|
18
|
+
@page.using(table.hashes.first)
|
19
|
+
end
|
20
|
+
|
21
|
+
When (/^a totally fictitious concept is used$/) do
|
22
|
+
@page = SimpleObjectPage.new(@browser, true)
|
23
|
+
@page.using('physicsConceptsID' => 'Tachyonic Antitravel')
|
24
|
+
end
|
25
|
+
|
26
|
+
When (/^two futuristic technologies are chosen$/) do
|
27
|
+
@page = SimpleObjectPage.new(@browser, true)
|
28
|
+
@page.using('neuralShunt' => true, 'organicCircuitry' => true)
|
29
|
+
end
|
30
|
+
|
31
|
+
When (/^a way to vaporize is selected$/) do
|
32
|
+
@page.using('unstablePhaseShiftID' => true)
|
33
|
+
end
|
34
|
+
|
35
|
+
Then (/^the users option should be available$/) do
|
36
|
+
@page = EntityList.new(@browser)
|
37
|
+
@page.users_exists?.should == true
|
38
|
+
end
|
39
|
+
|
40
|
+
Then (/^the users option should not be available$/) do
|
41
|
+
@page = EntityList.new(@browser)
|
42
|
+
@page.users_exists?.should == false
|
43
|
+
end
|
44
|
+
|
45
|
+
Then (/^that concept should be selected$/) do
|
46
|
+
@page.physicsConceptsID.should == 'Tachyonic Antitravel'
|
47
|
+
end
|
48
|
+
|
49
|
+
Then (/^those technologies should be checked$/) do
|
50
|
+
@page.neuralShunt_checked?.should == true
|
51
|
+
@page.organicCircuitry_checked?.should == true
|
52
|
+
end
|
53
|
+
|
54
|
+
Then (/^that vaporization method should be selected$/) do
|
55
|
+
@page.unstablePhaseShiftID_selected?.should == true
|
56
|
+
end
|
@@ -1,3 +1,15 @@
|
|
1
1
|
Then (/^the page should contain the text "([^"]*)"$/) do |text|
|
2
2
|
@page.text.include? text
|
3
3
|
end
|
4
|
+
|
5
|
+
Then (/^the page should have the title "([^"]*)"$/) do |text|
|
6
|
+
@page.title.include? text
|
7
|
+
end
|
8
|
+
|
9
|
+
Then (/^the page should contain the markup "([^"]*)"$/) do |markup|
|
10
|
+
@page.markup.include? markup
|
11
|
+
end
|
12
|
+
|
13
|
+
Then (/^the page url should be "([^"]*)"$/) do |url|
|
14
|
+
@page.url.should == url
|
15
|
+
end
|
@@ -3,6 +3,11 @@ When (/^the object test page link on the landing page is clicked$/) do
|
|
3
3
|
@page.simple_object_page
|
4
4
|
end
|
5
5
|
|
6
|
+
When (/^the oath link on the object test page is clicked$/) do
|
7
|
+
step %{on the object test page}
|
8
|
+
@text_field = @page.link_object(id: "oath").click
|
9
|
+
end
|
10
|
+
|
6
11
|
When (/^the avengers link on the object test page is clicked by "([^"]*)"$/) do |locator|
|
7
12
|
@page = SimpleObjectPage.new(@browser, true)
|
8
13
|
@page.avengersID if locator == "id"
|
@@ -17,15 +22,24 @@ end
|
|
17
22
|
Then (/^the database app link should exist$/) do
|
18
23
|
@page.database_app_exists?.should == true
|
19
24
|
@page.database_app?.should == true
|
25
|
+
|
26
|
+
@web_object = @page.database_app_object
|
27
|
+
@web_object.should exist
|
20
28
|
end
|
21
29
|
|
22
30
|
Then (/^the fake link should not exist$/) do
|
23
31
|
@page.fake_link_exists?.should == false
|
32
|
+
|
33
|
+
@web_object = @page.fake_link_object
|
34
|
+
@web_object.should_not exist
|
24
35
|
end
|
25
36
|
|
26
37
|
Then (/^the database app link should be visible$/) do
|
27
38
|
@page.database_app_visible?.should == true
|
28
39
|
@page.database_app_?.should == true
|
40
|
+
|
41
|
+
@web_object = @page.database_app_object
|
42
|
+
@web_object.should be_visible
|
29
43
|
end
|
30
44
|
|
31
45
|
Then (/^the database app link should be a link object$/) do
|
@@ -11,9 +11,15 @@ When (/^on the events test page$/) do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
Then (/^the simple object page appears$/) do
|
14
|
-
|
14
|
+
title_text = "Simple Object Page | Test Application"
|
15
|
+
@page.wait_for(3, "title should have been #{title_text}") do
|
16
|
+
@page.title == title_text
|
17
|
+
end
|
15
18
|
end
|
16
19
|
|
17
20
|
Then (/^the first success page appears$/) do
|
18
|
-
|
21
|
+
title_text = "Success 1 | Test Application"
|
22
|
+
@page.wait_for(3, "title should have been #{title_text}") do
|
23
|
+
@page.title == title_text
|
24
|
+
end
|
19
25
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
When (/^the book title on the simple object test page is set to "([^"]*)"$/) do |text|
|
2
2
|
step %{on the object test page}
|
3
|
-
@page.bookTitleID =
|
3
|
+
@page.bookTitleID = text
|
4
4
|
end
|
5
5
|
|
6
6
|
When (/^the book title text field on the object test page is set by "([^"]*)"$/) do |locator|
|
@@ -13,19 +13,38 @@ When (/^the book title text field on the object test page is set by "([^"]*)"$/)
|
|
13
13
|
@page.bookTitleIndex = title if locator == "index"
|
14
14
|
end
|
15
15
|
|
16
|
+
When (/^the book author on the simple object test page is set to "([^"]*)"$/) do |text|
|
17
|
+
step %{on the object test page}
|
18
|
+
@text_field = @page.text_field_object(id: "bookAuthorID")
|
19
|
+
@text_field.value = text
|
20
|
+
end
|
21
|
+
|
22
|
+
When (/^the text "([^"]*)" is added to the book title$/) do |text|
|
23
|
+
@page.bookTitleID_object.append text
|
24
|
+
end
|
25
|
+
|
16
26
|
Then (/^the book title text field should exist$/) do
|
17
27
|
@page.bookTitleID_exists?.should == true
|
18
28
|
@page.bookTitleID?.should == true
|
29
|
+
|
30
|
+
@web_object = @page.bookTitleID_object
|
31
|
+
@web_object.should exist
|
19
32
|
end
|
20
33
|
|
21
34
|
Then (/^the book title text field should be visible$/) do
|
22
35
|
@page.bookTitleID_visible?.should == true
|
23
36
|
@page.bookTitleID_?.should == true
|
37
|
+
|
38
|
+
@web_object = @page.bookTitleID_object
|
39
|
+
@web_object.should be_visible
|
24
40
|
end
|
25
41
|
|
26
42
|
Then (/^the book title text field should be enabled$/) do
|
27
43
|
@page.bookTitleID_enabled?.should == true
|
28
44
|
@page.bookTitleID!.should == true
|
45
|
+
|
46
|
+
@web_object = @page.bookTitleID_object
|
47
|
+
@web_object.should be_enabled
|
29
48
|
end
|
30
49
|
|
31
50
|
Then (/^the book title text field should be a text field object$/) do
|
@@ -37,8 +56,25 @@ Then (/^the book title should be "([^"]*)"$/) do |text|
|
|
37
56
|
@page.bookTitleID.should == text
|
38
57
|
end
|
39
58
|
|
59
|
+
Then (/^the book author should be "([^"]*)"$/) do |text|
|
60
|
+
@text_field.value.should == text
|
61
|
+
end
|
62
|
+
|
40
63
|
Then (/^the fake text field should not exist$/) do
|
41
64
|
@page.fake_text_field_exists?.should == false
|
65
|
+
|
66
|
+
@web_object = @page.fake_text_field_object
|
67
|
+
@web_object.should_not exist
|
68
|
+
end
|
69
|
+
|
70
|
+
Then (/^the fake text field should not be visible$/) do
|
71
|
+
# This test cannot actually pass because an attempt to check for visibility
|
72
|
+
# will result in an "unable to locate element" error. This throws an
|
73
|
+
# UnknownObjectException.
|
74
|
+
|
75
|
+
#@page.fake_text_field_visible?.should == false
|
76
|
+
#@web_object = @page.fake_text_field_object
|
77
|
+
#@web_object.should_not be_visible
|
42
78
|
end
|
43
79
|
|
44
80
|
Then (/^the fake text field should be a text field object$/) do
|
@@ -56,6 +92,9 @@ end
|
|
56
92
|
|
57
93
|
Then (/^the book publisher ID text field should not be enabled$/) do
|
58
94
|
@page.bookPubID_enabled?.should == false
|
95
|
+
|
96
|
+
@web_object = @page.bookPubID_object
|
97
|
+
@web_object.should_not be_enabled
|
59
98
|
end
|
60
99
|
|
61
100
|
Then (/^the text of the book publisher ID text field should be "([^"]*)"$/) do |text|
|
@@ -15,11 +15,17 @@ end
|
|
15
15
|
Then (/^the reference ID text field should have a black background$/) do
|
16
16
|
@web_object = @page.bookRefID_object
|
17
17
|
@style = @web_object.style('background-color')
|
18
|
-
@style.should == "
|
18
|
+
@style.should == "rgba(0,0,0,1)"
|
19
19
|
end
|
20
20
|
|
21
21
|
Then (/^the reference ID text field should have yellow text$/) do
|
22
22
|
@web_object = @page.bookRefID_object
|
23
23
|
@style = @web_object.style('color')
|
24
|
-
@style.should == "
|
24
|
+
@style.should == "rgba(255,255,0,1)"
|
25
|
+
end
|
26
|
+
|
27
|
+
Then (/^the book title text field should be an input field$/) do
|
28
|
+
@web_object = @page.bookTitleID_object
|
29
|
+
@tag = @web_object.tag
|
30
|
+
@tag.should == 'input'
|
25
31
|
end
|
data/specs/text_field.feature
CHANGED
@@ -10,10 +10,16 @@ Feature: Ability to Support Text Field Web Objects
|
|
10
10
|
Scenario: Set text in a text field and get text from it
|
11
11
|
When the book title on the simple object test page is set to "Revelation Space"
|
12
12
|
Then the book title should be "Revelation Space"
|
13
|
+
|
14
|
+
Scenario: Append text to a text field
|
15
|
+
When the book title on the simple object test page is set to "Absolution"
|
16
|
+
And the text " Gap" is added to the book title
|
17
|
+
Then the book title should be "Absolution Gap"
|
13
18
|
|
14
19
|
Scenario: Handling a non-existent text field
|
15
20
|
When on the object test page
|
16
21
|
Then the fake text field should not exist
|
22
|
+
And the fake text field should not be visible
|
17
23
|
But the fake text field should be a text field object
|
18
24
|
|
19
25
|
Scenario: Handling a disabled text field
|
@@ -23,6 +29,10 @@ Feature: Ability to Support Text Field Web Objects
|
|
23
29
|
And the text of the book publisher ID text field should be "ESC:001678:FNC"
|
24
30
|
And the book publisher ID text field object should be a text field object
|
25
31
|
But the book publisher ID text field should not be enabled
|
32
|
+
|
33
|
+
Scenario: Handling a non-declared text field
|
34
|
+
When the book author on the simple object test page is set to "Alastair Reynolds"
|
35
|
+
Then the book author should be "Alastair Reynolds"
|
26
36
|
|
27
37
|
Scenario Outline: Finding text fields with locators
|
28
38
|
When the book title text field on the object test page is set by "<locator>"
|
data/specs/web_object.feature
CHANGED
@@ -9,3 +9,7 @@ Feature: Ability to Handle Generic Aspects of Web Objects
|
|
9
9
|
When on the object test page
|
10
10
|
Then the reference ID text field should have a black background
|
11
11
|
And the reference ID text field should have yellow text
|
12
|
+
|
13
|
+
Scenario: Get the tag of an object
|
14
|
+
When on the object test page
|
15
|
+
Then the book title text field should be an input field
|
data/symbiont.gemspec
CHANGED
@@ -14,8 +14,9 @@ Gem::Specification.new do |gem|
|
|
14
14
|
|
15
15
|
gem.add_development_dependency "rspec", "2.10.0"
|
16
16
|
gem.add_development_dependency "simplecov", "0.6.4"
|
17
|
+
gem.add_development_dependency "yard", "0.8.2.1"
|
17
18
|
|
18
|
-
gem.add_runtime_dependency "watir-webdriver", "0.
|
19
|
+
gem.add_runtime_dependency "watir-webdriver", "0.6.1"
|
19
20
|
|
20
21
|
gem.required_ruby_version = '>= 1.9.2'
|
21
22
|
gem.rubyforge_project = "symbiont"
|
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.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-07-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -43,6 +43,22 @@ dependencies:
|
|
43
43
|
- - '='
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: 0.6.4
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: yard
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - '='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 0.8.2.1
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - '='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.8.2.1
|
46
62
|
- !ruby/object:Gem::Dependency
|
47
63
|
name: watir-webdriver
|
48
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,7 +66,7 @@ dependencies:
|
|
50
66
|
requirements:
|
51
67
|
- - '='
|
52
68
|
- !ruby/object:Gem::Version
|
53
|
-
version: 0.
|
69
|
+
version: 0.6.1
|
54
70
|
type: :runtime
|
55
71
|
prerelease: false
|
56
72
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +74,7 @@ dependencies:
|
|
58
74
|
requirements:
|
59
75
|
- - '='
|
60
76
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
77
|
+
version: 0.6.1
|
62
78
|
description: An endosymbiotic facultative library for web application testing.
|
63
79
|
email:
|
64
80
|
- jeffnyman@gmail.com
|
@@ -101,6 +117,7 @@ files:
|
|
101
117
|
- app/views/test_page.erb
|
102
118
|
- cucumber.yml
|
103
119
|
- lib/symbiont.rb
|
120
|
+
- lib/symbiont/data_setter.rb
|
104
121
|
- lib/symbiont/enclosers.rb
|
105
122
|
- lib/symbiont/evaluators.rb
|
106
123
|
- lib/symbiont/factory.rb
|
@@ -111,6 +128,7 @@ files:
|
|
111
128
|
- lib/symbiont/platform_watir/platform_object.rb
|
112
129
|
- lib/symbiont/platforms.rb
|
113
130
|
- lib/symbiont/version.rb
|
131
|
+
- lib/symbiont/web_objects.rb
|
114
132
|
- lib/symbiont/web_objects/_common.rb
|
115
133
|
- lib/symbiont/web_objects/button.rb
|
116
134
|
- lib/symbiont/web_objects/checkbox.rb
|
@@ -124,6 +142,7 @@ files:
|
|
124
142
|
- lib/symbiont/web_objects/table_row.rb
|
125
143
|
- lib/symbiont/web_objects/text_field.rb
|
126
144
|
- spec/spec_helper.rb
|
145
|
+
- spec/symbiont/data_setter_spec.rb
|
127
146
|
- spec/symbiont/enclosers_spec.rb
|
128
147
|
- spec/symbiont/evaluators_spec.rb
|
129
148
|
- spec/symbiont/factory_spec.rb
|
@@ -142,10 +161,20 @@ files:
|
|
142
161
|
- spec/symbiont/platform_object_spec.rb
|
143
162
|
- spec/symbiont/symbiont_spec.rb
|
144
163
|
- spec/symbiont/web_object_spec.rb
|
164
|
+
- spec/symbiont/web_objects/button_spec.rb
|
165
|
+
- spec/symbiont/web_objects/checkbox_spec.rb
|
166
|
+
- spec/symbiont/web_objects/div_spec.rb
|
167
|
+
- spec/symbiont/web_objects/link_spec.rb
|
168
|
+
- spec/symbiont/web_objects/radio_spec.rb
|
169
|
+
- spec/symbiont/web_objects/select_list_spec.rb
|
170
|
+
- spec/symbiont/web_objects/span_spec.rb
|
171
|
+
- spec/symbiont/web_objects/table_cell_spec.rb
|
145
172
|
- spec/symbiont/web_objects/table_row_spec.rb
|
146
173
|
- spec/symbiont/web_objects/table_spec.rb
|
174
|
+
- spec/symbiont/web_objects/text_field_spec.rb
|
147
175
|
- specs/button.feature
|
148
176
|
- specs/checkbox.feature
|
177
|
+
- specs/data_setter.feature
|
149
178
|
- specs/definitions/pages.rb
|
150
179
|
- specs/div.feature
|
151
180
|
- specs/evaluators.feature
|
@@ -161,6 +190,7 @@ files:
|
|
161
190
|
- specs/support/hooks.rb
|
162
191
|
- specs/support/test_steps/action_steps_buttons.rb
|
163
192
|
- specs/support/test_steps/action_steps_checkboxes.rb
|
193
|
+
- specs/support/test_steps/action_steps_data_setter.rb
|
164
194
|
- specs/support/test_steps/action_steps_divs.rb
|
165
195
|
- specs/support/test_steps/action_steps_evaluators.rb
|
166
196
|
- specs/support/test_steps/action_steps_events.rb
|