Fix tests

This commit is contained in:
Girish Ramakrishnan 2020-09-23 14:34:55 -07:00
parent c867117dcc
commit 2b04304570
1 changed files with 5 additions and 4 deletions

View File

@ -108,14 +108,15 @@ describe('Application life cycle test', function () {
} }
function addSubscription(callback) { function addSubscription(callback) {
var url = "https://cloudron.io/blog/rss.xml"; var url = 'https://blog.cloudron.io/rss/';
const addUrl = app.manifest.version === '1.10.0' ? `${baseUrl()}/i/?c=subscription` : `${baseUrl()}/i/?c=subscription&a=add`;
browser.get(`${baseUrl()}/i/?c=subscription`).then(function () { browser.get(addUrl).then(function () {
return visible(by.xpath('//input[@name="url_rss"]')); return visible(by.xpath('//input[@name="url_rss"]'));
}).then(function () { }).then(function () {
return browser.findElement(by.xpath('//input[@name="url_rss"]')).sendKeys(url); return browser.findElement(by.xpath('//input[@name="url_rss"]')).sendKeys(url);
}).then(function () { }).then(function () {
return browser.findElement(by.xpath('//form[@id="add_rss"]/div/button[@type="submit"]')).click(); return browser.findElement(by.xpath('//button[@type="submit"]/ancestor::form[@id="add_rss"]')).submit();
}).then(function () { }).then(function () {
return visible(by.xpath('//div[@id="notification" and @class="notification good"]')); return visible(by.xpath('//div[@id="notification" and @class="notification good"]'));
}).then(function () { }).then(function () {
@ -169,7 +170,7 @@ describe('Application life cycle test', function () {
function subscriptionExists(callback) { function subscriptionExists(callback) {
browser.get(`${baseUrl()}/i/?get=c_1`).then(function () { browser.get(`${baseUrl()}/i/?get=c_1`).then(function () {
return visible(by.xpath('//a[text()="Cloudron.io"]')); return visible(by.xpath('//span[text()="Cloudron"]'));
}).then(function () { }).then(function () {
callback(); callback();
}); });