Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions lib/page-object/accessors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,6 @@ def row(name, identifier={:index => 0}, &block)
def image(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'image_for', &block)
define_method("#{name}_loaded?") do
return platform.image_loaded_for identifier.clone unless block_given?
self.send("#{name}_element").loaded?
end
end
Expand Down Expand Up @@ -622,7 +621,6 @@ def form(name, identifier={:index => 0}, &block)
def list_item(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'list_item_for', &block)
define_method(name) do
return platform.list_item_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end
Expand All @@ -644,7 +642,6 @@ def list_item(name, identifier={:index => 0}, &block)
def unordered_list(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'unordered_list_for', &block)
define_method(name) do
return platform.unordered_list_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end
Expand All @@ -666,7 +663,6 @@ def unordered_list(name, identifier={:index => 0}, &block)
def ordered_list(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'ordered_list_for', &block)
define_method(name) do
return platform.ordered_list_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end
Expand All @@ -688,7 +684,6 @@ def ordered_list(name, identifier={:index => 0}, &block)
def h1(name, identifier={:index => 0}, &block)
standard_methods(name, identifier,'h1_for', &block)
define_method(name) do
return platform.h1_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end
Expand All @@ -708,7 +703,6 @@ def h1(name, identifier={:index => 0}, &block)
def h2(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'h2_for', &block)
define_method(name) do
return platform.h2_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end
Expand All @@ -728,7 +722,6 @@ def h2(name, identifier={:index => 0}, &block)
def h3(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'h3_for', &block)
define_method(name) do
return platform.h3_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end
Expand All @@ -748,7 +741,6 @@ def h3(name, identifier={:index => 0}, &block)
def h4(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'h4_for', &block)
define_method(name) do
return platform.h4_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end
Expand All @@ -768,7 +760,6 @@ def h4(name, identifier={:index => 0}, &block)
def h5(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'h5_for', &block)
define_method(name) do
return platform.h5_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end
Expand All @@ -788,7 +779,6 @@ def h5(name, identifier={:index => 0}, &block)
def h6(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'h6_for', &block)
define_method(name) do
return platform.h6_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end
Expand All @@ -808,7 +798,6 @@ def h6(name, identifier={:index => 0}, &block)
def paragraph(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'paragraph_for', &block)
define_method(name) do
return platform.paragraph_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end
Expand All @@ -829,8 +818,7 @@ def paragraph(name, identifier={:index => 0}, &block)
def file_field(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'file_field_for', &block)
define_method("#{name}=") do |value|
return platform.file_field_value_set(identifier.clone, value) unless block_given?
self.send("#{name}_element").value = value
self.send("#{name}_element").set(value)
end
end

Expand All @@ -849,7 +837,6 @@ def file_field(name, identifier={:index => 0}, &block)
def label(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'label_for', &block)
define_method(name) do
return platform.label_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end
Expand All @@ -869,7 +856,6 @@ def label(name, identifier={:index => 0}, &block)
def area(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'area_for', &block)
define_method(name) do
return platform.click_area_for identifier.clone unless block_given?
self.send("#{name}_element").click
end
end
Expand Down Expand Up @@ -937,7 +923,6 @@ def video(name, identifier={:index => 0}, &block)
def b(name, identifier={:index => 0}, &block)
standard_methods(name, identifier,'b_for', &block)
define_method(name) do
return platform.b_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end
Expand All @@ -957,7 +942,6 @@ def b(name, identifier={:index => 0}, &block)
def i(name, identifier={:index => 0}, &block)
standard_methods(name, identifier,'i_for', &block)
define_method(name) do
return platform.i_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end
Expand Down
128 changes: 0 additions & 128 deletions lib/page-object/platforms/watir/page_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -591,14 +591,6 @@ def rows_for(identifier)
find_watir_elements("trs(identifier)", Elements::TableRow, identifier, 'tr')
end

#
# platform method to retrieve load status of an image element
# See PageObject::Accessors#image
#
def image_loaded_for(identifier)
process_watir_call("image(identifier).loaded?", Elements::Image, identifier)
end

#
# platform method to retrieve an image element
# See PageObject::Accessors#image
Expand Down Expand Up @@ -629,14 +621,6 @@ def forms_for(identifier)
find_watir_elements("forms(identifier)", Elements::Form, identifier)
end

#
# platform method to retrieve the text from a list item
# See PageObject::Accessors#list_item
#
def list_item_text_for(identifier)
process_watir_call("li(identifier).text", Elements::ListItem, identifier, nil, 'li')
end

#
# platform method to retrieve a list item element
# See PageObject::Accessors#list_item
Expand All @@ -652,14 +636,6 @@ def list_items_for(identifier)
find_watir_elements("lis(identifier)", Elements::ListItem, identifier, 'li')
end

#
# platform method to retrieve the text from an unordered list
# See PageObject::Accessors#unordered_list
#
def unordered_list_text_for(identifier)
process_watir_call("ul(identifier).text", Elements::UnorderedList, identifier, nil, 'ul')
end

#
# platform method to retrieve an unordered list element
# See PageObject::Accessors#unordered_list
Expand All @@ -675,14 +651,6 @@ def unordered_lists_for(identifier)
find_watir_elements("uls(identifier)", Elements::UnorderedList, identifier, 'ul')
end

#
# platform method to retrieve the text from an ordered list
# See PageObject::Accessors#ordered_list
#
def ordered_list_text_for(identifier)
process_watir_call("ol(identifier).text", Elements::OrderedList, identifier, nil, 'ol')
end

#
# platform method to retrieve an ordered list element
# See PageObject::Accessors#ordered_list
Expand All @@ -698,14 +666,6 @@ def ordered_lists_for(identifier)
find_watir_elements("ols(identifier)", Elements::OrderedList, identifier, 'ol')
end

#
# platform method to retrieve the text for a h1
# See PageObject::Accessors#h1
#
def h1_text_for(identifier)
process_watir_call("h1(identifier).text", Elements::Heading, identifier, nil, 'h1')
end

#
# platform method to retrieve the h1 element
# See PageObject::Accessors#h1
Expand All @@ -721,14 +681,6 @@ def h1s_for(identifier)
find_watir_elements("h1s(identifier)", Elements::Heading, identifier, 'h1')
end

#
# platform method to retrieve the text for a h2
# See PageObject::Accessors#h2
#
def h2_text_for(identifier)
process_watir_call("h2(identifier).text", Elements::Heading, identifier, nil, 'h2')
end

#
# platform method to retrieve the h2 element
# See PageObject::Accessors#h2
Expand All @@ -744,14 +696,6 @@ def h2s_for(identifier)
find_watir_elements("h2s(identifier)", Elements::Heading, identifier, 'h2')
end

#
# platform method to retrieve the text for a h3
# See PageObject::Accessors#h3
#
def h3_text_for(identifier)
process_watir_call("h3(identifier).text", Elements::Heading, identifier, nil, 'h3')
end

#
# platform method to retrieve the h3 element
# See PageObject::Accessors#h3
Expand All @@ -767,14 +711,6 @@ def h3s_for(identifier)
find_watir_elements("h3s(identifier)", Elements::Heading, identifier, 'h3')
end

#
# platform method to retrieve the text for a h4
# See PageObject::Accessors#h4
#
def h4_text_for(identifier)
process_watir_call("h4(identifier).text", Elements::Heading, identifier, nil, 'h4')
end

#
# platform method to retrieve the h4 element
# See PageObject::Accessors#h4
Expand All @@ -790,14 +726,6 @@ def h4s_for(identifier)
find_watir_elements("h4s(identifier)", Elements::Heading, identifier, 'h4')
end

#
# platform method to retrieve the text for a h5
# See PageObject::Accessors#h5
#
def h5_text_for(identifier)
process_watir_call("h5(identifier).text", Elements::Heading, identifier, nil, 'h5')
end

#
# platform method to retrieve the h5 element
# See PageObject::Accessors#h5
Expand All @@ -813,14 +741,6 @@ def h5s_for(identifier)
find_watir_elements("h5s(identifier)", Elements::Heading, identifier, 'h5')
end

#
# platform method to retrieve the text for a h6
# See PageObject::Accessors#h6
#
def h6_text_for(identifier)
process_watir_call("h6(identifier).text", Elements::Heading, identifier, nil, 'h6')
end

#
# platform method to retrieve the h6 element
# See PageObject::Accessors#h6
Expand All @@ -836,14 +756,6 @@ def h6s_for(identifier)
find_watir_elements("h6s(identifier)", Elements::Heading, identifier, 'h6')
end

#
# platform method to retrieve the text for a paragraph
# See PageObject::Accessors#paragraph
#
def paragraph_text_for(identifier)
process_watir_call("p(identifier).text", Elements::Paragraph, identifier, nil, 'p')
end

#
# platform method to retrieve the paragraph element
# See PageObject::Accessors#paragraph
Expand All @@ -859,14 +771,6 @@ def paragraphs_for(identifier)
find_watir_elements("ps(identifier)", Elements::Paragraph, identifier, 'p')
end

#
# platform method to return the text for a label
# See PageObject::Accessors#label
#
def label_text_for(identifier)
process_watir_call("label(identifier).text", Elements::Label, identifier, nil, 'label')
end

#
# platform method to return a PageObject::Elements::Label element
# See PageObject::Accessors#label
Expand All @@ -883,15 +787,6 @@ def labels_for(identifier)
find_watir_elements("labels(identifier)", Elements::Label, identifier, 'label')
end

#
# platform method to set the file on a file_field element
# See PageObject::Accessors#file_field
#
def file_field_value_set(identifier, value)
process_watir_call("file_field(identifier).set(value)", Elements::FileField,
identifier, value)
end

#
# platform method to retrieve a file_field element
# See PageObject::Accessors#file_field
Expand All @@ -907,13 +802,6 @@ def file_fields_for(identifier)
find_watir_elements("file_fields(identifier)", Elements::FileField, identifier)
end

#
# platform method to click on an area
#
def click_area_for(identifier)
process_watir_call("area(identifier).click", Elements::Area, identifier, nil, 'area')
end

#
# platform method to retrieve an area element
#
Expand Down Expand Up @@ -1016,14 +904,6 @@ def svgs_for(identifier)
find_watir_elements("element(identifier)", Elements::Element, identifier)
end

#
# platform method to retrieve the text for a b
# See PageObject::Accessors#b
#
def b_text_for(identifier)
process_watir_call("b(identifier).text", Elements::Bold, identifier, nil, 'b')
end

#
# platform method to retrieve the b element
# See PageObject::Accessors#b
Expand All @@ -1039,14 +919,6 @@ def bs_for(identifier)
find_watir_elements("bs(identifier)", Elements::Bold, identifier, 'b')
end

#
# platform method to retrieve the text for a i
# See PageObject::Accessors#i
#
def i_text_for(identifier)
process_watir_call("i(identifier).text", Elements::Italic, identifier, nil, 'i')
end

#
# platform method to retrieve the i element
# See PageObject::Accessors#i
Expand Down