check mail using imap probe
This commit is contained in:
parent
0412ca1f43
commit
150b65ae64
|
@ -10,6 +10,7 @@ var AppStore = require('../appstore.js'),
|
||||||
Cloudron = require('../cloudron.js'),
|
Cloudron = require('../cloudron.js'),
|
||||||
common = require('../common.js'),
|
common = require('../common.js'),
|
||||||
dnsSync = require('dns-sync'),
|
dnsSync = require('dns-sync'),
|
||||||
|
ImapProbe = require('../imap-probe.js'),
|
||||||
mailer = require('../mailer.js'),
|
mailer = require('../mailer.js'),
|
||||||
sleep = require('sleep').sleep;
|
sleep = require('sleep').sleep;
|
||||||
|
|
||||||
|
@ -25,7 +26,7 @@ describe('Cloudron backup testing', function () {
|
||||||
|
|
||||||
var owner = common.getOwner();
|
var owner = common.getOwner();
|
||||||
var admin = common.getAdmin();
|
var admin = common.getAdmin();
|
||||||
var cloudron, appId, box, backupInfo;
|
var cloudron, appId, box, backupInfo, imap;
|
||||||
|
|
||||||
it('can login to the store', function () {
|
it('can login to the store', function () {
|
||||||
var accessToken = appStore.getAccessToken(owner);
|
var accessToken = appStore.getAccessToken(owner);
|
||||||
|
@ -44,6 +45,16 @@ describe('Cloudron backup testing', function () {
|
||||||
});
|
});
|
||||||
box = appStore.waitForCloudron(box.id);
|
box = appStore.waitForCloudron(box.id);
|
||||||
cloudron = new Cloudron(box);
|
cloudron = new Cloudron(box);
|
||||||
|
|
||||||
|
imap = new ImapProbe({
|
||||||
|
user: common.getOwner().username,
|
||||||
|
password: common.getOwner().password,
|
||||||
|
host: cloudron.adminFqdn(),
|
||||||
|
port: 993, // imap port
|
||||||
|
tls: true,
|
||||||
|
tlsOptions: { rejectUnauthorized: false },
|
||||||
|
readOnly: true
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can activate the box', function () {
|
it('can activate the box', function () {
|
||||||
|
@ -63,6 +74,14 @@ describe('Cloudron backup testing', function () {
|
||||||
cloudron.saveSieveScript(owner, done);
|
cloudron.saveSieveScript(owner, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('can receive mail', function (done) {
|
||||||
|
imap.probe({
|
||||||
|
subject: new RegExp('^Hi from e2e test$'),
|
||||||
|
to: new RegExp(owner.username + '@' + box.domain),
|
||||||
|
body: /The release depends on you/
|
||||||
|
}, done);
|
||||||
|
});
|
||||||
|
|
||||||
var location = 'test' + (Math.random() * 10000).toFixed();
|
var location = 'test' + (Math.random() * 10000).toFixed();
|
||||||
it('can install app', function () {
|
it('can install app', function () {
|
||||||
var manifest = appStore.getManifest(common.TESTAPP_ID, common.TESTAPP_VERSION);
|
var manifest = appStore.getManifest(common.TESTAPP_ID, common.TESTAPP_VERSION);
|
||||||
|
@ -102,6 +121,18 @@ describe('Cloudron backup testing', function () {
|
||||||
cloudron.setCredentials(owner.password, token);
|
cloudron.setCredentials(owner.password, token);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('retains old mail', function (done) {
|
||||||
|
imap.probe({
|
||||||
|
subject: new RegExp('^Hi from e2e test$'),
|
||||||
|
to: new RegExp(owner.username + '@' + box.domain),
|
||||||
|
body: /The release depends on you/
|
||||||
|
}, done);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('can check sieve script', function (done) {
|
||||||
|
cloudron.checkSieveScript(owner, done);
|
||||||
|
});
|
||||||
|
|
||||||
it('wait for app', function () {
|
it('wait for app', function () {
|
||||||
cloudron.waitForApp(appId);
|
cloudron.waitForApp(appId);
|
||||||
});
|
});
|
||||||
|
@ -114,14 +145,6 @@ describe('Cloudron backup testing', function () {
|
||||||
cloudron.uninstallApp(appId);
|
cloudron.uninstallApp(appId);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can check mail', function (done) {
|
|
||||||
cloudron.checkMail(owner, done);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('can check sieve script', function (done) {
|
|
||||||
cloudron.checkSieveScript(owner, done);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('can delete the cloudron', function () {
|
it('can delete the cloudron', function () {
|
||||||
appStore.deleteCloudron(box);
|
appStore.deleteCloudron(box);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue