예제 #1
0
    def test_capture_shoould_vefify_screenshot_file_for_file_based_custom_screenshot(self):
        first_screenshot = os.path.join(
            os.getenv("gauge_screenshots_dir"), "screenshot{0}.png".format(uuid1()))
        second_screenshot = os.path.join(
            os.getenv("gauge_screenshots_dir"), "screenshot{0}.png".format(uuid1()))

        def returns_abs_path():
            return first_screenshot

        def returns_base_ath():
            return os.path.basename(second_screenshot)
        registry.set_screenshot_provider(returns_abs_path, True)
        ScreenshotsStore.capture()
        self.assertEqual([os.path.basename(first_screenshot)],
                         ScreenshotsStore.pending_screenshots())

        registry.set_screenshot_provider(returns_base_ath, True)
        ScreenshotsStore.capture()
        self.assertEqual([os.path.basename(second_screenshot)],
                         ScreenshotsStore.pending_screenshots())
예제 #2
0
def custom_screenshot_writer(func):
    registry.set_screenshot_provider(func, True)
    return func
예제 #3
0
def custom_screen_grabber(func):
    _warn_screenshot_deprecation('custom_screen_grabber',
                                 'custom_screenshot_writer')
    registry.set_screenshot_provider(func, False)
    return func
예제 #4
0
def screenshot(func):
    registry.set_screenshot_provider(func)
    return func
예제 #5
0
def custom_screen_grabber(func):
    registry.set_screenshot_provider(func)
    return func
예제 #6
0
def screenshot(func):
    _warn_screenshot_deprecation()
    registry.set_screenshot_provider(func)
    return func
예제 #7
0
def screenshot(func):
    registry.set_screenshot_provider(func)
    return func
예제 #8
0
 def tearDown(self):
     registry.set_screenshot_provider(
         self.__old_screenshot_provider, self.__is_screenshot_writer)