Bladeren bron

Fixup test to be able to work with already installed app

Johannes Zellner 7 jaren geleden
bovenliggende
commit
b9d23d04d4
1 gewijzigde bestanden met toevoegingen van 5 en 4 verwijderingen
  1. 5 4
      test/test.js

+ 5 - 4
test/test.js

@@ -17,6 +17,7 @@ var execSync = require('child_process').execSync,
     path = require('path'),
     rimraf = require('rimraf'),
     superagent = require('superagent'),
+    util = require('util'),
     webdriver = require('selenium-webdriver');
 
 var by = require('selenium-webdriver').By,
@@ -82,7 +83,7 @@ describe('Application life cycle test', function () {
     }
 
     function checkHtaccess(done) {
-        var out = execSync('cloudron exec -- cat /app/data/htaccess');
+        var out = execSync(util.format('cloudron exec --app %s -- cat /app/data/htaccess', app.id));
         expect(out.toString('utf8').indexOf('RewriteEngine On')).to.not.be(-1); // wp generates this with permalinks in hard mode
         done();
     }
@@ -220,7 +221,7 @@ describe('Application life cycle test', function () {
     it('can access permalink', checkPermalink);
 
     it('can restart app', function (done) {
-        execSync('cloudron restart --wait');
+        execSync('cloudron restart --wait --app ' + app.id);
         done();
     });
 
@@ -261,7 +262,7 @@ describe('Application life cycle test', function () {
 
     it('move to different location', function () {
         browser.manage().deleteAllCookies();
-        execSync('cloudron configure --wait --location ' + LOCATION + '2', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
+        execSync('cloudron configure --wait --location ' + LOCATION + '2 --app ' + app.id, { 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');
@@ -338,7 +339,7 @@ describe('Application life cycle test', function () {
     it('can see updated post', checkPost);
     it('can see media', checkMedia);
     it('can access permalink', checkPermalink);
- 
+
     it('uninstall app', function () {
         execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
     });