forked from cheezy/page-object
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request cheezy#1 from sivart84/radio_button_group_tests
Initial commit for radio button group tests
- Loading branch information
Showing
4 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Feature: Radio Button Groups | ||
In order to interact with radio button groups | ||
Testers will need access and interrogation ability | ||
|
||
|
||
Background: | ||
Given I am on the static elements page | ||
|
||
Scenario: Confirm existence of a radio button group | ||
When a page has a radio button group | ||
Then I should see that the radio button group exists | ||
|
||
Scenario: No radio buttons in the group have been selected | ||
When no radio buttons have been selected | ||
Then no radio buttons should be selected | ||
|
||
Scenario: Selecting grouped radio buttons by text | ||
When I select the "Cheddar" radio button | ||
Then the "Cheddar" radio button should be selected | ||
Then the "Emmental" radio button should not be selected | ||
Then the "Muenster" radio button should not be selected | ||
When I select the "Emmental" radio button | ||
Then the "Cheddar" radio button should not be selected | ||
Then the "Emmental" radio button should be selected | ||
Then the "Muenster" radio button should not be selected | ||
|
||
Scenario: Selecting grouped radio buttons by value | ||
When I select the "ched" radio button | ||
Then the "Cheddar" radio button should be selected | ||
Then the "Emmental" radio button should not be selected | ||
Then the "Muenster" radio button should not be selected | ||
When I select the "muen" radio button | ||
Then the "Cheddar" radio button should not be selected | ||
Then the "Emmental" radio button should not be selected | ||
Then the "Muenster" radio button should be selected | ||
|
||
Scenario: Getting an array of elements for each radio button in the group | ||
When I ask for the elements of a radio button group | ||
Then I should have an array with elements for each radio button | ||
And the radio button element values should be "ched", "emmen", "muen" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
When /^no radio buttons have been selected$/ do | ||
# nothing to do here | ||
end | ||
|
||
Then /^no radio buttons should be selected$/ do | ||
@page.favorite_cheese_selected?.should == false | ||
end | ||
|
||
When /^I select the "([^\"]*)" radio button$/ do |how| | ||
@page.send "select_favorite_cheese(#{how})" | ||
end | ||
|
||
Then /^the "([^\"]*)" radio button should be selected$/ do |how| | ||
@page.favorite_cheese_selected?.should == "#{how}" | ||
end | ||
|
||
Then /^the "([^\"]*)" radio button should not be selected$/ do |how| | ||
@page.favorite_cheese_selected?.should != "#{how}" | ||
end | ||
|
||
Then /^I should see that the radio button group exists$/ do | ||
@page.favorite_cheese?.should == true | ||
end | ||
|
||
When /^I ask for the elements of a radio button group$/ do | ||
@elems = @page.favorite_cheese_elements | ||
end | ||
|
||
Then /^I should have an array with elements for each radio button$/ do | ||
@elems.length.should == 3 | ||
end | ||
|
||
And /^the radio button element values should be "([^\"]*)", "([^\"]*)", "([^\"]*)"$/ do |val1, val2, val3| | ||
elem_arr = @elems.collect { |elem| elem.value } | ||
elem_arr.should == [val1, val2, val3] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters