cello 0.0.19 → 0.0.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/Gemfile +1 -0
- data/README.md +33 -14
- data/Rakefile +3 -1
- data/bin/cello +4 -0
- data/features/pages/firefox.rb +1 -1
- data/features/pages/headless.rb +1 -1
- data/features/pages/input_fields.rb +1 -1
- data/features/pages/response_page.rb +1 -1
- data/features/support/env.rb +2 -0
- data/lib/cello/Elem.rb +0 -0
- data/lib/cello/commands/help.rb +29 -0
- data/lib/cello/commands/main.rb +29 -0
- data/lib/cello/commands/version.rb +7 -0
- data/lib/cello/commands.rb +2 -0
- data/lib/cello/{structure → pageobjects}/browser.rb +1 -1
- data/lib/cello/{structure → pageobjects}/html_elements/button_helper.rb +1 -1
- data/lib/cello/{structure → pageobjects}/html_elements/checkbox_helper.rb +1 -1
- data/lib/cello/{structure → pageobjects}/html_elements/div_helper.rb +1 -1
- data/lib/cello/{structure → pageobjects}/html_elements/dsl.rb +1 -1
- data/lib/cello/{structure → pageobjects}/html_elements/element_helper.rb +1 -1
- data/lib/cello/{structure → pageobjects}/html_elements/hidden_helper.rb +1 -1
- data/lib/cello/{structure → pageobjects}/html_elements/link_helper.rb +1 -1
- data/lib/cello/{structure → pageobjects}/html_elements/logger.rb +1 -1
- data/lib/cello/{structure → pageobjects}/html_elements/radio_helper.rb +1 -1
- data/lib/cello/{structure → pageobjects}/html_elements/select_helper.rb +1 -1
- data/lib/cello/{structure → pageobjects}/html_elements/span_helper.rb +1 -1
- data/lib/cello/{structure → pageobjects}/html_elements/textarea_helper.rb +1 -1
- data/lib/cello/{structure → pageobjects}/html_elements/textfield_helper.rb +1 -1
- data/lib/cello/{structure → pageobjects}/page.rb +2 -3
- data/lib/cello/pageobjects/recorder.rb +32 -0
- data/lib/cello/version.rb +1 -1
- data/lib/cello.rb +18 -3
- data/spec/button_spec.rb +3 -2
- data/spec/checkbox_spec.rb +1 -1
- data/spec/div_spec.rb +3 -2
- data/spec/element_spec.rb +1 -0
- data/spec/hidden_spec.rb +3 -2
- data/spec/link_spec.rb +3 -2
- data/spec/mock/page.rb +3 -2
- data/spec/page_spec.rb +3 -2
- data/spec/radio_spec.rb +3 -2
- data/spec/select_spec.rb +2 -1
- data/spec/span_spec.rb +3 -2
- data/spec/spec_helper.rb +3 -1
- data/spec/textarea_spec.rb +2 -1
- data/spec/textfield_spec.rb +2 -1
- metadata +26 -22
- data/examples/bugbang/flows/search.feature +0 -19
- data/examples/bugbang/flows/step_definitions/search.rb +0 -43
- data/examples/bugbang/flows/support/env.rb +0 -1
- data/examples/bugbang/pages/home.rb +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 385bfdd2bf71d6f2f4cadac48705f8fd8a329e33
|
4
|
+
data.tar.gz: a2c108a775c8006f4e9bffba6ef09624d6af3533
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a00f9bf782f16486ad9f7a07df92b2edc1f04f648567e844f7b492b1a470ea39c5302f1688c63040d3cad97e601d6074c80a445c4899ae9c78a2a8ff7ddcbe16
|
7
|
+
data.tar.gz: 155fd1998bb0c23a5e53ba86b668d72db16cb744bdf16494275d75605f0693c2588a2a5e40c27fa65254cf782b0e1b8444941735b936d6a90f4c3e7adee64215
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,19 +1,35 @@
|
|
1
|
-
CELLO
|
1
|
+
CELLO
|
2
2
|
=====
|
3
|
-
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/cello.png)](http://badge.fury.io/rb/cello)
|
4
4
|
[![Build Status](https://secure.travis-ci.org/camiloribeiro/cello.png)](http://travis-ci.org/camiloribeiro/cello)
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
The
|
15
|
-
|
16
|
-
|
5
|
+
[![Code Climate](https://codeclimate.com/github/camiloribeiro/cello.png)](https://codeclimate.com/github/camiloribeiro/cello)
|
6
|
+
[![Dependency Status](https://gemnasium.com/camiloribeiro/cello.png)](https://gemnasium.com/camiloribeiro/cello)
|
7
|
+
[![Coverage Status](https://coveralls.io/repos/camiloribeiro/cello/badge.png)](https://coveralls.io/r/camiloribeiro/cello)
|
8
|
+
[![endorse](https://api.coderwall.com/camiloribeiro/endorsecount.png)](https://coderwall.com/camiloribeiro)
|
9
|
+
|
10
|
+
|
11
|
+
,;,
|
12
|
+
#(|)# Cello is a framework for automated web UI tests based on Watir-Webdriver.
|
13
|
+
#|||# It may uses the Cucumber readable behavior specification language.
|
14
|
+
||| The tests are based on the Page Object Model, in a lightweght and intuitive way.
|
15
|
+
||| / It is written in Ruby, and extended by metaprogramming and some magic.
|
16
|
+
||| /#/
|
17
|
+
_|||_ / / Cello isn't officially released or stable yet, but the concept is already done.
|
18
|
+
.' ||| '/ / It consists in a a group of patterns for describing your pages as classes.
|
19
|
+
/ ||| / / The interface is designed by a DSL focussing in the Browser's user.
|
20
|
+
| |||/ /|
|
21
|
+
|_ ||/ /_| You can control as many browsers as needed, and create iteractions between actors.
|
22
|
+
,_)=|/|/ ( You can also get a page with its elements by running a "cello get url".
|
23
|
+
) /|/ ( This is the way we can use the "record" feature to make it easier to automate.
|
24
|
+
/ /|/| \
|
25
|
+
| / /|| | It uses metaprog, so it doesn't rely in bad generated code from the rec feature.
|
26
|
+
| / /~~~/ | It merges the power of selenium, the page object model and gherkin documentation.
|
27
|
+
\/ / \ / /
|
28
|
+
/`/.__Y__.-'
|
29
|
+
/#/ |
|
30
|
+
|
|
31
|
+
!
|
32
|
+
|
17
33
|
What is the idea?
|
18
34
|
-----------------
|
19
35
|
The core idea is based on two techniques and lots of ideas:
|
@@ -88,6 +104,8 @@ ROADMAP
|
|
88
104
|
|
89
105
|
- DDT: Data driven testing by nature
|
90
106
|
|
107
|
+
ASCII Image: http://www.geocities.com/spunk1111/music.htm
|
108
|
+
|
91
109
|
LICENSE
|
92
110
|
=======
|
93
111
|
|
@@ -101,3 +119,4 @@ http://www.apache.org/licenses/LICENSE-2.0
|
|
101
119
|
|
102
120
|
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
103
121
|
|
122
|
+
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/camiloribeiro/cello/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
|
data/Rakefile
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
require "cucumber/rake/task"
|
2
2
|
require 'rspec/core/rake_task'
|
3
|
+
require 'coveralls/rake/task'
|
4
|
+
Coveralls::RakeTask.new
|
3
5
|
|
4
|
-
task :default => [:spec,:run]
|
6
|
+
task :default => [:spec,:run, 'coveralls:push']
|
5
7
|
|
6
8
|
RSpec::Core::RakeTask .new(:spec) do |task|
|
7
9
|
task.rspec_opts = ["--format documentation"]
|
data/bin/cello
ADDED
data/features/pages/firefox.rb
CHANGED
data/features/pages/headless.rb
CHANGED
@@ -2,7 +2,7 @@ require "cello"
|
|
2
2
|
|
3
3
|
module StaticPages
|
4
4
|
module Site
|
5
|
-
class InputPage < Cello::
|
5
|
+
class InputPage < Cello::PageObjects::Page
|
6
6
|
element :text_field, :text_field, :id => 'text1'
|
7
7
|
element :text_fieldname, :text_field, :name => 'text1'
|
8
8
|
element :text_fieldxpath, :text_field, :xpah, '//*[@id="text1"]'
|
data/features/support/env.rb
CHANGED
data/lib/cello/Elem.rb
ADDED
File without changes
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class Cello::Commands::Help
|
2
|
+
|
3
|
+
def self.run
|
4
|
+
puts <<-HELP
|
5
|
+
Usage: cello <command> [options*]
|
6
|
+
|
7
|
+
cello version #{Cello::VERSION}: Cucumber Page-Object integration made easy
|
8
|
+
|
9
|
+
Available commands:
|
10
|
+
|
11
|
+
help Show this help text
|
12
|
+
|
13
|
+
-nP, --new-project Creates the structure of a cello project
|
14
|
+
-np, --new-page Curl the page and creates the page object for that url
|
15
|
+
-nf, --new-feature Creates a new feature file and its step definition
|
16
|
+
|
17
|
+
-r, --run-tests Runs all the tests
|
18
|
+
-w, --run-wip Runs all the tests
|
19
|
+
|
20
|
+
-d, --debbug Runs all the tests
|
21
|
+
|
22
|
+
--version, -v: Print version and exit
|
23
|
+
--help, -h: Show this message
|
24
|
+
|
25
|
+
For more support read our api >> http://rubydoc.info/gems/cello
|
26
|
+
Have a nice day :)
|
27
|
+
HELP
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class Cello::Commands::Main
|
2
|
+
|
3
|
+
class << self
|
4
|
+
|
5
|
+
def run(args=ARGV)
|
6
|
+
cmd = args.shift
|
7
|
+
|
8
|
+
case cmd
|
9
|
+
when "-h", "--help", NilClass
|
10
|
+
Cello::Commands::Help.run
|
11
|
+
exit 0
|
12
|
+
when "-v", "--version", "version"
|
13
|
+
Cello::Commands::Version.run
|
14
|
+
exit 0
|
15
|
+
when "-np", "--create-project", "newproject"
|
16
|
+
Cello::Commands::CreatePage.run
|
17
|
+
exit 0
|
18
|
+
end
|
19
|
+
|
20
|
+
unless system("cello #{cmd}", *args)
|
21
|
+
if $?.exitstatus == 127 # bash 'command not found'
|
22
|
+
puts "Unknown subcommand #{cmd.inspect}"
|
23
|
+
Cello::Commands::Help.run
|
24
|
+
exit 127
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -1,11 +1,10 @@
|
|
1
1
|
require File.join(File.dirname(__FILE__), "./html_elements/element_helper")
|
2
|
-
require "rubygems"
|
3
2
|
require "rspec"
|
4
3
|
|
5
4
|
module Cello
|
6
|
-
module
|
5
|
+
module PageObjects
|
7
6
|
class Page
|
8
|
-
extend Cello::
|
7
|
+
extend Cello::PageObjects::ElementHelper
|
9
8
|
attr_reader :engine
|
10
9
|
|
11
10
|
def initialize(engine)
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require "rest-client"
|
2
|
+
|
3
|
+
class Elem < Struct.new(:element_id, :element_name, :element_type); end
|
4
|
+
class Recorder
|
5
|
+
def get_elements page_url
|
6
|
+
foo = RestClient.get page_url
|
7
|
+
title = foo.scan(/\<title\>(.*?)\<\/title\>/)[0].to_s.gsub!(/\W+/, ' ').strip!.split(" ").each { |w| w.capitalize! }.join("")
|
8
|
+
page = "require 'cello'\n"
|
9
|
+
page += "class #{title} < Cello::PageObjects::Page\n\n"
|
10
|
+
ary = Array.new()
|
11
|
+
foo.scan(/\<input(.*?)\>/).each do |raw_element|
|
12
|
+
bar = Elem.new nil, nil, nil
|
13
|
+
raw_element.to_s.split(" ").each do |element|
|
14
|
+
bar.element_type = element.split("=")[1].gsub!(/\W+/, '') if !element.scan(/type/).empty?
|
15
|
+
bar.element_name = element.split("=")[1].gsub!(/\W+/, '') if !element.scan(/name/).empty?
|
16
|
+
bar.element_id = element.split("=")[1].gsub!(/\W+/, '') if !element.scan(/id/).empty?
|
17
|
+
end
|
18
|
+
ary.push bar if (!bar.element_type.nil? && (!bar.element_id.nil? || !bar.element_name.nil?))
|
19
|
+
end
|
20
|
+
|
21
|
+
ary.each do |yup|
|
22
|
+
key = ":id"
|
23
|
+
yup.element_name = yup.element_id if yup.element_name.nil?
|
24
|
+
key = ":name" if yup.element_id.nil?
|
25
|
+
yup.element_id = yup.element_name if yup.element_id.nil?
|
26
|
+
page += " element :#{yup.element_name}, :#{yup.element_type}, #{key} => '#{yup.element_id }'\n" if !yup.element_type.empty? && !yup.element_type != "hidden"
|
27
|
+
end
|
28
|
+
page += "\n url(\"#{page_url}\")\n\n"
|
29
|
+
page += "end\n"
|
30
|
+
page
|
31
|
+
end
|
32
|
+
end
|
data/lib/cello/version.rb
CHANGED
data/lib/cello.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require File.join(File.dirname(__FILE__), './cello/version')
|
2
|
-
require 'rubygems'
|
3
2
|
require 'bundler/setup'
|
4
3
|
|
5
4
|
#common dependencies
|
@@ -7,9 +6,25 @@ require 'selenium-webdriver'
|
|
7
6
|
require 'watir-webdriver'
|
8
7
|
require 'cucumber'
|
9
8
|
|
9
|
+
#Modules
|
10
|
+
require File.join(File.dirname(__FILE__), './cello/pageobjects')
|
11
|
+
require File.join(File.dirname(__FILE__), './cello/structure')
|
12
|
+
require File.join(File.dirname(__FILE__), './cello/commands')
|
13
|
+
|
14
|
+
|
10
15
|
#internal dependences
|
11
|
-
require File.join(File.dirname(__FILE__), './cello/
|
12
|
-
require File.join(File.dirname(__FILE__), './cello/
|
16
|
+
require File.join(File.dirname(__FILE__), './cello/pageobjects/page')
|
17
|
+
require File.join(File.dirname(__FILE__), './cello/pageobjects/browser')
|
18
|
+
require File.join(File.dirname(__FILE__), './cello/pageobjects/recorder')
|
19
|
+
|
20
|
+
require File.join(File.dirname(__FILE__), './cello/structure/new_project')
|
21
|
+
|
22
|
+
# commands
|
23
|
+
require 'cello/commands'
|
24
|
+
require File.join(File.dirname(__FILE__), './cello/commands/main')
|
25
|
+
require File.join(File.dirname(__FILE__), './cello/commands/help')
|
26
|
+
require File.join(File.dirname(__FILE__), './cello/commands/version')
|
27
|
+
require File.join(File.dirname(__FILE__), './cello/commands/new_project')
|
13
28
|
|
14
29
|
module Cello
|
15
30
|
end
|
data/spec/button_spec.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), '../lib/cello/
|
1
|
+
require File.join(File.dirname(__FILE__), '../lib/cello/pageobjects/html_elements/button_helper.rb')
|
2
|
+
require File.dirname(__FILE__) + "/spec_helper"
|
2
3
|
|
3
|
-
describe Cello::
|
4
|
+
describe Cello::PageObjects::ButtonHelper do
|
4
5
|
describe "define_extras_for_button" do
|
5
6
|
end
|
6
7
|
end
|
data/spec/checkbox_spec.rb
CHANGED
data/spec/div_spec.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), '../lib/cello/
|
1
|
+
require File.join(File.dirname(__FILE__), '../lib/cello/pageobjects/html_elements/div_helper.rb')
|
2
|
+
require File.dirname(__FILE__) + "/spec_helper"
|
2
3
|
|
3
|
-
describe Cello::
|
4
|
+
describe Cello::PageObjects::DivHelper do
|
4
5
|
describe "define_extras_for_div" do
|
5
6
|
end
|
6
7
|
end
|
data/spec/element_spec.rb
CHANGED
data/spec/hidden_spec.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), '../lib/cello/
|
1
|
+
require File.join(File.dirname(__FILE__), '../lib/cello/pageobjects/html_elements/hidden_helper.rb')
|
2
|
+
require File.dirname(__FILE__) + "/spec_helper"
|
2
3
|
|
3
|
-
describe Cello::
|
4
|
+
describe Cello::PageObjects::HiddenHelper do
|
4
5
|
describe "define_extras_for_hidden" do
|
5
6
|
end
|
6
7
|
end
|
data/spec/link_spec.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), '../lib/cello/
|
1
|
+
require File.join(File.dirname(__FILE__), '../lib/cello/pageobjects/html_elements/link_helper.rb')
|
2
|
+
require File.dirname(__FILE__) + "/spec_helper"
|
2
3
|
|
3
|
-
describe Cello::
|
4
|
+
describe Cello::PageObjects::LinkHelper do
|
4
5
|
describe "define_extras_for_link" do
|
5
6
|
end
|
6
7
|
end
|
data/spec/mock/page.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__),"../../lib/cello/
|
1
|
+
require File.join(File.dirname(__FILE__),"../../lib/cello/pageobjects/page")
|
2
|
+
require File.dirname(__FILE__) + "/../spec_helper"
|
2
3
|
|
3
4
|
module Mock
|
4
5
|
module Site
|
5
|
-
class MockPage < Cello::
|
6
|
+
class MockPage < Cello::PageObjects::Page
|
6
7
|
element :element, :element, :id => 'elem1'
|
7
8
|
element :text_field, :text_field, :id => 'text1'
|
8
9
|
element :text_fieldname, :text_field, :name => 'text1'
|
data/spec/page_spec.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), '../lib/cello/
|
1
|
+
require File.join(File.dirname(__FILE__), '../lib/cello/pageobjects/page.rb')
|
2
|
+
require File.dirname(__FILE__) + "/spec_helper"
|
2
3
|
|
3
|
-
describe Cello::
|
4
|
+
describe Cello::PageObjects::Page do
|
4
5
|
describe "Create a page" do
|
5
6
|
end
|
6
7
|
describe "Visit the page" do
|
data/spec/radio_spec.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), '../lib/cello/
|
1
|
+
require File.join(File.dirname(__FILE__), '../lib/cello/pageobjects/html_elements/radio_helper.rb')
|
2
|
+
require File.dirname(__FILE__) + "/spec_helper"
|
2
3
|
|
3
|
-
describe Cello::
|
4
|
+
describe Cello::PageObjects::RadioHelper do
|
4
5
|
describe "define_extras_for_radio" do
|
5
6
|
it "Verify if the radio collection contains an specific radio" do
|
6
7
|
end
|
data/spec/select_spec.rb
CHANGED
data/spec/span_spec.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), '../lib/cello/
|
1
|
+
require File.join(File.dirname(__FILE__), '../lib/cello/pageobjects/html_elements/span_helper.rb')
|
2
|
+
require File.dirname(__FILE__) + "/spec_helper"
|
2
3
|
|
3
|
-
describe Cello::
|
4
|
+
describe Cello::PageObjects::SpanHelper do
|
4
5
|
describe "define_extras_for_Span" do
|
5
6
|
end
|
6
7
|
end
|
data/spec/spec_helper.rb
CHANGED
data/spec/textarea_spec.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "mock/page"
|
2
|
+
require File.dirname(__FILE__) + "/spec_helper"
|
2
3
|
|
3
|
-
describe Cello::
|
4
|
+
describe Cello::PageObjects::TextareaHelper do
|
4
5
|
describe "define_extras_for_textarea" do
|
5
6
|
before(:all) do
|
6
7
|
@page = Mock::Site::MockPage.new "foo"
|
data/spec/textfield_spec.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "mock/page"
|
2
|
+
require File.dirname(__FILE__) + "/spec_helper"
|
2
3
|
|
3
|
-
describe Cello::
|
4
|
+
describe Cello::PageObjects::TextfieldHelper do
|
4
5
|
describe "define_extras_for_textfield" do
|
5
6
|
before(:all) do
|
6
7
|
@page = Mock::Site::MockPage.new "foo"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cello
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Camilo Ribeiro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|
@@ -195,7 +195,8 @@ dependencies:
|
|
195
195
|
description: Cello is a framework that allows automate acceptance tests using page-object
|
196
196
|
email:
|
197
197
|
- cribeiro@thoughtworks.com
|
198
|
-
executables:
|
198
|
+
executables:
|
199
|
+
- cello
|
199
200
|
extensions: []
|
200
201
|
extra_rdoc_files: []
|
201
202
|
files:
|
@@ -207,11 +208,8 @@ files:
|
|
207
208
|
- LICENCE
|
208
209
|
- README.md
|
209
210
|
- Rakefile
|
211
|
+
- bin/cello
|
210
212
|
- cello.gemspec
|
211
|
-
- examples/bugbang/flows/search.feature
|
212
|
-
- examples/bugbang/flows/step_definitions/search.rb
|
213
|
-
- examples/bugbang/flows/support/env.rb
|
214
|
-
- examples/bugbang/pages/home.rb
|
215
213
|
- features/access_element.feature
|
216
214
|
- features/browser.feature
|
217
215
|
- features/button.feature
|
@@ -243,21 +241,27 @@ files:
|
|
243
241
|
- features/textarea.feature
|
244
242
|
- features/textfield.feature
|
245
243
|
- lib/cello.rb
|
246
|
-
- lib/cello/
|
247
|
-
- lib/cello/
|
248
|
-
- lib/cello/
|
249
|
-
- lib/cello/
|
250
|
-
- lib/cello/
|
251
|
-
- lib/cello/
|
252
|
-
- lib/cello/
|
253
|
-
- lib/cello/
|
254
|
-
- lib/cello/
|
255
|
-
- lib/cello/
|
256
|
-
- lib/cello/
|
257
|
-
- lib/cello/
|
258
|
-
- lib/cello/
|
259
|
-
- lib/cello/
|
260
|
-
- lib/cello/
|
244
|
+
- lib/cello/Elem.rb
|
245
|
+
- lib/cello/commands.rb
|
246
|
+
- lib/cello/commands/help.rb
|
247
|
+
- lib/cello/commands/main.rb
|
248
|
+
- lib/cello/commands/version.rb
|
249
|
+
- lib/cello/pageobjects/browser.rb
|
250
|
+
- lib/cello/pageobjects/html_elements/button_helper.rb
|
251
|
+
- lib/cello/pageobjects/html_elements/checkbox_helper.rb
|
252
|
+
- lib/cello/pageobjects/html_elements/div_helper.rb
|
253
|
+
- lib/cello/pageobjects/html_elements/dsl.rb
|
254
|
+
- lib/cello/pageobjects/html_elements/element_helper.rb
|
255
|
+
- lib/cello/pageobjects/html_elements/hidden_helper.rb
|
256
|
+
- lib/cello/pageobjects/html_elements/link_helper.rb
|
257
|
+
- lib/cello/pageobjects/html_elements/logger.rb
|
258
|
+
- lib/cello/pageobjects/html_elements/radio_helper.rb
|
259
|
+
- lib/cello/pageobjects/html_elements/select_helper.rb
|
260
|
+
- lib/cello/pageobjects/html_elements/span_helper.rb
|
261
|
+
- lib/cello/pageobjects/html_elements/textarea_helper.rb
|
262
|
+
- lib/cello/pageobjects/html_elements/textfield_helper.rb
|
263
|
+
- lib/cello/pageobjects/page.rb
|
264
|
+
- lib/cello/pageobjects/recorder.rb
|
261
265
|
- lib/cello/version.rb
|
262
266
|
- spec/button_spec.rb
|
263
267
|
- spec/checkbox_spec.rb
|
@@ -1,19 +0,0 @@
|
|
1
|
-
Feature: Search
|
2
|
-
As a Bug Bang reader
|
3
|
-
I want to navigate on the basic scenarios
|
4
|
-
|
5
|
-
Scenario: Basic search for common users
|
6
|
-
Given I am on The Bug Bang Theory home page
|
7
|
-
When I write "Camilo Ribeiro" on search field
|
8
|
-
And ask to search
|
9
|
-
Then I should see the follow results:
|
10
|
-
| BugBang Responde I: Horas x Qualidade (A eterna briga das empresas) |
|
11
|
-
| The Bugbang Theory |
|
12
|
-
| Penso, logo automatizo |
|
13
|
-
| The Bug Bang Theory 2.0 – Agile and Technical Testing Rocks! |
|
14
|
-
|
15
|
-
Scenario: Going to about page
|
16
|
-
Given I am on The Bug Bang Theory home page
|
17
|
-
When I go to about page
|
18
|
-
Then I should see the text "Camilo Ribeiro"
|
19
|
-
|
@@ -1,43 +0,0 @@
|
|
1
|
-
Dir[File.dirname(__FILE__) + "/../../pages/*.rb"].each do |file|
|
2
|
-
require file
|
3
|
-
end
|
4
|
-
|
5
|
-
Given /^I am on The Bug Bang Theory home page$/ do
|
6
|
-
@home = BugBang::HomePage.new
|
7
|
-
end
|
8
|
-
|
9
|
-
When /^I write "(.*?)" on search field$/ do |search_text|
|
10
|
-
@home.search_field_fill_with(search_text)
|
11
|
-
end
|
12
|
-
|
13
|
-
When /^ask to search$/ do
|
14
|
-
@home.search_button_click
|
15
|
-
end
|
16
|
-
|
17
|
-
Then /^I should see the follow results:$/ do |results|
|
18
|
-
results.hashes.each do |text|
|
19
|
-
@home.search text.to_s
|
20
|
-
end
|
21
|
-
@home.get_picture
|
22
|
-
embed 'screenshot.png', 'image/png'
|
23
|
-
@home.close
|
24
|
-
end
|
25
|
-
|
26
|
-
When /^I go to about page$/ do
|
27
|
-
@home.about_page_button_click
|
28
|
-
end
|
29
|
-
|
30
|
-
Then /^I should see the text "(.*?)"$/ do |text|
|
31
|
-
@home.search text.to_s
|
32
|
-
@home.get_picture
|
33
|
-
embed 'screenshot.png', 'image/png'
|
34
|
-
@home.close
|
35
|
-
end
|
36
|
-
|
37
|
-
Then /^I want see the the last twelve postblog session$/ do
|
38
|
-
pending # express the regexp above with the code you wish you had
|
39
|
-
end
|
40
|
-
|
41
|
-
Then /^It should be twelve links$/ do
|
42
|
-
pending # express the regexp above with the code you wish you had
|
43
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
|
@@ -1,27 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), '../../../lib/cello/structure/page')
|
2
|
-
|
3
|
-
module BugBang
|
4
|
-
class HomePage < Cello::Structure::Page
|
5
|
-
element :search_field, :text_field, :id => 's'
|
6
|
-
element :search_button, :button, :id => 'go'
|
7
|
-
element :about_page_button, :span, :text => 'Sobre o Autor'
|
8
|
-
element :last_twelve_Posts, :div, :text => 'Ultimos 20 posts'
|
9
|
-
|
10
|
-
@@url = 'http://bugbang.com.br/'
|
11
|
-
def initialize
|
12
|
-
super(@@url)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
class SearchResultPage < Cello::Structure::Page
|
17
|
-
def initialize
|
18
|
-
super(@@url)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
class AboutPage < Cello::Structure::Page
|
23
|
-
def initialize
|
24
|
-
super(@@url)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|