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#250 from sedx/add_bold_tag
Add support bold tag
Showing
18 changed files
with
274 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Feature: Bold | ||
|
||
Background: | ||
Given I am on the static elements page | ||
|
||
Scenario: Getting the text of headings | ||
When I get the bold text for the "b" element | ||
Then I should see "some text in bold" in bold | ||
|
||
Scenario Outline: Locating b on the Page | ||
When I search bold text for the b by "<search_by>" | ||
Then I should see "some text in bold" in bold | ||
|
||
Scenarios: | ||
| search_by | | ||
| id | | ||
| class | | ||
| name | | ||
| xpath | | ||
| index | | ||
| css | |
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
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,12 @@ | ||
When /^I get the bold text for the "([^\"]*)" element$/ do |el| | ||
@b = @page.send "#{el}_id" | ||
end | ||
|
||
Then /^I should see "([^\"]*)" in bold$/ do |text| | ||
@b.should == text | ||
end | ||
|
||
When /^I search bold text for the (\w+) by "([^"]*)"$/ do |text_decorator, type| | ||
@b = @page.send "#{text_decorator}_#{type}" | ||
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
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
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,11 @@ | ||
module PageObject | ||
module Elements | ||
class Bold < Element | ||
|
||
end | ||
|
||
::PageObject::Elements.tag_to_class[:b] = ::PageObject::Elements::Bold | ||
|
||
|
||
end | ||
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
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 |
---|---|---|
|
@@ -101,6 +101,7 @@ module LocatorGenerator | |
:canvas, | ||
:audio, | ||
:video, | ||
:b, | ||
:svg] | ||
|
||
def self.generate_locators(target) | ||
|
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
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,29 @@ | ||
require 'spec_helper' | ||
require 'page-object/elements' | ||
|
||
describe PageObject::Elements::Bold do | ||
let(:bold) { PageObject::Elements::Bold } | ||
|
||
describe "when mapping how to find an element" do | ||
it "should map watir types to same" do | ||
[:class, :id, :index, :name, :xpath].each do |t| | ||
identifier = bold.watir_identifier_for t => 'value' | ||
identifier.keys.first.should == t | ||
end | ||
end | ||
|
||
it "should map selenium types to same" do | ||
[:class, :id, :index, :name, :xpath].each do |t| | ||
key, value = bold.selenium_identifier_for t => 'value' | ||
key.should == t | ||
end | ||
end | ||
end | ||
|
||
describe "interface" do | ||
|
||
it "should register with tag :b" do | ||
::PageObject::Elements.element_class_for(:b).should == ::PageObject::Elements::Bold | ||
end | ||
end | ||
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
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