2013-11-08 03:46:11 +00:00
|
|
|
var width = 1024;
|
2013-10-20 05:09:24 +00:00
|
|
|
var height = 768;
|
|
|
|
|
2013-10-11 18:36:20 +00:00
|
|
|
var casper = require('casper').create({
|
|
|
|
viewportSize: {
|
2013-10-20 05:09:24 +00:00
|
|
|
width: width,
|
|
|
|
height: height
|
2013-10-11 18:36:20 +00:00
|
|
|
},
|
|
|
|
verbose: true,
|
|
|
|
logLevel: "debug"
|
|
|
|
});
|
|
|
|
|
2013-10-11 19:02:08 +00:00
|
|
|
var options = casper.cli.options;
|
|
|
|
var isDebug = !!options['d'];
|
|
|
|
|
2013-10-12 17:31:05 +00:00
|
|
|
var rootUrl = isDebug ? 'http://localhost:5000/' : 'https://quay.io/';
|
2013-10-12 01:28:02 +00:00
|
|
|
var repo = isDebug ? 'complex' : 'r0';
|
2013-11-08 03:46:11 +00:00
|
|
|
var org = isDebug ? 'buynlarge' : 'quay'
|
2013-11-08 04:36:16 +00:00
|
|
|
var orgrepo = 'orgrepo'
|
2013-10-12 01:28:02 +00:00
|
|
|
|
|
|
|
var outputDir = "screenshots/";
|
2013-10-11 18:36:20 +00:00
|
|
|
|
|
|
|
casper.on("remote.message", function(msg, trace) {
|
2013-12-03 03:37:00 +00:00
|
|
|
this.echo("Message: " + msg, "DEBUG");
|
2013-10-11 18:36:20 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
casper.on("page.error", function(msg, trace) {
|
2013-12-03 03:37:00 +00:00
|
|
|
this.echo("Page error: " + msg, "ERROR");
|
|
|
|
for (var i = 0; i < trace.length; i++) {
|
|
|
|
this.echo(JSON.stringify(trace[i]), "ERROR");
|
|
|
|
}
|
2013-10-11 18:36:20 +00:00
|
|
|
});
|
|
|
|
|
2013-10-20 05:09:24 +00:00
|
|
|
casper.start(rootUrl + 'signin', function () {
|
|
|
|
this.fill('.form-signin', {
|
2013-10-11 18:36:20 +00:00
|
|
|
'username': 'devtable',
|
2013-10-11 19:02:08 +00:00
|
|
|
'password': isDebug ? 'password': 'C>K98%y"_=54x"<',
|
2013-11-08 03:46:11 +00:00
|
|
|
}, false);
|
2013-10-11 18:36:20 +00:00
|
|
|
});
|
|
|
|
|
2013-11-08 03:46:11 +00:00
|
|
|
casper.thenClick('.form-signin button[type=submit]', function() {
|
|
|
|
this.waitForText('Top Repositories');
|
2013-10-11 18:36:20 +00:00
|
|
|
});
|
|
|
|
|
2014-01-10 01:22:22 +00:00
|
|
|
casper.then(function() {
|
|
|
|
this.log('Generating user home screenshot.');
|
|
|
|
});
|
2013-10-22 20:36:26 +00:00
|
|
|
|
2013-10-11 18:36:20 +00:00
|
|
|
casper.then(function() {
|
2013-10-12 01:28:02 +00:00
|
|
|
this.capture(outputDir + 'user-home.png');
|
2013-10-11 18:36:20 +00:00
|
|
|
});
|
|
|
|
|
2014-01-10 01:22:22 +00:00
|
|
|
casper.then(function() {
|
|
|
|
this.log('Generating repository view screenshot.');
|
|
|
|
});
|
|
|
|
|
2013-10-20 05:09:24 +00:00
|
|
|
casper.thenOpen(rootUrl + 'repository/devtable/' + repo + '?tag=v2.0', function() {
|
2013-10-11 19:02:08 +00:00
|
|
|
// Wait for the tree to initialize.
|
|
|
|
this.waitForSelector('.image-tree', function() {
|
|
|
|
// Wait for the tree's animation to finish.
|
|
|
|
this.wait(4000);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
casper.then(function() {
|
2013-10-12 01:28:02 +00:00
|
|
|
this.capture(outputDir + 'repo-view.png');
|
2013-10-11 19:02:08 +00:00
|
|
|
});
|
|
|
|
|
2014-01-10 01:22:22 +00:00
|
|
|
casper.then(function() {
|
|
|
|
this.log('Generating repository changes screenshot.');
|
|
|
|
});
|
|
|
|
|
2013-10-20 05:09:24 +00:00
|
|
|
casper.thenClick('#current-image dd a', function() {
|
|
|
|
this.waitForSelector('.result-count', function() {
|
|
|
|
this.capture(outputDir + 'repo-changes.png', {
|
|
|
|
top: 0,
|
|
|
|
left: 0,
|
|
|
|
width: width,
|
|
|
|
height: height
|
|
|
|
});
|
|
|
|
});
|
|
|
|
})
|
|
|
|
|
2014-01-10 01:22:22 +00:00
|
|
|
casper.then(function() {
|
|
|
|
this.log('Generating repository admin screenshot.');
|
|
|
|
});
|
|
|
|
|
2013-10-11 19:02:08 +00:00
|
|
|
casper.thenOpen(rootUrl + 'repository/devtable/' + repo + '/admin', function() {
|
|
|
|
this.waitForSelector('.repo-access-state');
|
|
|
|
});
|
|
|
|
|
|
|
|
casper.then(function() {
|
2013-10-12 01:28:02 +00:00
|
|
|
this.capture(outputDir + 'repo-admin.png');
|
2013-10-11 19:02:08 +00:00
|
|
|
});
|
|
|
|
|
2014-01-10 01:22:22 +00:00
|
|
|
casper.then(function() {
|
|
|
|
this.log('Generating organization repo list screenshot.');
|
|
|
|
});
|
|
|
|
|
2013-11-08 21:27:12 +00:00
|
|
|
casper.thenOpen(rootUrl + 'repository/?namespace=' + org, function() {
|
|
|
|
this.waitForText('Repositories');
|
2013-11-08 03:46:11 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
casper.then(function() {
|
2013-11-08 21:27:12 +00:00
|
|
|
this.capture(outputDir + 'org-repo-list.png');
|
2013-11-08 03:46:11 +00:00
|
|
|
});
|
|
|
|
|
2014-01-10 01:22:22 +00:00
|
|
|
casper.then(function() {
|
|
|
|
this.log('Generating organization teams screenshot.');
|
|
|
|
});
|
|
|
|
|
2013-11-08 03:46:11 +00:00
|
|
|
casper.thenOpen(rootUrl + 'organization/' + org, function() {
|
|
|
|
this.waitForSelector('.organization-name');
|
|
|
|
});
|
|
|
|
|
|
|
|
casper.then(function() {
|
|
|
|
this.capture(outputDir + 'org-teams.png');
|
|
|
|
});
|
|
|
|
|
2014-01-10 01:22:22 +00:00
|
|
|
casper.then(function() {
|
|
|
|
this.log('Generating organization admin screenshot.');
|
|
|
|
});
|
|
|
|
|
2013-11-08 03:46:11 +00:00
|
|
|
casper.thenOpen(rootUrl + 'organization/' + org + '/admin', function() {
|
|
|
|
this.waitForSelector('#repository-usage-chart');
|
|
|
|
});
|
|
|
|
|
|
|
|
casper.then(function() {
|
|
|
|
this.capture(outputDir + 'org-admin.png');
|
|
|
|
});
|
|
|
|
|
2014-01-10 01:22:22 +00:00
|
|
|
casper.then(function() {
|
|
|
|
this.log('Generating organization logs screenshot.');
|
|
|
|
});
|
|
|
|
|
2013-12-03 03:37:00 +00:00
|
|
|
casper.thenClick('a[data-target="#logs"]', function() {
|
|
|
|
this.waitForSelector('svg > g', function() {
|
2014-01-10 01:22:22 +00:00
|
|
|
this.wait(1000, function() {
|
|
|
|
this.capture(outputDir + 'org-logs.png');
|
|
|
|
});
|
2013-12-03 03:37:00 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2014-01-10 01:22:22 +00:00
|
|
|
casper.then(function() {
|
|
|
|
this.log('Generating oganization repository admin screenshot.');
|
|
|
|
});
|
|
|
|
|
2013-11-08 04:36:16 +00:00
|
|
|
casper.thenOpen(rootUrl + 'repository/' + org + '/' + orgrepo + '/admin', function() {
|
|
|
|
this.waitForText('outsideorg')
|
|
|
|
});
|
|
|
|
|
|
|
|
casper.then(function() {
|
|
|
|
this.capture(outputDir + 'org-repo-admin.png');
|
|
|
|
});
|
|
|
|
|
2013-10-11 18:36:20 +00:00
|
|
|
casper.run();
|