From f6d501819bdf7e650215345c79efc082b468b6c0 Mon Sep 17 00:00:00 2001 From: yackob03 Date: Fri, 11 Oct 2013 14:36:20 -0400 Subject: [PATCH] First check-in of casperjs screenshot generation. --- .gitignore | 3 ++- screenshots/README.md | 5 +++++ screenshots/screenshots.js | 45 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 screenshots/README.md create mode 100644 screenshots/screenshots.js diff --git a/.gitignore b/.gitignore index 2befc02c4..36e2e27dd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.pyc venv .elasticbeanstalk/ -static/snapshots/ \ No newline at end of file +static/snapshots/ +screenshots/*.png diff --git a/screenshots/README.md b/screenshots/README.md new file mode 100644 index 000000000..33a96c219 --- /dev/null +++ b/screenshots/README.md @@ -0,0 +1,5 @@ +run with: + +``` +casperjs screenshots.js +``` diff --git a/screenshots/screenshots.js b/screenshots/screenshots.js new file mode 100644 index 000000000..b0f0d7233 --- /dev/null +++ b/screenshots/screenshots.js @@ -0,0 +1,45 @@ +var casper = require('casper').create({ + viewportSize: { + width: 1024, + height: 768 + }, + verbose: true, + logLevel: "debug" +}); + +var rootUrl = 'https://quay.io/'; + +casper.start(rootUrl); + +casper.on("remote.message", function(msg, trace) { + this.echo("Message: " + msg, "DEBUG"); +}); + +casper.on("page.error", function(msg, trace) { + this.echo("Page error: " + msg, "ERROR"); +}); + +casper.then(function() { + this.capture('landing.png'); +}); + +casper.thenOpen(rootUrl + 'signin'), function () { + this.fill('form', { + 'username': 'devtable', + 'password': 'C>K98%y"_=54x"<', + }, true); +}; + +casper.then(function() { + this.capture('filled-signin.png'); +}); + +casper.then(function() { + this.waitForText('Your Top Repositories'); +}); + +casper.then(function() { + this.capture('user-home.png'); +}); + +casper.run();