Merge branch 'test_api_config' into 'master'
Add test for api configuration See merge request !4
This commit is contained in:
commit
45f13f695f
17
test/test.js
17
test/test.js
|
@ -118,6 +118,19 @@ describe('Application life cycle test', function () {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function enableApi(callback) {
|
||||||
|
browser.get('https://' + app.fqdn + '/p/i/?c=auth').then(function () {
|
||||||
|
return browser.findElement(by.id('api_enabled')).click();
|
||||||
|
}).then(function () {
|
||||||
|
return browser.findElement(by.xpath('//form[@action=".?c=auth"]')).submit();
|
||||||
|
}).then(callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkApiConfiguration(callback) {
|
||||||
|
browser.get('https://' + app.fqdn + '/p/api/greader.php/check%2Fcompatibility').then(function () {
|
||||||
|
exists(by.xpath('//pre[text()="PASS"]'), 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' });
|
||||||
|
@ -138,6 +151,8 @@ describe('Application life cycle test', function () {
|
||||||
it('can login', login);
|
it('can login', login);
|
||||||
it('can subscribe', addSubscription);
|
it('can subscribe', addSubscription);
|
||||||
it('can add users', addUser);
|
it('can add users', addUser);
|
||||||
|
it('can enable API', enableApi);
|
||||||
|
it('can check configuration', checkApiConfiguration);
|
||||||
it('can logout', logout);
|
it('can logout', logout);
|
||||||
|
|
||||||
it('backup app', function () {
|
it('backup app', function () {
|
||||||
|
@ -149,6 +164,7 @@ describe('Application life cycle test', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can login', login);
|
it('can login', login);
|
||||||
|
it('can check configuration', checkApiConfiguration);
|
||||||
it('can logout', logout);
|
it('can logout', logout);
|
||||||
|
|
||||||
it('move to different location', function () {
|
it('move to different location', function () {
|
||||||
|
@ -160,6 +176,7 @@ describe('Application life cycle test', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can login', login);
|
it('can login', login);
|
||||||
|
it('can check configuration', checkApiConfiguration);
|
||||||
it('can logout', logout);
|
it('can logout', logout);
|
||||||
|
|
||||||
it('uninstall app', function () {
|
it('uninstall app', function () {
|
||||||
|
|
Loading…
Reference in New Issue