cello 0.0.19 → 0.0.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/Gemfile +1 -0
  4. data/README.md +33 -14
  5. data/Rakefile +3 -1
  6. data/bin/cello +4 -0
  7. data/features/pages/firefox.rb +1 -1
  8. data/features/pages/headless.rb +1 -1
  9. data/features/pages/input_fields.rb +1 -1
  10. data/features/pages/response_page.rb +1 -1
  11. data/features/support/env.rb +2 -0
  12. data/lib/cello/Elem.rb +0 -0
  13. data/lib/cello/commands/help.rb +29 -0
  14. data/lib/cello/commands/main.rb +29 -0
  15. data/lib/cello/commands/version.rb +7 -0
  16. data/lib/cello/commands.rb +2 -0
  17. data/lib/cello/{structure → pageobjects}/browser.rb +1 -1
  18. data/lib/cello/{structure → pageobjects}/html_elements/button_helper.rb +1 -1
  19. data/lib/cello/{structure → pageobjects}/html_elements/checkbox_helper.rb +1 -1
  20. data/lib/cello/{structure → pageobjects}/html_elements/div_helper.rb +1 -1
  21. data/lib/cello/{structure → pageobjects}/html_elements/dsl.rb +1 -1
  22. data/lib/cello/{structure → pageobjects}/html_elements/element_helper.rb +1 -1
  23. data/lib/cello/{structure → pageobjects}/html_elements/hidden_helper.rb +1 -1
  24. data/lib/cello/{structure → pageobjects}/html_elements/link_helper.rb +1 -1
  25. data/lib/cello/{structure → pageobjects}/html_elements/logger.rb +1 -1
  26. data/lib/cello/{structure → pageobjects}/html_elements/radio_helper.rb +1 -1
  27. data/lib/cello/{structure → pageobjects}/html_elements/select_helper.rb +1 -1
  28. data/lib/cello/{structure → pageobjects}/html_elements/span_helper.rb +1 -1
  29. data/lib/cello/{structure → pageobjects}/html_elements/textarea_helper.rb +1 -1
  30. data/lib/cello/{structure → pageobjects}/html_elements/textfield_helper.rb +1 -1
  31. data/lib/cello/{structure → pageobjects}/page.rb +2 -3
  32. data/lib/cello/pageobjects/recorder.rb +32 -0
  33. data/lib/cello/version.rb +1 -1
  34. data/lib/cello.rb +18 -3
  35. data/spec/button_spec.rb +3 -2
  36. data/spec/checkbox_spec.rb +1 -1
  37. data/spec/div_spec.rb +3 -2
  38. data/spec/element_spec.rb +1 -0
  39. data/spec/hidden_spec.rb +3 -2
  40. data/spec/link_spec.rb +3 -2
  41. data/spec/mock/page.rb +3 -2
  42. data/spec/page_spec.rb +3 -2
  43. data/spec/radio_spec.rb +3 -2
  44. data/spec/select_spec.rb +2 -1
  45. data/spec/span_spec.rb +3 -2
  46. data/spec/spec_helper.rb +3 -1
  47. data/spec/textarea_spec.rb +2 -1
  48. data/spec/textfield_spec.rb +2 -1
  49. metadata +26 -22
  50. data/examples/bugbang/flows/search.feature +0 -19
  51. data/examples/bugbang/flows/step_definitions/search.rb +0 -43
  52. data/examples/bugbang/flows/support/env.rb +0 -1
  53. data/examples/bugbang/pages/home.rb +0 -27
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 67bd151cb71e969f4df8da32909adc3daf0a4b1e
4
- data.tar.gz: 4feabc3cbf257c091d75de65d3c3a41dc56308ff
3
+ metadata.gz: 385bfdd2bf71d6f2f4cadac48705f8fd8a329e33
4
+ data.tar.gz: a2c108a775c8006f4e9bffba6ef09624d6af3533
5
5
  SHA512:
6
- metadata.gz: 549d76e7ce6d9bd7a9ca225972825b2796dc4e09279f6a9e2b385fcb38bf64a1d10270c4b88d01e7878ac2274baff094d8abbb596c421b04dc85cf4218500411
7
- data.tar.gz: 1d5b5d37fb87ce83004d309486475e1f4abe6e2d857dce327ececeb8c7026a80548162717385428393e60788835749508e43ee01ab2aed10f8225520021d1cdd
6
+ metadata.gz: a00f9bf782f16486ad9f7a07df92b2edc1f04f648567e844f7b492b1a470ea39c5302f1688c63040d3cad97e601d6074c80a445c4899ae9c78a2a8ff7ddcbe16
7
+ data.tar.gz: 155fd1998bb0c23a5e53ba86b668d72db16cb744bdf16494275d75605f0693c2588a2a5e40c27fa65254cf782b0e1b8444941735b936d6a90f4c3e7adee64215
data/.gitignore CHANGED
@@ -1,3 +1,5 @@
1
1
  *.sw*
2
+ boot.sh
2
3
  Gemfile.lock
3
4
  *.gem
5
+ /coverage
data/Gemfile CHANGED
@@ -9,5 +9,6 @@ gem 'headless'
9
9
  gem 'rspec'
10
10
  gem "nyan-cat-formatter"
11
11
  gem "sourcify", "~> 0.5.0"
12
+ gem 'coveralls', require: false
12
13
 
13
14
  gemspec
data/README.md CHANGED
@@ -1,19 +1,35 @@
1
- CELLO ♩♪ ♮ d[^_^]b ♫ ♬ ♭♯
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
- What?
7
- -----
8
- Cello is a framework for automated web UI tests based on Watir-Webdriver. It uses the [Cucumber](http://cukes.info/) readable behavior specification language to specify tests based on the Page Object Model. It is written in Ruby, and extended by metaprogramming and magic.
9
-
10
- This framework isn't officially released or stable yet, but the concept is already done. It consists in a way to implement tests fast, like when we record using tools like the Seleium IDE, but without all the terrible code generated by those tools.
11
-
12
- What a funny name :-p!
13
- ----------------------
14
- The name is Cello not just because I play and love it, but because as a music composition consists of steps that when synchronized guide the musician to play wonderful songs, the acceptance automated tests are steps that when synchronized guide the developer to keep coding wonderful pieces of business value.
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
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require 'cello'
3
+
4
+ Cello::Commands::Main.run
@@ -2,7 +2,7 @@ require File.join(File.dirname(__FILE__), '../../lib/cello')
2
2
 
3
3
  module StaticPages
4
4
  module Site
5
- class Firefox < Cello::Structure::Browser
5
+ class Firefox < Cello::PageObjects::Browser
6
6
  def initialize
7
7
  super :firefox
8
8
  end
@@ -2,7 +2,7 @@ require "cello"
2
2
 
3
3
  module StaticPages
4
4
  module Site
5
- class Phantom < Cello::Structure::Browser
5
+ class Phantom < Cello::PageObjects::Browser
6
6
  def initialize
7
7
  super :phantomjs
8
8
  end
@@ -2,7 +2,7 @@ require "cello"
2
2
 
3
3
  module StaticPages
4
4
  module Site
5
- class InputPage < Cello::Structure::Page
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"]'
@@ -2,7 +2,7 @@ require File.join(File.dirname(__FILE__), '../../lib/cello')
2
2
 
3
3
  module StaticPages
4
4
  module Site
5
- class ResponsePage < Cello::Structure::Page
5
+ class ResponsePage < Cello::PageObjects::Page
6
6
  element :text, :text_field, :id => 'new_element'
7
7
 
8
8
  def get_url
@@ -1 +1,3 @@
1
+ require 'coveralls'
2
+ Coveralls.wear_merged!
1
3
 
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
@@ -0,0 +1,7 @@
1
+ class Cello::Commands::Version
2
+ class << self
3
+ def run(args=ARGV)
4
+ puts "cello version #{Cello::VERSION}"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,2 @@
1
+ module Cello::Commands
2
+ end
@@ -2,7 +2,7 @@ require "rubygems"
2
2
  require "watir-webdriver"
3
3
 
4
4
  module Cello
5
- module Structure
5
+ module PageObjects
6
6
  class Browser
7
7
  attr_accessor :context
8
8
  attr_reader :browser
@@ -1,5 +1,5 @@
1
1
  module Cello
2
- module Structure
2
+ module PageObjects
3
3
  module ButtonHelper
4
4
  def define_extras_for_button(name)
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module Cello
2
- module Structure
2
+ module PageObjects
3
3
  module CheckboxHelper
4
4
  def define_extras_for_checkbox(name)
5
5
  define_method "#{name}_check" do
@@ -1,5 +1,5 @@
1
1
  module Cello
2
- module Structure
2
+ module PageObjects
3
3
  module DivHelper
4
4
  def define_extras_for_div(name)
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module Cello
2
- module Structure
2
+ module PageObjects
3
3
  module DslHelper
4
4
  def def textfield_domain
5
5
  contains = "#{name}_contains"
@@ -3,7 +3,7 @@ Dir[File.dirname(__FILE__) + "/*.rb"].each do |file|
3
3
  end
4
4
 
5
5
  module Cello
6
- module Structure
6
+ module PageObjects
7
7
  module ElementHelper
8
8
 
9
9
  private
@@ -1,5 +1,5 @@
1
1
  module Cello
2
- module Structure
2
+ module PageObjects
3
3
  module HiddenHelper
4
4
  def define_extras_for_hidden(name)
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module Cello
2
- module Structure
2
+ module PageObjects
3
3
  module LinkHelper
4
4
  def define_extras_for_link(name)
5
5
  end
@@ -1,7 +1,7 @@
1
1
  #require 'sourcify'
2
2
 
3
3
  module Cello
4
- module Structure
4
+ module PageObjects
5
5
  module LogHelper
6
6
 
7
7
  def logger(name, method, type, params=nil)
@@ -1,5 +1,5 @@
1
1
  module Cello
2
- module Structure
2
+ module PageObjects
3
3
  module RadioHelper
4
4
  def define_extras_for_radios(name)
5
5
  define_method "#{name}_is_real?" do
@@ -1,5 +1,5 @@
1
1
  module Cello
2
- module Structure
2
+ module PageObjects
3
3
  module SelectHelper
4
4
  def define_extras_for_select(name)
5
5
  include LogHelper
@@ -1,5 +1,5 @@
1
1
  module Cello
2
- module Structure
2
+ module PageObjects
3
3
  module SpanHelper
4
4
  def define_extras_for_span(name)
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module Cello
2
- module Structure
2
+ module PageObjects
3
3
  module TextareaHelper
4
4
  def define_extras_for_textarea(name)
5
5
  define_method "#{name}_is_enable?" do
@@ -1,5 +1,5 @@
1
1
  module Cello
2
- module Structure
2
+ module PageObjects
3
3
  module TextfieldHelper
4
4
  def define_extras_for_text_field(name)
5
5
  define_method "#{name}_clear" do
@@ -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 Structure
5
+ module PageObjects
7
6
  class Page
8
- extend Cello::Structure::ElementHelper
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
@@ -1,3 +1,3 @@
1
1
  module Cello
2
- VERSION = "0.0.19"
2
+ VERSION = "0.0.21"
3
3
  end
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/structure/page')
12
- require File.join(File.dirname(__FILE__), './cello/structure/browser')
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/structure/html_elements/button_helper.rb')
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::Structure::ButtonHelper do
4
+ describe Cello::PageObjects::ButtonHelper do
4
5
  describe "define_extras_for_button" do
5
6
  end
6
7
  end
@@ -1,7 +1,7 @@
1
1
  require 'mock/page'
2
2
  require "pry"
3
3
 
4
- describe Cello::Structure::CheckboxHelper do
4
+ describe Cello::PageObjects::CheckboxHelper do
5
5
  describe "define_extras_for_checkbox" do
6
6
  before(:all) do
7
7
  @page = Mock::Site::MockPage.new "foo"
data/spec/div_spec.rb CHANGED
@@ -1,6 +1,7 @@
1
- require File.join(File.dirname(__FILE__), '../lib/cello/structure/html_elements/div_helper.rb')
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::Structure::DivHelper do
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
@@ -1,4 +1,5 @@
1
1
  require 'mock/page'
2
+ require File.dirname(__FILE__) + "/spec_helper"
2
3
 
3
4
  describe "Class with element" do
4
5
  describe "Element interface" do
data/spec/hidden_spec.rb CHANGED
@@ -1,6 +1,7 @@
1
- require File.join(File.dirname(__FILE__), '../lib/cello/structure/html_elements/hidden_helper.rb')
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::Structure::HiddenHelper do
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/structure/html_elements/link_helper.rb')
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::Structure::LinkHelper do
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/structure/page")
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::Structure::Page
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/structure/page.rb')
1
+ require File.join(File.dirname(__FILE__), '../lib/cello/pageobjects/page.rb')
2
+ require File.dirname(__FILE__) + "/spec_helper"
2
3
 
3
- describe Cello::Structure::Page do
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/structure/html_elements/radio_helper.rb')
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::Structure::RadioHelper do
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
@@ -1,6 +1,7 @@
1
1
  require "mock/page"
2
+ require File.dirname(__FILE__) + "/spec_helper"
2
3
 
3
- describe Cello::Structure::SelectHelper do
4
+ describe Cello::PageObjects::SelectHelper do
4
5
  describe "define_extras_for_select" do
5
6
  before(:all) do
6
7
  @page = Mock::Site::MockPage.new "foo"
data/spec/span_spec.rb CHANGED
@@ -1,6 +1,7 @@
1
- require File.join(File.dirname(__FILE__), '../lib/cello/structure/html_elements/span_helper.rb')
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::Structure::SpanHelper do
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
@@ -1,5 +1,7 @@
1
1
  require 'rspec'
2
- require 'sudoku'
2
+ require 'coveralls'
3
+
4
+ Coveralls.wear_merged!
3
5
 
4
6
  RSpec.configure do |config|
5
7
  config.color_enabled = true
@@ -1,6 +1,7 @@
1
1
  require "mock/page"
2
+ require File.dirname(__FILE__) + "/spec_helper"
2
3
 
3
- describe Cello::Structure::TextareaHelper do
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"
@@ -1,6 +1,7 @@
1
1
  require "mock/page"
2
+ require File.dirname(__FILE__) + "/spec_helper"
2
3
 
3
- describe Cello::Structure::TextfieldHelper do
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.19
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: 2013-11-26 00:00:00.000000000 Z
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/structure/browser.rb
247
- - lib/cello/structure/html_elements/button_helper.rb
248
- - lib/cello/structure/html_elements/checkbox_helper.rb
249
- - lib/cello/structure/html_elements/div_helper.rb
250
- - lib/cello/structure/html_elements/dsl.rb
251
- - lib/cello/structure/html_elements/element_helper.rb
252
- - lib/cello/structure/html_elements/hidden_helper.rb
253
- - lib/cello/structure/html_elements/link_helper.rb
254
- - lib/cello/structure/html_elements/logger.rb
255
- - lib/cello/structure/html_elements/radio_helper.rb
256
- - lib/cello/structure/html_elements/select_helper.rb
257
- - lib/cello/structure/html_elements/span_helper.rb
258
- - lib/cello/structure/html_elements/textarea_helper.rb
259
- - lib/cello/structure/html_elements/textfield_helper.rb
260
- - lib/cello/structure/page.rb
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