Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4a405a5f1 | ||
|
|
e475e1ec34 | ||
|
|
5f17b33dbc | ||
|
|
0a64acf236 | ||
|
|
1b20ba1a1a | ||
|
|
16414ae13c | ||
|
|
55935f194f | ||
|
|
7cbe157dbd | ||
|
|
46f25d776d | ||
|
|
1e9400ab2e | ||
|
|
c8b81a87b3 | ||
|
|
337178cbe3 | ||
|
|
417ccb1b90 | ||
|
|
bd139e7e51 | ||
|
|
1fd50ed537 | ||
|
|
fbcbe82562 | ||
|
|
0796c63cfc | ||
|
|
57a7c5a874 | ||
|
|
564422747a | ||
|
|
540e8b955a | ||
|
|
d80249d454 | ||
|
|
144d1169ec | ||
|
|
f5ebcedfa3 | ||
|
|
647e78afd2 | ||
|
|
b255387cde | ||
|
|
7976cc122d | ||
|
|
a2709eebdb | ||
|
|
3018681164 | ||
|
|
800e8f667e | ||
|
|
1363bab648 | ||
|
|
6099885ae5 | ||
|
|
638ba056a0 |
46
CHANGELOG.md
46
CHANGELOG.md
@@ -1275,3 +1275,49 @@
|
||||
* Update Synapse to 1.114.0
|
||||
* [Full changelog](https://github.com/element-hq/synapse/releases/tag/v1.114.0)
|
||||
|
||||
[1.97.5]
|
||||
* Update Synapse to 1.115.0
|
||||
* [Full changelog](https://github.com/element-hq/synapse/releases/tag/v1.115.0)
|
||||
|
||||
[1.97.6]
|
||||
* Update Synapse to 1.116.0
|
||||
* [Full changelog](https://github.com/element-hq/synapse/releases/tag/v1.116.0)
|
||||
|
||||
[1.98.0]
|
||||
* Update Synapse to 1.118.0
|
||||
* [Full changelog](https://github.com/element-hq/synapse/releases/tag/v1.118.0)
|
||||
|
||||
[1.98.1]
|
||||
* Update S3 Storage Provider to 1.5.0
|
||||
[1.99.0]
|
||||
* Update synapse to 1.119.0
|
||||
* [Full Changelog](https://github.com/element-hq/synapse/releases/tag/v1.118.0)
|
||||
* Support [MSC4151](https://github.com/matrix-org/matrix-spec-proposals/pull/4151)'s stable report room API. ([#​17374](https://github.com/element-hq/synapse/issues/17374))
|
||||
* Add experimental support for [MSC4222](https://github.com/matrix-org/matrix-spec-proposals/pull/4222) (Adding `state_after` to sync v2). ([#​17888](https://github.com/element-hq/synapse/issues/17888))
|
||||
* Fix bug with sliding sync where `$LAZY`-loading room members would not return `required_state` membership in incremental syncs. ([#​17809](https://github.com/element-hq/synapse/issues/17809))
|
||||
* Check if user has membership in a room before tagging it. Contributed by Lama Alosaimi. ([#​17839](https://github.com/element-hq/synapse/issues/17839))
|
||||
* Fix a bug in the admin redact endpoint where the background task would not run if a worker was specified in
|
||||
* Fix bug where some presence and typing timeouts can expire early. ([#​17850](https://github.com/element-hq/synapse/issues/17850))
|
||||
* Fix detection when the built Rust library was outdated when using source installations. ([#​17861](https://github.com/element-hq/synapse/issues/17861))
|
||||
* Fix a long-standing bug in Synapse which could cause one-time keys to be issued in the incorrect order, causing message decryption failures. ([#​17903](https://github.com/element-hq/synapse/pull/17903))
|
||||
* Fix experimental support for [MSC4222](https://github.com/matrix-org/matrix-spec-proposals/pull/4222) (Adding `state_after` to sync v2) where we would return the full state on incremental syncs when using lazy loaded members and there were no new events in the timeline. ([#​17915](https://github.com/element-hq/synapse/pull/17915))
|
||||
* Remove support for python 3.8. ([#​17908](https://github.com/element-hq/synapse/issues/17908))
|
||||
* Add a test for downloading and thumbnailing a CMYK JPEG. ([#​17786](https://github.com/element-hq/synapse/issues/17786))
|
||||
* Refactor database calls to remove `Generator` usage. ([#​17813](https://github.com/element-hq/synapse/issues/17813), [#​17814](https://github.com/element-hq/synapse/issues/17814), [#​17815](https://github.com/element-hq/synapse/issues/17815), [#​17816](https://github.com/element-hq/synapse/issues/17816), [#​17817](https://github.com/element-hq/synapse/issues/17817), [#​17818](https://github.com/element-hq/synapse/issues/17818), [#​17890](https://github.com/element-hq/synapse/issues/17890))
|
||||
* Include the destination in the error of 'Destination mismatch' on federation requests. ([#​17830](https://github.com/element-hq/synapse/issues/17830))
|
||||
* The nix flake inside the repository no longer tracks nixpkgs/master to not catch the latest bugs from a MR merged 5 minutes ago. ([#​17852](https://github.com/element-hq/synapse/issues/17852))
|
||||
* Minor speed-up of sliding sync by computing extensions results in parallel. ([#​17884](https://github.com/element-hq/synapse/issues/17884))
|
||||
* Bump the default Python version in the Synapse Dockerfile from 3.11 -> 3.12. ([#​17887](https://github.com/element-hq/synapse/issues/17887))
|
||||
* Remove usage of internal header encoding API. ([#​17894](https://github.com/element-hq/synapse/issues/17894))
|
||||
* Use unique name for each os.arch variant when uploading Wheel artifacts. ([#​17905](https://github.com/element-hq/synapse/issues/17905))
|
||||
* Fix tests to run with latest Twisted. ([#​17906](https://github.com/element-hq/synapse/pull/17906), [#​17907](https://github.com/element-hq/synapse/pull/17907), [#​17911](https://github.com/element-hq/synapse/pull/17911))
|
||||
* Update version constraint to allow the latest poetry-core 1.9.1. ([#​17902](https://github.com/element-hq/synapse/pull/17902))
|
||||
* Update the portdb CI to use Python 3.13 and Postgres 17 as latest dependencies. ([#​17909](https://github.com/element-hq/synapse/pull/17909))
|
||||
* Add an index to `current_state_delta_stream` table. ([#​17912](https://github.com/element-hq/synapse/issues/17912))
|
||||
* Fix building and attaching release artifacts during the release process. ([#​17921](https://github.com/element-hq/synapse/issues/17921))
|
||||
|
||||
[1.100.0]
|
||||
* Update synapse to 1.120.0
|
||||
* [Full Changelog](https://github.com/element-hq/synapse/releases/tag/v1.118.0)
|
||||
* Fix a bug introduced in Synapse v1.120rc1 which would cause the newly-introduced `delete_old_otks` job to fail in worker-mode deployments. ([#​17960](https://github.com/element-hq/synapse/issues/17960))
|
||||
|
||||
|
||||
@@ -5,24 +5,39 @@
|
||||
"description": "file://DESCRIPTION.md",
|
||||
"changelog": "file://CHANGELOG.md",
|
||||
"tagline": "Secure & decentralized communication",
|
||||
"version": "1.97.4",
|
||||
"upstreamVersion": "1.114.0",
|
||||
"version": "1.100.0",
|
||||
"upstreamVersion": "1.120.0",
|
||||
"healthCheckPath": "/",
|
||||
"httpPort": 8008,
|
||||
"memoryLimit": 536870912,
|
||||
"addons": {
|
||||
"localstorage": {},
|
||||
"oidc": { "loginRedirectUri": "/_synapse/client/oidc/callback" },
|
||||
"oidc": {
|
||||
"loginRedirectUri": "/_synapse/client/oidc/callback"
|
||||
},
|
||||
"postgresql": {},
|
||||
"sendmail": { "supportsDisplayName": true },
|
||||
"turn": { "optional": true }
|
||||
"sendmail": {
|
||||
"supportsDisplayName": true
|
||||
},
|
||||
"turn": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"manifestVersion": 2,
|
||||
"website": "https://matrix.org",
|
||||
"contactEmail": "support@cloudron.io",
|
||||
"icon": "file://logo.png",
|
||||
"tags": [
|
||||
"im", "collaboration", "voip", "videochat", "chat", "slack", "zulip", "federated"
|
||||
"im",
|
||||
"collaboration",
|
||||
"voip",
|
||||
"videochat",
|
||||
"chat",
|
||||
"slack",
|
||||
"zulip",
|
||||
"federated",
|
||||
"element",
|
||||
"riot"
|
||||
],
|
||||
"mediaLinks": [
|
||||
"https://screenshots.cloudron.io/org.matrix.synapse/1.png",
|
||||
|
||||
@@ -9,16 +9,17 @@ RUN virtualenv -p python3 /app/code/env
|
||||
ENV VIRTUAL_ENV=/app/code/env
|
||||
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||
|
||||
ARG VERSION=1.114.0
|
||||
# renovate: datasource=github-releases depName=element-hq/synapse versioning=semver extractVersion=^v(?<version>.+)$
|
||||
ARG SYNAPSE_VERSION=1.120.0
|
||||
|
||||
# https://github.com/matrix-org/synapse-s3-storage-provider
|
||||
ARG STORAGE_PROVIDER_VERSION=1beb6af95e1f5caedb8e6e7e1cc176cdb2106d37
|
||||
# renovate: datasource=github-releases depName=matrix-org/synapse-s3-storage-provider versioning=semver extractVersion=^v(?<version>.+)$
|
||||
ARG S3PROVIDER_VERSION=1.5.0
|
||||
|
||||
# Synapse (https://github.com/matrix-org/synapse/blob/master/INSTALL.md)
|
||||
# lxml - required for previews
|
||||
RUN pip install --upgrade pip && \
|
||||
pip install --upgrade setuptools && \
|
||||
pip install matrix-synapse==v${VERSION} psycopg2-binary python-ldap matrix-synapse-ldap3 lxml publicsuffix2 git+https://github.com/matrix-org/synapse-s3-storage-provider.git@${STORAGE_PROVIDER_VERSION} matrix-synapse[oidc]
|
||||
pip install matrix-synapse==v${SYNAPSE_VERSION} psycopg2-binary python-ldap matrix-synapse-ldap3 lxml publicsuffix2 git+https://github.com/matrix-org/synapse-s3-storage-provider.git@v${S3PROVIDER_VERSION} matrix-synapse[oidc]
|
||||
|
||||
# Updated suffix list
|
||||
RUN curl -L https://publicsuffix.org/list/public_suffix_list.dat -o /app/code/env/lib/python3.10/site-packages/publicsuffix2/public_suffix_list.dat
|
||||
|
||||
4
renovate.json5
Normal file
4
renovate.json5
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": ["local>devops/renovator//default.renovate.json5"]
|
||||
}
|
||||
72
test/package-lock.json
generated
72
test/package-lock.json
generated
@@ -9,16 +9,17 @@
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"chromedriver": "^128.0.1",
|
||||
"chromedriver": "^131.0.1",
|
||||
"expect.js": "^0.3.1",
|
||||
"mocha": "^10.7.3",
|
||||
"selenium-webdriver": "^4.24.0"
|
||||
"mocha": "^10.8.2",
|
||||
"selenium-webdriver": "^4.27.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@bazel/runfiles": {
|
||||
"version": "5.8.1",
|
||||
"resolved": "https://registry.npmjs.org/@bazel/runfiles/-/runfiles-5.8.1.tgz",
|
||||
"integrity": "sha512-NDdfpdQ6rZlylgv++iMn5FkObC/QlBQvipinGLSOguTYpRywmieOyJ29XHvUilspwTFSILWpoE9CqMGkHXug1g=="
|
||||
"version": "6.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@bazel/runfiles/-/runfiles-6.3.1.tgz",
|
||||
"integrity": "sha512-1uLNT5NZsUVIGS4syuHwTzZ8HycMPyr6POA3FCE4GbMtc4rhoJk8aZKtNIRthJYfL+iioppi+rTfH3olMPr9nA==",
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/@testim/chrome-version": {
|
||||
"version": "1.1.4",
|
||||
@@ -246,10 +247,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/chromedriver": {
|
||||
"version": "128.0.1",
|
||||
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-128.0.1.tgz",
|
||||
"integrity": "sha512-UmWqZXXAyuRa37pE+lnU46vJcCM/y0ddF015LHxycEOYfuqsK7k9ZxJuXCQNWbws9e7FAMQj/GJZT92WPgis0g==",
|
||||
"version": "131.0.1",
|
||||
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-131.0.1.tgz",
|
||||
"integrity": "sha512-LHRh+oaNU1WowJjAkWsviN8pTzQYJDbv/FvJyrQ7XhjKdIzVh/s3GV1iU7IjMTsxIQnBsTjx+9jWjzCWIXC7ug==",
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@testim/chrome-version": "^1.1.4",
|
||||
"axios": "^1.7.4",
|
||||
@@ -924,9 +926,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/mocha": {
|
||||
"version": "10.7.3",
|
||||
"resolved": "https://registry.npmjs.org/mocha/-/mocha-10.7.3.tgz",
|
||||
"integrity": "sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A==",
|
||||
"version": "10.8.2",
|
||||
"resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz",
|
||||
"integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-colors": "^4.1.3",
|
||||
"browser-stdout": "^1.3.1",
|
||||
@@ -1180,11 +1183,22 @@
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||
},
|
||||
"node_modules/selenium-webdriver": {
|
||||
"version": "4.24.0",
|
||||
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.24.0.tgz",
|
||||
"integrity": "sha512-qrqoHhHPZuKLiz5VAQUxrn3ILs7/cYqn2/x96r35g5JjkLUjOS1lX+F+tEJKhRMlQ/MGJ+N1016JF5g2xZUFzw==",
|
||||
"version": "4.27.0",
|
||||
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.27.0.tgz",
|
||||
"integrity": "sha512-LkTJrNz5socxpPnWPODQ2bQ65eYx9JK+DQMYNihpTjMCqHwgWGYQnQTCAAche2W3ZP87alA+1zYPvgS8tHNzMQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/SeleniumHQ"
|
||||
},
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/selenium"
|
||||
}
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@bazel/runfiles": "^5.8.1",
|
||||
"@bazel/runfiles": "^6.3.1",
|
||||
"jszip": "^3.10.1",
|
||||
"tmp": "^0.2.3",
|
||||
"ws": "^8.18.0"
|
||||
@@ -1490,9 +1504,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@bazel/runfiles": {
|
||||
"version": "5.8.1",
|
||||
"resolved": "https://registry.npmjs.org/@bazel/runfiles/-/runfiles-5.8.1.tgz",
|
||||
"integrity": "sha512-NDdfpdQ6rZlylgv++iMn5FkObC/QlBQvipinGLSOguTYpRywmieOyJ29XHvUilspwTFSILWpoE9CqMGkHXug1g=="
|
||||
"version": "6.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@bazel/runfiles/-/runfiles-6.3.1.tgz",
|
||||
"integrity": "sha512-1uLNT5NZsUVIGS4syuHwTzZ8HycMPyr6POA3FCE4GbMtc4rhoJk8aZKtNIRthJYfL+iioppi+rTfH3olMPr9nA=="
|
||||
},
|
||||
"@testim/chrome-version": {
|
||||
"version": "1.1.4",
|
||||
@@ -1663,9 +1677,9 @@
|
||||
}
|
||||
},
|
||||
"chromedriver": {
|
||||
"version": "128.0.1",
|
||||
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-128.0.1.tgz",
|
||||
"integrity": "sha512-UmWqZXXAyuRa37pE+lnU46vJcCM/y0ddF015LHxycEOYfuqsK7k9ZxJuXCQNWbws9e7FAMQj/GJZT92WPgis0g==",
|
||||
"version": "131.0.1",
|
||||
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-131.0.1.tgz",
|
||||
"integrity": "sha512-LHRh+oaNU1WowJjAkWsviN8pTzQYJDbv/FvJyrQ7XhjKdIzVh/s3GV1iU7IjMTsxIQnBsTjx+9jWjzCWIXC7ug==",
|
||||
"requires": {
|
||||
"@testim/chrome-version": "^1.1.4",
|
||||
"axios": "^1.7.4",
|
||||
@@ -2135,9 +2149,9 @@
|
||||
}
|
||||
},
|
||||
"mocha": {
|
||||
"version": "10.7.3",
|
||||
"resolved": "https://registry.npmjs.org/mocha/-/mocha-10.7.3.tgz",
|
||||
"integrity": "sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A==",
|
||||
"version": "10.8.2",
|
||||
"resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz",
|
||||
"integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==",
|
||||
"requires": {
|
||||
"ansi-colors": "^4.1.3",
|
||||
"browser-stdout": "^1.3.1",
|
||||
@@ -2338,11 +2352,11 @@
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||
},
|
||||
"selenium-webdriver": {
|
||||
"version": "4.24.0",
|
||||
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.24.0.tgz",
|
||||
"integrity": "sha512-qrqoHhHPZuKLiz5VAQUxrn3ILs7/cYqn2/x96r35g5JjkLUjOS1lX+F+tEJKhRMlQ/MGJ+N1016JF5g2xZUFzw==",
|
||||
"version": "4.27.0",
|
||||
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.27.0.tgz",
|
||||
"integrity": "sha512-LkTJrNz5socxpPnWPODQ2bQ65eYx9JK+DQMYNihpTjMCqHwgWGYQnQTCAAche2W3ZP87alA+1zYPvgS8tHNzMQ==",
|
||||
"requires": {
|
||||
"@bazel/runfiles": "^5.8.1",
|
||||
"@bazel/runfiles": "^6.3.1",
|
||||
"jszip": "^3.10.1",
|
||||
"tmp": "^0.2.3",
|
||||
"ws": "^8.18.0"
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"chromedriver": "^128.0.1",
|
||||
"chromedriver": "^131.0.1",
|
||||
"expect.js": "^0.3.1",
|
||||
"mocha": "^10.7.3",
|
||||
"selenium-webdriver": "^4.24.0"
|
||||
"mocha": "^10.8.2",
|
||||
"selenium-webdriver": "^4.27.0"
|
||||
}
|
||||
}
|
||||
|
||||
123
test/test.js
123
test/test.js
@@ -1,11 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/* jshint esversion: 8 */
|
||||
/* global it:false */
|
||||
/* global xit:false */
|
||||
/* global describe:false */
|
||||
/* global before:false */
|
||||
/* global after:false */
|
||||
/* global it, xit, describe, before, after, afterEach */
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -13,11 +9,11 @@ require('chromedriver');
|
||||
|
||||
const execSync = require('child_process').execSync,
|
||||
expect = require('expect.js'),
|
||||
fs = require('fs'),
|
||||
path = require('path'),
|
||||
{ Builder, By, Key, until } = require('selenium-webdriver'),
|
||||
{ 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);
|
||||
@@ -27,7 +23,7 @@ describe('Application life cycle test', function () {
|
||||
this.timeout(0);
|
||||
|
||||
const ELEMENT_LOCATION = 'element-test';
|
||||
const LOCATION = 'test';
|
||||
const LOCATION = process.env.LOCATION || 'test';
|
||||
const TEST_TIMEOUT = parseInt(process.env.TIMEOUT, 10) || 10000;
|
||||
const EXEC_ARGS = { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' };
|
||||
const USERNAME = process.env.USERNAME;
|
||||
@@ -36,22 +32,40 @@ describe('Application life cycle test', function () {
|
||||
const ROOM_NAME = 'Test room ' + ROOM_ID;
|
||||
const MSG_TEXT = 'Test message ';
|
||||
|
||||
let browser, app;
|
||||
let athenticated_by_oidc = false;
|
||||
let browser, app, elementApp;
|
||||
|
||||
before(function () {
|
||||
const options = new Options().windowSize({ width: 1280, height: 1024 });
|
||||
if (process.env.HEADLESS) options.addArguments('headless');
|
||||
const chromeOptions = new Options().windowSize({ width: 1280, height: 1024 });
|
||||
if (process.env.CI) chromeOptions.addArguments('no-sandbox', 'disable-dev-shm-usage', 'headless');
|
||||
browser = new Builder().forBrowser('chrome').setChromeOptions(chromeOptions).build();
|
||||
if (!fs.existsSync('./screenshots')) fs.mkdirSync('./screenshots');
|
||||
|
||||
browser = new Builder().forBrowser('chrome').setChromeOptions(options).build();
|
||||
if (process.env.CI) execSync(`cloudron uninstall --app ${ELEMENT_LOCATION} || true`, EXEC_ARGS);
|
||||
});
|
||||
|
||||
after(function () {
|
||||
browser.quit();
|
||||
});
|
||||
|
||||
function sleep(millis) {
|
||||
return new Promise(resolve => setTimeout(resolve, millis));
|
||||
afterEach(async function () {
|
||||
if (!process.env.CI || !app) return;
|
||||
|
||||
const currentUrl = await browser.getCurrentUrl();
|
||||
if (!currentUrl.includes(app.domain)) return;
|
||||
expect(this.currentTest.title).to.be.a('string');
|
||||
|
||||
const screenshotData = await browser.takeScreenshot();
|
||||
fs.writeFileSync(`./screenshots/${new Date().getTime()}-${this.currentTest.title.replaceAll(' ', '_')}.png`, screenshotData, 'base64');
|
||||
});
|
||||
|
||||
async function clearCache() {
|
||||
await browser.manage().deleteAllCookies();
|
||||
await browser.quit();
|
||||
browser = null;
|
||||
const chromeOptions = new Options().windowSize({ width: 1280, height: 1024 });
|
||||
if (process.env.CI) chromeOptions.addArguments('no-sandbox', 'disable-dev-shm-usage', 'headless');
|
||||
chromeOptions.addArguments(`--user-data-dir=${await fs.promises.mkdtemp('/tmp/test-')}`); // --profile-directory=Default
|
||||
browser = new Builder().forBrowser('chrome').setChromeOptions(chromeOptions).build();
|
||||
}
|
||||
|
||||
async function waitForElement(elem) {
|
||||
@@ -67,8 +81,8 @@ describe('Application life cycle test', function () {
|
||||
|
||||
function getElementAppInfo() {
|
||||
const inspect = JSON.parse(execSync('cloudron inspect'));
|
||||
app = inspect.apps.filter(function (a) { return a.location.indexOf(ELEMENT_LOCATION) === 0; })[0];
|
||||
expect(app).to.be.an('object');
|
||||
elementApp = inspect.apps.filter(function (a) { return a.location.indexOf(ELEMENT_LOCATION) === 0; })[0];
|
||||
expect(elementApp).to.be.an('object');
|
||||
}
|
||||
|
||||
function getMessage() {
|
||||
@@ -80,7 +94,7 @@ describe('Application life cycle test', function () {
|
||||
execSync(`cloudron exec --app ${ELEMENT_LOCATION} -- bash -c "jq '.default_server_config[\\"m.homeserver\\"].base_url = \\"https://${app.fqdn}\\"' /app/data/config.json | sponge /app/data/config.json"`);
|
||||
execSync(`cloudron restart --app ${ELEMENT_LOCATION}`);
|
||||
// wait when all services are up and running
|
||||
await sleep(15000);
|
||||
await browser.sleep(15000);
|
||||
}
|
||||
|
||||
async function checkLandingPage() {
|
||||
@@ -89,7 +103,7 @@ describe('Application life cycle test', function () {
|
||||
}
|
||||
|
||||
async function registerUser() {
|
||||
await browser.get(`https://${app.fqdn}/#/register`);
|
||||
await browser.get(`https://${elementApp.fqdn}/#/register`);
|
||||
await waitForElement(By.xpath('//input[@label="Username"]'));
|
||||
await browser.findElement(By.xpath('//input[@label="Username"]')).sendKeys(USERNAME);
|
||||
await browser.sleep(2000);
|
||||
@@ -106,35 +120,29 @@ describe('Application life cycle test', function () {
|
||||
await waitForElement(By.xpath(`//h1[contains(., "Welcome")]`));
|
||||
}
|
||||
|
||||
async function loginOIDC(username, password) {
|
||||
async function loginOIDC(username, password, hasSession, proceedWithReset) {
|
||||
browser.manage().deleteAllCookies();
|
||||
await browser.get(`https://${app.fqdn}/#/login`);
|
||||
await browser.get(`https://${elementApp.fqdn}/#/login`);
|
||||
await browser.sleep(6000);
|
||||
|
||||
await waitForElement(By.xpath('//div[@role="button" and contains(., "Continue with Cloudron")]'));
|
||||
await browser.findElement(By.xpath('//div[@role="button" and contains(., "Continue with Cloudron")]')).click();
|
||||
await browser.sleep(2000);
|
||||
|
||||
if (!athenticated_by_oidc) {
|
||||
if (!hasSession) {
|
||||
await waitForElement(By.xpath('//input[@name="username"]'));
|
||||
await browser.findElement(By.xpath('//input[@name="username"]')).sendKeys(username);
|
||||
await browser.findElement(By.xpath('//input[@name="password"]')).sendKeys(password);
|
||||
await browser.sleep(2000);
|
||||
await browser.findElement(By.id('loginSubmitButton')).click();
|
||||
await browser.sleep(2000);
|
||||
|
||||
athenticated_by_oidc = true;
|
||||
}
|
||||
|
||||
await waitForElement(By.xpath('//p[@class="confirm-trust" and contains(., "Continuing will grant ")]'));
|
||||
await browser.findElement(By.xpath('//a[contains(., "Continue")]')).click();
|
||||
await browser.sleep(2000);
|
||||
|
||||
//if (await browser.findElements(By.xpath('//div[@aria-label="Skip verification for now"]')).then(found => !!found.length)) {
|
||||
// await skipVerification();
|
||||
//}
|
||||
|
||||
if (await browser.findElements(By.xpath('//div[text()="Proceed with reset"]')).then(found => !!found.length)) {
|
||||
if (proceedWithReset) {
|
||||
await browser.findElement(By.xpath('//div[text()="Proceed with reset"]')).click();
|
||||
|
||||
await waitForElement(By.xpath('//button[text()="Continue"]'));
|
||||
@@ -160,17 +168,13 @@ describe('Application life cycle test', function () {
|
||||
}
|
||||
|
||||
async function login() {
|
||||
await browser.get('https://' + app.fqdn + '/#/login');
|
||||
await browser.get(`https://${elementApp.fqdn}/#/login`);
|
||||
await browser.wait(until.elementLocated(By.xpath('//input[@value="Sign in"]')), TEST_TIMEOUT);
|
||||
await browser.findElement(By.xpath('//input[@name="username"]')).sendKeys(USERNAME);
|
||||
await browser.findElement(By.xpath('//input[@name="password"]')).sendKeys(PASSWORD);
|
||||
await browser.findElement(By.xpath('//input[@value="Sign in"]')).click();
|
||||
await browser.sleep(5000);
|
||||
|
||||
if (await browser.findElements(By.xpath('//div[@aria-label="Skip verification for now"]')).then(found => !!found.length)) {
|
||||
await skipVerification();
|
||||
}
|
||||
|
||||
await skipVerification();
|
||||
await browser.wait(until.elementLocated(By.xpath('//span[text()="Rooms"]')), TEST_TIMEOUT);
|
||||
}
|
||||
|
||||
@@ -185,7 +189,7 @@ describe('Application life cycle test', function () {
|
||||
}
|
||||
|
||||
async function logout() {
|
||||
await browser.get('https://' + app.fqdn + '/#/home');
|
||||
await browser.get(`https://${elementApp.fqdn}/#/home`);
|
||||
await browser.sleep(5000);
|
||||
await waitForElement(By.xpath('//div[@role="button" and @aria-label="User menu"]'));
|
||||
|
||||
@@ -195,21 +199,21 @@ describe('Application life cycle test', function () {
|
||||
await browser.findElement(By.xpath('//li[@role="menuitem" and @aria-label="Sign out"]')).click();
|
||||
await browser.sleep(2000);
|
||||
|
||||
// if (await browser.findElements(By.xpath('//button[contains(text(), "I don\'t want my encrypted messages")]')).then(found => !!found.length)) {
|
||||
if (await browser.findElements(By.xpath('//button[contains(text(), "I don\'t want my encrypted messages")]')).then(found => !!found.length)) {
|
||||
await browser.findElement(By.xpath('//button[contains(text(), "I don\'t want my encrypted messages")]')).click();
|
||||
await browser.sleep(3000);
|
||||
// }
|
||||
}
|
||||
|
||||
await waitForElement(By.xpath('//h1[text()="Sign in"]'));
|
||||
}
|
||||
|
||||
async function isLoggedIn() {
|
||||
await browser.get('https://' + app.fqdn + '/#/home');
|
||||
await browser.get(`https://${elementApp.fqdn}/#/home`);
|
||||
await browser.wait(until.elementLocated(By.xpath('//span[text()="Rooms"]')), TEST_TIMEOUT);
|
||||
}
|
||||
|
||||
async function createRoom() {
|
||||
await browser.get('https://' + app.fqdn + '/#/home');
|
||||
await browser.get(`https://${elementApp.fqdn}/#/home`);
|
||||
await browser.sleep(4000);
|
||||
await waitForElement(By.xpath('//div[@role="button" and @aria-label="Add room"]'));
|
||||
await browser.findElement(By.xpath('//div[@role="button" and @aria-label="Add room"]')).click();
|
||||
@@ -229,7 +233,7 @@ describe('Application life cycle test', function () {
|
||||
}
|
||||
|
||||
async function checkRoom() {
|
||||
await browser.get('https://' + app.fqdn + '/#/home');
|
||||
await browser.get(`https://${elementApp.fqdn}/#/home`);
|
||||
await browser.sleep(4000);
|
||||
await waitForElement(By.xpath('//div[@role="treeitem" and @aria-label="' + ROOM_NAME + '"]'));
|
||||
await browser.findElement(By.xpath('//div[@role="treeitem" and @aria-label="' + ROOM_NAME + '"]')).click();
|
||||
@@ -261,15 +265,12 @@ describe('Application life cycle test', function () {
|
||||
it('can register new user', registerUser);
|
||||
it('create room', createRoom);
|
||||
it('can send message', sendMessage);
|
||||
|
||||
it('can logout', logout);
|
||||
it('can logout', logout); // from auto-login
|
||||
|
||||
it('can login', login);
|
||||
it('check room', checkRoom);
|
||||
it('can logout', logout);
|
||||
|
||||
it('can get app info', getAppInfo);
|
||||
|
||||
it('uninstall element-web app', async function () {
|
||||
await browser.get('about:blank');
|
||||
execSync(`cloudron uninstall --app ${ELEMENT_LOCATION}`, EXEC_ARGS);
|
||||
@@ -281,10 +282,10 @@ describe('Application life cycle test', function () {
|
||||
it('can get app info', getAppInfo);
|
||||
|
||||
it('can install element-web app (sso)', function () { execSync('cloudron install --appstore-id im.riot.cloudronapp --location ' + ELEMENT_LOCATION, EXEC_ARGS); });
|
||||
it('can get Element app info', getElementAppInfo);
|
||||
it('update element-app config', updateSynapseConfig);
|
||||
|
||||
it('can get Element app info', getElementAppInfo);
|
||||
it('can login via OIDC', loginOIDC.bind(null, USERNAME, PASSWORD));
|
||||
it('can login via OIDC', loginOIDC.bind(null, USERNAME, PASSWORD, false, false /* proceedWithReset */));
|
||||
it('create room', createRoom);
|
||||
it('can send message', sendMessage);
|
||||
it('can get app info', getAppInfo);
|
||||
@@ -293,10 +294,8 @@ describe('Application life cycle test', function () {
|
||||
|
||||
it('backup app', function () { execSync(`cloudron backup create --app ${app.id}`, EXEC_ARGS); });
|
||||
|
||||
it('can get Element app info', getElementAppInfo);
|
||||
it('is logged in', isLoggedIn);
|
||||
it('check room', checkRoom);
|
||||
it('can get app info', getAppInfo);
|
||||
|
||||
it('restore app', async function () {
|
||||
const backups = JSON.parse(execSync(`cloudron backup list --raw --app ${app.id}`));
|
||||
@@ -310,7 +309,6 @@ describe('Application life cycle test', function () {
|
||||
execSync(`cloudron restore --backup ${backups[0].id} --app ${app.id}`, EXEC_ARGS);
|
||||
});
|
||||
|
||||
it('can get Element app info', getElementAppInfo);
|
||||
it('is logged in', isLoggedIn);
|
||||
it('check room', checkRoom);
|
||||
it('can send message', sendMessage);
|
||||
@@ -323,50 +321,49 @@ describe('Application life cycle test', function () {
|
||||
|
||||
execSync(`cloudron configure --location ${LOCATION}2`, EXEC_ARGS);
|
||||
getAppInfo();
|
||||
// wait when all services are up and running
|
||||
await sleep(15000);
|
||||
await browser.sleep(15000);
|
||||
});
|
||||
|
||||
it('update element-app config', updateSynapseConfig);
|
||||
|
||||
it('can get Element app info', getElementAppInfo);
|
||||
it('can login via OIDC', loginOIDC.bind(null, USERNAME, PASSWORD));
|
||||
it('can login via OIDC', loginOIDC.bind(null, USERNAME, PASSWORD, true, true /* proceedWithReset */));
|
||||
it('check room', checkRoom);
|
||||
it('can send message', sendMessage);
|
||||
|
||||
it('can logout', logout);
|
||||
it('can get app info', getAppInfo);
|
||||
|
||||
it('uninstall app', async function () {
|
||||
await browser.get('about:blank');
|
||||
execSync(`cloudron uninstall --app ${app.id}`, EXEC_ARGS);
|
||||
});
|
||||
|
||||
it('uninstall element-web app', function () {
|
||||
execSync(`cloudron uninstall --app ${ELEMENT_LOCATION}`, EXEC_ARGS);
|
||||
});
|
||||
|
||||
// test update
|
||||
it('clear cache', clearCache);
|
||||
it('can install app for update', function () { execSync('cloudron install --appstore-id org.matrix.synapse --location ' + LOCATION, EXEC_ARGS); });
|
||||
it('can install element-web app (update)', function () { execSync('cloudron install --appstore-id im.riot.cloudronapp --location ' + ELEMENT_LOCATION, EXEC_ARGS); });
|
||||
|
||||
it('can get app info', getAppInfo);
|
||||
it('update element-app config', updateSynapseConfig);
|
||||
|
||||
it('can install element-web app (update)', function () { execSync('cloudron install --appstore-id im.riot.cloudronapp --location ' + ELEMENT_LOCATION, EXEC_ARGS); });
|
||||
it('can get Element app info', getElementAppInfo);
|
||||
|
||||
it('can login via OIDC', loginOIDC.bind(null, USERNAME, PASSWORD));
|
||||
it('update element-app config', updateSynapseConfig);
|
||||
|
||||
it('can login via OIDC', loginOIDC.bind(null, USERNAME, PASSWORD, false, false /* proceedWithReset */));
|
||||
it('is logged in', isLoggedIn);
|
||||
it('create room', createRoom);
|
||||
it('can send message', sendMessage);
|
||||
it('can logout', logout);
|
||||
it('can get app info', getAppInfo);
|
||||
|
||||
it('can update', async function () {
|
||||
await browser.get('about:blank');
|
||||
execSync(`cloudron update --app ${app.id}`, EXEC_ARGS);
|
||||
// wait when all services are up and running
|
||||
await sleep(15000);
|
||||
await browser.sleep(15000);
|
||||
});
|
||||
|
||||
it('can get Element app info', getElementAppInfo);
|
||||
it('can login via OIDC', loginOIDC.bind(null, USERNAME, PASSWORD));
|
||||
it('can login via OIDC', loginOIDC.bind(null, USERNAME, PASSWORD, true, true /* proceedWithReset */));
|
||||
it('is logged in', isLoggedIn);
|
||||
it('check room', checkRoom);
|
||||
it('can send message', sendMessage);
|
||||
|
||||
Reference in New Issue
Block a user