Fix tests
This commit is contained in:
parent
5bb5fae5c8
commit
3594901aee
23
test/test.js
23
test/test.js
|
@ -94,12 +94,8 @@ describe('Application life cycle test', function () {
|
||||||
function addSubscription(callback) {
|
function addSubscription(callback) {
|
||||||
var url = "https://cloudron.io/blog/rss.xml";
|
var url = "https://cloudron.io/blog/rss.xml";
|
||||||
|
|
||||||
browser.get('https://' + app.fqdn).then(function () {
|
browser.get(`https://${app.fqdn}/p/i/?c=subscription`).then(function () {
|
||||||
return visible(by.id('stream'));
|
return visible(by.xpath('//input[@name="url_rss"]'));
|
||||||
}).then(function () {
|
|
||||||
return browser.findElement(by.xpath('//a[@href=".?c=subscription"]')).click();
|
|
||||||
}).then(function () {
|
|
||||||
return visible(by.id('add_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 () {
|
||||||
|
@ -113,24 +109,15 @@ describe('Application life cycle test', function () {
|
||||||
|
|
||||||
function addUser(callback) {
|
function addUser(callback) {
|
||||||
var test_username = 'test';
|
var test_username = 'test';
|
||||||
var manage_users_btn = by.xpath('//a[@href=".?c=user&a=manage"]');
|
|
||||||
|
|
||||||
browser.get('https://' + app.fqdn).then(function () {
|
browser.get(`https://${app.fqdn}/p/i/?c=user&a=manage`).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 () {
|
|
||||||
return visible(by.id('new_user_name'));
|
return visible(by.id('new_user_name'));
|
||||||
}).then(function () {
|
}).then(function () {
|
||||||
return browser.findElement(by.id('new_user_name')).sendKeys(test_username);
|
return browser.findElement(by.id('new_user_name')).sendKeys(test_username);
|
||||||
}).then(function () {
|
}).then(function () {
|
||||||
return browser.findElement(by.id('new_user_passwordPlain')).sendKeys(password);
|
return browser.findElement(by.id('new_user_passwordPlain')).sendKeys(password);
|
||||||
}).then(function () {
|
}).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 () {
|
}).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 () {
|
||||||
|
@ -142,7 +129,7 @@ describe('Application life cycle test', function () {
|
||||||
browser.get('https://' + app.fqdn + '/p/i/?c=auth').then(function () {
|
browser.get('https://' + app.fqdn + '/p/i/?c=auth').then(function () {
|
||||||
return browser.findElement(by.id('api_enabled')).click();
|
return browser.findElement(by.id('api_enabled')).click();
|
||||||
}).then(function () {
|
}).then(function () {
|
||||||
return browser.findElement(by.xpath('//form[@action=".?c=auth"]')).submit();
|
return browser.findElement(by.xpath('//button[text()="Submit"]')).submit();
|
||||||
}).then(function () {
|
}).then(function () {
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue