cloudron-e2e-test/test/before.js

51 lines
1.3 KiB
JavaScript
Raw Normal View History

2015-07-27 23:17:37 +00:00
/*
* This test cleans up all t-* cloudrons from previous run.
*/
'use strict';
var AppStore = require('../appstore.js'),
2016-04-02 04:11:58 +00:00
common = require('../common.js'),
execSync = require('child_process').execSync;
2015-07-27 23:17:37 +00:00
require('colors');
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
describe('Cleanup old cloudrons', function () {
this.timeout(0);
var appStore = new AppStore('https://api.staging.cloudron.io');
var owner = common.getOwner();
var admin = common.getAdmin();
2015-07-27 23:17:37 +00:00
var cloudrons;
it('can login to the store', function () {
var accessToken = appStore.getAccessToken(owner);
appStore.setCredentials(owner.password, accessToken);
var adminAccessToken = appStore.getAccessToken(admin);
2015-12-18 16:31:22 +00:00
appStore.setAdminCredentials(admin.password, adminAccessToken);
2015-07-27 23:17:37 +00:00
});
it('can list cloudrons', function () {
cloudrons = appStore.getCloudrons();
});
it('admin can delete the cloudrons', function () {
2015-07-27 23:17:37 +00:00
for (var i = 0; i < cloudrons.length; i++) {
appStore.deleteCloudron(cloudrons[i]);
}
});
});
2016-04-02 04:11:58 +00:00
describe('Fake release', function () {
2016-04-02 05:37:48 +00:00
this.timeout(0);
2016-04-02 04:11:58 +00:00
it('can release a fake version to staging', function () {
execSync(__dirname + '/../../release/release rerelease --env staging', { stdio: [ null, process.stdout, process.stderr ] });
});
});