1
0
mirror of https://git.cloudron.io/cloudron/syncthing-app synced 2025-09-13 16:29:09 +00:00

Compare commits

...

13 Commits

Author SHA1 Message Date
Girish Ramakrishnan
15c363a5f7 Version 1.26.0 2023-12-12 11:33:35 +01:00
Girish Ramakrishnan
575262b21e Update test packages 2023-12-12 11:17:31 +01:00
Vladimir D
76ed36f766 LDAP auth implemented 2023-12-11 15:21:30 +04:00
Johannes Zellner
4f5c579e4c Update test deps 2023-12-11 10:58:44 +01:00
Johannes Zellner
687d751dd9 Bump version 2023-12-11 10:58:34 +01:00
Johannes Zellner
20eefea761 Fixup tests 2023-11-15 14:34:12 +01:00
Johannes Zellner
0a81bc61d4 Bump version 2023-11-15 14:22:16 +01:00
Johannes Zellner
19bdaba65f Bump version 2023-11-13 16:07:56 +01:00
Johannes Zellner
9805180643 Fixup test for real login form 2023-11-13 15:54:18 +01:00
Johannes Zellner
daccdb9237 Update test deps 2023-11-13 14:34:22 +01:00
Girish Ramakrishnan
14fcde4cd4 Update Syncthing to 1.26.0 2023-11-13 12:46:24 +01:00
Girish Ramakrishnan
688e6d53a1 remove unneeded test 2023-10-11 11:06:56 +05:30
Girish Ramakrishnan
ae4e726aa9 asyncify 2023-10-11 11:00:23 +05:30
8 changed files with 155 additions and 141 deletions

View File

@@ -412,3 +412,27 @@
[1.24.0] [1.24.0]
* Update base image to 4.2.0 * Update base image to 4.2.0
[1.25.0]
* Update Syncthing to 1.26.0
* [Full changelog](https://github.com/syncthing/syncthing/releases/tag/v1.26.0)
* #9106: Posting config with invalid versioner type causes panic
* #9120: Deduplicated files on Windows aren't treated as regular files any more (Go 1.21)
* #9133: Syncthing Docker container fails to start if underlying filesystem doesn't support chown
* #9143: traefik no longer url escape X-Forwarded-Tls-Client-Cert header
* #9149: Favicon is stuck in notify state
* #4137: Use a real login screen + sessions instead of HTTP basic auth
[1.25.1]
* Update Syncthing to 1.26.1
* [Full changelog](https://github.com/syncthing/syncthing/releases/tag/v1.26.1)
[1.25.2]
* Update Syncthing to 1.27.1
* [Full changelog](https://github.com/syncthing/syncthing/releases/tag/v1.27.1)
* #9253: Permission error on folder causes "connection error" dialog when opening folder editor
* #9269: panic: nil pointer dereference in (*indexHandlerRegistry).startLocked
* #9274: Missing lock in DeviceStatistics ("fatal error: concurrent map read and map write")
[1.26.0]
* Add LDAP support

View File

@@ -5,12 +5,13 @@
"description": "file://DESCRIPTION.md", "description": "file://DESCRIPTION.md",
"changelog": "file://CHANGELOG", "changelog": "file://CHANGELOG",
"tagline": "Decentralized file synchronization", "tagline": "Decentralized file synchronization",
"version": "1.24.0", "version": "1.26.0",
"upstreamVersion": "1.25.0", "upstreamVersion": "1.27.1",
"healthCheckPath": "/healthcheck", "healthCheckPath": "/healthcheck",
"httpPort": 8000, "httpPort": 8000,
"addons": { "addons": {
"localstorage": {} "localstorage": {},
"ldap": {}
}, },
"tcpPorts": { "tcpPorts": {
"SYNC_PORT": { "SYNC_PORT": {
@@ -36,5 +37,6 @@
"https://screenshots.cloudron.io/net.syncthing.cloudronapp2/2.png", "https://screenshots.cloudron.io/net.syncthing.cloudronapp2/2.png",
"https://screenshots.cloudron.io/net.syncthing.cloudronapp2/3.png" "https://screenshots.cloudron.io/net.syncthing.cloudronapp2/3.png"
], ],
"optionalSso": true,
"postInstallMessage": "file://POSTINSTALL.md" "postInstallMessage": "file://POSTINSTALL.md"
} }

View File

@@ -3,7 +3,7 @@ FROM cloudron/base:4.2.0@sha256:46da2fffb36353ef714f97ae8e962bd2c212ca091108d768
RUN mkdir -p /app/code RUN mkdir -p /app/code
WORKDIR /app/code WORKDIR /app/code
ARG VERSION=1.25.0 ARG VERSION=1.27.1
RUN wget https://github.com/syncthing/syncthing/releases/download/v${VERSION}/syncthing-linux-amd64-v${VERSION}.tar.gz -O - | tar -xz -C /app/code --strip-components=1 RUN wget https://github.com/syncthing/syncthing/releases/download/v${VERSION}/syncthing-linux-amd64-v${VERSION}.tar.gz -O - | tar -xz -C /app/code --strip-components=1

View File

@@ -1,7 +1,11 @@
<sso>
All Cloudron users are admins and can manage synchronising files.
</sso>
<nosso>
This app is pre-setup with an admin account. The initial credentials are: This app is pre-setup with an admin account. The initial credentials are:
**Username**: admin<br/> **Username**: admin<br/>
**Password**: changeme<br/> **Password**: changeme<br/>
Please change the admin password immediately. Please change the admin password immediately.
</nosso>

View File

@@ -17,8 +17,21 @@ if [[ ! -f /app/data/config/config.xml ]]; then
--update "//configuration/options/defaultFolderPath" -v '/app/data/folders' \ --update "//configuration/options/defaultFolderPath" -v '/app/data/folders' \
--update "//configuration/options/urAccepted" -v '-1' \ --update "//configuration/options/urAccepted" -v '-1' \
/app/data/config/config.xml /app/data/config/config.xml
fi fi
if [[ -n ${CLOUDRON_LDAP_HOST:-} ]]; then
xmlstarlet ed --inplace \
--subnode "//configuration/gui" -t elem -n "authMode" -v "ldap" \
--subnode "//configuration/ldap" -t elem -n "address" -v "${CLOUDRON_LDAP_HOST:-}:${CLOUDRON_LDAP_PORT}" \
--subnode "//configuration/ldap" -t elem -n "bindDN" -v "${CLOUDRON_LDAP_BIND_DN:-}" \
--subnode "//configuration/ldap" -t elem -n "insecureSkipVerify" -v "true" \
--subnode "//configuration/ldap" -t elem -n "searchBaseDN" -v "${CLOUDRON_LDAP_USERS_BASE_DN:-}" \
--subnode "//configuration/ldap" -t elem -n "searchFilter" -v "(&amp;(objectclass=user)(|(username=%s)(mail=%s)))" \
/app/data/config/config.xml
fi
# Set the listenAddress and the gui enabled to make sure user doesnt lock themselves out by accident. # Set the listenAddress and the gui enabled to make sure user doesnt lock themselves out by accident.
sed -e "s,<listenAddress>.*</listenAddress>,<listenAddress>tcp://:${SYNC_PORT}</listenAddress>," -i /app/data/config/config.xml sed -e "s,<listenAddress>.*</listenAddress>,<listenAddress>tcp://:${SYNC_PORT}</listenAddress>," -i /app/data/config/config.xml
sed -e 's,<gui .*>,<gui enabled="true" tls="false" debugging="false">,' -i /app/data/config/config.xml sed -e 's,<gui .*>,<gui enabled="true" tls="false" debugging="false">,' -i /app/data/config/config.xml

80
test/package-lock.json generated
View File

@@ -9,17 +9,17 @@
"version": "1.0.0", "version": "1.0.0",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"chromedriver": "^117.0.3", "chromedriver": "^120.0.0",
"expect.js": "^0.3.1", "expect.js": "^0.3.1",
"mocha": "^10.2.0", "mocha": "^10.2.0",
"selenium-webdriver": "^4.14.0", "selenium-webdriver": "^4.16.0",
"superagent": "^8.1.2" "superagent": "^8.1.2"
} }
}, },
"node_modules/@testim/chrome-version": { "node_modules/@testim/chrome-version": {
"version": "1.1.3", "version": "1.1.4",
"resolved": "https://registry.npmjs.org/@testim/chrome-version/-/chrome-version-1.1.3.tgz", "resolved": "https://registry.npmjs.org/@testim/chrome-version/-/chrome-version-1.1.4.tgz",
"integrity": "sha512-g697J3WxV/Zytemz8aTuKjTGYtta9+02kva3C1xc7KXB8GdbfE1akGJIsZLyY/FSh2QrnE+fiB7vmWU3XNcb6A==" "integrity": "sha512-kIhULpw9TrGYnHp/8VfdcneIcxKnLixmADtukQRtJUmsVlMg0niMkwV0xZmi8hqa57xqilIHjWFA0GKvEjVU5g=="
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "16.11.6", "version": "16.11.6",
@@ -105,9 +105,9 @@
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
}, },
"node_modules/axios": { "node_modules/axios": {
"version": "1.4.0", "version": "1.6.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz", "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.1.tgz",
"integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==", "integrity": "sha512-vfBmhDpKafglh0EldBEbVuoe7DyAavGSLWhuSm5ZSEKQnHhBf0xAAwybbNH1IkrJNGnS/VG4I5yxig1pCEXE4g==",
"dependencies": { "dependencies": {
"follow-redirects": "^1.15.0", "follow-redirects": "^1.15.0",
"form-data": "^4.0.0", "form-data": "^4.0.0",
@@ -236,18 +236,18 @@
} }
}, },
"node_modules/chromedriver": { "node_modules/chromedriver": {
"version": "117.0.3", "version": "120.0.0",
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-117.0.3.tgz", "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-120.0.0.tgz",
"integrity": "sha512-c2rk2eGK5zZFBJMdviUlAJfQEBuPNIKfal4+rTFVYAmrWbMPYAqPozB+rIkc1lDP/Ryw44lPiqKglrI01ILhTQ==", "integrity": "sha512-LGy2LhWRBiqDarFIU8gQ43EEyj+07Tc3JuUhthkESAwZ99lrifSnKZwKU0aVwansU84+k6bt71z7K3dkk65gZg==",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@testim/chrome-version": "^1.1.3", "@testim/chrome-version": "^1.1.4",
"axios": "^1.4.0", "axios": "^1.6.0",
"compare-versions": "^6.0.0", "compare-versions": "^6.1.0",
"extract-zip": "^2.0.1", "extract-zip": "^2.0.1",
"https-proxy-agent": "^5.0.1", "https-proxy-agent": "^5.0.1",
"proxy-from-env": "^1.1.0", "proxy-from-env": "^1.1.0",
"tcp-port-used": "^1.0.1" "tcp-port-used": "^1.0.2"
}, },
"bin": { "bin": {
"chromedriver": "bin/chromedriver" "chromedriver": "bin/chromedriver"
@@ -479,9 +479,9 @@
} }
}, },
"node_modules/follow-redirects": { "node_modules/follow-redirects": {
"version": "1.15.2", "version": "1.15.3",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz",
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==",
"funding": [ "funding": [
{ {
"type": "individual", "type": "individual",
@@ -1166,9 +1166,9 @@
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
}, },
"node_modules/selenium-webdriver": { "node_modules/selenium-webdriver": {
"version": "4.14.0", "version": "4.16.0",
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.14.0.tgz", "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.16.0.tgz",
"integrity": "sha512-637rs8anqMKHbWxcBZpyG3Gcs+rBUtAUiqk0O/knUqH4Paj3MFUZrz88/pVGOLNryEVy2z92fZomT8p1ENl1gA==", "integrity": "sha512-IbqpRpfGE7JDGgXHJeWuCqT/tUqnLvZ14csSwt+S8o4nJo3RtQoE9VR4jB47tP/A8ArkYsh/THuMY6kyRP6kuA==",
"dependencies": { "dependencies": {
"jszip": "^3.10.1", "jszip": "^3.10.1",
"tmp": "^0.2.1", "tmp": "^0.2.1",
@@ -1468,9 +1468,9 @@
}, },
"dependencies": { "dependencies": {
"@testim/chrome-version": { "@testim/chrome-version": {
"version": "1.1.3", "version": "1.1.4",
"resolved": "https://registry.npmjs.org/@testim/chrome-version/-/chrome-version-1.1.3.tgz", "resolved": "https://registry.npmjs.org/@testim/chrome-version/-/chrome-version-1.1.4.tgz",
"integrity": "sha512-g697J3WxV/Zytemz8aTuKjTGYtta9+02kva3C1xc7KXB8GdbfE1akGJIsZLyY/FSh2QrnE+fiB7vmWU3XNcb6A==" "integrity": "sha512-kIhULpw9TrGYnHp/8VfdcneIcxKnLixmADtukQRtJUmsVlMg0niMkwV0xZmi8hqa57xqilIHjWFA0GKvEjVU5g=="
}, },
"@types/node": { "@types/node": {
"version": "16.11.6", "version": "16.11.6",
@@ -1538,9 +1538,9 @@
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
}, },
"axios": { "axios": {
"version": "1.4.0", "version": "1.6.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz", "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.1.tgz",
"integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==", "integrity": "sha512-vfBmhDpKafglh0EldBEbVuoe7DyAavGSLWhuSm5ZSEKQnHhBf0xAAwybbNH1IkrJNGnS/VG4I5yxig1pCEXE4g==",
"requires": { "requires": {
"follow-redirects": "^1.15.0", "follow-redirects": "^1.15.0",
"form-data": "^4.0.0", "form-data": "^4.0.0",
@@ -1633,17 +1633,17 @@
} }
}, },
"chromedriver": { "chromedriver": {
"version": "117.0.3", "version": "120.0.0",
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-117.0.3.tgz", "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-120.0.0.tgz",
"integrity": "sha512-c2rk2eGK5zZFBJMdviUlAJfQEBuPNIKfal4+rTFVYAmrWbMPYAqPozB+rIkc1lDP/Ryw44lPiqKglrI01ILhTQ==", "integrity": "sha512-LGy2LhWRBiqDarFIU8gQ43EEyj+07Tc3JuUhthkESAwZ99lrifSnKZwKU0aVwansU84+k6bt71z7K3dkk65gZg==",
"requires": { "requires": {
"@testim/chrome-version": "^1.1.3", "@testim/chrome-version": "^1.1.4",
"axios": "^1.4.0", "axios": "^1.6.0",
"compare-versions": "^6.0.0", "compare-versions": "^6.1.0",
"extract-zip": "^2.0.1", "extract-zip": "^2.0.1",
"https-proxy-agent": "^5.0.1", "https-proxy-agent": "^5.0.1",
"proxy-from-env": "^1.1.0", "proxy-from-env": "^1.1.0",
"tcp-port-used": "^1.0.1" "tcp-port-used": "^1.0.2"
} }
}, },
"cliui": { "cliui": {
@@ -1814,9 +1814,9 @@
"integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==" "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ=="
}, },
"follow-redirects": { "follow-redirects": {
"version": "1.15.2", "version": "1.15.3",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz",
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q=="
}, },
"form-data": { "form-data": {
"version": "4.0.0", "version": "4.0.0",
@@ -2300,9 +2300,9 @@
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
}, },
"selenium-webdriver": { "selenium-webdriver": {
"version": "4.14.0", "version": "4.16.0",
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.14.0.tgz", "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.16.0.tgz",
"integrity": "sha512-637rs8anqMKHbWxcBZpyG3Gcs+rBUtAUiqk0O/knUqH4Paj3MFUZrz88/pVGOLNryEVy2z92fZomT8p1ENl1gA==", "integrity": "sha512-IbqpRpfGE7JDGgXHJeWuCqT/tUqnLvZ14csSwt+S8o4nJo3RtQoE9VR4jB47tP/A8ArkYsh/THuMY6kyRP6kuA==",
"requires": { "requires": {
"jszip": "^3.10.1", "jszip": "^3.10.1",
"tmp": "^0.2.1", "tmp": "^0.2.1",

View File

@@ -9,10 +9,10 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"chromedriver": "^117.0.3", "chromedriver": "^120.0.0",
"expect.js": "^0.3.1", "expect.js": "^0.3.1",
"mocha": "^10.2.0", "mocha": "^10.2.0",
"selenium-webdriver": "^4.14.0", "selenium-webdriver": "^4.16.0",
"superagent": "^8.1.2" "superagent": "^8.1.2"
} }
} }

View File

@@ -5,6 +5,7 @@
/* global before */ /* global before */
/* global after */ /* global after */
/* global it */ /* global it */
/* global xit */
'use strict'; 'use strict';
@@ -15,9 +16,14 @@ const execSync = require('child_process').execSync,
superagent = require('superagent'), superagent = require('superagent'),
path = require('path'), path = require('path'),
timers = require('timers/promises'), timers = require('timers/promises'),
{ Builder, By, Key, until } = require('selenium-webdriver'), { Builder, By, until } = require('selenium-webdriver'),
{ Options } = require('selenium-webdriver/chrome'); { Options } = require('selenium-webdriver/chrome');
if (!process.env.USERNAME || !process.env.PASSWORD) {
console.log('USERNAME and PASSWORD env vars need to be set');
process.exit(1);
}
describe('Application life cycle test', function () { describe('Application life cycle test', function () {
this.timeout(0); this.timeout(0);
@@ -28,7 +34,9 @@ describe('Application life cycle test', function () {
const EXEC_ARGS = { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }; const EXEC_ARGS = { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' };
let browser, app; let browser, app;
const username = 'admin', password = 'changeme'; const adminUsername = 'admin', adminPassword = 'changeme';
let username = process.env.USERNAME;
let password = process.env.PASSWORD;
before(function () { before(function () {
browser = new Builder().forBrowser('chrome').setChromeOptions(new Options().windowSize({ width: 1280, height: 1024 })).build(); browser = new Builder().forBrowser('chrome').setChromeOptions(new Options().windowSize({ width: 1280, height: 1024 })).build();
@@ -44,131 +52,90 @@ describe('Application life cycle test', function () {
expect(app).to.be.an('object'); expect(app).to.be.an('object');
} }
function waitForElement(elem) { async function waitForElement(elem) {
return browser.wait(until.elementLocated(elem), TEST_TIMEOUT).then(function () { await browser.wait(until.elementLocated(elem), TEST_TIMEOUT);
return browser.wait(until.elementIsVisible(browser.findElement(elem)), TEST_TIMEOUT); await browser.wait(until.elementIsVisible(browser.findElement(elem)), TEST_TIMEOUT);
});
} }
function invalidPassword(callback) { async function login(username, password) {
superagent.get('https://' + app.fqdn).auth(username, password + 'x').end(function (error, result) { await browser.manage().deleteAllCookies();
expect(result.status).to.eql(401); await browser.get('https://' + app.fqdn);
await waitForElement(By.id('user'));
callback(); await browser.findElement(By.id('user')).sendKeys(username);
}); await browser.findElement(By.id('password')).sendKeys(password);
await browser.findElement(By.xpath('//button[@type="submit"]')).click();
await waitForElement(By.xpath('//span[text()="Actions"]'));
} }
function loadPage(callback) { async function loadPage() {
browser.manage().deleteAllCookies().then(function () { await browser.get('https://' + app.fqdn);
return browser.sleep(5000); await waitForElement(By.xpath('//span[text()="Actions"]'));
}).then(function() {
return browser.get('https://' + username + ':' + encodeURIComponent(password) + '@' + app.fqdn).then(function () {
return browser.get('https://' + app.fqdn);
});
}).then(function () {
return browser.sleep(5000);
}).then(function () {
return browser.get('https://' + app.fqdn);
}).then(function () {
return waitForElement(By.xpath('//span[text()="Actions"]'));
}).then(function () {
callback();
});
} }
function addFolder(callback) { async function addFolder() {
browser.get('https://' + app.fqdn).then(function () { await browser.get('https://' + app.fqdn);
return browser.findElement(By.css('[ng-click*=addFolder]')).click(); await browser.findElement(By.css('[ng-click*=addFolder]')).click();
}).then(function () { await waitForElement(By.id('folderPath'));
return waitForElement(By.id('folderPath')); await browser.sleep(4000); // wait more, not sure why this is needed
}).then(function () { await browser.findElement(By.id('folderLabel')).sendKeys(FOLDER);
return browser.sleep(4000); // wait more, not sure why this is needed await browser.sleep(4000); // without this sometimes only part of the folder name gets through
}).then(function() { await browser.findElement(By.css('[ng-click*=saveFolder]')).click();
return browser.findElement(By.id('folderLabel')).sendKeys(FOLDER); await browser.wait(until.elementLocated(By.css('#folders .panel-status span[ng-switch-when=unshared]')), TEST_TIMEOUT);
}).then(function () { await browser.sleep(4000);
return browser.sleep(4000); // without this sometimes only part of the folder name gets through
}).then(function() {
return browser.findElement(By.css('[ng-click*=saveFolder]')).click();
}).then(function() {
return browser.wait(until.elementLocated(By.css('#folders .panel-status span[ng-switch-when=unshared]')), TEST_TIMEOUT);
}).then(function () {
return browser.sleep(4000);
}).then(function() {
callback();
});
} }
function checkFolder(callback) { async function checkFolder() {
browser.get('https://' + app.fqdn).then(function () { await browser.get('https://' + app.fqdn);
return browser.sleep(5000); await browser.sleep(5000);
}).then(function () { await browser.get('https://' + app.fqdn);
return browser.get('https://' + app.fqdn); await browser.wait(until.elementLocated(By.xpath(`//span[text()="${FOLDER}"]`)), TEST_TIMEOUT);
}).then(function () {
return browser.wait(until.elementLocated(By.xpath(`//span[text()="${FOLDER}"]`)), TEST_TIMEOUT);
}).then(function () {
callback();
});
}
function removeFolder(callback) {
browser.get('https://' + app.fqdn).then(function () {
return waitForElement(By.xpath('//span[text()="Actions"]'));
}).then(function() {
return browser.findElement(By.css('#folders button')).click();
}).then(function () {
return browser.sleep(3000); //No way to check for visibility of angular-js components
}).then(function () {
return browser.findElement(By.css('#folder-0 button[ng-click*=editFolder]')).click();
}).then(function () {
return browser.sleep(3000); //No way to check for visibility of angular-js components
}).then(function () {
return browser.findElement(By.xpath('//button[@data-target="#remove-folder-confirmation"]')).click();
}).then(function () {
return browser.sleep(3000); //No way to check for visibility of angular-js components
}).then(function () {
return browser.findElement(By.css('[ng-click*=deleteFolder]')).click();
}).then(function () {
return browser.sleep(3000); //This needs to run for some time
}).then(function () {
callback();
});
} }
xit('build app', function () { execSync('cloudron build', EXEC_ARGS); }); xit('build app', function () { execSync('cloudron build', EXEC_ARGS); });
it('install app', async function () { // NO SSO
execSync('cloudron install --port-bindings SYNC_PORT=' + SYNC_PORT + ' --location ' + LOCATION, EXEC_ARGS); it('install app (NO SSO)', function () { execSync('cloudron install --no-sso --port-bindings SYNC_PORT=' + SYNC_PORT + ' --location ' + LOCATION, EXEC_ARGS); });
await timers.setTimeout(30000);
});
it('can get app information', getAppInfo); it('can get app information', getAppInfo);
it('fails with invalid password', invalidPassword); it('can admin login', login.bind(null, adminUsername, adminPassword));
it('can load page', loadPage);
it('can add folder', addFolder);
it('can check folder', checkFolder);
it('uninstall app', async function () {
await browser.get('about:blank');
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
});
// SSO
it('install app (SSO)', function () { execSync('cloudron install --port-bindings SYNC_PORT=' + SYNC_PORT + ' --location ' + LOCATION, EXEC_ARGS); });
it('can get app information', getAppInfo);
it('can login', login.bind(null, username, password));
it('can load page', loadPage); it('can load page', loadPage);
it('can add folder', addFolder); it('can add folder', addFolder);
it('backup app', async function () { it('backup app', async function () { execSync('cloudron backup create --app ' + app.id, EXEC_ARGS); });
execSync('cloudron backup create --app ' + app.id, EXEC_ARGS);
await timers.setTimeout(30000);
});
it('restore app', async function () { it('restore app', async function () {
await browser.get('about:blank'); await browser.get('about:blank');
execSync('cloudron restore --app ' + app.id, EXEC_ARGS); execSync('cloudron restore --app ' + app.id, EXEC_ARGS);
await timers.setTimeout(30000); await timers.setTimeout(5000);
}); });
it('can login', login.bind(null, username, password));
it('can load page', loadPage); it('can load page', loadPage);
it('can check folder', checkFolder); it('can check folder', checkFolder);
it('move to different location', async function () { it('move to different location', async function () {
await browser.get('about:blank'); await browser.get('about:blank');
execSync(`cloudron configure --location ${LOCATION}2 --app ${app.id}`, EXEC_ARGS); execSync(`cloudron configure --location ${LOCATION}2 --app ${app.id}`, EXEC_ARGS);
await timers.setTimeout(30000); await timers.setTimeout(5000);
}); });
it('can get app information', getAppInfo); it('can get app information', getAppInfo);
it('can login', login.bind(null, username, password));
it('can load page', loadPage); it('can load page', loadPage);
it('can check folder', checkFolder); it('can check folder', checkFolder);
it('can remove folder', removeFolder);
it('uninstall app', async function () { it('uninstall app', async function () {
await browser.get('about:blank'); await browser.get('about:blank');
@@ -181,6 +148,8 @@ describe('Application life cycle test', function () {
await timers.setTimeout(30000); await timers.setTimeout(30000);
}); });
it('can get app information', getAppInfo); it('can get app information', getAppInfo);
// next release it should be replaced with LDAP login
it('can admin login', login.bind(null, adminUsername, adminPassword));
it('can load page', loadPage); it('can load page', loadPage);
it('can add folder', addFolder); it('can add folder', addFolder);
it('can update', async function () { it('can update', async function () {
@@ -188,6 +157,8 @@ describe('Application life cycle test', function () {
execSync('cloudron update --app ' + LOCATION, EXEC_ARGS); execSync('cloudron update --app ' + LOCATION, EXEC_ARGS);
await timers.setTimeout(30000); await timers.setTimeout(30000);
}); });
// next release it should be replaced with LDAP login
it('can admin login', login.bind(null, adminUsername, adminPassword));
it('can check folder', checkFolder); it('can check folder', checkFolder);
it('uninstall app', async function () { it('uninstall app', async function () {