Created
February 14, 2013 17:10
-
-
Save Jigarsolanki/4954338 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class CheckDetails | |
| include CommonWaits | |
| def initialize(selenium) | |
| @selenium = selenium | |
| end | |
| def server_details_disabled_check_links | |
| # This uses an Xpath because CSS would find all checks, not just disabled checks | |
| locator_type = :xpath | |
| locator = "//section[contains(@class, 'monitoring-section')]/descendant::div[@class='data_table_row data_table_row_disabled']/descendant::a[@class='linkCell textCellContent']" | |
| wait_for_element_to_be_displayed(locator_type, locator) | |
| objs = Elements.new(@selenium, locator_type, locator).element_array | |
| end | |
| def wait_for_data | |
| locator_type = :css | |
| locator = "#check_status" | |
| obj = Element.new(@selenium, locator_type, locator) | |
| obj.wait_until_visible | |
| end | |
| def field_name(name) | |
| locator_type = :xpath | |
| locator = "//dt[contains(text(), '#{name}')]" | |
| obj = Element.new(@selenium, locator_type, locator) | |
| return locator, obj | |
| end | |
| def field_value(field_locator) | |
| locator_type = :xpath | |
| locator = "#{field_locator}/following-sibling::dd" | |
| obj = Element.new(@selenium, locator_type, locator) | |
| end | |
| def edit_parameters_pencil_icon | |
| locator_type = :css | |
| locator = "#parameters_toggle" | |
| obj = Element.new(@selenium, locator_type, locator) | |
| end | |
| def edit_target_pencil_icon | |
| locator_type = :css | |
| locator = ".details_section #target-toggle" | |
| obj = Button.new(@selenium, locator_type, locator) | |
| end | |
| def get_target | |
| locator_type = :css | |
| locator = ".details_value.check-target" | |
| obj = Element.new(@selenium, locator_type, locator) | |
| end | |
| # Since Create Check and Modify Target use completely different select menus, we need a second set | |
| # of methods for Change Target testing | |
| def target_value | |
| locator_type = :css | |
| locator = "#checkTarget" | |
| obj = List_Box.new(@selenium, locator_type, locator) | |
| end | |
| def target_value_options | |
| locator_type = :css | |
| locator = "#checkTarget option" | |
| wait_for_element_to_be_displayed(locator_type, locator) | |
| obj = Elements.new(@selenium, locator_type, locator).element_array | |
| end | |
| def hostname_textbox | |
| locator_type = :css | |
| locator = ".hostnameContainer #hostname" | |
| obj = TextBox.new(@selenium, locator_type, locator) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment