test app reconfigure
This commit is contained in:
parent
8d7d65cce4
commit
566bcd19bc
33
test/test.js
33
test/test.js
|
@ -166,6 +166,39 @@ describe('Application life cycle test', function () {
|
|||
done();
|
||||
});
|
||||
|
||||
it('move to different location', function () {
|
||||
browser.manage().deleteAllCookies();
|
||||
execSync('cloudron install --location ' + LOCATION + '2', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
||||
var inspect = JSON.parse(execSync('cloudron inspect'));
|
||||
app = inspect.apps.filter(function (a) { return a.location === LOCATION + '2'; })[0];
|
||||
expect(app).to.be.an('object');
|
||||
});
|
||||
|
||||
it('can login', function (done) {
|
||||
browser.get('https://' + app.fqdn + '/user/login');
|
||||
browser.findElement(by.id('user_name')).sendKeys(username);
|
||||
browser.findElement(by.id('password')).sendKeys(password);
|
||||
browser.findElement(by.tagName('form')).submit();
|
||||
browser.wait(until.elementLocated(by.linkText('Dashboard')), 4000).then(function () { done(); });
|
||||
});
|
||||
|
||||
it('displays correct clone url', function (done) {
|
||||
browser.get('https://' + app.fqdn + '/' + username + '/' + reponame);
|
||||
browser.findElement(by.id('repo-clone-url')).getAttribute('value').then(function (cloneUrl) {
|
||||
expect(cloneUrl).to.be('ssh://cloudron@' + app.fqdn + ':29418/' + username + '/' + reponame + '.git');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('can clone the url', function (done) {
|
||||
var env = Object.create(process.env);
|
||||
env.GIT_SSH = __dirname + '/git_ssh_wrapper.sh';
|
||||
execSync('git clone ssh://cloudron@' + app.fqdn + ':29418/' + username + '/' + reponame + '.git ' + repodir, { env: env });
|
||||
expect(fs.existsSync(repodir + '/newfile')).to.be(true);
|
||||
rimraf.sync(repodir);
|
||||
done();
|
||||
});
|
||||
|
||||
it('uninstall app', function () {
|
||||
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue