Kaynağa Gözat

Set test window size and always use appid

Johannes Zellner 8 yıl önce
ebeveyn
işleme
9e4adada2c
1 değiştirilmiş dosya ile 6 ekleme ve 7 silme
  1. 6 7
      test/test.js

+ 6 - 7
test/test.js

@@ -42,6 +42,7 @@ describe('Application life cycle test', function () {
     var email, token;
 
     function login(done) {
+        browser.manage().window().setSize(1280,768);
         browser.manage().deleteAllCookies();
         browser.get('https://' + app.fqdn + '/login');
         browser.executeScript('localStorage.clear();')
@@ -59,8 +60,8 @@ describe('Application life cycle test', function () {
     function checkMailPlugin(done) {
         browser.get('https://' + app.fqdn + '/admin/emailers/local');
         browser.sleep(4000);
-        browser.wait(until.elementLocated(by.id('emailer:local:host')), TEST_TIMEOUT).then(function () {
-            browser.findElement(by.id('emailer:local:host')).getAttribute('value').then(function (val) {
+        browser.wait(until.elementLocated(by.id('host')), TEST_TIMEOUT).then(function () {
+            browser.findElement(by.id('host')).getAttribute('value').then(function (val) {
                 if (val !== 'mail') return done(new Error('Incorrect mail server value: ' + val));
                 done();
             });
@@ -84,7 +85,7 @@ describe('Application life cycle test', function () {
     }
 
     function installCustomPlugin(done) {
-        execSync('cloudron exec -- /usr/local/bin/gosu cloudron:cloudron npm install nodebb-plugin-beep', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
+        execSync('cloudron exec --app ' + app.id + ' -- /usr/local/bin/gosu cloudron:cloudron npm install nodebb-plugin-beep', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
         done();
     }
 
@@ -138,9 +139,7 @@ describe('Application life cycle test', function () {
         execSync('cloudron build', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
     });
 
-    console.log('IMPORTANT: make the browser window full screen. Otherwise the responsive UI hides elements required for this test');
-
-    it('install app', function () {
+    xit('install app', function () {
         execSync('cloudron install --new --wait --location ' + LOCATION, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
     });
 
@@ -183,7 +182,7 @@ describe('Application life cycle test', function () {
     it('can check image', checkImage);
 
     it('move to different location', function () {
-        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');