This repository has been archived by the owner on Jan 11, 2018. It is now read-only.
forked from d3ming/tagcompare
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tmillner
committed
Dec 29, 2015
1 parent
76555c4
commit bbe2e67
Showing
3 changed files
with
43 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,8 @@ | |
}, | ||
"types": { | ||
"iframe": true, | ||
"script": false | ||
"script": false, | ||
"preview": false | ||
} | ||
}, | ||
"saucelabs": { | ||
|
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,40 @@ | ||
import pytest | ||
import os | ||
|
||
from tagcompare import capture | ||
from tagcompare import webdriver | ||
from tagcompare import output | ||
|
||
|
||
@pytest.mark.integration | ||
def test_capture_preview_override(): | ||
test_capture_preview(True) | ||
|
||
|
||
@pytest.mark.integration | ||
def test_capture_preview_dont_override(): | ||
test_capture_preview(False) | ||
|
||
|
||
def test_capture_preview(override): | ||
""" | ||
Verify that we can render the previews | ||
:return: | ||
""" | ||
pb = output.create(build="capture_tag_test", config="testconfig", cid="testcid", | ||
tagsize="leaderboard", tagtype="preview") | ||
capabilities = { | ||
"platform": "Windows 7", | ||
"browserName": "firefox" | ||
} | ||
driver = webdriver.setup_webdriver(capabilities) | ||
result = capture.__capture_preview(pathbuilder=pb, | ||
driver=driver, | ||
capture_existing=override) | ||
driver.quit() | ||
assert result is not None, "Could not capture tags!" | ||
assert result is not False, "Tag capture skipped!" | ||
assert len(result) == 0, "Errors while capturing preview!" | ||
assert os.path.exists(pb.tagimage), "tagimage was not captured!" | ||
assert os.path.exists(pb.taghtml), "taghtml was not captured!" | ||
pb.rmbuild() |
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