cloudron-e2e-test/test/000-cleanup.js
Girish Ramakrishnan 6be392841f Add cleanup scripts
2015-07-27 16:17:37 -07:00

44 lines
1.0 KiB
JavaScript

#!/usr/bin/env node
/*
* This test cleans up all t-* cloudrons from previous run.
*/
'use strict';
var AppStore = require('../appstore.js'),
assert = require('assert'),
Cloudron = require('../cloudron.js'),
common = require('../common.js'),
request = require('superagent-sync'),
semver = require('semver');
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 cloudrons;
it('can login to the store', function () {
var accessToken = appStore.getAccessToken(owner);
appStore.setCredentials(owner.password, accessToken);
});
it('can list cloudrons', function () {
cloudrons = appStore.getCloudrons();
});
it('can delete the cloudrons', function () {
for (var i = 0; i < cloudrons.length; i++) {
appStore.deleteCloudron(cloudrons[i]);
}
});
});