|
@@ -33,10 +33,12 @@ describe('Application life cycle test', function () {
|
|
var app, reponame = 'testrepo';
|
|
var app, reponame = 'testrepo';
|
|
var username = process.env.USERNAME;
|
|
var username = process.env.USERNAME;
|
|
var password = process.env.PASSWORD;
|
|
var password = process.env.PASSWORD;
|
|
|
|
+ var email = process.env.EMAIL;
|
|
|
|
|
|
before(function (done) {
|
|
before(function (done) {
|
|
if (!process.env.USERNAME) return done(new Error('USERNAME env var not set'));
|
|
if (!process.env.USERNAME) return done(new Error('USERNAME env var not set'));
|
|
if (!process.env.PASSWORD) return done(new Error('PASSWORD env var not set'));
|
|
if (!process.env.PASSWORD) return done(new Error('PASSWORD env var not set'));
|
|
|
|
+ if (!process.env.EMAIL) return done(new Error('EMAIL env var not set'));
|
|
|
|
|
|
var seleniumJar= require('selenium-server-standalone-jar');
|
|
var seleniumJar= require('selenium-server-standalone-jar');
|
|
var SeleniumServer = require('selenium-webdriver/remote').SeleniumServer;
|
|
var SeleniumServer = require('selenium-webdriver/remote').SeleniumServer;
|
|
@@ -204,4 +206,21 @@ describe('Application life cycle test', function () {
|
|
it('uninstall app', function () {
|
|
it('uninstall app', function () {
|
|
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
|
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ // check if the _first_ login via email succeeds
|
|
|
|
+ it('can login via email', function () {
|
|
|
|
+ execSync('cloudron install --new --wait --location ' + LOCATION, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
|
|
|
+ var inspect = JSON.parse(execSync('cloudron inspect'));
|
|
|
|
+
|
|
|
|
+ app = inspect.apps.filter(function (a) { return a.location === LOCATION; })[0];
|
|
|
|
+ expect(app).to.be.an('object');
|
|
|
|
+
|
|
|
|
+ browser.get('https://' + app.fqdn + '/user/login');
|
|
|
|
+ browser.findElement(by.id('user_name')).sendKeys(email);
|
|
|
|
+ browser.findElement(by.id('password')).sendKeys(password);
|
|
|
|
+ browser.findElement(by.tagName('form')).submit();
|
|
|
|
+ browser.wait(until.elementLocated(by.linkText('Dashboard')), 4000).then(function () { done(); });
|
|
|
|
+
|
|
|
|
+ execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
|
|
|
+ });
|
|
});
|
|
});
|