diff options
Diffstat (limited to 'js/tests/e2e')
-rw-r--r-- | js/tests/e2e/include/auth.js | 17 | ||||
-rw-r--r-- | js/tests/e2e/main.js | 43 |
2 files changed, 35 insertions, 25 deletions
diff --git a/js/tests/e2e/include/auth.js b/js/tests/e2e/include/auth.js new file mode 100644 index 000000000..6dea83a77 --- /dev/null +++ b/js/tests/e2e/include/auth.js @@ -0,0 +1,17 @@ +/** + * ownCloud - News + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Bernhard Posselt <dev@bernhard-posselt.com> + * @copyright Bernhard Posselt 2012, 2014 + */ + +exports.login = function (browser) { + browser.ignoreSynchronization = true; + browser.get('http://localhost/owncloud/'); + browser.findElement(By.id('user')).sendKeys('admin'); + browser.findElement(By.id('password')).sendKeys('admin'); + browser.findElement(By.id('submit')).click(); +};
\ No newline at end of file diff --git a/js/tests/e2e/main.js b/js/tests/e2e/main.js index 94e31ee62..40ab73c38 100644 --- a/js/tests/e2e/main.js +++ b/js/tests/e2e/main.js @@ -1,34 +1,27 @@ +/** + * ownCloud - News + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Bernhard Posselt <dev@bernhard-posselt.com> + * @copyright Bernhard Posselt 2012, 2014 + */ + +var auth = require('./include/auth.js'); + describe('news page', function () { 'use strict'; - var ptor = protractor.getInstance(); - - beforeEach(function () { - browser.ignoreSynchronization = true; - return browser.ignoreSynchronization; - }); - beforeEach(function () { - ptor.get('http://localhost/owncloud/'); - ptor.findElement(By.id('user')).sendKeys('admin'); - ptor.findElement(By.id('password')).sendKeys('admin'); - ptor.findElement(By.id('submit')).click(); + auth.login(browser); }); - - describe('should log in', function () { - - beforeEach(function () { - browser.ignoreSynchronization = false; - return browser.ignoreSynchronization; - }); - - it('should go to the news page', function () { - ptor.get('http://localhost/owncloud/index.php/apps/news/'); - ptor.getTitle().then(function (title) { - expect(title).toBe('News - ownCloud'); - }); + it('should go to the news page', function () { + browser.get('http://localhost/owncloud/index.php/apps/news/'); + browser.getTitle().then(function (title) { + expect(title).toBe('News - ownCloud'); }); - }); + });
\ No newline at end of file |