Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
42 additions
and
53 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 |
---|---|---|
@@ -1,11 +1,6 @@ | ||
module CapybaraPageObject | ||
class Anchor < CapybaraPageObject::Element | ||
def link | ||
source[:href] | ||
end | ||
|
||
def uri | ||
URI link | ||
end | ||
field(:link) { source[:href] } | ||
field(:uri) { URI link } | ||
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 |
---|---|---|
@@ -1,15 +1,7 @@ | ||
module CapybaraPageObject | ||
class Head < CapybaraPageObject::Element | ||
def title | ||
find('title').text | ||
end | ||
|
||
def meta_description | ||
find('meta[@name="description"]')['content'] | ||
end | ||
|
||
def meta_keywords | ||
find('meta[@name="keywords"]')['content'].split(',').collect(&:strip) | ||
end | ||
field(:title) { find('title').text } | ||
field(:meta_description) { find('meta[@name="description"]')['content'] } | ||
field(:meta_keywords) { find('meta[@name="keywords"]')['content'].split(',').collect(&:strip) } | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,7 @@ | ||
module CapybaraPageObject | ||
class Image < CapybaraPageObject::Element | ||
def key | ||
alt | ||
end | ||
|
||
def value | ||
URI(source[:src]) | ||
end | ||
|
||
def alt | ||
source[:alt].strip | ||
end | ||
field(:key) { alt } | ||
field(:value) { URI(source[:src]) } | ||
field(:alt){ source[:alt].strip } | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,6 @@ | ||
module CapybaraPageObject | ||
class Meta < CapybaraPageObject::Element | ||
def key | ||
source[:name] | ||
end | ||
|
||
def value | ||
source[:content] | ||
end | ||
field(:key) { source[:name] } | ||
field(:value) { source[:content] } | ||
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
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