2014-05-19 18:14:18 +00:00
|
|
|
var width = 1060;
|
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';
|
2014-03-17 21:34:23 +00:00
|
|
|
var org = isDebug ? 'buynlarge' : 'devtable'
|
|
|
|
var orgrepo = isDebug ? 'buynlarge/orgrepo' : 'quay/testconnect2';
|
|
|
|
var buildrepo = isDebug ? 'devtable/building' : 'quay/testconnect2';
|
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 () {
|
2014-03-17 21:34:23 +00:00
|
|
|
this.wait(1000);
|
|
|
|
});
|
|
|
|
|
|
|
|
casper.thenClick('.accordion-toggle[data-target="#collapseSignin"]', function() {
|
|
|
|
this.wait(1000);
|
|
|
|
});
|
|
|
|
|
|
|
|
casper.then(function () {
|
2013-10-20 05:09:24 +00:00
|
|
|
this.fill('.form-signin', {
|
2014-03-17 21:34:23 +00:00
|
|
|
'username': isDebug ? 'devtable' : 'quaydemo',
|
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() {
|
2014-03-17 21:34:23 +00:00
|
|
|
this.waitForSelector('.fa-lock');
|
2014-01-10 01:22:22 +00:00
|
|
|
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-05-19 18:14:18 +00:00
|
|
|
|
|
|
|
casper.thenClick('a[data-image="c3d710edbd3b"]', function() {
|
|
|
|
this.waitForText('And 3048 more...', function() {
|
|
|
|
this.capture(outputDir + 'image-view.png');
|
|
|
|
});
|
2014-01-10 01:22:22 +00:00
|
|
|
});
|
|
|
|
|
2014-05-19 18:14:18 +00:00
|
|
|
casper.thenClick('.image-link', function() {
|
2013-10-20 05:09:24 +00:00
|
|
|
this.waitForSelector('.result-count', function() {
|
|
|
|
this.capture(outputDir + 'repo-changes.png', {
|
|
|
|
top: 0,
|
|
|
|
left: 0,
|
|
|
|
width: width,
|
|
|
|
height: height
|
|
|
|
});
|
|
|
|
});
|
2014-05-19 18:14:18 +00:00
|
|
|
});
|
|
|
|
|
2013-10-20 05:09:24 +00:00
|
|
|
|
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() {
|
2014-01-10 17:40:14 +00:00
|
|
|
this.capture(outputDir + 'org-logs.png', {
|
|
|
|
top: 0,
|
|
|
|
left: 0,
|
|
|
|
width: width,
|
|
|
|
height: height + 200
|
|
|
|
});
|
2014-01-10 01:22:22 +00:00
|
|
|
});
|
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.');
|
|
|
|
});
|
|
|
|
|
2014-03-17 21:34:23 +00:00
|
|
|
casper.thenOpen(rootUrl + 'repository/' + orgrepo + '/admin', function() {
|
|
|
|
this.waitForText('Robot Account')
|
2013-11-08 04:36:16 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
casper.then(function() {
|
|
|
|
this.capture(outputDir + 'org-repo-admin.png');
|
|
|
|
});
|
|
|
|
|
2014-03-17 21:34:23 +00:00
|
|
|
|
|
|
|
casper.then(function() {
|
|
|
|
this.log('Generating build history screenshot.');
|
|
|
|
});
|
|
|
|
|
|
|
|
casper.thenOpen(rootUrl + 'repository/' + buildrepo + '/build', function() {
|
|
|
|
this.waitForText('Starting');
|
|
|
|
});
|
|
|
|
|
|
|
|
casper.then(function() {
|
|
|
|
this.capture(outputDir + 'build-history.png');
|
|
|
|
});
|
|
|
|
|
2013-10-11 18:36:20 +00:00
|
|
|
casper.run();
|