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-22 20:36:26 +00:00
|
|
|
var disableOlark = function() {
|
|
|
|
casper.then(function() {
|
2013-11-08 03:46:11 +00:00
|
|
|
this.waitForText('Chat with us!', function() {
|
2013-10-22 20:36:26 +00:00
|
|
|
this.evaluate(function() {
|
|
|
|
console.log(olark);
|
|
|
|
window.olark.configure('box.start_hidden', true);
|
|
|
|
window.olark('api.box.hide');
|
|
|
|
});
|
2013-11-08 03:46:11 +00:00
|
|
|
}, function() {
|
|
|
|
// Do nothing, if olark never loaded we're ok with that
|
2013-10-22 20:36:26 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
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) {
|
|
|
|
this.echo("Message: " + msg, "DEBUG");
|
|
|
|
});
|
|
|
|
|
|
|
|
casper.on("page.error", function(msg, trace) {
|
|
|
|
this.echo("Page error: " + msg, "ERROR");
|
|
|
|
});
|
|
|
|
|
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
|
|
|
});
|
|
|
|
|
2013-10-22 20:36:26 +00:00
|
|
|
disableOlark();
|
|
|
|
|
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
|
|
|
});
|
|
|
|
|
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);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2013-10-22 20:36:26 +00:00
|
|
|
disableOlark();
|
|
|
|
|
2013-10-11 19:02:08 +00:00
|
|
|
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
|
|
|
});
|
|
|
|
|
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
|
|
|
|
});
|
|
|
|
});
|
|
|
|
})
|
|
|
|
|
2013-10-11 19:02:08 +00:00
|
|
|
casper.thenOpen(rootUrl + 'repository/devtable/' + repo + '/admin', function() {
|
|
|
|
this.waitForSelector('.repo-access-state');
|
|
|
|
});
|
|
|
|
|
2013-10-22 20:36:26 +00:00
|
|
|
disableOlark();
|
|
|
|
|
2013-10-11 19:02:08 +00:00
|
|
|
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
|
|
|
});
|
|
|
|
|
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
|
|
|
});
|
|
|
|
|
|
|
|
disableOlark();
|
|
|
|
|
|
|
|
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
|
|
|
});
|
|
|
|
|
|
|
|
casper.thenOpen(rootUrl + 'organization/' + org, function() {
|
|
|
|
this.waitForSelector('.organization-name');
|
|
|
|
});
|
|
|
|
|
|
|
|
disableOlark();
|
|
|
|
|
|
|
|
casper.then(function() {
|
|
|
|
this.capture(outputDir + 'org-teams.png');
|
|
|
|
});
|
|
|
|
|
|
|
|
casper.thenOpen(rootUrl + 'organization/' + org + '/admin', function() {
|
|
|
|
this.waitForSelector('#repository-usage-chart');
|
|
|
|
});
|
|
|
|
|
|
|
|
disableOlark();
|
|
|
|
|
|
|
|
casper.then(function() {
|
|
|
|
this.capture(outputDir + 'org-admin.png');
|
|
|
|
});
|
|
|
|
|
2013-11-08 04:36:16 +00:00
|
|
|
casper.thenOpen(rootUrl + 'repository/' + org + '/' + orgrepo + '/admin', function() {
|
|
|
|
this.waitForText('outsideorg')
|
|
|
|
});
|
|
|
|
|
|
|
|
disableOlark();
|
|
|
|
|
|
|
|
casper.then(function() {
|
|
|
|
this.capture(outputDir + 'org-repo-admin.png');
|
|
|
|
});
|
|
|
|
|
2013-10-11 18:36:20 +00:00
|
|
|
casper.run();
|