cello 0.0.17 → 0.0.19
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 +7 -0
- data/.gitignore +1 -3
- data/.ruby-version +1 -0
- data/.travis.yml +4 -0
- data/Gemfile +2 -0
- data/LICENCE +1 -1
- data/README.md +3 -3
- data/Rakefile +7 -1
- data/cello.gemspec +5 -0
- data/features/browser.feature +1 -0
- data/features/element.feature +8 -8
- data/features/get_html_attributes.feature +4 -4
- data/features/pages/firefox.rb +0 -1
- data/features/pages/headless.rb +11 -0
- data/features/pages/input_fields.rb +2 -7
- data/features/step_definitions/access_element.rb +6 -8
- data/features/step_definitions/browser.rb +5 -6
- data/features/step_definitions/checkbox.rb +9 -11
- data/features/step_definitions/common_steps.rb +6 -28
- data/features/step_definitions/element.rb +12 -14
- data/features/step_definitions/html_attributes.rb +4 -3
- data/features/step_definitions/radio.rb +19 -23
- data/features/step_definitions/select.rb +12 -18
- data/features/step_definitions/textarea.rb +27 -29
- data/features/step_definitions/textfield.rb +32 -34
- data/lib/cello/structure/browser.rb +1 -5
- data/lib/cello/structure/html_elements/element_helper.rb +33 -11
- data/lib/cello/structure/html_elements/logger.rb +34 -0
- data/lib/cello/structure/html_elements/select_helper.rb +18 -8
- data/lib/cello/structure/page.rb +11 -4
- data/lib/cello/version.rb +1 -1
- data/lib/cello.rb +1 -1
- data/spec/checkbox_spec.rb +10 -2
- data/spec/element_spec.rb +13 -7
- data/spec/mock/page.rb +25 -0
- data/spec/select_spec.rb +11 -4
- data/spec/textarea_spec.rb +15 -3
- data/spec/textfield_spec.rb +13 -1
- metadata +190 -206
- data/travis.yml +0 -7
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 67bd151cb71e969f4df8da32909adc3daf0a4b1e
|
|
4
|
+
data.tar.gz: 4feabc3cbf257c091d75de65d3c3a41dc56308ff
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 549d76e7ce6d9bd7a9ca225972825b2796dc4e09279f6a9e2b385fcb38bf64a1d10270c4b88d01e7878ac2274baff094d8abbb596c421b04dc85cf4218500411
|
|
7
|
+
data.tar.gz: 1d5b5d37fb87ce83004d309486475e1f4abe6e2d857dce327ececeb8c7026a80548162717385428393e60788835749508e43ee01ab2aed10f8225520021d1cdd
|
data/.gitignore
CHANGED
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ruby-2.0.0-p247@cello
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/LICENCE
CHANGED
data/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
CELLO
|
|
1
|
+
CELLO ♩♪ ♮ d[^_^]b ♫ ♬ ♭♯
|
|
2
2
|
=====
|
|
3
3
|
|
|
4
|
-
[](http://travis-ci.org/camiloribeiro/cello
|
|
4
|
+
[](http://travis-ci.org/camiloribeiro/cello)
|
|
5
5
|
|
|
6
6
|
What?
|
|
7
7
|
-----
|
|
@@ -91,7 +91,7 @@ ROADMAP
|
|
|
91
91
|
LICENSE
|
|
92
92
|
=======
|
|
93
93
|
|
|
94
|
-
Copyright 2012 Camilo Ribeiro
|
|
94
|
+
Copyright 2012 - 2013 Camilo Ribeiro camilo@camiloribeiro.com
|
|
95
95
|
|
|
96
96
|
This file is part of Cello.
|
|
97
97
|
|
data/Rakefile
CHANGED
|
@@ -3,7 +3,13 @@ require 'rspec/core/rake_task'
|
|
|
3
3
|
|
|
4
4
|
task :default => [:spec,:run]
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
RSpec::Core::RakeTask .new(:spec) do |task|
|
|
7
|
+
task.rspec_opts = ["--format documentation"]
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
RSpec::Core::RakeTask .new(:nyan) do |task|
|
|
11
|
+
task.rspec_opts = ["--format NyanCatFormater"]
|
|
12
|
+
end
|
|
7
13
|
|
|
8
14
|
Cucumber::Rake::Task.new(:run) do |task|
|
|
9
15
|
task.cucumber_opts = ["-t","~@pending","features --format pretty"]
|
data/cello.gemspec
CHANGED
|
@@ -8,6 +8,7 @@ Gem::Specification.new do |s|
|
|
|
8
8
|
s.authors = ["Camilo Ribeiro"]
|
|
9
9
|
s.email = ["cribeiro@thoughtworks.com"]
|
|
10
10
|
s.homepage = "http://github.com/camiloribeiro/cello"
|
|
11
|
+
s.license = "Apache 2.0"
|
|
11
12
|
s.summary = %q{Fast and simple Page-Object with BDD}
|
|
12
13
|
s.description = %q{Cello is a framework that allows automate acceptance tests using page-object}
|
|
13
14
|
|
|
@@ -27,8 +28,12 @@ Gem::Specification.new do |s|
|
|
|
27
28
|
s.add_development_dependency 'rake'
|
|
28
29
|
s.add_development_dependency 'rspec'
|
|
29
30
|
s.add_development_dependency 'headless'
|
|
31
|
+
s.add_development_dependency 'nyan-cat-formatter'
|
|
30
32
|
|
|
31
33
|
s.add_dependency 'cucumber'
|
|
32
34
|
s.add_dependency 'rspec'
|
|
33
35
|
s.add_dependency 'watir-webdriver'
|
|
36
|
+
s.add_dependency 'sourcify'
|
|
37
|
+
s.add_dependency 'icecream'
|
|
38
|
+
|
|
34
39
|
end
|
data/features/browser.feature
CHANGED
data/features/element.feature
CHANGED
|
@@ -3,7 +3,7 @@ Feature: Element
|
|
|
3
3
|
I want use element to run my tests
|
|
4
4
|
|
|
5
5
|
Scenario: Click at the element
|
|
6
|
-
Given I am on a page that has
|
|
6
|
+
Given I am on a page that has an element
|
|
7
7
|
And that element is named as:
|
|
8
8
|
| checkbox |
|
|
9
9
|
| text_field |
|
|
@@ -12,7 +12,7 @@ Feature: Element
|
|
|
12
12
|
Then I want click on this element
|
|
13
13
|
|
|
14
14
|
Scenario: Know if the element is visible
|
|
15
|
-
Given I am on a page that has
|
|
15
|
+
Given I am on a page that has an element
|
|
16
16
|
And that element is named as:
|
|
17
17
|
| checkbox |
|
|
18
18
|
| text_field |
|
|
@@ -21,7 +21,7 @@ Feature: Element
|
|
|
21
21
|
Then I want know if this element is visible
|
|
22
22
|
|
|
23
23
|
Scenario: Know if the element is enable
|
|
24
|
-
Given I am on a page that has
|
|
24
|
+
Given I am on a page that has an element
|
|
25
25
|
And that element is named as:
|
|
26
26
|
| checkbox |
|
|
27
27
|
| text_field |
|
|
@@ -30,7 +30,7 @@ Feature: Element
|
|
|
30
30
|
Then I want know if this element is enable
|
|
31
31
|
|
|
32
32
|
Scenario: Know if the element exists
|
|
33
|
-
Given I am on a page that has
|
|
33
|
+
Given I am on a page that has an element
|
|
34
34
|
And that element is named as:
|
|
35
35
|
| checkbox |
|
|
36
36
|
| text_field |
|
|
@@ -39,7 +39,7 @@ Feature: Element
|
|
|
39
39
|
Then I want know if this element exists
|
|
40
40
|
|
|
41
41
|
Scenario: Right click at the element
|
|
42
|
-
Given I am on a page that has
|
|
42
|
+
Given I am on a page that has an element
|
|
43
43
|
And that element is named as:
|
|
44
44
|
| checkbox |
|
|
45
45
|
| text_field |
|
|
@@ -49,7 +49,7 @@ Feature: Element
|
|
|
49
49
|
|
|
50
50
|
@pending
|
|
51
51
|
Scenario: Wait until the element is gone
|
|
52
|
-
Given I am on a page that has
|
|
52
|
+
Given I am on a page that has an element
|
|
53
53
|
And that element is named as:
|
|
54
54
|
| checkbox |
|
|
55
55
|
| text_field |
|
|
@@ -58,7 +58,7 @@ Feature: Element
|
|
|
58
58
|
|
|
59
59
|
@pending
|
|
60
60
|
Scenario: Wait until the element is present
|
|
61
|
-
Given I am on a page that has
|
|
61
|
+
Given I am on a page that has an element
|
|
62
62
|
And that element is named as:
|
|
63
63
|
| checkbox |
|
|
64
64
|
| text_field |
|
|
@@ -67,7 +67,7 @@ Feature: Element
|
|
|
67
67
|
|
|
68
68
|
@pending
|
|
69
69
|
Scenario: get the location of it
|
|
70
|
-
Given I am on a page that has
|
|
70
|
+
Given I am on a page that has an element
|
|
71
71
|
And that element is named as:
|
|
72
72
|
| checkbox |
|
|
73
73
|
| text_field |
|
|
@@ -3,28 +3,28 @@ Feature: Getting HTML Atributes
|
|
|
3
3
|
I want to get HTML atributs from elements
|
|
4
4
|
|
|
5
5
|
Scenario: Get the value of a html element
|
|
6
|
-
Given I am on a page that has
|
|
6
|
+
Given I am on a page that has an element
|
|
7
7
|
And the textfield has the value "text value"
|
|
8
8
|
When I ask for the "value" of it element
|
|
9
9
|
Then I should see the value of it
|
|
10
10
|
|
|
11
11
|
@pending
|
|
12
12
|
Scenario: Get the text of a html element
|
|
13
|
-
Given I am on a page that has
|
|
13
|
+
Given I am on a page that has an element
|
|
14
14
|
And the textfield has the text "text text"
|
|
15
15
|
When I ask for the "text" of it element
|
|
16
16
|
Then I should see the text of it
|
|
17
17
|
|
|
18
18
|
@pending
|
|
19
19
|
Scenario: Get the class of a html element
|
|
20
|
-
Given I am on a page that has
|
|
20
|
+
Given I am on a page that has an element
|
|
21
21
|
And the textfield has the class "text_class"
|
|
22
22
|
When I ask for the "class" of it element
|
|
23
23
|
Then I should see the class of it
|
|
24
24
|
|
|
25
25
|
@pending
|
|
26
26
|
Scenario: Get the tilte of a html element
|
|
27
|
-
Given I am on a page that has
|
|
27
|
+
Given I am on a page that has an element
|
|
28
28
|
And the textfield has the title "text title"
|
|
29
29
|
When I ask for the "title" of it element
|
|
30
30
|
Then I should see the title of it
|
data/features/pages/firefox.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require
|
|
1
|
+
require "cello"
|
|
2
2
|
|
|
3
3
|
module StaticPages
|
|
4
4
|
module Site
|
|
@@ -12,13 +12,8 @@ module StaticPages
|
|
|
12
12
|
element :select, :select, :id => 'select1'
|
|
13
13
|
element :link, :link, :id => 'link1'
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
'file://' + File.dirname(__FILE__) + '/../site/inputs.html'
|
|
17
|
-
end
|
|
15
|
+
url('file://' + File.dirname(__FILE__) + '/../site/inputs.html')
|
|
18
16
|
|
|
19
|
-
def initialize(teste)
|
|
20
|
-
super(teste)
|
|
21
|
-
end
|
|
22
17
|
end
|
|
23
18
|
end
|
|
24
19
|
end
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
require file
|
|
3
|
-
end
|
|
1
|
+
require "cello"
|
|
4
2
|
|
|
5
3
|
Then /^I should be able to write "(.*?)" in a element using id$/ do |text|
|
|
6
|
-
@
|
|
7
|
-
@
|
|
4
|
+
@browser.text_field_fill_with(text)
|
|
5
|
+
@browser.close
|
|
8
6
|
end
|
|
9
7
|
|
|
10
8
|
Then /^I should be able to write "(.*?)" in a element using name$/ do |text|
|
|
11
|
-
@
|
|
12
|
-
@
|
|
9
|
+
@browser.text_fieldname_fill_with(text)
|
|
10
|
+
@browser.close
|
|
13
11
|
end
|
|
14
12
|
|
|
15
13
|
Then /^I should be able to write "(.*?)" in a element using label$/ do |text|
|
|
@@ -18,7 +16,7 @@ end
|
|
|
18
16
|
|
|
19
17
|
Then /^I should be able to write "(.*?)" in a element using xpath$/ do |text|
|
|
20
18
|
#pending
|
|
21
|
-
@
|
|
19
|
+
@browser.text_fieldxpath_fill_with(text)
|
|
22
20
|
end
|
|
23
21
|
|
|
24
22
|
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
require file
|
|
3
|
-
end
|
|
1
|
+
require "cello"
|
|
4
2
|
|
|
5
3
|
Given /^I have a browser with no context \(blank page\)$/ do
|
|
6
|
-
@browser = StaticPages::Site::
|
|
4
|
+
@browser = StaticPages::Site::Phantom.new
|
|
7
5
|
end
|
|
8
6
|
|
|
9
7
|
When /^I ask for the context inputs$/ do
|
|
@@ -20,8 +18,9 @@ Then /^I should see the page inputs$/ do
|
|
|
20
18
|
end
|
|
21
19
|
|
|
22
20
|
Given /^I am in the inputs context$/ do
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
steps %Q{
|
|
22
|
+
Given I have a browser with no context (blank page)
|
|
23
|
+
When I ask for the context inputs}
|
|
25
24
|
@browser.visit
|
|
26
25
|
@browser.title.should == "Inputs page"
|
|
27
26
|
end
|
|
@@ -1,24 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
require file
|
|
3
|
-
end
|
|
1
|
+
require "cello"
|
|
4
2
|
|
|
5
3
|
Then /^I should be able to verify if it is checked$/ do
|
|
6
|
-
@
|
|
7
|
-
@
|
|
4
|
+
@browser.checkbox_is_checked?
|
|
5
|
+
@browser.close
|
|
8
6
|
end
|
|
9
7
|
|
|
10
8
|
Then /^I should be able to verify if it is unchecked$/ do
|
|
11
|
-
@
|
|
12
|
-
@
|
|
9
|
+
@browser.checkbox_is_unchecked?
|
|
10
|
+
@browser.close
|
|
13
11
|
end
|
|
14
12
|
|
|
15
13
|
Then /^I should be able to check it$/ do
|
|
16
|
-
@
|
|
17
|
-
@
|
|
14
|
+
@browser.checkbox_check
|
|
15
|
+
@browser.close
|
|
18
16
|
end
|
|
19
17
|
|
|
20
18
|
Then /^I should be able to uncheck it$/ do
|
|
21
|
-
@
|
|
22
|
-
@
|
|
19
|
+
@browser.checkbox_uncheck
|
|
20
|
+
@browser.close
|
|
23
21
|
end
|
|
24
22
|
|
|
@@ -1,39 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
require file
|
|
3
|
-
end
|
|
4
|
-
|
|
5
|
-
Given /^I am on a page that has a element$/ do
|
|
6
|
-
@page = StaticPages::Site::Firefox.new
|
|
7
|
-
@page.context StaticPages::Site::InputPage
|
|
8
|
-
@page.visit
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
Given /^I am on a page that has a textfield$/ do
|
|
12
|
-
@page = StaticPages::Site::Firefox.new
|
|
13
|
-
@page.context StaticPages::Site::InputPage
|
|
14
|
-
@page.visit
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
Given /^I am on a page that has a textarea$/ do
|
|
18
|
-
@page = StaticPages::Site::Firefox.new
|
|
19
|
-
@page.context StaticPages::Site::InputPage
|
|
20
|
-
@page.visit
|
|
21
|
-
end
|
|
1
|
+
require "cello"
|
|
22
2
|
|
|
23
|
-
Given /^I am on a page that has a checkbox$/ do
|
|
24
|
-
|
|
25
|
-
@page.context StaticPages::Site::InputPage
|
|
26
|
-
@page.visit
|
|
3
|
+
Given /^I am on a page that has (?:a|an) (?:select|element|checkbox|textfield|textarea)$/ do
|
|
4
|
+
step "I am in the inputs context"
|
|
27
5
|
end
|
|
28
6
|
|
|
29
7
|
And /^There is a textfield with the text "(.*?)"$/ do |text|
|
|
30
|
-
@
|
|
8
|
+
@browser.text_field_fill_with(text)
|
|
31
9
|
end
|
|
32
10
|
|
|
33
11
|
And /^There is a textarea with the text "(.*?)"$/ do |text|
|
|
34
|
-
@
|
|
12
|
+
@browser.textarea_fill_with(text)
|
|
35
13
|
end
|
|
36
14
|
|
|
37
15
|
And /^There is a checkbox checked$/ do
|
|
38
|
-
@
|
|
16
|
+
@browser.checkbox_check
|
|
39
17
|
end
|
|
@@ -1,45 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
require file
|
|
3
|
-
end
|
|
1
|
+
require "cello"
|
|
4
2
|
|
|
5
3
|
Given /^that element is named as:$/ do |elements|
|
|
6
4
|
elements.raw.each do |name|
|
|
7
|
-
@
|
|
5
|
+
@browser.send("#{name.first}_is_real?")
|
|
8
6
|
end
|
|
9
7
|
@elements = elements
|
|
10
8
|
end
|
|
11
9
|
|
|
12
10
|
Then /^I want click on this element$/ do
|
|
13
11
|
@elements.raw.each do |name|
|
|
14
|
-
@
|
|
12
|
+
@browser.send("#{name.first}_click")
|
|
15
13
|
end
|
|
16
|
-
@
|
|
14
|
+
@browser.close
|
|
17
15
|
end
|
|
18
16
|
|
|
19
17
|
Then /^I want know if this element is visible$/ do
|
|
20
18
|
@elements.raw.each do |name|
|
|
21
|
-
@
|
|
19
|
+
@browser.send("#{name.first}_is_visible?")
|
|
22
20
|
end
|
|
23
|
-
@
|
|
21
|
+
@browser.close
|
|
24
22
|
end
|
|
25
23
|
|
|
26
24
|
Then /^I want know if this element is enable$/ do
|
|
27
25
|
@elements.raw.each do |name|
|
|
28
|
-
@
|
|
26
|
+
@browser.send("#{name.first}_is_enable?")
|
|
29
27
|
end
|
|
30
|
-
@
|
|
28
|
+
@browser.close
|
|
31
29
|
end
|
|
32
30
|
|
|
33
31
|
Then /^I want know if this element exists$/ do
|
|
34
32
|
@elements.raw.each do |name|
|
|
35
|
-
@
|
|
33
|
+
@browser.send("#{name.first}_is_real?")
|
|
36
34
|
end
|
|
37
|
-
@
|
|
35
|
+
@browser.close
|
|
38
36
|
end
|
|
39
37
|
|
|
40
38
|
Then /^I shoud be able to click with the right button in this element$/ do
|
|
41
39
|
@elements.raw.each do |name|
|
|
42
|
-
@
|
|
40
|
+
@browser.send("#{name.first}_right_click")
|
|
43
41
|
end
|
|
44
|
-
@
|
|
42
|
+
@browser.close
|
|
45
43
|
end
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
Given /^the textfield has the value "(.*?)"$/ do |value|
|
|
2
|
-
|
|
2
|
+
# require "pry"; binding.pry
|
|
3
|
+
@browser.text_field_fill_with(value)
|
|
3
4
|
@value == value
|
|
4
5
|
end
|
|
5
6
|
|
|
6
7
|
When /^I ask for the "(.*?)" of it element$/ do |att|
|
|
7
|
-
@text_value == @
|
|
8
|
+
@text_value == @browser.text_field_get(att)
|
|
8
9
|
end
|
|
9
10
|
|
|
10
11
|
Then /^I should see the value of it$/ do
|
|
11
12
|
@text_value.should == @value
|
|
12
|
-
@
|
|
13
|
+
@browser.close
|
|
13
14
|
end
|
|
@@ -1,55 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
require file
|
|
3
|
-
end
|
|
1
|
+
require "cello"
|
|
4
2
|
|
|
5
3
|
Given /^I am on a page that has a radio group with the follow opitions:$/ do |radios|
|
|
6
|
-
|
|
7
|
-
@page.context StaticPages::Site::InputPage
|
|
8
|
-
@page.visit
|
|
4
|
+
step "I am in the inputs context"
|
|
9
5
|
radios.raw.each do |radio|
|
|
10
|
-
@
|
|
6
|
+
@browser.radios_contains(radio)
|
|
11
7
|
end
|
|
12
8
|
end
|
|
13
9
|
|
|
14
10
|
Given /^the option "(.*?)" is setted$/ do |option|
|
|
15
|
-
@
|
|
16
|
-
@
|
|
11
|
+
@browser.radios_set(option)
|
|
12
|
+
@browser.radios_checked_option_is?(option).should be_true
|
|
17
13
|
end
|
|
18
14
|
|
|
19
15
|
Then /^I should be able to know that the option "(.*?)" is setted$/ do |option|
|
|
20
|
-
@
|
|
16
|
+
@browser.radios_checked_option?.should include(option)
|
|
21
17
|
end
|
|
22
18
|
|
|
23
19
|
Then /^I should be able to know if the option "(.*?)" is not setted$/ do |option|
|
|
24
|
-
@
|
|
25
|
-
@
|
|
20
|
+
@browser.radios_checked_option_is_not?(option).should be_true
|
|
21
|
+
@browser.close
|
|
26
22
|
end
|
|
27
23
|
|
|
28
24
|
Then /^I should fail when ask if the the option "(.*?)" is not setted$/ do |option|
|
|
29
|
-
@
|
|
30
|
-
@
|
|
25
|
+
@browser.radios_checked_option_is_not?(option).should be_false
|
|
26
|
+
@browser.close
|
|
31
27
|
end
|
|
32
28
|
|
|
33
29
|
Then /^I should be able to know if the option "(.*?)" is setted$/ do |option|
|
|
34
|
-
@
|
|
35
|
-
@
|
|
30
|
+
@browser.radios_checked_option_is?(option).should be_true
|
|
31
|
+
@browser.close
|
|
36
32
|
end
|
|
37
33
|
|
|
38
34
|
Then /^I should fail when ask if the option "(.*?)" is setted$/ do |option|
|
|
39
|
-
@
|
|
40
|
-
@
|
|
35
|
+
@browser.radios_checked_option_is?(option).should be_false
|
|
36
|
+
@browser.close
|
|
41
37
|
end
|
|
42
38
|
|
|
43
39
|
Then /^I should be able to know if there is some options setted$/ do
|
|
44
|
-
@
|
|
45
|
-
@
|
|
40
|
+
@browser.radios_has_selected_option?.should be_true
|
|
41
|
+
@browser.close
|
|
46
42
|
end
|
|
47
43
|
|
|
48
44
|
Then /^I should fail when ask if there is some options setted$/ do
|
|
49
|
-
@
|
|
50
|
-
@
|
|
45
|
+
@browser.radios_has_selected_option?.should be_false
|
|
46
|
+
@browser.close
|
|
51
47
|
end
|
|
52
48
|
|
|
53
49
|
Then /^I should be able to select the option "(.*?)"$/ do |option|
|
|
54
|
-
@
|
|
50
|
+
@browser.radios_set(option)
|
|
55
51
|
end
|
|
@@ -1,39 +1,33 @@
|
|
|
1
|
-
Given /^I am on a page that has a select$/ do
|
|
2
|
-
@page = StaticPages::Site::Firefox.new
|
|
3
|
-
@page.context StaticPages::Site::InputPage
|
|
4
|
-
@page.visit
|
|
5
|
-
end
|
|
6
|
-
|
|
7
1
|
Then /^I should be able to get the options available of it$/ do
|
|
8
|
-
@
|
|
9
|
-
@
|
|
2
|
+
@browser.select_get_options.should == ["...","Cello","Cucumber","Ruby","Rspec","QA Rocks!"]
|
|
3
|
+
@browser.close
|
|
10
4
|
end
|
|
11
5
|
|
|
12
6
|
Then /^I should be able to select an option on it$/ do
|
|
13
|
-
@
|
|
7
|
+
@browser.select_select("Cucumber")
|
|
14
8
|
end
|
|
15
9
|
|
|
16
10
|
Then /^be sure that the option setted is the option selected$/ do
|
|
17
|
-
@
|
|
18
|
-
@
|
|
11
|
+
@browser.select_is("Cucumber").should be_true
|
|
12
|
+
@browser.close
|
|
19
13
|
end
|
|
20
14
|
|
|
21
15
|
Given /^the option "(.*?)" is selected$/ do |option|
|
|
22
|
-
@
|
|
16
|
+
@browser.select_select option
|
|
23
17
|
end
|
|
24
18
|
|
|
25
19
|
Then /^I should be able to know the option "(.*?)" is selected$/ do |option|
|
|
26
|
-
@
|
|
27
|
-
@
|
|
20
|
+
@browser.select_selected.should == option
|
|
21
|
+
@browser.close
|
|
28
22
|
end
|
|
29
23
|
|
|
30
24
|
Then /^I should fail when ask if the option "(.*?)" is selected$/ do |option|
|
|
31
|
-
@
|
|
32
|
-
@
|
|
25
|
+
@browser.select_selected.should_not == option
|
|
26
|
+
@browser.close
|
|
33
27
|
end
|
|
34
28
|
|
|
35
29
|
Then /^I should be able to go to the default option of it$/ do
|
|
36
|
-
@
|
|
37
|
-
@
|
|
30
|
+
@browser.select_clear
|
|
31
|
+
@browser.select_selected.should == "..."
|
|
38
32
|
end
|
|
39
33
|
|