Skip to content

Commit

Permalink
Unused action report works properly now
Browse files Browse the repository at this point in the history
  • Loading branch information
heynemann committed May 10, 2010
1 parent b40f34f commit b110f97
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 2 deletions.
4 changes: 4 additions & 0 deletions pyccuracy/actions/core/checkbox_actions.py
Expand Up @@ -28,6 +28,7 @@ class CheckboxCheckAction(ActionBase):
h3. Description
This action checks the given checkbox.'''
__builtin__ = True
regex = LanguageItem("checkbox_check_regex")

def execute(self, context, checkbox_key):
Expand All @@ -46,6 +47,7 @@ class CheckboxUncheckAction(ActionBase):
h3. Description
This action unchecks the given checkbox.'''
__builtin__ = True
regex = LanguageItem("checkbox_uncheck_regex")

def execute(self, context, checkbox_key):
Expand All @@ -64,6 +66,7 @@ class CheckboxIsCheckedAction(ActionBase):
h3. Description
This action asserts that the given checkbox is checked.'''
__builtin__ = True
regex = LanguageItem("checkbox_is_checked_regex")

def execute(self, context, checkbox_key):
Expand All @@ -84,6 +87,7 @@ class CheckboxIsNotCheckedAction(ActionBase):
h3. Description
This action asserts that the given checkbox is not checked.'''
__builtin__ = True
regex = LanguageItem("checkbox_is_not_checked_regex")

def execute(self, context, checkbox_key):
Expand Down
20 changes: 20 additions & 0 deletions pyccuracy/actions/core/element_actions.py
Expand Up @@ -70,6 +70,7 @@ class ElementDoesNotContainStyleAction(ActionBase):
h3. Description
This action asserts that the given element does not have the given style with any value.'''
__builtin__ = True
regex = LanguageItem('element_does_not_contain_style_regex')

def execute(self, context, element_type, element_name, style_name):
Expand All @@ -94,6 +95,7 @@ class ElementContainsStyleAction(ActionBase):
h3. Description
This action asserts that the given element has the given style with any value.'''
__builtin__ = True
regex = LanguageItem('element_contains_style_regex')

def execute(self, context, element_type, element_name, style_name):
Expand All @@ -118,6 +120,7 @@ class ElementClickAction(ActionBase):
h3. Description
This action instructs the browser driver to click the given element. If the "and wait" suffix is used, a "Wait for page to load" action is executed after this one.'''
__builtin__ = True
regex = LanguageItem('element_click_regex')

def execute(self, context, element_type, element_name, should_wait):
Expand Down Expand Up @@ -146,6 +149,7 @@ class ElementIsVisibleAction(ActionBase):
h3. Description
This action asserts that the given element is visible.'''
__builtin__ = True
regex = LanguageItem('element_is_visible_regex')

def execute(self, context, element_type, element_name):
Expand All @@ -163,6 +167,7 @@ class ElementIsNotVisibleAction(ActionBase):
h3. Description
This action asserts that the given element is not visible.'''
__builtin__ = True
regex = LanguageItem('element_is_not_visible_regex')

def execute(self, context, element_type, element_name):
Expand All @@ -180,6 +185,7 @@ class ElementIsEnabledAction(ActionBase):
h3. Description
This action asserts that the given element is enabled.'''
__builtin__ = True
regex = LanguageItem('element_is_enabled_regex')

def execute(self, context, element_type, element_name):
Expand All @@ -201,6 +207,7 @@ class ElementIsDisabledAction(ActionBase):
h3. Description
This action asserts that the given element is disabled.'''
__builtin__ = True
regex = LanguageItem('element_is_disabled_regex')

def execute(self, context, element_type, element_name):
Expand All @@ -225,6 +232,7 @@ class ElementWaitForPresenceAction(ActionBase):
This action is really useful when you have some processing done (maybe AJAX) before an element is dynamically created.
'''
__builtin__ = True
regex = LanguageItem("element_wait_for_presence_regex")

def execute(self, context, element_type, element_name, timeout):
Expand All @@ -250,6 +258,7 @@ class ElementWaitForDisappearAction(ActionBase):
This action is really useful when you have some processing done (maybe AJAX) before an element is dynamically removed or hidden.
'''
__builtin__ = True
regex = LanguageItem("element_wait_for_disappear_regex")

def execute(self, context, element_type, element_name, timeout):
Expand All @@ -271,6 +280,7 @@ class ElementDragAction(ActionBase):
h3. Description
This action instructs the browser driver to drag the "from" element to the "target" element.'''
__builtin__ = True
regex = LanguageItem("element_drag_drop_regex")

def execute(self, context, from_element_type, from_element_name, to_element_type, to_element_name):
Expand All @@ -291,6 +301,7 @@ class ElementContainsTextAction(ActionBase):
h3. Description
This action asserts that the text for the given element contains the specified one.'''
__builtin__ = True
regex = LanguageItem("element_contains_text_regex")

def execute(self, context, element_type, element_name, text):
Expand All @@ -312,6 +323,7 @@ class ElementDoesNotContainTextAction(ActionBase):
h3. Description
This action asserts that the text for the given element does not contain the specified one.'''
__builtin__ = True
regex = LanguageItem("element_does_not_contain_text_regex")

def execute(self, context, element_type, element_name, text):
Expand All @@ -333,6 +345,7 @@ class ElementMatchesTextAction(ActionBase):
h3. Description
This action asserts that the text for the given element matches exactly the specified one.'''
__builtin__ = True
regex = LanguageItem("element_matches_text_regex")

def execute(self, context, element_type, element_name, text):
Expand All @@ -354,6 +367,7 @@ class ElementDoesNotMatchTextAction(ActionBase):
h3. Description
This action asserts that the text for the given element does not match exactly the specified one.'''
__builtin__ = True
regex = LanguageItem("element_does_not_match_text_regex")

def execute(self, context, element_type, element_name, text):
Expand All @@ -375,6 +389,7 @@ class ElementContainsMarkupAction(ActionBase):
h3. Description
This action asserts that the markup for the given element contains the specified one.'''
__builtin__ = True
regex = LanguageItem("element_contains_markup_regex")

def execute(self, context, element_type, element_name, markup):
Expand All @@ -396,6 +411,7 @@ class ElementDoesNotContainMarkupAction(ActionBase):
h3. Description
This action asserts that the markup for the given element does not contain the specified one.'''
__builtin__ = True
regex = LanguageItem("element_does_not_contain_markup_regex")

def execute(self, context, element_type, element_name, markup):
Expand All @@ -417,6 +433,7 @@ class ElementMatchesMarkupAction(ActionBase):
h3. Description
This action asserts that the markup for the given element matches exactly the specified one.'''
__builtin__ = True
regex = LanguageItem("element_matches_markup_regex")

def execute(self, context, element_type, element_name, markup):
Expand All @@ -438,6 +455,7 @@ class ElementDoesNotMatchMarkupAction(ActionBase):
h3. Description
This action asserts that the markup for the given element does not match exactly the specified one.'''
__builtin__ = True
regex = LanguageItem("element_does_not_match_markup_regex")

def execute(self, context, element_type, element_name, markup):
Expand All @@ -459,6 +477,7 @@ class ElementMouseoverAction(ActionBase):
h3. Description
This action instructs the browser driver to mouse over the specified element.'''
__builtin__ = True
regex = LanguageItem("element_mouseover_regex")

def execute(self, context, element_type, element_name):
Expand All @@ -476,6 +495,7 @@ class ElementMouseOutAction(ActionBase):
h3. Description
This action instructs the browser driver to remove mouse focus from the specified element.'''
__builtin__ = True
regex = LanguageItem("element_mouseout_regex")

def execute(self, context, element_type, element_name):
Expand Down
2 changes: 2 additions & 0 deletions pyccuracy/actions/core/image_actions.py
Expand Up @@ -28,6 +28,7 @@ class ImageHasSrcOfAction(ActionBase):
h3. Description
This action asserts that an image has the given src attribute.'''
__builtin__ = True
regex = LanguageItem("image_has_src_regex")

def execute(self, context, image_name, src):
Expand All @@ -49,6 +50,7 @@ class ImageDoesNotHaveSrcOfAction(ActionBase):
h3. Description
This action asserts that an image does not have the given src attribute.'''
__builtin__ = True
regex = LanguageItem("image_does_not_have_src_regex")

def execute(self, context, image_name, src):
Expand Down
1 change: 1 addition & 0 deletions pyccuracy/actions/core/link_actions.py
Expand Up @@ -28,6 +28,7 @@ class LinkHasHrefOfAction(ActionBase):
h3. Description
This action asserts that a link has the given href attribute.'''
__builtin__ = True
regex = LanguageItem("link_has_href_regex")

def execute(self, context, link_name, href):
Expand Down
7 changes: 7 additions & 0 deletions pyccuracy/actions/core/page_actions.py
Expand Up @@ -37,6 +37,7 @@ class PageGoToAction(ActionBase):
If you specify an url directly, Pyccuracy sets the current page to None and you can't use registered elements. That might make sense for some scenarios, but is the least preferred way of using this action.
This action also issues automatically a wait for page to load action after navigating. This is important to make sure that the following actions work with a properly loaded page.'''
__builtin__ = True
regex = LanguageItem('page_go_to_regex')

def execute(self, context, url):
Expand Down Expand Up @@ -69,6 +70,7 @@ class PageAmInAction(ActionBase):
The same rule for direct urls of Go to Page applies to this action.
Other than that, this action does not do anything. The main purpose of this action is responding to some client event or redirect that might have changed the current page without our direct action (like submitting a form that redirects us to a different page).'''
__builtin__ = True
regex = LanguageItem("page_am_in_regex")

def execute(self, context, url):
Expand All @@ -94,6 +96,7 @@ class PageSeeTitleAction(ActionBase):
h3. Description
This action asserts that the currently loaded page's title (Browser title) is the specified one. '''
__builtin__ = True
regex = LanguageItem("page_see_title_regex")

def execute(self, context, title):
Expand All @@ -110,6 +113,7 @@ class PageCheckContainsMarkupAction(ActionBase):
h3. Description
This action asserts that the currently loaded page's mark-up contains the given mark-up.'''
__builtin__ = True
regex = LanguageItem("page_check_contains_markup_regex")

def execute(self, context, expected_markup):
Expand All @@ -127,6 +131,7 @@ class PageCheckDoesNotContainMarkupAction(ActionBase):
h3. Description
This action asserts that the currently loaded page's mark-up *does not* contain the given mark-up.'''
__builtin__ = True
regex = LanguageItem("page_check_does_not_contain_markup_regex")

def execute(self, context, expected_markup):
Expand All @@ -145,6 +150,7 @@ class PageWaitForPageToLoadAction(ActionBase):
h3. Description
This action instructs the browser driver to wait for a given number of seconds for the page to load. If it times out, the test fails.'''
__builtin__ = True
regex = LanguageItem("page_wait_for_page_to_load_regex")

def execute(self, context, timeout):
Expand All @@ -168,6 +174,7 @@ class PageWaitForSecondsAction(ActionBase):
h3. Description
This action is just a proxy to Python's time.sleep function. It just hangs for a given number of seconds.'''
__builtin__ = True
regex = LanguageItem("page_wait_for_seconds_regex")

def execute(self, context, timeout):
Expand Down
3 changes: 3 additions & 0 deletions pyccuracy/actions/core/radio_actions.py
Expand Up @@ -28,6 +28,7 @@ class RadioCheckAction(ActionBase):
h3. Description
This action marks the given radio button.'''
__builtin__ = True
regex = LanguageItem("radio_check_regex")

def execute(self, context, radio_key):
Expand All @@ -46,6 +47,7 @@ class RadioIsCheckedAction(ActionBase):
h3. Description
This action asserts that the given radio button is checked.'''
__builtin__ = True
regex = LanguageItem("radio_is_checked_regex")

def execute(self, context, radio_key):
Expand All @@ -66,6 +68,7 @@ class RadioIsNotCheckedAction(ActionBase):
h3. Description
This action asserts that the given radio button is not checked.'''
__builtin__ = True
regex = LanguageItem("radio_is_not_checked_regex")

def execute(self, context, radio_key):
Expand Down
11 changes: 11 additions & 0 deletions pyccuracy/actions/core/select_actions.py
Expand Up @@ -33,6 +33,7 @@ class SelectOptionByValueAction(ActionBase):
This action instructs the browser driver to select the option in the specified select that matches the specified value.'''

__builtin__ = True
regex = LanguageItem("select_option_by_value_regex")

def execute(self, context, select_name, option_value):
Expand All @@ -55,6 +56,7 @@ class SelectHasSelectedValueAction(ActionBase):
h3. Description
This action asserts that the currently selected option in the specified select has the specified value.'''
__builtin__ = True
regex = LanguageItem("select_has_selected_value_regex")

def execute(self, context, select_name, option_value):
Expand All @@ -76,6 +78,7 @@ class SelectOptionByIndexAction(ActionBase):
h3. Description
This action instructs the browser driver to select the option in the specified select with the specified index.'''
__builtin__ = True
regex = LanguageItem("select_option_by_index_regex")

def execute(self, context, select_name, index):
Expand All @@ -99,6 +102,7 @@ class SelectHasSelectedIndexAction(ActionBase):
h3. Description
This action asserts that the currently selected option in the specified select has the specified index.'''
__builtin__ = True
regex = LanguageItem("select_has_selected_index_regex")

def execute(self, context, select_name, index):
Expand All @@ -120,6 +124,7 @@ class SelectOptionByTextAction(ActionBase):
h3. Description
This action instructs the browser driver to select the option in the specified select with the specified text.'''
__builtin__ = True
regex = LanguageItem("select_option_by_text_regex")

def execute(self, context, select_name, text):
Expand All @@ -142,6 +147,7 @@ class SelectHasSelectedTextAction(ActionBase):
h3. Description
This action asserts that the currently selected option in the specified select has the specified text.'''
__builtin__ = True
regex = LanguageItem("select_has_selected_text_regex")

def execute(self, context, select_name, text):
Expand All @@ -163,6 +169,7 @@ class SelectDoesNotHaveSelectedIndexAction(ActionBase):
h3. Description
This action asserts that the currently selected option in the specified select does not have the specified index.'''
__builtin__ = True
regex = LanguageItem("select_does_not_have_selected_index_regex")

def execute(self, context, select_name, index):
Expand All @@ -185,6 +192,7 @@ class SelectDoesNotHaveSelectedValueAction(ActionBase):
h3. Description
This action asserts that the currently selected option in the specified select does not have the specified value.'''
__builtin__ = True
regex = LanguageItem("select_does_not_have_selected_value_regex")

def execute(self, context, select_name, value):
Expand All @@ -207,6 +215,7 @@ class SelectDoesNotHaveSelectedTextAction(ActionBase):
h3. Description
This action asserts that the currently selected option in the specified select does not have the specified text.'''
__builtin__ = True
regex = LanguageItem("select_does_not_have_selected_text_regex")

def execute(self, context, select_name, text):
Expand All @@ -229,6 +238,7 @@ class SelectContainsOptionWithTextAction(ActionBase):
h3. Description
This action asserts that the specified select contains at least one option with the specified text.'''
__builtin__ = True
regex = LanguageItem("select_contains_option_with_text_regex")

def execute(self, context, select_name, text):
Expand All @@ -254,6 +264,7 @@ class SelectDoesNotContainOptionWithTextAction(ActionBase):
h3. Description
This action asserts that the specified select does not contain any options with the specified text.'''
__builtin__ = True
regex = LanguageItem("select_does_not_contain_option_with_text_regex")

def execute(self, context, select_name, text):
Expand Down

0 comments on commit b110f97

Please sign in to comment.