Add test for static files
This commit is contained in:
parent
62182d519b
commit
9aa88ae21a
|
@ -17,6 +17,6 @@
|
||||||
"rimraf": "^2.5.3",
|
"rimraf": "^2.5.3",
|
||||||
"selenium-server-standalone-jar": "^2.53.1",
|
"selenium-server-standalone-jar": "^2.53.1",
|
||||||
"selenium-webdriver": "^2.53.3",
|
"selenium-webdriver": "^2.53.3",
|
||||||
"superagent": "^1.4.0"
|
"superagent": "^1.8.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
16
test/test.js
16
test/test.js
|
@ -7,6 +7,7 @@ require('chromedriver');
|
||||||
var execSync = require('child_process').execSync,
|
var execSync = require('child_process').execSync,
|
||||||
expect = require('expect.js'),
|
expect = require('expect.js'),
|
||||||
path = require('path'),
|
path = require('path'),
|
||||||
|
superagent = require('superagent'),
|
||||||
webdriver = require('selenium-webdriver');
|
webdriver = require('selenium-webdriver');
|
||||||
|
|
||||||
var by = webdriver.By,
|
var by = webdriver.By,
|
||||||
|
@ -146,6 +147,17 @@ describe('Application life cycle test', function () {
|
||||||
visible(by.xpath('//a[text()="Cloudron.io"]'), callback);
|
visible(by.xpath('//a[text()="Cloudron.io"]'), callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getStaticExtensionFile(callback) {
|
||||||
|
superagent.get(`https://${app.fqdn}/p/ext.php?f=xExtension-StickyFeeds/static/script.js&t=js`)
|
||||||
|
.buffer(true)
|
||||||
|
.end(function (err, res) {
|
||||||
|
expect(err).to.be(null);
|
||||||
|
expect(res.status).to.be(200);
|
||||||
|
expect(res.text).to.contain('sticky_feeds'); // relies on the buffer flag above
|
||||||
|
callback();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
xit('build app', function () {
|
xit('build app', function () {
|
||||||
execSync('cloudron build', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
execSync('cloudron build', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
||||||
});
|
});
|
||||||
|
@ -162,6 +174,7 @@ describe('Application life cycle test', function () {
|
||||||
it('can enable API', enableApi);
|
it('can enable API', enableApi);
|
||||||
it('can check configuration', checkApiConfiguration);
|
it('can check configuration', checkApiConfiguration);
|
||||||
it('subscription exists', subscriptionExists);
|
it('subscription exists', subscriptionExists);
|
||||||
|
it('can get static extension file', getStaticExtensionFile);
|
||||||
it('can logout', logout);
|
it('can logout', logout);
|
||||||
|
|
||||||
it('backup app', function () {
|
it('backup app', function () {
|
||||||
|
@ -175,6 +188,7 @@ describe('Application life cycle test', function () {
|
||||||
it('can login', login);
|
it('can login', login);
|
||||||
it('can check configuration', checkApiConfiguration);
|
it('can check configuration', checkApiConfiguration);
|
||||||
it('subscription exists', subscriptionExists);
|
it('subscription exists', subscriptionExists);
|
||||||
|
it('can get static extension file', getStaticExtensionFile);
|
||||||
it('can logout', logout);
|
it('can logout', logout);
|
||||||
|
|
||||||
it('move to different location', function () {
|
it('move to different location', function () {
|
||||||
|
@ -188,6 +202,7 @@ describe('Application life cycle test', function () {
|
||||||
it('can login', login);
|
it('can login', login);
|
||||||
it('can check configuration', checkApiConfiguration);
|
it('can check configuration', checkApiConfiguration);
|
||||||
it('subscription exists', subscriptionExists);
|
it('subscription exists', subscriptionExists);
|
||||||
|
it('can get static extension file', getStaticExtensionFile);
|
||||||
it('can logout', logout);
|
it('can logout', logout);
|
||||||
|
|
||||||
it('uninstall app', function () {
|
it('uninstall app', function () {
|
||||||
|
@ -213,6 +228,7 @@ describe('Application life cycle test', function () {
|
||||||
|
|
||||||
it('can login', login);
|
it('can login', login);
|
||||||
it('subscription exists', subscriptionExists);
|
it('subscription exists', subscriptionExists);
|
||||||
|
it('can get static extension file', getStaticExtensionFile);
|
||||||
|
|
||||||
it('uninstall app', function () {
|
it('uninstall app', function () {
|
||||||
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
||||||
|
|
Loading…
Reference in New Issue