Add test for api configuration

https://github.com/FreshRSS/FreshRSS/issues/443#issuecomment-36666133
This commit is contained in:
Girish Ramakrishnan 2017-05-24 11:19:26 -07:00
parent fe944c9238
commit 7691695423
1 changed files with 17 additions and 0 deletions

View File

@ -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 () {