fdutils/selenium_util/decorators.py
def with_screen_shot(before=True, after=True, name_to_use=''):
    """ decorator to retrieve the screen shot at the beginning and end of the called method.
        This decorator should be used only on Site instance methods or it will raise an Exception

    There are two hidden kwargs that can be passed to alter the behavior of this decorator on running time:
        get_screen_shot: flag to tell the system to get the shot even if there is no test attached to it
        name_to_use_for_shot: string to be used for the name (appended to the timestamp) instead of the function name

    :param before: flag to indicate that we want a shot before the function
    :param after: flag to indicate that we want a shot after the function
    :return:
    """

    def function_deco(f):
        @functools.wraps(f)
        def wrapper(self, *args, **kwargs):

            name_for_shot = kwargs.pop('name_to_use_for_shot', name_to_use)
            f_name = name_for_shot if name_for_shot else f.__name__[:MAX_LENGTH_FUNCTION_NAME_TO_RECORD]

            if before:
                self.get_screenshot('before_' + f_name, True)

            ret = f(self, *args, **kwargs)

            if after:
                self.get_screenshot('after_' + f_name, True)

            return ret

        return wrapper

    return function_deco
 decorator to retrieve the screen shot at the beginning and end of the called method.
        This decorator should be used only on Site instance methods or it will raise an Exception

    There are two hidden kwargs that can be passed to alter the behavior of this decorator on running time:
        get_screen_shot: flag to tell the system to get the shot even if there is no test attached to it
        name_to_use_for_shot: string to be used for the name (appended to the timestamp) instead of the function name

    :param before: flag to indicate that we want a shot before the function
    :param after: flag to indicate that we want a shot after the function
    :return:
    
decorator to retrieve the screen shot at the beginning and end of the called method.
This decorator should be used only on Site instance methods or it will raise an Exception

There are two hidden kwargs that can be passed to alter the behavior of this decorator on running time:
get_screen_shot: flag to tell the system to get the shot even if there is no test attached to it
name_to_use_for_shot: string to be used for the name (appended to the timestamp) instead of the function name
decorator to retrieve the screen shot at the beginning and end of the called method . This decorator should be used only on Site instance methods or it will raise an Exception There are two hidden kwargs that can be passed to alter the behavior of this decorator on running time : get_screen_shot : flag to tell the system to get the shot even if there is no test attached to it name_to_use_for_shot : string to be used for the name ( appended to the timestamp ) instead of the function name
def with_screen_shot(before=True, after=True, name_to_use=''):
    def function_deco(f):
        @functools.wraps(f)
        def wrapper(self, *args, **kwargs):
            name_for_shot = kwargs.pop('name_to_use_for_shot', name_to_use)
            f_name = name_for_shot if name_for_shot else f.__name__[:MAX_LENGTH_FUNCTION_NAME_TO_RECORD]
            if before:
                self.get_screenshot('before_' + f_name, True)
            ret = f(self, *args, **kwargs)
            if after:
                self.get_screenshot('after_' + f_name, True)
            return ret
        return wrapper
    return function_deco
def with_screen_shot ( before = True , after = True , name_to_use = '' ) : def function_deco ( f ) : @ functools . wraps ( f ) def wrapper ( self , * args , ** kwargs ) : name_for_shot = kwargs . pop ( 'name_to_use_for_shot' , name_to_use ) f_name = name_for_shot if name_for_shot else f . __name__ [ : MAX_LENGTH_FUNCTION_NAME_TO_RECORD ] if before : self . get_screenshot ( 'before_' + f_name , True ) ret = f ( self , * args , ** kwargs ) if after : self . get_screenshot ( 'after_' + f_name , True ) return ret return wrapper return function_deco
decorator to retrieve the screen shot at the beginning and end of the called method.
decorator to retrieve the screen shot at the beginning and end of the called method .
""" decorator to retrieve the screen shot at the beginning and end of the called method.
        This decorator should be used only on Site instance methods or it will raise an Exception

    There are two hidden kwargs that can be passed to alter the behavior of this decorator on running time:
        get_screen_shot: flag to tell the system to get the shot even if there is no test attached to it
        name_to_use_for_shot: string to be used for the name (appended to the timestamp) instead of the function name

    :param before: flag to indicate that we want a shot before the function
    :param after: flag to indicate that we want a shot after the function
    :return:
    """
None
before
flag to indicate that we want a shot before the function
flag to indicate that we want a shot before the function
after
flag to indicate that we want a shot after the function
flag to indicate that we want a shot after the function
name_to_use