-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renamed get-scrreenshot_by_filename to screenshot and added tests.
- Loading branch information
Og B. Maciel
committed
Oct 7, 2013
1 parent
d2dacbd
commit 9913fbb
Showing
4 changed files
with
39 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# Copyright 2013 splinter authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style | ||
# license that can be found in the LICENSE file. | ||
|
||
class ScreenshotTest(object): | ||
|
||
def test_take_screenshot(self): | ||
"should take a screenshot of the current page" | ||
filename = self.browser.screenshot() | ||
self.assertTrue('tmp' in filename) | ||
|
||
def test_take_screenshot_with_prefix(self): | ||
"should add the prefix to the screenshot file name" | ||
filename = self.browser.screenshot(name='foobar') | ||
self.assertTrue('foobar' in filename) | ||
|
||
def test_take_screenshot_with_suffix(self): | ||
"should add the suffix to the screenshot file name" | ||
filename = self.browser.screenshot(suffix='jpeg') | ||
self.assertEqual('jpg', filename[-3:]) |