First check-in of casperjs screenshot generation.
This commit is contained in:
parent
076ef34ff2
commit
f6d501819b
3 changed files with 52 additions and 1 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
|||
*.pyc
|
||||
venv
|
||||
.elasticbeanstalk/
|
||||
static/snapshots/
|
||||
static/snapshots/
|
||||
screenshots/*.png
|
||||
|
|
5
screenshots/README.md
Normal file
5
screenshots/README.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
run with:
|
||||
|
||||
```
|
||||
casperjs screenshots.js
|
||||
```
|
45
screenshots/screenshots.js
Normal file
45
screenshots/screenshots.js
Normal file
|
@ -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();
|
Reference in a new issue