From 76916954239d95b65068adaad95ef982108746d1 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Wed, 24 May 2017 11:19:26 -0700 Subject: [PATCH] Add test for api configuration https://github.com/FreshRSS/FreshRSS/issues/443#issuecomment-36666133 --- test/test.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/test.js b/test/test.js index b242042..fda55de 100644 --- a/test/test.js +++ b/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 () { 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 subscribe', addSubscription); it('can add users', addUser); + it('can enable API', enableApi); + it('can check configuration', checkApiConfiguration); it('can logout', logout); it('backup app', function () { @@ -149,6 +164,7 @@ describe('Application life cycle test', function () { }); it('can login', login); + it('can check configuration', checkApiConfiguration); it('can logout', logout); it('move to different location', function () { @@ -160,6 +176,7 @@ describe('Application life cycle test', function () { }); it('can login', login); + it('can check configuration', checkApiConfiguration); it('can logout', logout); it('uninstall app', function () {