symbiont 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +4 -0
- data/Gemfile +1 -1
- data/LICENSE.txt +0 -0
- data/README.md +18 -12
- data/Rakefile +0 -0
- data/bin/console +10 -0
- data/bin/setup +5 -0
- data/lib/symbiont/accessor.rb +0 -0
- data/lib/symbiont/assertions.rb +0 -0
- data/lib/symbiont/data_builder.rb +0 -0
- data/lib/symbiont/data_reader.rb +1 -0
- data/lib/symbiont/data_setter.rb +0 -0
- data/lib/symbiont/elements.rb +0 -0
- data/lib/symbiont/errors.rb +2 -0
- data/lib/symbiont/factory.rb +2 -0
- data/lib/symbiont/helpers.rb +0 -0
- data/lib/symbiont/pages.rb +0 -0
- data/lib/symbiont/service_objects.rb +78 -0
- data/lib/symbiont/soap_methods.rb +72 -0
- data/lib/symbiont/version.rb +1 -1
- data/lib/symbiont/workflows.rb +88 -0
- data/lib/symbiont.rb +3 -0
- data/symbiont.gemspec +7 -5
- metadata +40 -37
- data/.coveralls.yml +0 -1
- data/.travis.yml +0 -24
- data/spec/fixtures/default.yml +0 -3
- data/spec/fixtures/element_definitions.rb +0 -71
- data/spec/fixtures/mock_data.yml +0 -3
- data/spec/fixtures/mock_drivers.rb +0 -8
- data/spec/fixtures/page_definitions.rb +0 -36
- data/spec/spec_helper.rb +0 -49
- data/spec/symbiont/assertion_spec.rb +0 -88
- data/spec/symbiont/data_builder_spec.rb +0 -38
- data/spec/symbiont/data_setter_spec.rb +0 -19
- data/spec/symbiont/driver_spec.rb +0 -52
- data/spec/symbiont/element_spec.rb +0 -10
- data/spec/symbiont/factory_spec.rb +0 -117
- data/spec/symbiont/page_spec.rb +0 -177
- data/test/symbiont-script.rb +0 -159
data/test/symbiont-script.rb
DELETED
@@ -1,159 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
$: << './lib'
|
3
|
-
|
4
|
-
require 'rspec'
|
5
|
-
include RSpec::Matchers
|
6
|
-
|
7
|
-
require 'watir-webdriver'
|
8
|
-
|
9
|
-
require 'symbiont'
|
10
|
-
include Symbiont::Factory
|
11
|
-
|
12
|
-
#========================================
|
13
|
-
|
14
|
-
class Dialogic
|
15
|
-
attach Symbiont
|
16
|
-
|
17
|
-
url_is 'http://localhost:9292'
|
18
|
-
|
19
|
-
p :login_form, id: 'open'
|
20
|
-
text_field :username, id: 'username'
|
21
|
-
text_field :password, id: 'password'
|
22
|
-
button :login, id: 'login-button'
|
23
|
-
|
24
|
-
def login_as_admin
|
25
|
-
login_form.click
|
26
|
-
username.set 'admin'
|
27
|
-
password.set 'admin'
|
28
|
-
login.click
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
class Weight
|
33
|
-
attach Symbiont
|
34
|
-
|
35
|
-
url_is 'http://localhost:9292/weight'
|
36
|
-
|
37
|
-
text_field :weight, id: 'wt', index: 0
|
38
|
-
button :calculate, id: 'calculate'
|
39
|
-
|
40
|
-
def convert(value)
|
41
|
-
weight.set value
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
class Practice
|
46
|
-
attach Symbiont
|
47
|
-
|
48
|
-
url_is 'http://localhost:9292/practice'
|
49
|
-
url_matches /:\d{4}/
|
50
|
-
title_is 'Dialogic - Practice Page'
|
51
|
-
|
52
|
-
checkbox :enable_sith_list, id: 'toggleSith'
|
53
|
-
select_list :sith_power, id: 'sith'
|
54
|
-
select_list :physics_concept, id: 'physics'
|
55
|
-
|
56
|
-
button :alert, id: 'alertButton'
|
57
|
-
button :confirm, id: 'confirmButton'
|
58
|
-
button :prompt, id: 'promptButton'
|
59
|
-
|
60
|
-
link :view_in_frame, id: 'framed_page'
|
61
|
-
|
62
|
-
iframe :boxframe, class: 'fancybox-iframe'
|
63
|
-
|
64
|
-
text_field :weight, -> { boxframe.text_field(id: 'wt') }
|
65
|
-
|
66
|
-
article :practice, id: 'practice'
|
67
|
-
|
68
|
-
a :page_link do |text|
|
69
|
-
practice.a(text: text)
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
def non_framed
|
74
|
-
@page = Weight.new(@driver)
|
75
|
-
@page.view
|
76
|
-
@page.weight.set '200'
|
77
|
-
@page.calculate.click
|
78
|
-
end
|
79
|
-
|
80
|
-
def framed
|
81
|
-
@page = Practice.new(@driver)
|
82
|
-
@page.view
|
83
|
-
##@page.view_in_frame.click
|
84
|
-
@page.page_link('View Weight Calculator in Frame').click
|
85
|
-
@page.weight.set '200'
|
86
|
-
|
87
|
-
##on_view(Practice).page_link('View Weight Calculator in Frame').click
|
88
|
-
end
|
89
|
-
|
90
|
-
def basic
|
91
|
-
@page = Practice.new(@driver)
|
92
|
-
@page.should be_a_kind_of(Symbiont)
|
93
|
-
@page.should be_an_instance_of(Practice)
|
94
|
-
|
95
|
-
@page.view
|
96
|
-
@page.has_correct_url?
|
97
|
-
@page.has_correct_title?
|
98
|
-
|
99
|
-
@page.should have_correct_url
|
100
|
-
@page.should have_correct_title
|
101
|
-
|
102
|
-
expect(@page.url).to eq('http://localhost:9292/practice')
|
103
|
-
@page.markup.include?('<strong id="group">Apocalypticists Unite</strong>').should be_true
|
104
|
-
@page.text.include?('LEAST FAVORITE WAY').should be_true
|
105
|
-
expect(@page.title).to eq('Dialogic - Practice Page')
|
106
|
-
|
107
|
-
script = <<-JS
|
108
|
-
return arguments[0].innerHTML
|
109
|
-
JS
|
110
|
-
|
111
|
-
result = @page.run_script(script, @page.view_in_frame)
|
112
|
-
expect(result).to eq('View Weight Calculator in Frame')
|
113
|
-
end
|
114
|
-
|
115
|
-
def factory
|
116
|
-
on_view(Weight)
|
117
|
-
on(Weight).convert('200')
|
118
|
-
on(Weight).calculate.click
|
119
|
-
|
120
|
-
on(Weight) do
|
121
|
-
@active.convert('200')
|
122
|
-
@active.calculate.click
|
123
|
-
end
|
124
|
-
|
125
|
-
on(Weight) do |page|
|
126
|
-
page.convert('200')
|
127
|
-
page.calculate.click
|
128
|
-
end
|
129
|
-
end
|
130
|
-
|
131
|
-
def javascript_dialogs
|
132
|
-
response = @page.will_alert { @page.alert.click }
|
133
|
-
expect(response).to eq 'Alert Message Received'
|
134
|
-
|
135
|
-
response = @page.will_confirm(false) { @page.confirm.click }
|
136
|
-
expect(response).to eq 'Confirmation Message Received'
|
137
|
-
|
138
|
-
response = @page.will_prompt("magenta") { @page.prompt.click }
|
139
|
-
expect(response[:message]).to eq('Favorite Color')
|
140
|
-
expect(response[:default_value]).to eq('blue')
|
141
|
-
end
|
142
|
-
|
143
|
-
def wait_state
|
144
|
-
Watir::Wait.until { @page.weight.exists? }
|
145
|
-
@page.weight.when_present.set '200'
|
146
|
-
end
|
147
|
-
|
148
|
-
#basic
|
149
|
-
|
150
|
-
symbiont_browser
|
151
|
-
|
152
|
-
@page = Dialogic.new(@browser)
|
153
|
-
@page.view
|
154
|
-
@page.login_as_admin
|
155
|
-
|
156
|
-
@page = Practice.new(@browser)
|
157
|
-
@page.view
|
158
|
-
@page.enable_sith_list.set
|
159
|
-
@page.sith_power.select 'Sundering Assault'
|