Created
May 31, 2012 12:30
-
-
Save smerrill/2843077 to your computer and use it in GitHub Desktop.
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
casper = require('casper').create({ | |
verbose: true, | |
logLevel: "debug" | |
}) | |
# Variables for the tests. | |
url = "http://georgia.gov" | |
breakpoints = [ | |
[1280, 1024], | |
[960, 640], | |
[480, 320] | |
] | |
links = [ | |
"/", | |
"/search?query=georgia", | |
#"/agency-list", | |
#"/environment", | |
] | |
casper.start() | |
casper.each links, (self, link) -> | |
fullUrl = url + link | |
# Reset the viewport. | |
@viewport breakpoints[0][0], breakpoints[0][1] | |
@thenOpen fullUrl, -> | |
# Reset the viewport. | |
@viewport breakpoints[0][0], breakpoints[0][1] | |
@test.assertHttpStatus 200, "#{link} was found." | |
@each breakpoints, (self, breakpoint) -> | |
@viewport breakpoint[0], breakpoint[1] | |
@capture fullUrl.replace(/[^a-zA-Z0-9]/gi,'-').replace(/^https?-+/, '') + breakpoint[0] + ".png" | |
casper.run -> | |
# Show the test results. | |
@test.renderResults true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment