cello 0.0.23 → 0.0.25

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3ee74dd13759682a982129f1148123829312454d
4
- data.tar.gz: c90e11fccc3055ce2f6113f47305ce251c07ff7c
3
+ metadata.gz: c9bea50c1e1c99955d16569b8e6f0590861b1c00
4
+ data.tar.gz: 6f1eb4111de8aaafeaa7810bf30f50b8b6171a90
5
5
  SHA512:
6
- metadata.gz: 442a3e7209fc3d967ce2413453b242e518dde6b831379c4cdfedc7b54adc15e22db41bf8c55522ca70e60535d7f496e678c964cd91386938aa51b51863683655
7
- data.tar.gz: 0f03315a9c011398fd53e6faa2561ec568e97b702b9f89b69681553c17329dd9856525aaac057ddd0a09d511f6c50ca4631e83cf2d49a381246629185d4b70b5
6
+ metadata.gz: ecaead65fa5527b56f63c14f7f9d3f34938e8e01906c946ee941aecb95905c3dbe58594f15dcbc5163d8d047530e4f117cb24b1136c4460698635e13e0f35362
7
+ data.tar.gz: 656bd32c1d0143ad22ed40703ed5d1bec0b65d214bdf7975b758d1f51f355908610001d2c4b5a2bbb52ba4b67190498f4a1c22b915e4d6d21ca1bf04f9bf2c7c
data/cello.gemspec CHANGED
@@ -21,19 +21,16 @@ Gem::Specification.new do |s|
21
21
 
22
22
  s.require_paths = ["lib"]
23
23
 
24
- s.add_development_dependency 'simplecov'
25
- s.add_development_dependency 'pry'
26
- s.add_development_dependency 'cucumber'
27
- s.add_development_dependency 'watir-webdriver'
28
- s.add_development_dependency 'rake'
29
- s.add_development_dependency 'rspec'
30
- s.add_development_dependency 'headless'
31
- s.add_development_dependency 'nyan-cat-formatter'
24
+ s.add_development_dependency 'simplecov', '~> 0'
25
+ s.add_development_dependency 'pry', '~> 0'
26
+ s.add_development_dependency 'rake', '~> 10.4.2'
27
+ s.add_development_dependency 'headless', '~> 0'
28
+ s.add_development_dependency 'nyan-cat-formatter', '~> 0'
32
29
 
33
- s.add_dependency 'cucumber'
34
- s.add_dependency 'rspec'
35
- s.add_dependency 'watir-webdriver'
36
- s.add_dependency 'sourcify'
37
- s.add_dependency 'icecream'
30
+ s.add_dependency 'cucumber', '~> 2.0.0'
31
+ s.add_dependency 'rspec', '~> 3.2.0'
32
+ s.add_dependency 'watir-webdriver', '~> 0.7.0'
33
+ s.add_dependency 'sourcify', '~> 0.5.0'
34
+ s.add_dependency 'icecream', '~> 0.0.14'
38
35
 
39
36
  end
@@ -0,0 +1,8 @@
1
+ Feature: Access elements inside Iframe
2
+ As developer
3
+ I want access elements inside an iframe
4
+
5
+ @wip
6
+ Scenario: Write in a element textfield using id
7
+ Given I am on a page that has a textfield inside a iframe
8
+ Then I should be able to write "Test" in a element inside the iframe using id
@@ -8,13 +8,19 @@ Feature: Browser
8
8
  And and I ask to visit the page
9
9
  Then I should see the page inputs
10
10
 
11
+ Scenario: Get another context
12
+ Given I have a browser with no context (blank page)
13
+ When I ask for the context iframe
14
+ And and I ask to visit the page
15
+ Then I should see the page iframe
16
+
11
17
  Scenario: Fill a textfield on a context
12
18
  Given I am in the inputs context
13
19
  When I ask for fill the textfield
14
20
  Then I should see the filled textfield
15
21
  And I should be able to close the browser
16
22
 
17
- @pending @bugado
23
+ @pending
18
24
  Scenario: Pass by two different contexts
19
25
  Given I am in the inputs context
20
26
  When I ask for fill the textfield
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), '../../lib/cello')
1
+ require "cello"
2
2
 
3
3
  module StaticPages
4
4
  module Site
File without changes
@@ -0,0 +1,14 @@
1
+ require "cello"
2
+ require File.dirname(__FILE__) + "/input_fields_module.rb"
3
+
4
+ module StaticPages
5
+ module Site
6
+ class IframePage < Cello::PageObjects::Page
7
+ iframe "check", StaticPages::Site::InputIframe, :id => 'annoying-iframe'
8
+
9
+ def url
10
+ 'file://' + File.dirname(__FILE__) + '/../site/iframe.html'
11
+ end
12
+ end
13
+ end
14
+ end
@@ -3,6 +3,7 @@ require "cello"
3
3
  module StaticPages
4
4
  module Site
5
5
  class InputPage < Cello::PageObjects::Page
6
+
6
7
  element :text_field, :text_field, :id => 'text1'
7
8
  element :text_fieldname, :text_field, :name => 'text1'
8
9
  element :text_fieldxpath, :text_field, :xpah, '//*[@id="text1"]'
@@ -12,7 +13,9 @@ module StaticPages
12
13
  element :select, :select, :id => 'select1'
13
14
  element :link, :link, :id => 'link1'
14
15
 
15
- url('file://' + File.dirname(__FILE__) + '/../site/inputs.html')
16
+ def url
17
+ 'file://' + File.dirname(__FILE__) + '/../site/inputs.html'
18
+ end
16
19
 
17
20
  end
18
21
  end
@@ -0,0 +1,12 @@
1
+ require "cello"
2
+
3
+ module StaticPages
4
+ module Site
5
+ module InputIframe
6
+ extend Cello::PageObjects::Iframe
7
+
8
+ element :text_inside_iframe, :text_field, :id => 'text1'
9
+
10
+ end
11
+ end
12
+ end
@@ -1,17 +1,14 @@
1
- require File.join(File.dirname(__FILE__), '../../lib/cello')
1
+ require "cello"
2
2
 
3
3
  module StaticPages
4
4
  module Site
5
5
  class ResponsePage < Cello::PageObjects::Page
6
6
  element :text, :text_field, :id => 'new_element'
7
-
8
- def get_url
9
- 'file://' + File.dirname(__FILE__) + '/../site/read_page.html'
10
- end
11
7
 
12
- def initialize(teste)
13
- super(teste)
8
+ def url
9
+ 'file://' + File.dirname(__FILE__) + '/../site/read_page.html'
14
10
  end
11
+
15
12
  end
16
13
  end
17
14
  end
@@ -0,0 +1,11 @@
1
+ <html>
2
+ <head>
3
+ <title> Iframe page </title>
4
+ </head>
5
+ <div>
6
+ <div> <p><b>Textfield:</b></p>
7
+ <div>Textfield with id text1</div><div> <input id='text1' type='text'></div>
8
+ </div>
9
+ </div>
10
+ <iframe src=".iframe.html" id="annoying-iframe"></iframe>
11
+ </html>
@@ -8,6 +8,10 @@ When /^I ask for the context inputs$/ do
8
8
  @browser.context StaticPages::Site::InputPage
9
9
  end
10
10
 
11
+ When /^I ask for the context iframe$/ do
12
+ @browser.context StaticPages::Site::IframePage
13
+ end
14
+
11
15
  When /^and I ask to visit the page$/ do
12
16
  @browser.visit
13
17
  end
@@ -17,6 +21,11 @@ Then /^I should see the page inputs$/ do
17
21
  @browser.close
18
22
  end
19
23
 
24
+ Then /^I should see the page iframe$/ do
25
+ @browser.title.should == "Iframe page"
26
+ @browser.close
27
+ end
28
+
20
29
  Given /^I am in the inputs context$/ do
21
30
  steps %Q{
22
31
  Given I have a browser with no context (blank page)
@@ -15,3 +15,18 @@ end
15
15
  And /^There is a checkbox checked$/ do
16
16
  @browser.checkbox_check
17
17
  end
18
+
19
+ Given /^I am on a page that has a textfield inside a iframe$/ do
20
+ @browser.should be nil
21
+ @browser = StaticPages::Site::Phantom.new
22
+ @browser.title.should == ""
23
+ @browser.context StaticPages::Site::IframePage
24
+ @browser.title.should == ""
25
+ @browser.visit
26
+ @browser.title.should == "Iframe page"
27
+ end
28
+
29
+ Then /^I should be able to write "(.*?)" in a element inside the iframe using id$/ do |text|
30
+ @browser.text_inside_iframe_fill_with(text)
31
+ @browser.close
32
+ end
@@ -9,7 +9,7 @@ end
9
9
 
10
10
  Given /^the option "(.*?)" is setted$/ do |option|
11
11
  @browser.radios_set(option)
12
- @browser.radios_checked_option_is?(option).should be_true
12
+ @browser.radios_checked_option_is?(option).should be true
13
13
  end
14
14
 
15
15
  Then /^I should be able to know that the option "(.*?)" is setted$/ do |option|
@@ -17,32 +17,32 @@ Then /^I should be able to know that the option "(.*?)" is setted$/ do |option|
17
17
  end
18
18
 
19
19
  Then /^I should be able to know if the option "(.*?)" is not setted$/ do |option|
20
- @browser.radios_checked_option_is_not?(option).should be_true
20
+ @browser.radios_checked_option_is_not?(option).should be true
21
21
  @browser.close
22
22
  end
23
23
 
24
24
  Then /^I should fail when ask if the the option "(.*?)" is not setted$/ do |option|
25
- @browser.radios_checked_option_is_not?(option).should be_false
25
+ @browser.radios_checked_option_is_not?(option).should be false
26
26
  @browser.close
27
27
  end
28
28
 
29
29
  Then /^I should be able to know if the option "(.*?)" is setted$/ do |option|
30
- @browser.radios_checked_option_is?(option).should be_true
30
+ @browser.radios_checked_option_is?(option).should be true
31
31
  @browser.close
32
32
  end
33
33
 
34
34
  Then /^I should fail when ask if the option "(.*?)" is setted$/ do |option|
35
- @browser.radios_checked_option_is?(option).should be_false
35
+ @browser.radios_checked_option_is?(option).should be false
36
36
  @browser.close
37
37
  end
38
38
 
39
39
  Then /^I should be able to know if there is some options setted$/ do
40
- @browser.radios_has_selected_option?.should be_true
40
+ @browser.radios_has_selected_option?.should be true
41
41
  @browser.close
42
42
  end
43
43
 
44
44
  Then /^I should fail when ask if there is some options setted$/ do
45
- @browser.radios_has_selected_option?.should be_false
45
+ @browser.radios_has_selected_option?.should be false
46
46
  @browser.close
47
47
  end
48
48
 
@@ -8,7 +8,7 @@ Then /^I should be able to select an option on it$/ do
8
8
  end
9
9
 
10
10
  Then /^be sure that the option setted is the option selected$/ do
11
- @browser.select_is("Cucumber").should be_true
11
+ @browser.select_is("Cucumber").should be true
12
12
  @browser.close
13
13
  end
14
14
 
@@ -1,7 +1,7 @@
1
1
  require "cello"
2
2
 
3
3
  Then /^I should can knows if this page has a textarea$/ do
4
- @browser.textarea_is_real?.should be_true
4
+ @browser.textarea_is_real?.should be true
5
5
  @browser.close
6
6
  end
7
7
 
@@ -16,42 +16,42 @@ Then /^I shoud be able to get the text "(.*?)" from this textarea$/ do |text|
16
16
  end
17
17
 
18
18
  Then /^I should be able to know if the text on the textarea does not contais the text "(.*?)"$/ do |text|
19
- @browser.textarea_dont_contain(text).should be_true
19
+ @browser.textarea_dont_contain(text).should be true
20
20
  @browser.close
21
21
  end
22
22
 
23
23
  Then /^I should fail when ask if the text on the textarea does not contais the text "(.*?)"$/ do |text|
24
- @browser.textarea_dont_contain(text).should be_false
24
+ @browser.textarea_dont_contain(text).should be false
25
25
  @browser.close
26
26
  end
27
27
 
28
28
  Then /^I should be able to know if the text on the textarea contais the text "(.*?)"$/ do |text|
29
- @browser.textarea_contains(text).should be_true
29
+ @browser.textarea_contains(text).should be true
30
30
  @browser.close
31
31
  end
32
32
 
33
33
  Then /^I should fail when ask if the text on the textarea contais the text "(.*?)"$/ do |text|
34
- @browser.textarea_contains(text).should be_false
34
+ @browser.textarea_contains(text).should be false
35
35
  @browser.close
36
36
  end
37
37
 
38
38
  Then /^I should be able to know if the text on the textarea is exacly the text "(.*?)"$/ do |text|
39
- @browser.textarea_text_is(text).should be_true
39
+ @browser.textarea_text_is(text).should be true
40
40
  @browser.close
41
41
  end
42
42
 
43
43
  Then /^I should fail when ask if the text on the textarea is exacly the text "(.*?)"$/ do |text|
44
- @browser.textarea_text_is(text).should be_false
44
+ @browser.textarea_text_is(text).should be false
45
45
  @browser.close
46
46
  end
47
47
 
48
48
  Then /^I should be able to know if the textarea is empty$/ do
49
- @browser.textarea_is_empty?.should be_true
49
+ @browser.textarea_is_empty?.should be true
50
50
  @browser.close
51
51
  end
52
52
 
53
53
  Then /^I should fail when ask if the textarea is empty$/ do
54
- @browser.textarea_is_empty?.should be_false
54
+ @browser.textarea_is_empty?.should be false
55
55
  @browser.close
56
56
  end
57
57
 
@@ -1,12 +1,12 @@
1
1
  require "cello"
2
2
 
3
3
  Then /^I should can knows if this page has a textfield named "(.*?)"$/ do |text_field_name|
4
- @browser.send("#{text_field_name}_is_real?").should be_true
4
+ @browser.send("#{text_field_name}_is_real?").should be true
5
5
  @browser.close
6
6
  end
7
7
 
8
8
  Then /^I should fail when ask if this page has a textfield named "(.*?)"$/ do |text_field_name|
9
- @browser.send("#{text_field_name}_is_real?").should be_false
9
+ @browser.send("#{text_field_name}_is_real?").should be false
10
10
  @browser.close
11
11
  end
12
12
 
@@ -27,42 +27,42 @@ Then /^I shoud fail to try get the text "(.*?)" from this textfield$/ do |text|
27
27
  end
28
28
 
29
29
  Then /^I should be able to know if the text on the textfield does not contais the text "(.*?)"$/ do |text|
30
- @browser.text_field_dont_contain(text).should be_true
30
+ @browser.text_field_dont_contain(text).should be true
31
31
  @browser.close
32
32
  end
33
33
 
34
34
  Then /^I should fail when ask if the text on the textfield does not contais the text "(.*?)"$/ do |text|
35
- @browser.text_field_dont_contain(text).should be_false
35
+ @browser.text_field_dont_contain(text).should be false
36
36
  @browser.close
37
37
  end
38
38
 
39
39
  Then /^I should be able to know if the text on the textfield contais the text "(.*?)"$/ do |text|
40
- @browser.text_field_contains(text).should be_true
40
+ @browser.text_field_contains(text).should be true
41
41
  @browser.close
42
42
  end
43
43
 
44
44
  Then /^I should fail when ask if the text on the textfield contais the text "(.*?)"$/ do |text|
45
- @browser.text_field_contains(text).should be_false
45
+ @browser.text_field_contains(text).should be false
46
46
  @browser.close
47
47
  end
48
48
 
49
49
  Then /^I should be able to know if the text on the textfield is exacly the text "(.*?)"$/ do |text|
50
- @browser.text_field_text_is(text).should be_true
50
+ @browser.text_field_text_is(text).should be true
51
51
  @browser.close
52
52
  end
53
53
 
54
54
  Then /^I should fail when ask if the text on the textfield is exacly the text "(.*?)"$/ do |text|
55
- @browser.text_field_text_is(text).should be_false
55
+ @browser.text_field_text_is(text).should be false
56
56
  @browser.close
57
57
  end
58
58
 
59
59
  Then /^I should be able to know if the textfield is empty$/ do
60
- @browser.text_field_is_empty?.should be_true
60
+ @browser.text_field_is_empty?.should be true
61
61
  @browser.close
62
62
  end
63
63
 
64
64
  Then /^I should fail when ask if the textfield is empty$/ do
65
- @browser.text_field_is_empty?.should be_false
65
+ @browser.text_field_is_empty?.should be false
66
66
  @browser.close
67
67
  end
68
68
 
data/lib/cello.rb CHANGED
@@ -13,6 +13,7 @@ require File.join(File.dirname(__FILE__), './cello/commands')
13
13
 
14
14
  #internal dependences
15
15
  require File.join(File.dirname(__FILE__), './cello/pageobjects/page')
16
+ require File.join(File.dirname(__FILE__), './cello/pageobjects/iframe')
16
17
  require File.join(File.dirname(__FILE__), './cello/pageobjects/browser')
17
18
  require File.join(File.dirname(__FILE__), './cello/pageobjects/recorder')
18
19
 
@@ -7,7 +7,7 @@ module Cello
7
7
  attr_accessor :context
8
8
  attr_reader :browser
9
9
 
10
- def initialize(browser)
10
+ def initialize browser
11
11
  @browser = Watir::Browser.new browser
12
12
  end
13
13
 
@@ -15,11 +15,11 @@ module Cello
15
15
  @context.visit
16
16
  end
17
17
 
18
- def context(page)
19
- @context = page.new(@browser)
18
+ def context page
19
+ @context = page.new @browser
20
20
  end
21
21
 
22
- def search(text)
22
+ def search text
23
23
  @browser.text.include? text
24
24
  end
25
25
 
@@ -39,8 +39,8 @@ module Cello
39
39
  #pending
40
40
  end
41
41
 
42
- def method_missing(method_name, *arguments)
43
- @context.send(method_name, *arguments)
42
+ def method_missing method_name, *arguments
43
+ @context.send method_name, *arguments
44
44
  end
45
45
  end
46
46
  end
@@ -11,15 +11,14 @@ module Cello
11
11
  def element(name, type, *args)
12
12
  class_eval do
13
13
  define_method name do
14
- engine.browser.send(type, *args)
14
+ engine.send(type, *args)
15
15
  end
16
16
 
17
- #define_extras(name, type)
18
17
  define_extras(name, type)
19
18
  end
20
-
21
19
  end
22
20
 
21
+
23
22
  def define_extras(name, type)
24
23
  include LogHelper
25
24
 
@@ -39,7 +38,6 @@ module Cello
39
38
  end
40
39
  define_method "#{name}_click" do
41
40
  logger(name, __method__, type) {
42
- # require "pry"; binding.pry
43
41
  send(name).click
44
42
  }
45
43
  end
@@ -75,6 +73,7 @@ module Cello
75
73
  include ButtonHelper
76
74
  include SpanHelper
77
75
  include HiddenHelper
76
+ include IframeHelper
78
77
 
79
78
  end
80
79
  end
@@ -0,0 +1,21 @@
1
+ Dir[File.dirname(__FILE__) + "/*.rb"].each do |file|
2
+ require file
3
+ end
4
+
5
+ module Cello
6
+ module PageObjects
7
+ module IframeHelper
8
+
9
+ def iframe name, elements, *args
10
+ class_eval do
11
+ include elements
12
+ define_method name do
13
+ engine.browser.iframe(*args)
14
+ end
15
+ end
16
+
17
+ end
18
+
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,11 @@
1
+ Dir[File.dirname(__FILE__) + "/html_elements/*.rb"].each do |file|
2
+ require file
3
+ end
4
+
5
+ module Cello
6
+ module PageObjects
7
+ module Iframe
8
+ include Cello::PageObjects::ElementHelper
9
+ end
10
+ end
11
+ end
@@ -7,17 +7,17 @@ module Cello
7
7
  extend Cello::PageObjects::ElementHelper
8
8
  attr_reader :engine
9
9
 
10
+ MESS = "SYSTEM ERROR: method missing"
11
+
10
12
  def initialize(engine)
11
13
  @engine = engine
12
14
  end
13
15
 
14
16
  def visit
15
- @engine.goto @@url
17
+ @engine.goto url
16
18
  end
17
19
 
18
- def self.url(url)
19
- @@url = url
20
- end
20
+ def url; raise MESS; end
21
21
 
22
22
  end
23
23
  end
@@ -9,7 +9,7 @@ class Cello::PageObjects::Recorder
9
9
  title = page_source.scan(/\<title\>(.*?)\<\/title\>/)[0].to_s.gsub!(/\W+/, ' ').strip!.split(" ").each { |w| w.capitalize! }.join("")
10
10
  page = "require 'cello'\n\n"
11
11
  page += "class #{title} < Cello::PageObjects::Page\n\n"
12
- ary = Array.new()
12
+ raw_element = Array.new()
13
13
  page_source.scan(/\<input(.*?)\>/).each do |raw_element|
14
14
  element_object = Elem.new nil, nil, nil
15
15
  raw_element.to_s.split(" ").each do |element|
@@ -17,15 +17,15 @@ class Cello::PageObjects::Recorder
17
17
  element_object.element_name = element.split("=")[1].gsub!(/\W+/, '') if !element.scan(/name/).empty?
18
18
  element_object.element_id = element.split("=")[1].gsub!(/\W+/, '') if !element.scan(/id/).empty?
19
19
  end
20
- ary.push element_object if (!element_object.element_type.nil? && (!element_object.element_id.nil? || !element_object.element_name.nil?))
20
+ raw_element.push element_object if (!element_object.element_type.nil? && (!element_object.element_id.nil? || !element_object.element_name.nil?))
21
21
  end
22
22
 
23
- ary.each do |yup|
23
+ raw_element.each do |complete_element|
24
24
  key = ":id"
25
- yup.element_name = yup.element_id if yup.element_name.nil?
26
- key = ":name" if yup.element_id.nil?
27
- yup.element_id = yup.element_name if yup.element_id.nil?
28
- page += " element :#{yup.element_name}, :#{yup.element_type}, #{key} => '#{yup.element_id }'\n" if !yup.element_type.empty? && !yup.element_type != "hidden"
25
+ complete_element.element_name = complete_element.element_id if complete_element.element_name.nil?
26
+ key = ":name" if complete_element.element_id.nil?
27
+ complete_element.element_id = complete_element.element_name if complete_element.element_id.nil?
28
+ page += " element :#{complete_element.element_name}, :#{complete_element.element_type}, #{key} => '#{complete_element.element_id }'\n" if !complete_element.element_type.empty? && !complete_element.element_type != "hidden"
29
29
  end
30
30
  page += "\n url(\"#{page_url}\")\n\n"
31
31
  page += "end\n"
data/lib/cello/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cello
2
- VERSION = "0.0.23"
2
+ VERSION = "0.0.25"
3
3
  end
@@ -7,16 +7,16 @@ describe Cello::PageObjects::CheckboxHelper do
7
7
  @page = Mock::Site::MockPage.new "foo"
8
8
  end
9
9
  it "Verify if is checked method exists" do
10
- (@page.methods.map.include? :checkbox_is_checked?).should be_true
10
+ (@page.methods.map.include? :checkbox_is_checked?).should be true
11
11
  end
12
12
  it "Verify if there it is unchecked" do
13
- (@page.methods.map.include? :checkbox_is_unchecked?).should be_true
13
+ (@page.methods.map.include? :checkbox_is_unchecked?).should be true
14
14
  end
15
15
  it "Check a Checkbox" do
16
- (@page.methods.map.include? :checkbox_check).should be_true
16
+ (@page.methods.map.include? :checkbox_check).should be true
17
17
  end
18
18
  it "Clear a Checkbox" do
19
- (@page.methods.map.include? :checkbox_uncheck).should be_true
19
+ (@page.methods.map.include? :checkbox_uncheck).should be true
20
20
  end
21
21
  end
22
22
  end
data/spec/element_spec.rb CHANGED
@@ -7,19 +7,19 @@ describe "Class with element" do
7
7
  @page = Mock::Site::MockPage.new "foo"
8
8
  end
9
9
  it "Verify if the element exists method exists" do
10
- (@page.methods.map.include? :element_is_real?).should be_true
10
+ (@page.methods.map.include? :element_is_real?).should be true
11
11
  end
12
12
  it "Click on the element method exists" do
13
- (@page.methods.map.include? :element_click).should be_true
13
+ (@page.methods.map.include? :element_click).should be true
14
14
  end
15
15
  it "Verify if the element is visible method exists" do
16
- (@page.methods.map.include? :element_is_visible?).should be_true
16
+ (@page.methods.map.include? :element_is_visible?).should be true
17
17
  end
18
18
  it "Verify if the element is enable methods exists" do
19
- (@page.methods.map.include? :element_is_enable?).should be_true
19
+ (@page.methods.map.include? :element_is_enable?).should be true
20
20
  end
21
21
  it "Click with the right button on the element method exists" do
22
- (@page.methods.map.include? :element_right_click).should be_true
22
+ (@page.methods.map.include? :element_right_click).should be true
23
23
  end
24
24
  end
25
25
  end
data/spec/select_spec.rb CHANGED
@@ -7,14 +7,10 @@ describe Cello::PageObjects::SelectHelper do
7
7
  @page = Mock::Site::MockPage.new "foo"
8
8
  end
9
9
  it "Select an option method exists" do
10
- (@page.methods.map.include? :select_select).should be_true
11
- end
12
- it "go to default or empty option method exists" do
13
- pending
14
- (@page.methods.map.include? :select_clear).should be_true
10
+ (@page.methods.map.include? :select_select).should be true
15
11
  end
16
12
  it "return the selected option method exists" do
17
- (@page.methods.map.include? :select_selected).should be_true
13
+ (@page.methods.map.include? :select_selected).should be true
18
14
  end
19
15
  end
20
16
  end
data/spec/spec_helper.rb CHANGED
@@ -4,6 +4,6 @@ require 'coveralls'
4
4
  Coveralls.wear_merged!
5
5
 
6
6
  RSpec.configure do |config|
7
- config.color_enabled = true
7
+ config.color = true
8
8
  config.formatter = 'documentation'
9
9
  end
@@ -7,31 +7,31 @@ describe Cello::PageObjects::TextareaHelper do
7
7
  @page = Mock::Site::MockPage.new "foo"
8
8
  end
9
9
  it "Veify if the textarea is enable method exists" do
10
- (@page.methods.map.include? :textarea_is_enable?).should be_true
10
+ (@page.methods.map.include? :textarea_is_enable?).should be true
11
11
  end
12
12
  it "Clear the textarea method exists" do
13
- (@page.methods.map.include? :textarea_clear).should be_true
13
+ (@page.methods.map.include? :textarea_clear).should be true
14
14
  end
15
15
  it "Get the text from the textarea" do
16
- (@page.methods.map.include? :textarea_get_text).should be_true
16
+ (@page.methods.map.include? :textarea_get_text).should be true
17
17
  end
18
18
  it "Fill the textarea with some specific text" do
19
- (@page.methods.map.include? :textarea_fill_with).should be_true
19
+ (@page.methods.map.include? :textarea_fill_with).should be true
20
20
  end
21
21
  it "Verify if the textarea does not contain some text" do
22
- (@page.methods.map.include? :textarea_dont_contain).should be_true
22
+ (@page.methods.map.include? :textarea_dont_contain).should be true
23
23
  end
24
24
  it "Verify if the textarea contains some text" do
25
- (@page.methods.map.include? :textarea_contains).should be_true
25
+ (@page.methods.map.include? :textarea_contains).should be true
26
26
  end
27
27
  it "Verify if the containt of the textarea is exacly some text" do
28
- (@page.methods.map.include? :textarea_text_is).should be_true
28
+ (@page.methods.map.include? :textarea_text_is).should be true
29
29
  end
30
30
  it "Verify if the textarea is empty" do
31
- (@page.methods.map.include? :textarea_is_empty?).should be_true
31
+ (@page.methods.map.include? :textarea_is_empty?).should be true
32
32
  end
33
33
  it "Get the size of the containt of the textarea" do
34
- (@page.methods.map.include? :textarea_text_size).should be_true
34
+ (@page.methods.map.include? :textarea_text_size).should be true
35
35
  end
36
36
  end
37
37
  end
@@ -7,31 +7,31 @@ describe Cello::PageObjects::TextfieldHelper do
7
7
  @page = Mock::Site::MockPage.new "foo"
8
8
  end
9
9
  it "Veify if the textfield is enabled" do
10
- (@page.methods.map.include? :text_field_is_enable?).should be_true
10
+ (@page.methods.map.include? :text_field_is_enable?).should be true
11
11
  end
12
12
  it "Clear the textfield" do
13
- (@page.methods.map.include? :text_field_clear).should be_true
13
+ (@page.methods.map.include? :text_field_clear).should be true
14
14
  end
15
15
  it "Get the text from the textfield" do
16
- (@page.methods.map.include? :text_field_get_text).should be_true
16
+ (@page.methods.map.include? :text_field_get_text).should be true
17
17
  end
18
18
  it "Fill the textfield with some specific text" do
19
- (@page.methods.map.include? :text_field_fill_with).should be_true
19
+ (@page.methods.map.include? :text_field_fill_with).should be true
20
20
  end
21
21
  it "Verify if the textfield does not contain some text" do
22
- (@page.methods.map.include? :text_field_dont_contain).should be_true
22
+ (@page.methods.map.include? :text_field_dont_contain).should be true
23
23
  end
24
24
  it "Verify if the textfield contains some text" do
25
- (@page.methods.map.include? :text_field_contains).should be_true
25
+ (@page.methods.map.include? :text_field_contains).should be true
26
26
  end
27
27
  it "Verify if the containt of the textfield is exacly some text" do
28
- (@page.methods.map.include? :text_field_text_is).should be_true
28
+ (@page.methods.map.include? :text_field_text_is).should be true
29
29
  end
30
30
  it "Verify if the textfield is empty" do
31
- (@page.methods.map.include? :text_field_is_empty?).should be_true
31
+ (@page.methods.map.include? :text_field_is_empty?).should be true
32
32
  end
33
33
  it "Get the size of the containt of the textfield" do
34
- (@page.methods.map.include? :text_field_text_size).should be_true
34
+ (@page.methods.map.include? :text_field_text_size).should be true
35
35
  end
36
36
  end
37
37
  end
metadata CHANGED
@@ -1,197 +1,155 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cello
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.23
4
+ version: 0.0.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Camilo Ribeiro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-12 00:00:00.000000000 Z
11
+ date: 2015-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pry
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: cucumber
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - '>='
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: watir-webdriver
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - '>='
38
+ - - ~>
67
39
  - !ruby/object:Gem::Version
68
40
  version: '0'
69
41
  - !ruby/object:Gem::Dependency
70
42
  name: rake
71
43
  requirement: !ruby/object:Gem::Requirement
72
44
  requirements:
73
- - - '>='
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - '>='
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: rspec
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - '>='
45
+ - - ~>
88
46
  - !ruby/object:Gem::Version
89
- version: '0'
47
+ version: 10.4.2
90
48
  type: :development
91
49
  prerelease: false
92
50
  version_requirements: !ruby/object:Gem::Requirement
93
51
  requirements:
94
- - - '>='
52
+ - - ~>
95
53
  - !ruby/object:Gem::Version
96
- version: '0'
54
+ version: 10.4.2
97
55
  - !ruby/object:Gem::Dependency
98
56
  name: headless
99
57
  requirement: !ruby/object:Gem::Requirement
100
58
  requirements:
101
- - - '>='
59
+ - - ~>
102
60
  - !ruby/object:Gem::Version
103
61
  version: '0'
104
62
  type: :development
105
63
  prerelease: false
106
64
  version_requirements: !ruby/object:Gem::Requirement
107
65
  requirements:
108
- - - '>='
66
+ - - ~>
109
67
  - !ruby/object:Gem::Version
110
68
  version: '0'
111
69
  - !ruby/object:Gem::Dependency
112
70
  name: nyan-cat-formatter
113
71
  requirement: !ruby/object:Gem::Requirement
114
72
  requirements:
115
- - - '>='
73
+ - - ~>
116
74
  - !ruby/object:Gem::Version
117
75
  version: '0'
118
76
  type: :development
119
77
  prerelease: false
120
78
  version_requirements: !ruby/object:Gem::Requirement
121
79
  requirements:
122
- - - '>='
80
+ - - ~>
123
81
  - !ruby/object:Gem::Version
124
82
  version: '0'
125
83
  - !ruby/object:Gem::Dependency
126
84
  name: cucumber
127
85
  requirement: !ruby/object:Gem::Requirement
128
86
  requirements:
129
- - - '>='
87
+ - - ~>
130
88
  - !ruby/object:Gem::Version
131
- version: '0'
89
+ version: 2.0.0
132
90
  type: :runtime
133
91
  prerelease: false
134
92
  version_requirements: !ruby/object:Gem::Requirement
135
93
  requirements:
136
- - - '>='
94
+ - - ~>
137
95
  - !ruby/object:Gem::Version
138
- version: '0'
96
+ version: 2.0.0
139
97
  - !ruby/object:Gem::Dependency
140
98
  name: rspec
141
99
  requirement: !ruby/object:Gem::Requirement
142
100
  requirements:
143
- - - '>='
101
+ - - ~>
144
102
  - !ruby/object:Gem::Version
145
- version: '0'
103
+ version: 3.2.0
146
104
  type: :runtime
147
105
  prerelease: false
148
106
  version_requirements: !ruby/object:Gem::Requirement
149
107
  requirements:
150
- - - '>='
108
+ - - ~>
151
109
  - !ruby/object:Gem::Version
152
- version: '0'
110
+ version: 3.2.0
153
111
  - !ruby/object:Gem::Dependency
154
112
  name: watir-webdriver
155
113
  requirement: !ruby/object:Gem::Requirement
156
114
  requirements:
157
- - - '>='
115
+ - - ~>
158
116
  - !ruby/object:Gem::Version
159
- version: '0'
117
+ version: 0.7.0
160
118
  type: :runtime
161
119
  prerelease: false
162
120
  version_requirements: !ruby/object:Gem::Requirement
163
121
  requirements:
164
- - - '>='
122
+ - - ~>
165
123
  - !ruby/object:Gem::Version
166
- version: '0'
124
+ version: 0.7.0
167
125
  - !ruby/object:Gem::Dependency
168
126
  name: sourcify
169
127
  requirement: !ruby/object:Gem::Requirement
170
128
  requirements:
171
- - - '>='
129
+ - - ~>
172
130
  - !ruby/object:Gem::Version
173
- version: '0'
131
+ version: 0.5.0
174
132
  type: :runtime
175
133
  prerelease: false
176
134
  version_requirements: !ruby/object:Gem::Requirement
177
135
  requirements:
178
- - - '>='
136
+ - - ~>
179
137
  - !ruby/object:Gem::Version
180
- version: '0'
138
+ version: 0.5.0
181
139
  - !ruby/object:Gem::Dependency
182
140
  name: icecream
183
141
  requirement: !ruby/object:Gem::Requirement
184
142
  requirements:
185
- - - '>='
143
+ - - ~>
186
144
  - !ruby/object:Gem::Version
187
- version: '0'
145
+ version: 0.0.14
188
146
  type: :runtime
189
147
  prerelease: false
190
148
  version_requirements: !ruby/object:Gem::Requirement
191
149
  requirements:
192
- - - '>='
150
+ - - ~>
193
151
  - !ruby/object:Gem::Version
194
- version: '0'
152
+ version: 0.0.14
195
153
  description: Cello is a framework that allows automate acceptance tests using page-object
196
154
  email:
197
155
  - cribeiro@thoughtworks.com
@@ -211,7 +169,10 @@ files:
211
169
  - bin/cello
212
170
  - cello.gemspec
213
171
  - features/access_element.feature
172
+ - features/access_element_inside_iframe.feature
214
173
  - features/browser.feature
174
+ - features/browsers/firefox.rb
175
+ - features/browsers/headless.rb
215
176
  - features/button.feature
216
177
  - features/checkbox.feature
217
178
  - features/choose_browser.feature
@@ -219,12 +180,13 @@ files:
219
180
  - features/element.feature
220
181
  - features/fire_event.feature
221
182
  - features/get_html_attributes.feature
222
- - features/pages/firefox.rb
223
- - features/pages/headless.rb
183
+ - features/pages/iframe.rb
224
184
  - features/pages/input_fields.rb
185
+ - features/pages/input_fields_module.rb
225
186
  - features/pages/response_page.rb
226
187
  - features/radio.feature
227
188
  - features/select.feature
189
+ - features/site/iframe.html
228
190
  - features/site/inputs.html
229
191
  - features/site/read_page.html
230
192
  - features/step_definitions/access_element.rb
@@ -256,6 +218,7 @@ files:
256
218
  - lib/cello/pageobjects/html_elements/dsl.rb
257
219
  - lib/cello/pageobjects/html_elements/element_helper.rb
258
220
  - lib/cello/pageobjects/html_elements/hidden_helper.rb
221
+ - lib/cello/pageobjects/html_elements/iframe_helper.rb
259
222
  - lib/cello/pageobjects/html_elements/link_helper.rb
260
223
  - lib/cello/pageobjects/html_elements/logger.rb
261
224
  - lib/cello/pageobjects/html_elements/radio_helper.rb
@@ -263,6 +226,7 @@ files:
263
226
  - lib/cello/pageobjects/html_elements/span_helper.rb
264
227
  - lib/cello/pageobjects/html_elements/textarea_helper.rb
265
228
  - lib/cello/pageobjects/html_elements/textfield_helper.rb
229
+ - lib/cello/pageobjects/iframe.rb
266
230
  - lib/cello/pageobjects/page.rb
267
231
  - lib/cello/pageobjects/recorder.rb
268
232
  - lib/cello/structure.rb
@@ -303,8 +267,56 @@ required_rubygems_version: !ruby/object:Gem::Requirement
303
267
  version: '0'
304
268
  requirements: []
305
269
  rubyforge_project: cello
306
- rubygems_version: 2.0.3
270
+ rubygems_version: 2.4.4
307
271
  signing_key:
308
272
  specification_version: 4
309
273
  summary: Fast and simple Page-Object with BDD
310
- test_files: []
274
+ test_files:
275
+ - features/access_element.feature
276
+ - features/access_element_inside_iframe.feature
277
+ - features/browser.feature
278
+ - features/browsers/firefox.rb
279
+ - features/browsers/headless.rb
280
+ - features/button.feature
281
+ - features/checkbox.feature
282
+ - features/choose_browser.feature
283
+ - features/dsl.feature
284
+ - features/element.feature
285
+ - features/fire_event.feature
286
+ - features/get_html_attributes.feature
287
+ - features/pages/iframe.rb
288
+ - features/pages/input_fields.rb
289
+ - features/pages/input_fields_module.rb
290
+ - features/pages/response_page.rb
291
+ - features/radio.feature
292
+ - features/select.feature
293
+ - features/site/iframe.html
294
+ - features/site/inputs.html
295
+ - features/site/read_page.html
296
+ - features/step_definitions/access_element.rb
297
+ - features/step_definitions/browser.rb
298
+ - features/step_definitions/checkbox.rb
299
+ - features/step_definitions/common_steps.rb
300
+ - features/step_definitions/element.rb
301
+ - features/step_definitions/html_attributes.rb
302
+ - features/step_definitions/radio.rb
303
+ - features/step_definitions/select.rb
304
+ - features/step_definitions/textarea.rb
305
+ - features/step_definitions/textfield.rb
306
+ - features/support/env.rb
307
+ - features/textarea.feature
308
+ - features/textfield.feature
309
+ - spec/button_spec.rb
310
+ - spec/checkbox_spec.rb
311
+ - spec/div_spec.rb
312
+ - spec/element_spec.rb
313
+ - spec/hidden_spec.rb
314
+ - spec/link_spec.rb
315
+ - spec/mock/page.rb
316
+ - spec/page_spec.rb
317
+ - spec/radio_spec.rb
318
+ - spec/select_spec.rb
319
+ - spec/span_spec.rb
320
+ - spec/spec_helper.rb
321
+ - spec/textarea_spec.rb
322
+ - spec/textfield_spec.rb