|
@@ -98,14 +98,6 @@ describe('Application life cycle test', function () {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- function checkMedia(done) {
|
|
|
- superagent.get(mediaLink).end(function (error, result) {
|
|
|
- expect(error).to.be(null);
|
|
|
- expect(result.statusCode).to.be(200);
|
|
|
- done();
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
function checkPost(done) {
|
|
|
browser.get('https://' + app.fqdn).then(function () {
|
|
|
return browser.wait(until.elementLocated(by.xpath('//h3/a[text()="Hello Cloudron!"]')), TIMEOUT);
|
|
@@ -148,8 +140,8 @@ describe('Application life cycle test', function () {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- function checkMedia(done) {
|
|
|
- browser.get('https://' + app.fqdn + '/wp-admin/upload.php?item=5').then(function () { // there's got to be a better way..
|
|
|
+ function checkMedia(item, done) {
|
|
|
+ browser.get(`https://${app.fqdn}/wp-admin/upload.php?item=${item}`).then(function () { // there's got to be a better way..
|
|
|
return browser.wait(until.elementLocated(by.xpath('//*[text()="Attachment Details"]')), TIMEOUT);
|
|
|
}).then(function () {
|
|
|
return browser.findElement(by.xpath('//img[@class="details-image"]')).getAttribute('src');
|
|
@@ -160,6 +152,14 @@ describe('Application life cycle test', function () {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ function checkMediaLink(done) {
|
|
|
+ superagent.get(mediaLink).end(function (error, result) {
|
|
|
+ expect(error).to.be(null);
|
|
|
+ expect(result.statusCode).to.be(200);
|
|
|
+ done();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
xit('build app', function () {
|
|
|
execSync('cloudron build', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
|
|
});
|
|
@@ -218,7 +218,8 @@ describe('Application life cycle test', function () {
|
|
|
it('can upload media', uploadMedia);
|
|
|
var mediaLink;
|
|
|
|
|
|
- it('can see media', checkMedia);
|
|
|
+ it('can see media', checkMedia.bind(null, 6));
|
|
|
+ it('can see media link', checkMediaLink);
|
|
|
it('has correct htaccess', checkHtaccess);
|
|
|
it('can access permalink', checkPermalink);
|
|
|
|
|
@@ -229,7 +230,7 @@ describe('Application life cycle test', function () {
|
|
|
|
|
|
it('can login', login.bind(null, username, password));
|
|
|
it('can see updated post', checkPost);
|
|
|
- it('can see media', checkMedia);
|
|
|
+ it('can see media link', checkMediaLink);
|
|
|
it('has correct htaccess', checkHtaccess);
|
|
|
it('can access permalink', checkPermalink);
|
|
|
|
|
@@ -243,7 +244,7 @@ describe('Application life cycle test', function () {
|
|
|
|
|
|
it('can login', login.bind(null, username, password));
|
|
|
it('can see updated post', checkPost);
|
|
|
- it('can see media', checkMedia);
|
|
|
+ it('can see media link', checkMediaLink);
|
|
|
it('has correct htaccess', checkHtaccess);
|
|
|
it('can access permalink', checkPermalink);
|
|
|
it('can login', login.bind(null, username, password));
|
|
@@ -273,7 +274,7 @@ describe('Application life cycle test', function () {
|
|
|
|
|
|
it('can login', login.bind(null, username, password));
|
|
|
it('can see updated post', checkPost);
|
|
|
- it('can see media', checkMedia);
|
|
|
+ it('can see media link', checkMediaLink);
|
|
|
it('has correct htaccess', checkHtaccess);
|
|
|
it('can access permalink', checkPermalink);
|
|
|
it('can login', login.bind(null, username, password));
|
|
@@ -339,7 +340,8 @@ describe('Application life cycle test', function () {
|
|
|
|
|
|
it('can login', login.bind(null, username, password));
|
|
|
it('can see updated post', checkPost);
|
|
|
- it('can see media', checkMedia);
|
|
|
+ it('can see media', checkMedia.bind(null, 5));
|
|
|
+ it('can see media link', checkMediaLink);
|
|
|
it('can access permalink', checkPermalink);
|
|
|
|
|
|
it('uninstall app', function () {
|