From 3594901aee76f06e2638d92970f0f132f957f891 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Sun, 9 Sep 2018 18:45:51 -0700 Subject: [PATCH] Fix tests --- test/test.js | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/test/test.js b/test/test.js index 3a19cff..dff4cce 100644 --- a/test/test.js +++ b/test/test.js @@ -94,12 +94,8 @@ describe('Application life cycle test', function () { function addSubscription(callback) { var url = "https://cloudron.io/blog/rss.xml"; - browser.get('https://' + app.fqdn).then(function () { - return visible(by.id('stream')); - }).then(function () { - return browser.findElement(by.xpath('//a[@href=".?c=subscription"]')).click(); - }).then(function () { - return visible(by.id('add_rss')); + browser.get(`https://${app.fqdn}/p/i/?c=subscription`).then(function () { + return visible(by.xpath('//input[@name="url_rss"]')); }).then(function () { return browser.findElement(by.xpath('//input[@name="url_rss"]')).sendKeys(url); }).then(function () { @@ -113,24 +109,15 @@ describe('Application life cycle test', function () { function addUser(callback) { var test_username = 'test'; - var manage_users_btn = by.xpath('//a[@href=".?c=user&a=manage"]'); - browser.get('https://' + app.fqdn).then(function () { - return visible(by.id('stream')); - }).then(function () { - return browser.findElement(by.className('dropdown-toggle')).click(); - }).then(function () { - return visible(manage_users_btn); - }).then(function () { - return browser.findElement(manage_users_btn).click(); - }).then(function () { + browser.get(`https://${app.fqdn}/p/i/?c=user&a=manage`).then(function () { return visible(by.id('new_user_name')); }).then(function () { return browser.findElement(by.id('new_user_name')).sendKeys(test_username); }).then(function () { return browser.findElement(by.id('new_user_passwordPlain')).sendKeys(password); }).then(function () { - return browser.findElement(by.xpath('//form[@action=".?c=user&a=create"]/div/div/button[@type="submit"]')).click(); + return browser.findElement(by.xpath('//button[text()="Create"]')).click(); }).then(function () { return visible(by.xpath('//div[@id="notification" and @class="notification good"]')); }).then(function () { @@ -142,7 +129,7 @@ describe('Application life cycle test', function () { 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(); + return browser.findElement(by.xpath('//button[text()="Submit"]')).submit(); }).then(function () { callback(); });