Merge pull request #3537 from matrix-org/bwindels/merge-e2e-tests
Merge end-to-end tests
This commit is contained in:
commit
fc175a971c
53 changed files with 4112 additions and 7 deletions
|
@ -15,9 +15,9 @@ steps:
|
|||
|
||||
- label: ":chains: End-to-End Tests"
|
||||
agents:
|
||||
# We use a medium sized instance instead of the normal small ones because
|
||||
# We use a xlarge sized instance instead of the normal small ones because
|
||||
# e2e tests otherwise take +-8min
|
||||
queue: "medium"
|
||||
queue: "xlarge"
|
||||
command:
|
||||
# TODO: Remove hacky chmod for BuildKite
|
||||
- "echo '--- Setup'"
|
||||
|
|
|
@ -168,3 +168,8 @@ Ensure you've followed the above development instructions and then:
|
|||
```bash
|
||||
yarn test
|
||||
```
|
||||
|
||||
## End-to-End tests
|
||||
|
||||
Make sure you've got your Riot development server running (by doing `yarn start` in riot-web), and then in this project, run `yarn run e2etests`.
|
||||
See `test/end-to-end-tests/README.md` for more information.
|
||||
|
|
|
@ -54,7 +54,8 @@
|
|||
"clean": "rimraf lib",
|
||||
"prepare": "yarn clean && yarn build && git rev-parse HEAD > git-revision.txt",
|
||||
"test": "karma start --single-run=true --browsers VectorChromeHeadless",
|
||||
"test-multi": "karma start"
|
||||
"test-multi": "karma start",
|
||||
"e2etests": "./test/end-to-end-tests/run.sh --riot-url http://localhost:8080"
|
||||
},
|
||||
"dependencies": {
|
||||
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
||||
|
|
|
@ -28,14 +28,14 @@ REACT_SDK_DIR=`pwd`
|
|||
echo "--- Building Riot"
|
||||
scripts/ci/build.sh
|
||||
# run end to end tests
|
||||
echo "--- Fetching end-to-end tests from master"
|
||||
scripts/fetchdep.sh matrix-org matrix-react-end-to-end-tests master
|
||||
pushd matrix-react-end-to-end-tests
|
||||
pushd test/end-to-end-tests
|
||||
ln -s $REACT_SDK_DIR/$RIOT_WEB_DIR riot/riot-web
|
||||
# PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true ./install.sh
|
||||
# CHROME_PATH=$(which google-chrome-stable) ./run.sh
|
||||
echo "--- Install synapse & other dependencies"
|
||||
./install.sh
|
||||
# install static webserver to server symlinked local copy of riot
|
||||
./riot/install-webserver.sh
|
||||
mkdir logs
|
||||
echo "+++ Running end-to-end tests"
|
||||
TESTS_STARTED=1
|
||||
|
|
3
test/end-to-end-tests/.gitignore
vendored
Normal file
3
test/end-to-end-tests/.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
node_modules
|
||||
*.png
|
||||
riot/env
|
43
test/end-to-end-tests/README.md
Normal file
43
test/end-to-end-tests/README.md
Normal file
|
@ -0,0 +1,43 @@
|
|||
# Matrix React SDK End-to-End tests
|
||||
|
||||
This directory contains tests for matrix-react-sdk. The tests fire up a headless Chrome and simulate user interaction (end-to-end). Note that end-to-end has little to do with the end-to-end encryption Matrix supports, just that we test the full stack, going from user interaction to expected DOM in the browser.
|
||||
|
||||
## Setup
|
||||
|
||||
Run `./install.sh`. This will:
|
||||
- install Synapse, fetches the master branch at the moment. If anything fails here, please refer to the Synapse README to see if you're missing one of the prerequisites.
|
||||
- install Riot, this fetches the master branch at the moment.
|
||||
- install dependencies (will download copy of chrome)
|
||||
|
||||
## Running the tests
|
||||
|
||||
Run tests with `./run.sh`.
|
||||
|
||||
### Debug tests locally.
|
||||
|
||||
`./run.sh` will run the tests against the Riot copy present in `riot/riot-web` served by a static Python HTTP server. You can symlink your `riot-web` develop copy here but that doesn't work well with Webpack recompiling. You can run the test runner directly and specify parameters to get more insight into a failure or run the tests against your local Webpack server.
|
||||
|
||||
```
|
||||
./synapse/stop.sh && \
|
||||
./synapse/start.sh && \
|
||||
node start.js <parameters>
|
||||
```
|
||||
It's important to always stop and start Synapse before each run of the tests to clear the in-memory SQLite database it uses, as the tests assume a blank slate.
|
||||
|
||||
start.js accepts these parameters (and more, see `node start.js --help`) that can help running the tests locally:
|
||||
|
||||
- `--riot-url <url>` don't use the Riot copy and static server provided by the tests, but use a running server like the Webpack watch server to run the tests against. Make sure to have the following local config:
|
||||
- `welcomeUserId` disabled as the tests assume there is no riot-bot currently.
|
||||
- `--slow-mo` type at a human speed, useful with `--windowed`.
|
||||
- `--throttle-cpu <factor>` throttle cpu in the browser by the given factor. Useful to reproduce failures because of insufficient timeouts happening on the slower CI server.
|
||||
- `--windowed` run the tests in an actual browser window Try to limit interacting with the windows while the tests are running. Hovering over the window tends to fail the tests, dragging the title bar should be fine though.
|
||||
- `--dev-tools` open the devtools in the browser window, only applies if `--windowed` is set as well.
|
||||
|
||||
Developer Guide
|
||||
===============
|
||||
|
||||
Please follow the standard Matrix contributor's guide:
|
||||
https://github.com/matrix-org/synapse/tree/master/CONTRIBUTING.rst
|
||||
|
||||
Please follow the Matrix JS/React code style as per:
|
||||
https://github.com/matrix-org/matrix-react-sdk/blob/master/code_style.md
|
8
test/end-to-end-tests/TODO.md
Normal file
8
test/end-to-end-tests/TODO.md
Normal file
|
@ -0,0 +1,8 @@
|
|||
|
||||
- join a peekable room by directory
|
||||
- join a peekable room by invite
|
||||
- join a non-peekable room by directory
|
||||
- join a non-peekable room by invite
|
||||
- leave a room and check we move to the "next" room
|
||||
- get kicked from a room and check that we show the correct message
|
||||
- get banned "
|
24
test/end-to-end-tests/has_custom_riot.js
Normal file
24
test/end-to-end-tests/has_custom_riot.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
Copyright 2019 The Matrix.org Foundation C.I.C.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// used from run.sh as getopts doesn't support long parameters
|
||||
const idx = process.argv.indexOf("--riot-url");
|
||||
let hasRiotUrl = false;
|
||||
if (idx !== -1) {
|
||||
const value = process.argv[idx + 1];
|
||||
hasRiotUrl = !!value;
|
||||
}
|
||||
process.stdout.write(hasRiotUrl ? "1" : "0" );
|
7
test/end-to-end-tests/install.sh
Executable file
7
test/end-to-end-tests/install.sh
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
# run with PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true sh install.sh if chrome is already installed
|
||||
set -e
|
||||
./synapse/install.sh
|
||||
# local testing doesn't need a Riot fetched from master,
|
||||
# so not installing that by default
|
||||
yarn install
|
19
test/end-to-end-tests/package.json
Normal file
19
test/end-to-end-tests/package.json
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"name": "e2e-tests",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"cheerio": "^1.0.0-rc.2",
|
||||
"commander": "^2.19.0",
|
||||
"puppeteer": "^1.14.0",
|
||||
"request": "^2.88.0",
|
||||
"request-promise-native": "^1.0.7",
|
||||
"uuid": "^3.3.2"
|
||||
}
|
||||
}
|
2
test/end-to-end-tests/riot/.gitignore
vendored
Normal file
2
test/end-to-end-tests/riot/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
riot-web
|
||||
riot.pid
|
33
test/end-to-end-tests/riot/config-template/config.json
Normal file
33
test/end-to-end-tests/riot/config-template/config.json
Normal file
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"default_hs_url": "http://localhost:5005",
|
||||
"default_is_url": "https://vector.im",
|
||||
"disable_custom_urls": false,
|
||||
"disable_guests": false,
|
||||
"disable_login_language_selector": false,
|
||||
"disable_3pid_login": false,
|
||||
"brand": "Riot",
|
||||
"integrations_ui_url": "https://scalar.vector.im/",
|
||||
"integrations_rest_url": "https://scalar.vector.im/api",
|
||||
"bug_report_endpoint_url": "https://riot.im/bugreports/submit",
|
||||
"features": {
|
||||
"feature_groups": "labs",
|
||||
"feature_pinning": "labs"
|
||||
},
|
||||
"default_federate": true,
|
||||
"welcomePageUrl": "home.html",
|
||||
"default_theme": "light",
|
||||
"roomDirectory": {
|
||||
"servers": [
|
||||
"localhost:5005"
|
||||
]
|
||||
},
|
||||
"piwik": {
|
||||
"url": "https://piwik.riot.im/",
|
||||
"whitelistedHSUrls": ["http://localhost:5005"],
|
||||
"whitelistedISUrls": ["https://vector.im", "https://matrix.org"],
|
||||
"siteId": 1
|
||||
},
|
||||
"enable_presence_by_hs_url": {
|
||||
"https://matrix.org": false
|
||||
}
|
||||
}
|
21
test/end-to-end-tests/riot/install-webserver.sh
Executable file
21
test/end-to-end-tests/riot/install-webserver.sh
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
BASE_DIR=$(cd $(dirname $0) && pwd)
|
||||
cd $BASE_DIR
|
||||
# Install ComplexHttpServer (a drop in replacement for Python's SimpleHttpServer
|
||||
# but with support for multiple threads) into a virtualenv.
|
||||
(
|
||||
virtualenv -p python3 env
|
||||
source env/bin/activate
|
||||
|
||||
# Having been bitten by pip SSL fail too many times, I don't trust the existing pip
|
||||
# to be able to --upgrade itself, so grab a new one fresh from source.
|
||||
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
|
||||
python get-pip.py
|
||||
rm get-pip.py
|
||||
|
||||
pip install ComplexHttpServer
|
||||
|
||||
deactivate
|
||||
)
|
16
test/end-to-end-tests/riot/install.sh
Executable file
16
test/end-to-end-tests/riot/install.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
RIOT_BRANCH=develop
|
||||
|
||||
if [ -d $BASE_DIR/riot-web ]; then
|
||||
echo "riot is already installed"
|
||||
exit
|
||||
fi
|
||||
|
||||
curl -L https://github.com/vector-im/riot-web/archive/${RIOT_BRANCH}.zip --output riot.zip
|
||||
unzip -q riot.zip
|
||||
rm riot.zip
|
||||
mv riot-web-${RIOT_BRANCH} riot-web
|
||||
cd riot-web
|
||||
yarn install
|
||||
yarn run build
|
54
test/end-to-end-tests/riot/start.sh
Executable file
54
test/end-to-end-tests/riot/start.sh
Executable file
|
@ -0,0 +1,54 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
PORT=5000
|
||||
BASE_DIR=$(cd $(dirname $0) && pwd)
|
||||
PIDFILE=$BASE_DIR/riot.pid
|
||||
CONFIG_BACKUP=config.e2etests_backup.json
|
||||
|
||||
if [ -f $PIDFILE ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
cd $BASE_DIR/
|
||||
echo -n "starting riot on http://localhost:$PORT ... "
|
||||
pushd riot-web/webapp/ > /dev/null
|
||||
|
||||
# backup config file before we copy template
|
||||
if [ -f config.json ]; then
|
||||
mv config.json $CONFIG_BACKUP
|
||||
fi
|
||||
cp $BASE_DIR/config-template/config.json .
|
||||
|
||||
LOGFILE=$(mktemp)
|
||||
# run web server in the background, showing output on error
|
||||
(
|
||||
source $BASE_DIR/env/bin/activate
|
||||
python -m ComplexHTTPServer $PORT > $LOGFILE 2>&1 &
|
||||
PID=$!
|
||||
echo $PID > $PIDFILE
|
||||
# wait so subshell does not exit
|
||||
# otherwise sleep below would not work
|
||||
wait $PID; RESULT=$?
|
||||
|
||||
# NOT expected SIGTERM (128 + 15)
|
||||
# from stop.sh?
|
||||
if [ $RESULT -ne 143 ]; then
|
||||
echo "failed"
|
||||
cat $LOGFILE
|
||||
rm $PIDFILE 2> /dev/null
|
||||
fi
|
||||
rm $LOGFILE
|
||||
exit $RESULT
|
||||
)&
|
||||
# to be able to return the exit code for immediate errors (like address already in use)
|
||||
# we wait for a short amount of time in the background and exit when the first
|
||||
# child process exits
|
||||
sleep 0.5 &
|
||||
# wait the first child process to exit (python or sleep)
|
||||
wait -n; RESULT=$?
|
||||
# return exit code of first child to exit
|
||||
if [ $RESULT -eq 0 ]; then
|
||||
echo "running"
|
||||
fi
|
||||
exit $RESULT
|
22
test/end-to-end-tests/riot/stop.sh
Executable file
22
test/end-to-end-tests/riot/stop.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
BASE_DIR=$(cd $(dirname $0) && pwd)
|
||||
PIDFILE=riot.pid
|
||||
CONFIG_BACKUP=config.e2etests_backup.json
|
||||
|
||||
cd $BASE_DIR
|
||||
|
||||
if [ -f $PIDFILE ]; then
|
||||
echo "stopping riot server ..."
|
||||
PID=$(cat $PIDFILE)
|
||||
rm $PIDFILE
|
||||
kill $PID
|
||||
|
||||
# revert config file
|
||||
cd riot-web/webapp
|
||||
rm config.json
|
||||
if [ -f $CONFIG_BACKUP ]; then
|
||||
mv $CONFIG_BACKUP config.json
|
||||
fi
|
||||
fi
|
39
test/end-to-end-tests/run.sh
Executable file
39
test/end-to-end-tests/run.sh
Executable file
|
@ -0,0 +1,39 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
BASE_DIR=$(cd $(dirname $0) && pwd)
|
||||
pushd $BASE_DIR
|
||||
|
||||
if [ ! -d "synapse/installations" ] || [ ! -d "node_modules" ]; then
|
||||
echo "Please first run $BASE_DIR/install.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
has_custom_riot=$(node has_custom_riot.js $@)
|
||||
|
||||
if [ ! -d "riot/riot-web" ] && [ $has_custom_riot -ne "1" ]; then
|
||||
echo "Please provide an instance of riot to test against by passing --riot-url <url> or running $BASE_DIR/riot/install.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
stop_servers() {
|
||||
if [ $has_custom_riot -ne "1" ]; then
|
||||
./riot/stop.sh
|
||||
fi
|
||||
./synapse/stop.sh
|
||||
}
|
||||
|
||||
handle_error() {
|
||||
EXIT_CODE=$?
|
||||
stop_servers
|
||||
exit $EXIT_CODE
|
||||
}
|
||||
|
||||
trap 'handle_error' ERR
|
||||
|
||||
./synapse/start.sh
|
||||
if [ $has_custom_riot -ne "1" ]; then
|
||||
./riot/start.sh
|
||||
fi
|
||||
node start.js $@
|
||||
stop_servers
|
29
test/end-to-end-tests/src/logbuffer.js
Normal file
29
test/end-to-end-tests/src/logbuffer.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
module.exports = class LogBuffer {
|
||||
constructor(page, eventName, eventMapper, reduceAsync=false, initialValue = "") {
|
||||
this.buffer = initialValue;
|
||||
page.on(eventName, (arg) => {
|
||||
const result = eventMapper(arg);
|
||||
if (reduceAsync) {
|
||||
result.then((r) => this.buffer += r);
|
||||
} else {
|
||||
this.buffer += result;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
62
test/end-to-end-tests/src/logger.js
Normal file
62
test/end-to-end-tests/src/logger.js
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
module.exports = class Logger {
|
||||
constructor(username) {
|
||||
this.indent = 0;
|
||||
this.username = username;
|
||||
this.muted = false;
|
||||
}
|
||||
|
||||
startGroup(description) {
|
||||
if (!this.muted) {
|
||||
const indent = " ".repeat(this.indent * 2);
|
||||
console.log(`${indent} * ${this.username} ${description}:`);
|
||||
}
|
||||
this.indent += 1;
|
||||
return this;
|
||||
}
|
||||
|
||||
endGroup() {
|
||||
this.indent -= 1;
|
||||
return this;
|
||||
}
|
||||
|
||||
step(description) {
|
||||
if (!this.muted) {
|
||||
const indent = " ".repeat(this.indent * 2);
|
||||
process.stdout.write(`${indent} * ${this.username} ${description} ... `);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
done(status = "done") {
|
||||
if (!this.muted) {
|
||||
process.stdout.write(status + "\n");
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
mute() {
|
||||
this.muted = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
unmute() {
|
||||
this.muted = false;
|
||||
return this;
|
||||
}
|
||||
};
|
30
test/end-to-end-tests/src/rest/consent.js
Normal file
30
test/end-to-end-tests/src/rest/consent.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const request = require('request-promise-native');
|
||||
const cheerio = require('cheerio');
|
||||
const url = require("url");
|
||||
|
||||
module.exports.approveConsent = async function(consentUrl) {
|
||||
const body = await request.get(consentUrl);
|
||||
const doc = cheerio.load(body);
|
||||
const v = doc("input[name=v]").val();
|
||||
const u = doc("input[name=u]").val();
|
||||
const h = doc("input[name=h]").val();
|
||||
const formAction = doc("form").attr("action");
|
||||
const absAction = url.resolve(consentUrl, formAction);
|
||||
await request.post(absAction).form({v, u, h});
|
||||
};
|
91
test/end-to-end-tests/src/rest/creator.js
Normal file
91
test/end-to-end-tests/src/rest/creator.js
Normal file
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const {exec} = require('child_process');
|
||||
const request = require('request-promise-native');
|
||||
const RestSession = require('./session');
|
||||
const RestMultiSession = require('./multi');
|
||||
|
||||
function execAsync(command, options) {
|
||||
return new Promise((resolve, reject) => {
|
||||
exec(command, options, (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
resolve({stdout, stderr});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = class RestSessionCreator {
|
||||
constructor(synapseSubdir, hsUrl, cwd) {
|
||||
this.synapseSubdir = synapseSubdir;
|
||||
this.hsUrl = hsUrl;
|
||||
this.cwd = cwd;
|
||||
}
|
||||
|
||||
async createSessionRange(usernames, password, groupName) {
|
||||
const sessionPromises = usernames.map((username) => this.createSession(username, password));
|
||||
const sessions = await Promise.all(sessionPromises);
|
||||
return new RestMultiSession(sessions, groupName);
|
||||
}
|
||||
|
||||
async createSession(username, password) {
|
||||
await this._register(username, password);
|
||||
console.log(` * created REST user ${username} ... done`);
|
||||
const authResult = await this._authenticate(username, password);
|
||||
return new RestSession(authResult);
|
||||
}
|
||||
|
||||
async _register(username, password) {
|
||||
const registerArgs = [
|
||||
'-c homeserver.yaml',
|
||||
`-u ${username}`,
|
||||
`-p ${password}`,
|
||||
'--no-admin',
|
||||
this.hsUrl,
|
||||
];
|
||||
const registerCmd = `./register_new_matrix_user ${registerArgs.join(' ')}`;
|
||||
const allCmds = [
|
||||
`cd ${this.synapseSubdir}`,
|
||||
". ./activate",
|
||||
registerCmd,
|
||||
].join(' && ');
|
||||
|
||||
await execAsync(allCmds, {cwd: this.cwd, encoding: 'utf-8'});
|
||||
}
|
||||
|
||||
async _authenticate(username, password) {
|
||||
const requestBody = {
|
||||
"type": "m.login.password",
|
||||
"identifier": {
|
||||
"type": "m.id.user",
|
||||
"user": username,
|
||||
},
|
||||
"password": password,
|
||||
};
|
||||
const url = `${this.hsUrl}/_matrix/client/r0/login`;
|
||||
const responseBody = await request.post({url, json: true, body: requestBody});
|
||||
return {
|
||||
accessToken: responseBody.access_token,
|
||||
homeServer: responseBody.home_server,
|
||||
userId: responseBody.user_id,
|
||||
deviceId: responseBody.device_id,
|
||||
hsUrl: this.hsUrl,
|
||||
};
|
||||
}
|
||||
};
|
92
test/end-to-end-tests/src/rest/multi.js
Normal file
92
test/end-to-end-tests/src/rest/multi.js
Normal file
|
@ -0,0 +1,92 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const Logger = require('../logger');
|
||||
|
||||
module.exports = class RestMultiSession {
|
||||
constructor(sessions, groupName) {
|
||||
this.log = new Logger(groupName);
|
||||
this.sessions = sessions;
|
||||
}
|
||||
|
||||
slice(groupName, start, end) {
|
||||
return new RestMultiSession(this.sessions.slice(start, end), groupName);
|
||||
}
|
||||
|
||||
pop(userName) {
|
||||
const idx = this.sessions.findIndex((s) => s.userName() === userName);
|
||||
if (idx === -1) {
|
||||
throw new Error(`user ${userName} not found`);
|
||||
}
|
||||
const session = this.sessions.splice(idx, 1)[0];
|
||||
return session;
|
||||
}
|
||||
|
||||
async setDisplayName(fn) {
|
||||
this.log.step("set their display name");
|
||||
await Promise.all(this.sessions.map(async (s) => {
|
||||
s.log.mute();
|
||||
await s.setDisplayName(fn(s));
|
||||
s.log.unmute();
|
||||
}));
|
||||
this.log.done();
|
||||
}
|
||||
|
||||
async join(roomIdOrAlias) {
|
||||
this.log.step(`join ${roomIdOrAlias}`);
|
||||
const rooms = await Promise.all(this.sessions.map(async (s) => {
|
||||
s.log.mute();
|
||||
const room = await s.join(roomIdOrAlias);
|
||||
s.log.unmute();
|
||||
return room;
|
||||
}));
|
||||
this.log.done();
|
||||
return new RestMultiRoom(rooms, roomIdOrAlias, this.log);
|
||||
}
|
||||
|
||||
room(roomIdOrAlias) {
|
||||
const rooms = this.sessions.map(s => s.room(roomIdOrAlias));
|
||||
return new RestMultiRoom(rooms, roomIdOrAlias, this.log);
|
||||
}
|
||||
};
|
||||
|
||||
class RestMultiRoom {
|
||||
constructor(rooms, roomIdOrAlias, log) {
|
||||
this.rooms = rooms;
|
||||
this.roomIdOrAlias = roomIdOrAlias;
|
||||
this.log = log;
|
||||
}
|
||||
|
||||
async talk(message) {
|
||||
this.log.step(`say "${message}" in ${this.roomIdOrAlias}`);
|
||||
await Promise.all(this.rooms.map(async (r) => {
|
||||
r.log.mute();
|
||||
await r.talk(message);
|
||||
r.log.unmute();
|
||||
}));
|
||||
this.log.done();
|
||||
}
|
||||
|
||||
async leave() {
|
||||
this.log.step(`leave ${this.roomIdOrAlias}`);
|
||||
await Promise.all(this.rooms.map(async (r) => {
|
||||
r.log.mute();
|
||||
await r.leave();
|
||||
r.log.unmute();
|
||||
}));
|
||||
this.log.done();
|
||||
}
|
||||
}
|
47
test/end-to-end-tests/src/rest/room.js
Normal file
47
test/end-to-end-tests/src/rest/room.js
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const uuidv4 = require('uuid/v4');
|
||||
|
||||
/* no pun intented */
|
||||
module.exports = class RestRoom {
|
||||
constructor(session, roomId, log) {
|
||||
this.session = session;
|
||||
this._roomId = roomId;
|
||||
this.log = log;
|
||||
}
|
||||
|
||||
async talk(message) {
|
||||
this.log.step(`says "${message}" in ${this._roomId}`);
|
||||
const txId = uuidv4();
|
||||
await this.session._put(`/rooms/${this._roomId}/send/m.room.message/${txId}`, {
|
||||
"msgtype": "m.text",
|
||||
"body": message,
|
||||
});
|
||||
this.log.done();
|
||||
return txId;
|
||||
}
|
||||
|
||||
async leave() {
|
||||
this.log.step(`leaves ${this._roomId}`);
|
||||
await this.session._post(`/rooms/${this._roomId}/leave`);
|
||||
this.log.done();
|
||||
}
|
||||
|
||||
roomId() {
|
||||
return this._roomId;
|
||||
}
|
||||
};
|
126
test/end-to-end-tests/src/rest/session.js
Normal file
126
test/end-to-end-tests/src/rest/session.js
Normal file
|
@ -0,0 +1,126 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const request = require('request-promise-native');
|
||||
const Logger = require('../logger');
|
||||
const RestRoom = require('./room');
|
||||
const {approveConsent} = require('./consent');
|
||||
|
||||
module.exports = class RestSession {
|
||||
constructor(credentials) {
|
||||
this.log = new Logger(credentials.userId);
|
||||
this._credentials = credentials;
|
||||
this._displayName = null;
|
||||
this._rooms = {};
|
||||
}
|
||||
|
||||
userId() {
|
||||
return this._credentials.userId;
|
||||
}
|
||||
|
||||
userName() {
|
||||
return this._credentials.userId.split(":")[0].substr(1);
|
||||
}
|
||||
|
||||
displayName() {
|
||||
return this._displayName;
|
||||
}
|
||||
|
||||
async setDisplayName(displayName) {
|
||||
this.log.step(`sets their display name to ${displayName}`);
|
||||
this._displayName = displayName;
|
||||
await this._put(`/profile/${this._credentials.userId}/displayname`, {
|
||||
displayname: displayName,
|
||||
});
|
||||
this.log.done();
|
||||
}
|
||||
|
||||
async join(roomIdOrAlias) {
|
||||
this.log.step(`joins ${roomIdOrAlias}`);
|
||||
const roomId = (await this._post(`/join/${encodeURIComponent(roomIdOrAlias)}`)).room_id;
|
||||
this.log.done();
|
||||
const room = new RestRoom(this, roomId, this.log);
|
||||
this._rooms[roomId] = room;
|
||||
this._rooms[roomIdOrAlias] = room;
|
||||
return room;
|
||||
}
|
||||
|
||||
room(roomIdOrAlias) {
|
||||
if (this._rooms.hasOwnProperty(roomIdOrAlias)) {
|
||||
return this._rooms[roomIdOrAlias];
|
||||
} else {
|
||||
throw new Error(`${this._credentials.userId} is not in ${roomIdOrAlias}`);
|
||||
}
|
||||
}
|
||||
|
||||
async createRoom(name, options) {
|
||||
this.log.step(`creates room ${name}`);
|
||||
const body = {
|
||||
name,
|
||||
};
|
||||
if (options.invite) {
|
||||
body.invite = options.invite;
|
||||
}
|
||||
if (options.public) {
|
||||
body.visibility = "public";
|
||||
} else {
|
||||
body.visibility = "private";
|
||||
}
|
||||
if (options.dm) {
|
||||
body.is_direct = true;
|
||||
}
|
||||
if (options.topic) {
|
||||
body.topic = options.topic;
|
||||
}
|
||||
|
||||
const roomId = (await this._post(`/createRoom`, body)).room_id;
|
||||
this.log.done();
|
||||
return new RestRoom(this, roomId, this.log);
|
||||
}
|
||||
|
||||
_post(csApiPath, body) {
|
||||
return this._request("POST", csApiPath, body);
|
||||
}
|
||||
|
||||
_put(csApiPath, body) {
|
||||
return this._request("PUT", csApiPath, body);
|
||||
}
|
||||
|
||||
async _request(method, csApiPath, body) {
|
||||
try {
|
||||
const responseBody = await request({
|
||||
url: `${this._credentials.hsUrl}/_matrix/client/r0${csApiPath}`,
|
||||
method,
|
||||
headers: {
|
||||
"Authorization": `Bearer ${this._credentials.accessToken}`,
|
||||
},
|
||||
json: true,
|
||||
body,
|
||||
});
|
||||
return responseBody;
|
||||
} catch (err) {
|
||||
const responseBody = err.response.body;
|
||||
if (responseBody.errcode === 'M_CONSENT_NOT_GIVEN') {
|
||||
await approveConsent(responseBody.consent_uri);
|
||||
return this._request(method, csApiPath, body);
|
||||
} else if (responseBody && responseBody.error) {
|
||||
throw new Error(`${method} ${csApiPath}: ${responseBody.error}`);
|
||||
} else {
|
||||
throw new Error(`${method} ${csApiPath}: ${err.response.statusCode}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
52
test/end-to-end-tests/src/scenario.js
Normal file
52
test/end-to-end-tests/src/scenario.js
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
const {range} = require('./util');
|
||||
const signup = require('./usecases/signup');
|
||||
const roomDirectoryScenarios = require('./scenarios/directory');
|
||||
const lazyLoadingScenarios = require('./scenarios/lazy-loading');
|
||||
const e2eEncryptionScenarios = require('./scenarios/e2e-encryption');
|
||||
|
||||
module.exports = async function scenario(createSession, restCreator) {
|
||||
let firstUser = true;
|
||||
async function createUser(username) {
|
||||
const session = await createSession(username);
|
||||
if (firstUser) {
|
||||
// only show browser version for first browser opened
|
||||
console.log(`running tests on ${await session.browser.version()} ...`);
|
||||
firstUser = false;
|
||||
}
|
||||
await signup(session, session.username, 'testsarefun!!!', session.hsUrl);
|
||||
return session;
|
||||
}
|
||||
|
||||
const alice = await createUser("alice");
|
||||
const bob = await createUser("bob");
|
||||
|
||||
await roomDirectoryScenarios(alice, bob);
|
||||
await e2eEncryptionScenarios(alice, bob);
|
||||
console.log("create REST users:");
|
||||
const charlies = await createRestUsers(restCreator);
|
||||
await lazyLoadingScenarios(alice, bob, charlies);
|
||||
};
|
||||
|
||||
async function createRestUsers(restCreator) {
|
||||
const usernames = range(1, 10).map((i) => `charly-${i}`);
|
||||
const charlies = await restCreator.createSessionRange(usernames, "testtest", "charly-1..10");
|
||||
await charlies.setDisplayName((s) => `Charly #${s.userName().split('-')[1]}`);
|
||||
return charlies;
|
||||
}
|
1
test/end-to-end-tests/src/scenarios/README.md
Normal file
1
test/end-to-end-tests/src/scenarios/README.md
Normal file
|
@ -0,0 +1 @@
|
|||
scenarios contains the high-level playbook for the test suite
|
36
test/end-to-end-tests/src/scenarios/directory.js
Normal file
36
test/end-to-end-tests/src/scenarios/directory.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
const join = require('../usecases/join');
|
||||
const sendMessage = require('../usecases/send-message');
|
||||
const {receiveMessage} = require('../usecases/timeline');
|
||||
const {createRoom} = require('../usecases/create-room');
|
||||
const changeRoomSettings = require('../usecases/room-settings');
|
||||
|
||||
module.exports = async function roomDirectoryScenarios(alice, bob) {
|
||||
console.log(" creating a public room and join through directory:");
|
||||
const room = 'test';
|
||||
await createRoom(alice, room);
|
||||
await changeRoomSettings(alice, {directory: true, visibility: "public_no_guests", alias: "#test"});
|
||||
await join(bob, room); //looks up room in directory
|
||||
const bobMessage = "hi Alice!";
|
||||
await sendMessage(bob, bobMessage);
|
||||
await receiveMessage(alice, {sender: "bob", body: bobMessage});
|
||||
const aliceMessage = "hi Bob, welcome!";
|
||||
await sendMessage(alice, aliceMessage);
|
||||
await receiveMessage(bob, {sender: "alice", body: aliceMessage});
|
||||
};
|
48
test/end-to-end-tests/src/scenarios/e2e-encryption.js
Normal file
48
test/end-to-end-tests/src/scenarios/e2e-encryption.js
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const sendMessage = require('../usecases/send-message');
|
||||
const acceptInvite = require('../usecases/accept-invite');
|
||||
const invite = require('../usecases/invite');
|
||||
const {receiveMessage} = require('../usecases/timeline');
|
||||
const {createRoom} = require('../usecases/create-room');
|
||||
const changeRoomSettings = require('../usecases/room-settings');
|
||||
const {startSasVerifcation, acceptSasVerification} = require('../usecases/verify');
|
||||
const assert = require('assert');
|
||||
|
||||
module.exports = async function e2eEncryptionScenarios(alice, bob) {
|
||||
console.log(" creating an e2e encrypted room and join through invite:");
|
||||
const room = "secrets";
|
||||
await createRoom(bob, room);
|
||||
await changeRoomSettings(bob, {encryption: true});
|
||||
// await cancelKeyBackup(bob);
|
||||
await invite(bob, "@alice:localhost");
|
||||
await acceptInvite(alice, room);
|
||||
// do sas verifcation
|
||||
bob.log.step(`starts SAS verification with ${alice.username}`);
|
||||
const bobSasPromise = startSasVerifcation(bob, alice.username);
|
||||
const aliceSasPromise = acceptSasVerification(alice, bob.username);
|
||||
// wait in parallel, so they don't deadlock on each other
|
||||
const [bobSas, aliceSas] = await Promise.all([bobSasPromise, aliceSasPromise]);
|
||||
assert.deepEqual(bobSas, aliceSas);
|
||||
bob.log.done(`done (match for ${bobSas.join(", ")})`);
|
||||
const aliceMessage = "Guess what I just heard?!";
|
||||
await sendMessage(alice, aliceMessage);
|
||||
await receiveMessage(bob, {sender: "alice", body: aliceMessage, encrypted: true});
|
||||
const bobMessage = "You've got to tell me!";
|
||||
await sendMessage(bob, bobMessage);
|
||||
await receiveMessage(alice, {sender: "bob", body: bobMessage, encrypted: true});
|
||||
};
|
122
test/end-to-end-tests/src/scenarios/lazy-loading.js
Normal file
122
test/end-to-end-tests/src/scenarios/lazy-loading.js
Normal file
|
@ -0,0 +1,122 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
const {delay} = require('../util');
|
||||
const join = require('../usecases/join');
|
||||
const sendMessage = require('../usecases/send-message');
|
||||
const {
|
||||
checkTimelineContains,
|
||||
scrollToTimelineTop,
|
||||
} = require('../usecases/timeline');
|
||||
const {createRoom} = require('../usecases/create-room');
|
||||
const {getMembersInMemberlist} = require('../usecases/memberlist');
|
||||
const changeRoomSettings = require('../usecases/room-settings');
|
||||
const assert = require('assert');
|
||||
|
||||
module.exports = async function lazyLoadingScenarios(alice, bob, charlies) {
|
||||
console.log(" creating a room for lazy loading member scenarios:");
|
||||
const charly1to5 = charlies.slice("charly-1..5", 0, 5);
|
||||
const charly6to10 = charlies.slice("charly-6..10", 5);
|
||||
assert(charly1to5.sessions.length, 5);
|
||||
assert(charly6to10.sessions.length, 5);
|
||||
await setupRoomWithBobAliceAndCharlies(alice, bob, charly1to5);
|
||||
await checkPaginatedDisplayNames(alice, charly1to5);
|
||||
await checkMemberList(alice, charly1to5);
|
||||
await joinCharliesWhileAliceIsOffline(alice, charly6to10);
|
||||
await checkMemberList(alice, charly6to10);
|
||||
await charlies.room(alias).leave();
|
||||
await delay(1000);
|
||||
await checkMemberListLacksCharlies(alice, charlies);
|
||||
await checkMemberListLacksCharlies(bob, charlies);
|
||||
};
|
||||
|
||||
const room = "Lazy Loading Test";
|
||||
const alias = "#lltest:localhost";
|
||||
const charlyMsg1 = "hi bob!";
|
||||
const charlyMsg2 = "how's it going??";
|
||||
|
||||
async function setupRoomWithBobAliceAndCharlies(alice, bob, charlies) {
|
||||
await createRoom(bob, room);
|
||||
await changeRoomSettings(bob, {directory: true, visibility: "public_no_guests", alias});
|
||||
// wait for alias to be set by server after clicking "save"
|
||||
// so the charlies can join it.
|
||||
await bob.delay(500);
|
||||
const charlyMembers = await charlies.join(alias);
|
||||
await charlyMembers.talk(charlyMsg1);
|
||||
await charlyMembers.talk(charlyMsg2);
|
||||
bob.log.step("sends 20 messages").mute();
|
||||
for (let i = 20; i >= 1; --i) {
|
||||
await sendMessage(bob, `I will only say this ${i} time(s)!`);
|
||||
}
|
||||
bob.log.unmute().done();
|
||||
await join(alice, alias);
|
||||
}
|
||||
|
||||
async function checkPaginatedDisplayNames(alice, charlies) {
|
||||
await scrollToTimelineTop(alice);
|
||||
//alice should see 2 messages from every charly with
|
||||
//the correct display name
|
||||
const expectedMessages = [charlyMsg1, charlyMsg2].reduce((messages, msgText) => {
|
||||
return charlies.sessions.reduce((messages, charly) => {
|
||||
return messages.concat({
|
||||
sender: charly.displayName(),
|
||||
body: msgText,
|
||||
});
|
||||
}, messages);
|
||||
}, []);
|
||||
await checkTimelineContains(alice, expectedMessages, charlies.log.username);
|
||||
}
|
||||
|
||||
async function checkMemberList(alice, charlies) {
|
||||
alice.log.step(`checks the memberlist contains herself, bob and ${charlies.log.username}`);
|
||||
const displayNames = (await getMembersInMemberlist(alice)).map((m) => m.displayName);
|
||||
assert(displayNames.includes("alice"));
|
||||
assert(displayNames.includes("bob"));
|
||||
charlies.sessions.forEach((charly) => {
|
||||
assert(displayNames.includes(charly.displayName()),
|
||||
`${charly.displayName()} should be in the member list, ` +
|
||||
`only have ${displayNames}`);
|
||||
});
|
||||
alice.log.done();
|
||||
}
|
||||
|
||||
async function checkMemberListLacksCharlies(session, charlies) {
|
||||
session.log.step(`checks the memberlist doesn't contain ${charlies.log.username}`);
|
||||
const displayNames = (await getMembersInMemberlist(session)).map((m) => m.displayName);
|
||||
charlies.sessions.forEach((charly) => {
|
||||
assert(!displayNames.includes(charly.displayName()),
|
||||
`${charly.displayName()} should not be in the member list, ` +
|
||||
`only have ${displayNames}`);
|
||||
});
|
||||
session.log.done();
|
||||
}
|
||||
|
||||
async function joinCharliesWhileAliceIsOffline(alice, charly6to10) {
|
||||
await alice.setOffline(true);
|
||||
await delay(1000);
|
||||
const members6to10 = await charly6to10.join(alias);
|
||||
const member6 = members6to10.rooms[0];
|
||||
member6.log.step("sends 20 messages").mute();
|
||||
for (let i = 20; i >= 1; --i) {
|
||||
await member6.talk("where is charly?");
|
||||
}
|
||||
member6.log.unmute().done();
|
||||
const catchupPromise = alice.waitForNextSuccessfulSync();
|
||||
await alice.setOffline(false);
|
||||
await catchupPromise;
|
||||
await delay(2000);
|
||||
}
|
222
test/end-to-end-tests/src/session.js
Normal file
222
test/end-to-end-tests/src/session.js
Normal file
|
@ -0,0 +1,222 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const puppeteer = require('puppeteer');
|
||||
const Logger = require('./logger');
|
||||
const LogBuffer = require('./logbuffer');
|
||||
const {delay} = require('./util');
|
||||
|
||||
const DEFAULT_TIMEOUT = 20000;
|
||||
|
||||
module.exports = class RiotSession {
|
||||
constructor(browser, page, username, riotserver, hsUrl) {
|
||||
this.browser = browser;
|
||||
this.page = page;
|
||||
this.hsUrl = hsUrl;
|
||||
this.riotserver = riotserver;
|
||||
this.username = username;
|
||||
this.consoleLog = new LogBuffer(page, "console", (msg) => `${msg.text()}\n`);
|
||||
this.networkLog = new LogBuffer(page, "requestfinished", async (req) => {
|
||||
const type = req.resourceType();
|
||||
const response = await req.response();
|
||||
return `${type} ${response.status()} ${req.method()} ${req.url()} \n`;
|
||||
}, true);
|
||||
this.log = new Logger(this.username);
|
||||
}
|
||||
|
||||
static async create(username, puppeteerOptions, riotserver, hsUrl, throttleCpuFactor = 1) {
|
||||
const browser = await puppeteer.launch(puppeteerOptions);
|
||||
const page = await browser.newPage();
|
||||
await page.setViewport({
|
||||
width: 1280,
|
||||
height: 800,
|
||||
});
|
||||
if (throttleCpuFactor !== 1) {
|
||||
const client = await page.target().createCDPSession();
|
||||
console.log("throttling cpu by a factor of", throttleCpuFactor);
|
||||
await client.send('Emulation.setCPUThrottlingRate', { rate: throttleCpuFactor });
|
||||
}
|
||||
return new RiotSession(browser, page, username, riotserver, hsUrl);
|
||||
}
|
||||
|
||||
async tryGetInnertext(selector) {
|
||||
const field = await this.page.$(selector);
|
||||
if (field != null) {
|
||||
const textHandle = await field.getProperty('innerText');
|
||||
return await textHandle.jsonValue();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
async getElementProperty(handle, property) {
|
||||
const propHandle = await handle.getProperty(property);
|
||||
return await propHandle.jsonValue();
|
||||
}
|
||||
|
||||
innerText(field) {
|
||||
return this.getElementProperty(field, 'innerText');
|
||||
}
|
||||
|
||||
getOuterHTML(field) {
|
||||
return this.getElementProperty(field, 'outerHTML');
|
||||
}
|
||||
|
||||
consoleLogs() {
|
||||
return this.consoleLog.buffer;
|
||||
}
|
||||
|
||||
networkLogs() {
|
||||
return this.networkLog.buffer;
|
||||
}
|
||||
|
||||
logXHRRequests() {
|
||||
let buffer = "";
|
||||
this.page.on('requestfinished', async (req) => {
|
||||
const type = req.resourceType();
|
||||
const response = await req.response();
|
||||
//if (type === 'xhr' || type === 'fetch') {
|
||||
buffer += `${type} ${response.status()} ${req.method()} ${req.url()} \n`;
|
||||
// if (req.method() === "POST") {
|
||||
// buffer += " Post data: " + req.postData();
|
||||
// }
|
||||
//}
|
||||
});
|
||||
return {
|
||||
logs() {
|
||||
return buffer;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
async printElements(label, elements) {
|
||||
console.log(label, await Promise.all(elements.map(this.getOuterHTML)));
|
||||
}
|
||||
|
||||
async replaceInputText(input, text) {
|
||||
// click 3 times to select all text
|
||||
await input.click({clickCount: 3});
|
||||
// waiting here solves not having selected all the text by the 3x click above,
|
||||
// presumably because of the Field label animation.
|
||||
await this.delay(300);
|
||||
// then remove it with backspace
|
||||
await input.press('Backspace');
|
||||
// and type the new text
|
||||
await input.type(text);
|
||||
}
|
||||
|
||||
query(selector, timeout = DEFAULT_TIMEOUT) {
|
||||
return this.page.waitForSelector(selector, {visible: true, timeout});
|
||||
}
|
||||
|
||||
async queryAll(selector) {
|
||||
const timeout = DEFAULT_TIMEOUT;
|
||||
await this.query(selector, timeout);
|
||||
return await this.page.$$(selector);
|
||||
}
|
||||
|
||||
waitForReload() {
|
||||
const timeout = DEFAULT_TIMEOUT;
|
||||
return new Promise((resolve, reject) => {
|
||||
const timeoutHandle = setTimeout(() => {
|
||||
this.browser.removeEventListener('domcontentloaded', callback);
|
||||
reject(new Error(`timeout of ${timeout}ms for waitForReload elapsed`));
|
||||
}, timeout);
|
||||
|
||||
const callback = async () => {
|
||||
clearTimeout(timeoutHandle);
|
||||
resolve();
|
||||
};
|
||||
|
||||
this.page.once('domcontentloaded', callback);
|
||||
});
|
||||
}
|
||||
|
||||
waitForNewPage() {
|
||||
const timeout = DEFAULT_TIMEOUT;
|
||||
return new Promise((resolve, reject) => {
|
||||
const timeoutHandle = setTimeout(() => {
|
||||
this.browser.removeListener('targetcreated', callback);
|
||||
reject(new Error(`timeout of ${timeout}ms for waitForNewPage elapsed`));
|
||||
}, timeout);
|
||||
|
||||
const callback = async (target) => {
|
||||
if (target.type() !== 'page') {
|
||||
return;
|
||||
}
|
||||
this.browser.removeListener('targetcreated', callback);
|
||||
clearTimeout(timeoutHandle);
|
||||
const page = await target.page();
|
||||
resolve(page);
|
||||
};
|
||||
|
||||
this.browser.on('targetcreated', callback);
|
||||
});
|
||||
}
|
||||
|
||||
/** wait for a /sync request started after this call that gets a 200 response */
|
||||
async waitForNextSuccessfulSync() {
|
||||
const syncUrls = [];
|
||||
function onRequest(request) {
|
||||
if (request.url().indexOf("/sync") !== -1) {
|
||||
syncUrls.push(request.url());
|
||||
}
|
||||
}
|
||||
|
||||
this.page.on('request', onRequest);
|
||||
|
||||
await this.page.waitForResponse((response) => {
|
||||
return syncUrls.includes(response.request().url()) && response.status() === 200;
|
||||
});
|
||||
|
||||
this.page.removeListener('request', onRequest);
|
||||
}
|
||||
|
||||
goto(url) {
|
||||
return this.page.goto(url);
|
||||
}
|
||||
|
||||
url(path) {
|
||||
return this.riotserver + path;
|
||||
}
|
||||
|
||||
delay(ms) {
|
||||
return delay(ms);
|
||||
}
|
||||
|
||||
async setOffline(enabled) {
|
||||
const description = enabled ? "offline" : "back online";
|
||||
this.log.step(`goes ${description}`);
|
||||
await this.page.setOfflineMode(enabled);
|
||||
this.log.done();
|
||||
}
|
||||
|
||||
close() {
|
||||
return this.browser.close();
|
||||
}
|
||||
|
||||
async poll(callback, interval = 100) {
|
||||
const timeout = DEFAULT_TIMEOUT;
|
||||
let waited = 0;
|
||||
while (waited < timeout) {
|
||||
await this.delay(interval);
|
||||
waited += interval;
|
||||
if (await callback()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
2
test/end-to-end-tests/src/usecases/README.md
Normal file
2
test/end-to-end-tests/src/usecases/README.md
Normal file
|
@ -0,0 +1,2 @@
|
|||
use cases contains the detailed DOM interactions to perform a given use case, may also do some assertions.
|
||||
use cases are often used in multiple scenarios.
|
35
test/end-to-end-tests/src/usecases/accept-invite.js
Normal file
35
test/end-to-end-tests/src/usecases/accept-invite.js
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
module.exports = async function acceptInvite(session, name) {
|
||||
session.log.step(`accepts "${name}" invite`);
|
||||
//TODO: brittle selector
|
||||
const invitesHandles = await session.queryAll('.mx_RoomTile_name.mx_RoomTile_invite');
|
||||
const invitesWithText = await Promise.all(invitesHandles.map(async (inviteHandle) => {
|
||||
const text = await session.innerText(inviteHandle);
|
||||
return {inviteHandle, text};
|
||||
}));
|
||||
const inviteHandle = invitesWithText.find(({inviteHandle, text}) => {
|
||||
return text.trim() === name;
|
||||
}).inviteHandle;
|
||||
|
||||
await inviteHandle.click();
|
||||
|
||||
const acceptInvitationLink = await session.query(".mx_RoomPreviewBar_Invite .mx_AccessibleButton_kind_primary");
|
||||
await acceptInvitationLink.click();
|
||||
|
||||
session.log.done();
|
||||
};
|
46
test/end-to-end-tests/src/usecases/create-room.js
Normal file
46
test/end-to-end-tests/src/usecases/create-room.js
Normal file
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
async function openRoomDirectory(session) {
|
||||
const roomDirectoryButton = await session.query('.mx_LeftPanel_explore .mx_AccessibleButton');
|
||||
await roomDirectoryButton.click();
|
||||
}
|
||||
|
||||
async function createRoom(session, roomName) {
|
||||
session.log.step(`creates room "${roomName}"`);
|
||||
|
||||
const roomListHeaders = await session.queryAll('.mx_RoomSubList_labelContainer');
|
||||
const roomListHeaderLabels = await Promise.all(roomListHeaders.map(h => session.innerText(h)));
|
||||
const roomsIndex = roomListHeaderLabels.findIndex(l => l.toLowerCase().includes("rooms"));
|
||||
if (roomsIndex === -1) {
|
||||
throw new Error("could not find room list section that contains rooms in header");
|
||||
}
|
||||
const roomsHeader = roomListHeaders[roomsIndex];
|
||||
const addRoomButton = await roomsHeader.$(".mx_RoomSubList_addRoom");
|
||||
await addRoomButton.click();
|
||||
|
||||
|
||||
const roomNameInput = await session.query('.mx_CreateRoomDialog_name input');
|
||||
await session.replaceInputText(roomNameInput, roomName);
|
||||
|
||||
const createButton = await session.query('.mx_Dialog_primary');
|
||||
await createButton.click();
|
||||
|
||||
await session.query('.mx_MessageComposer');
|
||||
session.log.done();
|
||||
}
|
||||
|
||||
module.exports = {openRoomDirectory, createRoom};
|
50
test/end-to-end-tests/src/usecases/dialog.js
Normal file
50
test/end-to-end-tests/src/usecases/dialog.js
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const assert = require('assert');
|
||||
|
||||
async function assertDialog(session, expectedTitle) {
|
||||
const titleElement = await session.query(".mx_Dialog .mx_Dialog_title");
|
||||
const dialogHeader = await session.innerText(titleElement);
|
||||
assert(dialogHeader, expectedTitle);
|
||||
}
|
||||
|
||||
async function acceptDialog(session, expectedTitle) {
|
||||
const foundDialog = await acceptDialogMaybe(session, expectedTitle);
|
||||
if (!foundDialog) {
|
||||
throw new Error("could not find a dialog");
|
||||
}
|
||||
}
|
||||
|
||||
async function acceptDialogMaybe(session, expectedTitle) {
|
||||
let primaryButton = null;
|
||||
try {
|
||||
primaryButton = await session.query(".mx_Dialog .mx_Dialog_primary");
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
if (expectedTitle) {
|
||||
await assertDialog(session, expectedTitle);
|
||||
}
|
||||
await primaryButton.click();
|
||||
return true;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
assertDialog,
|
||||
acceptDialog,
|
||||
acceptDialogMaybe,
|
||||
};
|
28
test/end-to-end-tests/src/usecases/invite.js
Normal file
28
test/end-to-end-tests/src/usecases/invite.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
module.exports = async function invite(session, userId) {
|
||||
session.log.step(`invites "${userId}" to room`);
|
||||
await session.delay(1000);
|
||||
const inviteButton = await session.query(".mx_MemberList_invite");
|
||||
await inviteButton.click();
|
||||
const inviteTextArea = await session.query(".mx_AddressPickerDialog textarea");
|
||||
await inviteTextArea.type(userId);
|
||||
await inviteTextArea.press("Enter");
|
||||
const confirmButton = await session.query(".mx_Dialog_primary");
|
||||
await confirmButton.click();
|
||||
session.log.done();
|
||||
};
|
29
test/end-to-end-tests/src/usecases/join.js
Normal file
29
test/end-to-end-tests/src/usecases/join.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const {openRoomDirectory} = require('./create-room');
|
||||
|
||||
module.exports = async function join(session, roomName) {
|
||||
session.log.step(`joins room "${roomName}"`);
|
||||
await openRoomDirectory(session);
|
||||
const roomInput = await session.query('.mx_DirectorySearchBox input');
|
||||
await session.replaceInputText(roomInput, roomName);
|
||||
|
||||
const joinFirstLink = await session.query('.mx_RoomDirectory_table .mx_RoomDirectory_join .mx_AccessibleButton');
|
||||
await joinFirstLink.click();
|
||||
await session.query('.mx_MessageComposer');
|
||||
session.log.done();
|
||||
};
|
71
test/end-to-end-tests/src/usecases/memberlist.js
Normal file
71
test/end-to-end-tests/src/usecases/memberlist.js
Normal file
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const assert = require('assert');
|
||||
|
||||
async function openMemberInfo(session, name) {
|
||||
const membersAndNames = await getMembersInMemberlist(session);
|
||||
const matchingLabel = membersAndNames.filter((m) => {
|
||||
return m.displayName === name;
|
||||
}).map((m) => m.label)[0];
|
||||
await matchingLabel.click();
|
||||
}
|
||||
|
||||
module.exports.openMemberInfo = openMemberInfo;
|
||||
|
||||
module.exports.verifyDeviceForUser = async function(session, name, expectedDevice) {
|
||||
session.log.step(`verifies e2e device for ${name}`);
|
||||
const membersAndNames = await getMembersInMemberlist(session);
|
||||
const matchingLabel = membersAndNames.filter((m) => {
|
||||
return m.displayName === name;
|
||||
}).map((m) => m.label)[0];
|
||||
await matchingLabel.click();
|
||||
// click verify in member info
|
||||
const firstVerifyButton = await session.query(".mx_MemberDeviceInfo_verify");
|
||||
await firstVerifyButton.click();
|
||||
// expect "Verify device" dialog and click "Begin Verification"
|
||||
const dialogHeader = await session.innerText(await session.query(".mx_Dialog .mx_Dialog_title"));
|
||||
assert(dialogHeader, "Verify device");
|
||||
const beginVerificationButton = await session.query(".mx_Dialog .mx_Dialog_primary");
|
||||
await beginVerificationButton.click();
|
||||
// get emoji SAS labels
|
||||
const sasLabelElements = await session.queryAll(
|
||||
".mx_VerificationShowSas .mx_VerificationShowSas_emojiSas .mx_VerificationShowSas_emojiSas_label");
|
||||
const sasLabels = await Promise.all(sasLabelElements.map(e => session.innerText(e)));
|
||||
console.log("my sas labels", sasLabels);
|
||||
|
||||
|
||||
const dialogCodeFields = await session.queryAll(".mx_QuestionDialog code");
|
||||
assert.equal(dialogCodeFields.length, 2);
|
||||
const deviceId = await session.innerText(dialogCodeFields[0]);
|
||||
const deviceKey = await session.innerText(dialogCodeFields[1]);
|
||||
assert.equal(expectedDevice.id, deviceId);
|
||||
assert.equal(expectedDevice.key, deviceKey);
|
||||
const confirmButton = await session.query(".mx_Dialog_primary");
|
||||
await confirmButton.click();
|
||||
const closeMemberInfo = await session.query(".mx_MemberInfo_cancel");
|
||||
await closeMemberInfo.click();
|
||||
session.log.done();
|
||||
};
|
||||
|
||||
async function getMembersInMemberlist(session) {
|
||||
const memberNameElements = await session.queryAll(".mx_MemberList .mx_EntityTile_name");
|
||||
return Promise.all(memberNameElements.map(async (el) => {
|
||||
return {label: el, displayName: await session.innerText(el)};
|
||||
}));
|
||||
}
|
||||
|
||||
module.exports.getMembersInMemberlist = getMembersInMemberlist;
|
99
test/end-to-end-tests/src/usecases/room-settings.js
Normal file
99
test/end-to-end-tests/src/usecases/room-settings.js
Normal file
|
@ -0,0 +1,99 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const assert = require('assert');
|
||||
const {acceptDialog} = require('./dialog');
|
||||
|
||||
async function setSettingsToggle(session, toggle, enabled) {
|
||||
const className = await session.getElementProperty(toggle, "className");
|
||||
const checked = className.includes("mx_ToggleSwitch_on");
|
||||
if (checked !== enabled) {
|
||||
await toggle.click();
|
||||
session.log.done();
|
||||
return true;
|
||||
} else {
|
||||
session.log.done("already set");
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = async function changeRoomSettings(session, settings) {
|
||||
session.log.startGroup(`changes the room settings`);
|
||||
/// XXX delay is needed here, possibly because the header is being rerendered
|
||||
/// click doesn't do anything otherwise
|
||||
await session.delay(1000);
|
||||
const settingsButton = await session.query(".mx_RoomHeader .mx_AccessibleButton[title=Settings]");
|
||||
await settingsButton.click();
|
||||
//find tabs
|
||||
const tabButtons = await session.queryAll(".mx_RoomSettingsDialog .mx_TabbedView_tabLabel");
|
||||
const tabLabels = await Promise.all(tabButtons.map(t => session.innerText(t)));
|
||||
const securityTabButton = tabButtons[tabLabels.findIndex(l => l.toLowerCase().includes("security"))];
|
||||
|
||||
const generalSwitches = await session.queryAll(".mx_RoomSettingsDialog .mx_ToggleSwitch");
|
||||
const isDirectory = generalSwitches[0];
|
||||
|
||||
if (typeof settings.directory === "boolean") {
|
||||
session.log.step(`sets directory listing to ${settings.directory}`);
|
||||
await setSettingsToggle(session, isDirectory, settings.directory);
|
||||
}
|
||||
|
||||
if (settings.alias) {
|
||||
session.log.step(`sets alias to ${settings.alias}`);
|
||||
const aliasField = await session.query(".mx_RoomSettingsDialog .mx_AliasSettings input[type=text]");
|
||||
await session.replaceInputText(aliasField, settings.alias);
|
||||
const addButton = await session.query(".mx_RoomSettingsDialog .mx_AliasSettings .mx_AccessibleButton");
|
||||
await addButton.click();
|
||||
session.log.done();
|
||||
}
|
||||
|
||||
securityTabButton.click();
|
||||
await session.delay(500);
|
||||
const securitySwitches = await session.queryAll(".mx_RoomSettingsDialog .mx_ToggleSwitch");
|
||||
const e2eEncryptionToggle = securitySwitches[0];
|
||||
|
||||
if (typeof settings.encryption === "boolean") {
|
||||
session.log.step(`sets room e2e encryption to ${settings.encryption}`);
|
||||
const clicked = await setSettingsToggle(session, e2eEncryptionToggle, settings.encryption);
|
||||
// if enabling, accept beta warning dialog
|
||||
if (clicked && settings.encryption) {
|
||||
await acceptDialog(session, "Enable encryption?");
|
||||
}
|
||||
}
|
||||
|
||||
if (settings.visibility) {
|
||||
session.log.step(`sets visibility to ${settings.visibility}`);
|
||||
const radios = await session.queryAll(".mx_RoomSettingsDialog input[type=radio]");
|
||||
assert.equal(radios.length, 7);
|
||||
const inviteOnly = radios[0];
|
||||
const publicNoGuests = radios[1];
|
||||
const publicWithGuests = radios[2];
|
||||
|
||||
if (settings.visibility === "invite_only") {
|
||||
await inviteOnly.click();
|
||||
} else if (settings.visibility === "public_no_guests") {
|
||||
await publicNoGuests.click();
|
||||
} else if (settings.visibility === "public_with_guests") {
|
||||
await publicWithGuests.click();
|
||||
} else {
|
||||
throw new Error(`unrecognized room visibility setting: ${settings.visibility}`);
|
||||
}
|
||||
session.log.done();
|
||||
}
|
||||
|
||||
const closeButton = await session.query(".mx_RoomSettingsDialog .mx_Dialog_cancelButton");
|
||||
await closeButton.click();
|
||||
|
||||
session.log.endGroup();
|
||||
};
|
34
test/end-to-end-tests/src/usecases/send-message.js
Normal file
34
test/end-to-end-tests/src/usecases/send-message.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const assert = require('assert');
|
||||
|
||||
module.exports = async function sendMessage(session, message) {
|
||||
session.log.step(`writes "${message}" in room`);
|
||||
// this selector needs to be the element that has contenteditable=true,
|
||||
// not any if its parents, otherwise it behaves flaky at best.
|
||||
const composer = await session.query('.mx_SendMessageComposer');
|
||||
// sometimes the focus that type() does internally doesn't seem to work
|
||||
// and calling click before seems to fix it 🤷
|
||||
await composer.click();
|
||||
await composer.type(message);
|
||||
const text = await session.innerText(composer);
|
||||
assert.equal(text.trim(), message.trim());
|
||||
await composer.press("Enter");
|
||||
// wait for the message to appear sent
|
||||
await session.query(".mx_EventTile_last:not(.mx_EventTile_sending)");
|
||||
session.log.done();
|
||||
};
|
54
test/end-to-end-tests/src/usecases/settings.js
Normal file
54
test/end-to-end-tests/src/usecases/settings.js
Normal file
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const assert = require('assert');
|
||||
|
||||
async function openSettings(session, section) {
|
||||
const menuButton = await session.query(".mx_TopLeftMenuButton_name");
|
||||
await menuButton.click();
|
||||
const settingsItem = await session.query(".mx_TopLeftMenu_icon_settings");
|
||||
await settingsItem.click();
|
||||
if (section) {
|
||||
const sectionButton = await session.query(
|
||||
`.mx_UserSettingsDialog .mx_TabbedView_tabLabels .mx_UserSettingsDialog_${section}Icon`);
|
||||
await sectionButton.click();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.enableLazyLoading = async function(session) {
|
||||
session.log.step(`enables lazy loading of members in the lab settings`);
|
||||
const settingsButton = await session.query('.mx_BottomLeftMenu_settings');
|
||||
await settingsButton.click();
|
||||
const llCheckbox = await session.query("#feature_lazyloading");
|
||||
await llCheckbox.click();
|
||||
await session.waitForReload();
|
||||
const closeButton = await session.query(".mx_RoomHeader_cancelButton");
|
||||
await closeButton.click();
|
||||
session.log.done();
|
||||
};
|
||||
|
||||
module.exports.getE2EDeviceFromSettings = async function(session) {
|
||||
session.log.step(`gets e2e device/key from settings`);
|
||||
await openSettings(session, "security");
|
||||
const deviceAndKey = await session.queryAll(".mx_SettingsTab_section .mx_SecurityUserSettingsTab_deviceInfo code");
|
||||
assert.equal(deviceAndKey.length, 2);
|
||||
const id = await (await deviceAndKey[0].getProperty("innerText")).jsonValue();
|
||||
const key = await (await deviceAndKey[1].getProperty("innerText")).jsonValue();
|
||||
const closeButton = await session.query(".mx_UserSettingsDialog .mx_Dialog_cancelButton");
|
||||
await closeButton.click();
|
||||
session.log.done();
|
||||
return {id, key};
|
||||
};
|
90
test/end-to-end-tests/src/usecases/signup.js
Normal file
90
test/end-to-end-tests/src/usecases/signup.js
Normal file
|
@ -0,0 +1,90 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const assert = require('assert');
|
||||
|
||||
module.exports = async function signup(session, username, password, homeserver) {
|
||||
session.log.step("signs up");
|
||||
await session.goto(session.url('/#/register'));
|
||||
// change the homeserver by clicking the advanced section
|
||||
if (homeserver) {
|
||||
const advancedButton = await session.query('.mx_ServerTypeSelector_type_Advanced');
|
||||
await advancedButton.click();
|
||||
|
||||
// depending on what HS is configured as the default, the advanced registration
|
||||
// goes the HS/IS entry directly (for matrix.org) or takes you to the user/pass entry (not matrix.org).
|
||||
// To work with both, we look for the "Change" link in the user/pass entry but don't fail when we can't find it
|
||||
// As this link should be visible immediately, and to not slow down the case where it isn't present,
|
||||
// pick a lower timeout of 5000ms
|
||||
try {
|
||||
const changeHsField = await session.query('.mx_AuthBody_editServerDetails', 5000);
|
||||
if (changeHsField) {
|
||||
await changeHsField.click();
|
||||
}
|
||||
} catch (err) {}
|
||||
|
||||
const hsInputField = await session.query('#mx_ServerConfig_hsUrl');
|
||||
await session.replaceInputText(hsInputField, homeserver);
|
||||
const nextButton = await session.query('.mx_Login_submit');
|
||||
// accept homeserver
|
||||
await nextButton.click();
|
||||
}
|
||||
//fill out form
|
||||
const usernameField = await session.query("#mx_RegistrationForm_username");
|
||||
const passwordField = await session.query("#mx_RegistrationForm_password");
|
||||
const passwordRepeatField = await session.query("#mx_RegistrationForm_passwordConfirm");
|
||||
await session.replaceInputText(usernameField, username);
|
||||
await session.replaceInputText(passwordField, password);
|
||||
await session.replaceInputText(passwordRepeatField, password);
|
||||
//wait 300ms because Registration/ServerConfig have a 250ms
|
||||
//delay to internally set the homeserver url
|
||||
//see Registration::render and ServerConfig::props::delayTimeMs
|
||||
await session.delay(300);
|
||||
/// focus on the button to make sure error validation
|
||||
/// has happened before checking the form is good to go
|
||||
const registerButton = await session.query('.mx_Login_submit');
|
||||
await registerButton.focus();
|
||||
// Password validation is async, wait for it to complete before submit
|
||||
await session.query(".mx_Field_valid #mx_RegistrationForm_password");
|
||||
//check no errors
|
||||
const errorText = await session.tryGetInnertext('.mx_Login_error');
|
||||
assert.strictEqual(!!errorText, false);
|
||||
//submit form
|
||||
//await page.screenshot({path: "beforesubmit.png", fullPage: true});
|
||||
await registerButton.click();
|
||||
|
||||
//confirm dialog saying you cant log back in without e-mail
|
||||
const continueButton = await session.query('.mx_QuestionDialog button.mx_Dialog_primary');
|
||||
await continueButton.click();
|
||||
|
||||
//find the privacy policy checkbox and check it
|
||||
const policyCheckbox = await session.query('.mx_InteractiveAuthEntryComponents_termsPolicy input');
|
||||
await policyCheckbox.click();
|
||||
|
||||
//now click the 'Accept' button to agree to the privacy policy
|
||||
const acceptButton = await session.query('.mx_InteractiveAuthEntryComponents_termsSubmit');
|
||||
await acceptButton.click();
|
||||
|
||||
//wait for registration to finish so the hash gets set
|
||||
//onhashchange better?
|
||||
|
||||
const foundHomeUrl = await session.poll(async () => {
|
||||
const url = session.page.url();
|
||||
return url === session.url('/#/home');
|
||||
});
|
||||
assert(foundHomeUrl);
|
||||
session.log.done();
|
||||
};
|
143
test/end-to-end-tests/src/usecases/timeline.js
Normal file
143
test/end-to-end-tests/src/usecases/timeline.js
Normal file
|
@ -0,0 +1,143 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const assert = require('assert');
|
||||
|
||||
module.exports.scrollToTimelineTop = async function(session) {
|
||||
session.log.step(`scrolls to the top of the timeline`);
|
||||
await session.page.evaluate(() => {
|
||||
return Promise.resolve().then(async () => {
|
||||
let timedOut = false;
|
||||
let timeoutHandle = null;
|
||||
// set scrollTop to 0 in a loop and check every 50ms
|
||||
// if content became available (scrollTop not being 0 anymore),
|
||||
// assume everything is loaded after 3s
|
||||
do {
|
||||
const timelineScrollView = document.querySelector(".mx_RoomView_timeline .mx_ScrollPanel");
|
||||
if (timelineScrollView && timelineScrollView.scrollTop !== 0) {
|
||||
if (timeoutHandle) {
|
||||
clearTimeout(timeoutHandle);
|
||||
}
|
||||
timeoutHandle = setTimeout(() => timedOut = true, 3000);
|
||||
timelineScrollView.scrollTop = 0;
|
||||
} else {
|
||||
await new Promise((resolve) => setTimeout(resolve, 50));
|
||||
}
|
||||
} while (!timedOut);
|
||||
});
|
||||
});
|
||||
session.log.done();
|
||||
};
|
||||
|
||||
module.exports.receiveMessage = async function(session, expectedMessage) {
|
||||
session.log.step(`receives message "${expectedMessage.body}" from ${expectedMessage.sender}`);
|
||||
// wait for a response to come in that contains the message
|
||||
// crude, but effective
|
||||
|
||||
async function getLastMessage() {
|
||||
const lastTile = await getLastEventTile(session);
|
||||
return getMessageFromEventTile(lastTile);
|
||||
}
|
||||
|
||||
let lastMessage;
|
||||
await session.poll(async () => {
|
||||
try {
|
||||
lastMessage = await getLastMessage();
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
// stop polling when found the expected message
|
||||
return lastMessage &&
|
||||
lastMessage.body === expectedMessage.body &&
|
||||
lastMessage.sender === expectedMessage.sender;
|
||||
});
|
||||
assertMessage(lastMessage, expectedMessage);
|
||||
session.log.done();
|
||||
};
|
||||
|
||||
|
||||
module.exports.checkTimelineContains = async function(session, expectedMessages, sendersDescription) {
|
||||
session.log.step(`checks timeline contains ${expectedMessages.length} ` +
|
||||
`given messages${sendersDescription ? ` from ${sendersDescription}`:""}`);
|
||||
const eventTiles = await getAllEventTiles(session);
|
||||
let timelineMessages = await Promise.all(eventTiles.map((eventTile) => {
|
||||
return getMessageFromEventTile(eventTile);
|
||||
}));
|
||||
//filter out tiles that were not messages
|
||||
timelineMessages = timelineMessages.filter((m) => !!m);
|
||||
timelineMessages.reduce((prevSender, m) => {
|
||||
if (m.continuation) {
|
||||
m.sender = prevSender;
|
||||
return prevSender;
|
||||
} else {
|
||||
return m.sender;
|
||||
}
|
||||
});
|
||||
|
||||
expectedMessages.forEach((expectedMessage) => {
|
||||
const foundMessage = timelineMessages.find((message) => {
|
||||
return message.sender === expectedMessage.sender &&
|
||||
message.body === expectedMessage.body;
|
||||
});
|
||||
try {
|
||||
assertMessage(foundMessage, expectedMessage);
|
||||
} catch (err) {
|
||||
console.log("timelineMessages", timelineMessages);
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
|
||||
session.log.done();
|
||||
};
|
||||
|
||||
function assertMessage(foundMessage, expectedMessage) {
|
||||
assert(foundMessage, `message ${JSON.stringify(expectedMessage)} not found in timeline`);
|
||||
assert.equal(foundMessage.body, expectedMessage.body);
|
||||
assert.equal(foundMessage.sender, expectedMessage.sender);
|
||||
if (expectedMessage.hasOwnProperty("encrypted")) {
|
||||
assert.equal(foundMessage.encrypted, expectedMessage.encrypted);
|
||||
}
|
||||
}
|
||||
|
||||
function getLastEventTile(session) {
|
||||
return session.query(".mx_EventTile_last");
|
||||
}
|
||||
|
||||
function getAllEventTiles(session) {
|
||||
return session.queryAll(".mx_RoomView_MessageList .mx_EventTile");
|
||||
}
|
||||
|
||||
async function getMessageFromEventTile(eventTile) {
|
||||
const senderElement = await eventTile.$(".mx_SenderProfile_name");
|
||||
const className = await (await eventTile.getProperty("className")).jsonValue();
|
||||
const classNames = className.split(" ");
|
||||
const bodyElement = await eventTile.$(".mx_EventTile_body");
|
||||
let sender = null;
|
||||
if (senderElement) {
|
||||
sender = await(await senderElement.getProperty("innerText")).jsonValue();
|
||||
}
|
||||
if (!bodyElement) {
|
||||
return null;
|
||||
}
|
||||
const body = await(await bodyElement.getProperty("innerText")).jsonValue();
|
||||
|
||||
return {
|
||||
sender,
|
||||
body,
|
||||
encrypted: classNames.includes("mx_EventTile_verified"),
|
||||
continuation: classNames.includes("mx_EventTile_continuation"),
|
||||
};
|
||||
}
|
69
test/end-to-end-tests/src/usecases/verify.js
Normal file
69
test/end-to-end-tests/src/usecases/verify.js
Normal file
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
Copyright 2019 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const assert = require('assert');
|
||||
const {openMemberInfo} = require("./memberlist");
|
||||
const {assertDialog, acceptDialog} = require("./dialog");
|
||||
|
||||
async function assertVerified(session) {
|
||||
const dialogSubTitle = await session.innerText(await session.query(".mx_Dialog h2"));
|
||||
assert(dialogSubTitle, "Verified!");
|
||||
}
|
||||
|
||||
async function startVerification(session, name) {
|
||||
await openMemberInfo(session, name);
|
||||
// click verify in member info
|
||||
const firstVerifyButton = await session.query(".mx_MemberDeviceInfo_verify");
|
||||
await firstVerifyButton.click();
|
||||
}
|
||||
|
||||
async function getSasCodes(session) {
|
||||
const sasLabelElements = await session.queryAll(
|
||||
".mx_VerificationShowSas .mx_VerificationShowSas_emojiSas .mx_VerificationShowSas_emojiSas_label");
|
||||
const sasLabels = await Promise.all(sasLabelElements.map(e => session.innerText(e)));
|
||||
return sasLabels;
|
||||
}
|
||||
|
||||
module.exports.startSasVerifcation = async function(session, name) {
|
||||
await startVerification(session, name);
|
||||
// expect "Verify device" dialog and click "Begin Verification"
|
||||
await assertDialog(session, "Verify device");
|
||||
// click "Begin Verification"
|
||||
await acceptDialog(session);
|
||||
const sasCodes = await getSasCodes(session);
|
||||
// click "Verify"
|
||||
await acceptDialog(session);
|
||||
await assertVerified(session);
|
||||
// click "Got it" when verification is done
|
||||
await acceptDialog(session);
|
||||
return sasCodes;
|
||||
};
|
||||
|
||||
module.exports.acceptSasVerification = async function(session, name) {
|
||||
await assertDialog(session, "Incoming Verification Request");
|
||||
const opponentLabelElement = await session.query(".mx_IncomingSasDialog_opponentProfile h2");
|
||||
const opponentLabel = await session.innerText(opponentLabelElement);
|
||||
assert(opponentLabel, name);
|
||||
// click "Continue" button
|
||||
await acceptDialog(session);
|
||||
const sasCodes = await getSasCodes(session);
|
||||
// click "Verify"
|
||||
await acceptDialog(session);
|
||||
await assertVerified(session);
|
||||
// click "Got it" when verification is done
|
||||
await acceptDialog(session);
|
||||
return sasCodes;
|
||||
};
|
27
test/end-to-end-tests/src/util.js
Normal file
27
test/end-to-end-tests/src/util.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
module.exports.range = function(start, amount, step = 1) {
|
||||
const r = [];
|
||||
for (let i = 0; i < amount; ++i) {
|
||||
r.push(start + (i * step));
|
||||
}
|
||||
return r;
|
||||
};
|
||||
|
||||
module.exports.delay = function(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
};
|
112
test/end-to-end-tests/start.js
Normal file
112
test/end-to-end-tests/start.js
Normal file
|
@ -0,0 +1,112 @@
|
|||
/*
|
||||
Copyright 2018 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const RiotSession = require('./src/session');
|
||||
const scenario = require('./src/scenario');
|
||||
const RestSessionCreator = require('./src/rest/creator');
|
||||
const fs = require("fs");
|
||||
|
||||
const program = require('commander');
|
||||
program
|
||||
.option('--no-logs', "don't output logs, document html on error", false)
|
||||
.option('--riot-url [url]', "riot url to test", "http://localhost:5000")
|
||||
.option('--windowed', "dont run tests headless", false)
|
||||
.option('--slow-mo', "type at a human speed", false)
|
||||
.option('--dev-tools', "open chrome devtools in browser window", false)
|
||||
.option('--throttle-cpu [factor]', "factor to slow down the cpu with", parseFloat, 1.0)
|
||||
.option('--no-sandbox', "same as puppeteer arg", false)
|
||||
.option('--log-directory <dir>', 'a directory to dump html and network logs in when the tests fail')
|
||||
.parse(process.argv);
|
||||
|
||||
const hsUrl = 'http://localhost:5005';
|
||||
|
||||
async function runTests() {
|
||||
const sessions = [];
|
||||
const options = {
|
||||
slowMo: program.slowMo ? 20 : undefined,
|
||||
devtools: program.devTools,
|
||||
headless: !program.windowed,
|
||||
args: [],
|
||||
};
|
||||
if (!program.sandbox) {
|
||||
options.args.push('--no-sandbox', '--disable-setuid-sandbox');
|
||||
}
|
||||
if (process.env.CHROME_PATH) {
|
||||
const path = process.env.CHROME_PATH;
|
||||
console.log(`(using external chrome/chromium at ${path}, make sure it's compatible with puppeteer)`);
|
||||
options.executablePath = path;
|
||||
}
|
||||
|
||||
const restCreator = new RestSessionCreator(
|
||||
'synapse/installations/consent/env/bin',
|
||||
hsUrl,
|
||||
__dirname,
|
||||
);
|
||||
|
||||
async function createSession(username) {
|
||||
const session = await RiotSession.create(username, options, program.riotUrl, hsUrl, program.throttleCpu);
|
||||
sessions.push(session);
|
||||
return session;
|
||||
}
|
||||
|
||||
let failure = false;
|
||||
try {
|
||||
await scenario(createSession, restCreator);
|
||||
} catch (err) {
|
||||
failure = true;
|
||||
console.log('failure: ', err);
|
||||
if (program.logDirectory) {
|
||||
await writeLogs(sessions, program.logDirectory);
|
||||
}
|
||||
}
|
||||
|
||||
// wait 5 minutes on failure if not running headless
|
||||
// to inspect what went wrong
|
||||
if (failure && options.headless === false) {
|
||||
await new Promise((resolve) => setTimeout(resolve, 5 * 60 * 1000));
|
||||
}
|
||||
|
||||
await Promise.all(sessions.map((session) => session.close()));
|
||||
|
||||
if (failure) {
|
||||
process.exit(-1);
|
||||
} else {
|
||||
console.log('all tests finished successfully');
|
||||
}
|
||||
}
|
||||
|
||||
async function writeLogs(sessions, dir) {
|
||||
const logs = "";
|
||||
for (let i = 0; i < sessions.length; ++i) {
|
||||
const session = sessions[i];
|
||||
const userLogDir = `${dir}/${session.username}`;
|
||||
fs.mkdirSync(userLogDir);
|
||||
const consoleLogName = `${userLogDir}/console.log`;
|
||||
const networkLogName = `${userLogDir}/network.log`;
|
||||
const appHtmlName = `${userLogDir}/app.html`;
|
||||
const documentHtml = await session.page.content();
|
||||
fs.writeFileSync(appHtmlName, documentHtml);
|
||||
fs.writeFileSync(networkLogName, session.networkLogs());
|
||||
fs.writeFileSync(consoleLogName, session.consoleLogs());
|
||||
await session.page.screenshot({path: `${userLogDir}/screenshot.png`});
|
||||
}
|
||||
return logs;
|
||||
}
|
||||
|
||||
runTests().catch(function(err) {
|
||||
console.log(err);
|
||||
process.exit(-1);
|
||||
});
|
2
test/end-to-end-tests/synapse/.gitignore
vendored
Normal file
2
test/end-to-end-tests/synapse/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
installations
|
||||
synapse.zip
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,23 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Test Privacy policy</title>
|
||||
</head>
|
||||
<body>
|
||||
{% if has_consented %}
|
||||
<p>
|
||||
Thank you, you've already accepted the license.
|
||||
</p>
|
||||
{% else %}
|
||||
<p>
|
||||
Please accept the license!
|
||||
</p>
|
||||
<form method="post" action="consent">
|
||||
<input type="hidden" name="v" value="{{version}}"/>
|
||||
<input type="hidden" name="u" value="{{user}}"/>
|
||||
<input type="hidden" name="h" value="{{userhmac}}"/>
|
||||
<input type="submit" value="Sure thing!"/>
|
||||
</form>
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,9 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Test Privacy policy</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Danke schon</p>
|
||||
</body>
|
||||
</html>
|
47
test/end-to-end-tests/synapse/install.sh
Executable file
47
test/end-to-end-tests/synapse/install.sh
Executable file
|
@ -0,0 +1,47 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# config
|
||||
SYNAPSE_BRANCH=develop
|
||||
INSTALLATION_NAME=consent
|
||||
SERVER_DIR=installations/$INSTALLATION_NAME
|
||||
CONFIG_TEMPLATE=consent
|
||||
PORT=5005
|
||||
# set current directory to script directory
|
||||
BASE_DIR=$(cd $(dirname $0) && pwd)
|
||||
|
||||
if [ -d $BASE_DIR/$SERVER_DIR ]; then
|
||||
echo "synapse is already installed"
|
||||
exit
|
||||
fi
|
||||
|
||||
cd $BASE_DIR
|
||||
mkdir -p $SERVER_DIR
|
||||
cd $SERVER_DIR
|
||||
virtualenv -p python3 env
|
||||
source env/bin/activate
|
||||
|
||||
# Having been bitten by pip SSL fail too many times, I don't trust the existing pip
|
||||
# to be able to --upgrade itself, so grab a new one fresh from source.
|
||||
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
|
||||
python get-pip.py
|
||||
|
||||
pip install --upgrade setuptools
|
||||
pip install https://codeload.github.com/matrix-org/synapse/zip/$SYNAPSE_BRANCH
|
||||
# apply configuration
|
||||
pushd env/bin/
|
||||
cp -r $BASE_DIR/config-templates/$CONFIG_TEMPLATE/. ./
|
||||
|
||||
# Hashes used instead of slashes because we'll get a value back from $(pwd) that'll be
|
||||
# full of un-escapable slashes.
|
||||
# Use .bak suffix as using no suffix doesn't work macOS.
|
||||
sed -i.bak "s#{{SYNAPSE_ROOT}}#$(pwd)/#g" homeserver.yaml
|
||||
sed -i.bak "s#{{SYNAPSE_PORT}}#${PORT}#g" homeserver.yaml
|
||||
sed -i.bak "s#{{FORM_SECRET}}#$(uuidgen)#g" homeserver.yaml
|
||||
sed -i.bak "s#{{REGISTRATION_SHARED_SECRET}}#$(uuidgen)#g" homeserver.yaml
|
||||
sed -i.bak "s#{{MACAROON_SECRET_KEY}}#$(uuidgen)#g" homeserver.yaml
|
||||
rm *.bak
|
||||
|
||||
popd
|
||||
# generate signing keys for signing_key_path
|
||||
python -m synapse.app.homeserver --generate-keys --config-dir env/bin/ -c env/bin/homeserver.yaml
|
15
test/end-to-end-tests/synapse/start.sh
Executable file
15
test/end-to-end-tests/synapse/start.sh
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
BASE_DIR=$(cd $(dirname $0) && pwd)
|
||||
cd $BASE_DIR
|
||||
cd installations/consent/env/bin/
|
||||
source activate
|
||||
LOGFILE=$(mktemp)
|
||||
echo "Synapse log file at $LOGFILE"
|
||||
./synctl start 2> $LOGFILE
|
||||
EXIT_CODE=$?
|
||||
if [ $EXIT_CODE -ne 0 ]; then
|
||||
cat $LOGFILE
|
||||
fi
|
||||
exit $EXIT_CODE
|
8
test/end-to-end-tests/synapse/stop.sh
Executable file
8
test/end-to-end-tests/synapse/stop.sh
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
BASE_DIR=$(cd $(dirname $0) && pwd)
|
||||
cd $BASE_DIR
|
||||
cd installations/consent/env/bin/
|
||||
source activate
|
||||
./synctl stop
|
759
test/end-to-end-tests/yarn.lock
Normal file
759
test/end-to-end-tests/yarn.lock
Normal file
|
@ -0,0 +1,759 @@
|
|||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@types/node@*":
|
||||
version "11.12.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-11.12.1.tgz#d90123f6c61fdf2f7cddd286ddae891586dd3488"
|
||||
integrity sha512-sKDlqv6COJrR7ar0+GqqhrXQDzQlMcqMnF2iEU6m9hLo8kxozoAGUazwPyELHlRVmjsbvlnGXjnzyptSXVmceA==
|
||||
|
||||
agent-base@^4.1.0:
|
||||
version "4.2.1"
|
||||
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9"
|
||||
integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==
|
||||
dependencies:
|
||||
es6-promisify "^5.0.0"
|
||||
|
||||
ajv@^6.5.5:
|
||||
version "6.10.0"
|
||||
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1"
|
||||
integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==
|
||||
dependencies:
|
||||
fast-deep-equal "^2.0.1"
|
||||
fast-json-stable-stringify "^2.0.0"
|
||||
json-schema-traverse "^0.4.1"
|
||||
uri-js "^4.2.2"
|
||||
|
||||
asn1@~0.2.3:
|
||||
version "0.2.4"
|
||||
resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136"
|
||||
integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==
|
||||
dependencies:
|
||||
safer-buffer "~2.1.0"
|
||||
|
||||
assert-plus@1.0.0, assert-plus@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
|
||||
integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=
|
||||
|
||||
async-limiter@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8"
|
||||
integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==
|
||||
|
||||
asynckit@^0.4.0:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
|
||||
integrity sha1-x57Zf380y48robyXkLzDZkdLS3k=
|
||||
|
||||
aws-sign2@~0.7.0:
|
||||
version "0.7.0"
|
||||
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"
|
||||
integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=
|
||||
|
||||
aws4@^1.8.0:
|
||||
version "1.8.0"
|
||||
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
|
||||
integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==
|
||||
|
||||
balanced-match@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
|
||||
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
|
||||
|
||||
bcrypt-pbkdf@^1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e"
|
||||
integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=
|
||||
dependencies:
|
||||
tweetnacl "^0.14.3"
|
||||
|
||||
boolbase@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e"
|
||||
integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24=
|
||||
|
||||
brace-expansion@^1.1.7:
|
||||
version "1.1.11"
|
||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
|
||||
integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
|
||||
dependencies:
|
||||
balanced-match "^1.0.0"
|
||||
concat-map "0.0.1"
|
||||
|
||||
buffer-from@^1.0.0:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
|
||||
integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
|
||||
|
||||
caseless@~0.12.0:
|
||||
version "0.12.0"
|
||||
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
|
||||
integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=
|
||||
|
||||
cheerio@^1.0.0-rc.2:
|
||||
version "1.0.0-rc.2"
|
||||
resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.2.tgz#4b9f53a81b27e4d5dac31c0ffd0cfa03cc6830db"
|
||||
integrity sha1-S59TqBsn5NXawxwP/Qz6A8xoMNs=
|
||||
dependencies:
|
||||
css-select "~1.2.0"
|
||||
dom-serializer "~0.1.0"
|
||||
entities "~1.1.1"
|
||||
htmlparser2 "^3.9.1"
|
||||
lodash "^4.15.0"
|
||||
parse5 "^3.0.1"
|
||||
|
||||
combined-stream@^1.0.6, combined-stream@~1.0.6:
|
||||
version "1.0.7"
|
||||
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828"
|
||||
integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==
|
||||
dependencies:
|
||||
delayed-stream "~1.0.0"
|
||||
|
||||
commander@^2.19.0:
|
||||
version "2.19.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a"
|
||||
integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==
|
||||
|
||||
concat-map@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
|
||||
|
||||
concat-stream@1.6.2:
|
||||
version "1.6.2"
|
||||
resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34"
|
||||
integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==
|
||||
dependencies:
|
||||
buffer-from "^1.0.0"
|
||||
inherits "^2.0.3"
|
||||
readable-stream "^2.2.2"
|
||||
typedarray "^0.0.6"
|
||||
|
||||
core-util-is@1.0.2, core-util-is@~1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
||||
integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=
|
||||
|
||||
css-select@~1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858"
|
||||
integrity sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=
|
||||
dependencies:
|
||||
boolbase "~1.0.0"
|
||||
css-what "2.1"
|
||||
domutils "1.5.1"
|
||||
nth-check "~1.0.1"
|
||||
|
||||
css-what@2.1:
|
||||
version "2.1.3"
|
||||
resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2"
|
||||
integrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==
|
||||
|
||||
dashdash@^1.12.0:
|
||||
version "1.14.1"
|
||||
resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
|
||||
integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
|
||||
debug@2.6.9:
|
||||
version "2.6.9"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
|
||||
integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
|
||||
dependencies:
|
||||
ms "2.0.0"
|
||||
|
||||
debug@^3.1.0:
|
||||
version "3.2.6"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
|
||||
integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==
|
||||
dependencies:
|
||||
ms "^2.1.1"
|
||||
|
||||
debug@^4.1.0:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
|
||||
integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
|
||||
dependencies:
|
||||
ms "^2.1.1"
|
||||
|
||||
delayed-stream@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
|
||||
integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk=
|
||||
|
||||
dom-serializer@0, dom-serializer@~0.1.0:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0"
|
||||
integrity sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==
|
||||
dependencies:
|
||||
domelementtype "^1.3.0"
|
||||
entities "^1.1.1"
|
||||
|
||||
domelementtype@1, domelementtype@^1.3.0, domelementtype@^1.3.1:
|
||||
version "1.3.1"
|
||||
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f"
|
||||
integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==
|
||||
|
||||
domhandler@^2.3.0:
|
||||
version "2.4.2"
|
||||
resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803"
|
||||
integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==
|
||||
dependencies:
|
||||
domelementtype "1"
|
||||
|
||||
domutils@1.5.1:
|
||||
version "1.5.1"
|
||||
resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf"
|
||||
integrity sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=
|
||||
dependencies:
|
||||
dom-serializer "0"
|
||||
domelementtype "1"
|
||||
|
||||
domutils@^1.5.1:
|
||||
version "1.7.0"
|
||||
resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a"
|
||||
integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==
|
||||
dependencies:
|
||||
dom-serializer "0"
|
||||
domelementtype "1"
|
||||
|
||||
ecc-jsbn@~0.1.1:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9"
|
||||
integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=
|
||||
dependencies:
|
||||
jsbn "~0.1.0"
|
||||
safer-buffer "^2.1.0"
|
||||
|
||||
entities@^1.1.1, entities@~1.1.1:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56"
|
||||
integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==
|
||||
|
||||
es6-promise@^4.0.3:
|
||||
version "4.2.6"
|
||||
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.6.tgz#b685edd8258886365ea62b57d30de28fadcd974f"
|
||||
integrity sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q==
|
||||
|
||||
es6-promisify@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203"
|
||||
integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=
|
||||
dependencies:
|
||||
es6-promise "^4.0.3"
|
||||
|
||||
extend@~3.0.2:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
|
||||
integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==
|
||||
|
||||
extract-zip@^1.6.6:
|
||||
version "1.6.7"
|
||||
resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.6.7.tgz#a840b4b8af6403264c8db57f4f1a74333ef81fe9"
|
||||
integrity sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k=
|
||||
dependencies:
|
||||
concat-stream "1.6.2"
|
||||
debug "2.6.9"
|
||||
mkdirp "0.5.1"
|
||||
yauzl "2.4.1"
|
||||
|
||||
extsprintf@1.3.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
|
||||
integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=
|
||||
|
||||
extsprintf@^1.2.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
|
||||
integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=
|
||||
|
||||
fast-deep-equal@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49"
|
||||
integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=
|
||||
|
||||
fast-json-stable-stringify@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2"
|
||||
integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I=
|
||||
|
||||
fd-slicer@~1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.0.1.tgz#8b5bcbd9ec327c5041bf9ab023fd6750f1177e65"
|
||||
integrity sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=
|
||||
dependencies:
|
||||
pend "~1.2.0"
|
||||
|
||||
forever-agent@~0.6.1:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
|
||||
integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=
|
||||
|
||||
form-data@~2.3.2:
|
||||
version "2.3.3"
|
||||
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6"
|
||||
integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==
|
||||
dependencies:
|
||||
asynckit "^0.4.0"
|
||||
combined-stream "^1.0.6"
|
||||
mime-types "^2.1.12"
|
||||
|
||||
fs.realpath@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||
integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
|
||||
|
||||
getpass@^0.1.1:
|
||||
version "0.1.7"
|
||||
resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
|
||||
integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
|
||||
glob@^7.1.3:
|
||||
version "7.1.3"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1"
|
||||
integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==
|
||||
dependencies:
|
||||
fs.realpath "^1.0.0"
|
||||
inflight "^1.0.4"
|
||||
inherits "2"
|
||||
minimatch "^3.0.4"
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
har-schema@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92"
|
||||
integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=
|
||||
|
||||
har-validator@~5.1.0:
|
||||
version "5.1.3"
|
||||
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080"
|
||||
integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==
|
||||
dependencies:
|
||||
ajv "^6.5.5"
|
||||
har-schema "^2.0.0"
|
||||
|
||||
htmlparser2@^3.9.1:
|
||||
version "3.10.1"
|
||||
resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f"
|
||||
integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==
|
||||
dependencies:
|
||||
domelementtype "^1.3.1"
|
||||
domhandler "^2.3.0"
|
||||
domutils "^1.5.1"
|
||||
entities "^1.1.1"
|
||||
inherits "^2.0.1"
|
||||
readable-stream "^3.1.1"
|
||||
|
||||
http-signature@~1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
|
||||
integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
jsprim "^1.2.2"
|
||||
sshpk "^1.7.0"
|
||||
|
||||
https-proxy-agent@^2.2.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0"
|
||||
integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==
|
||||
dependencies:
|
||||
agent-base "^4.1.0"
|
||||
debug "^3.1.0"
|
||||
|
||||
inflight@^1.0.4:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||
integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=
|
||||
dependencies:
|
||||
once "^1.3.0"
|
||||
wrappy "1"
|
||||
|
||||
inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
||||
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
|
||||
|
||||
is-typedarray@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
|
||||
integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=
|
||||
|
||||
isarray@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
|
||||
integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
|
||||
|
||||
isstream@~0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
|
||||
integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=
|
||||
|
||||
jsbn@~0.1.0:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
|
||||
integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM=
|
||||
|
||||
json-schema-traverse@^0.4.1:
|
||||
version "0.4.1"
|
||||
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
|
||||
integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==
|
||||
|
||||
json-schema@0.2.3:
|
||||
version "0.2.3"
|
||||
resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
|
||||
integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=
|
||||
|
||||
json-stringify-safe@~5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
|
||||
integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=
|
||||
|
||||
jsprim@^1.2.2:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2"
|
||||
integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=
|
||||
dependencies:
|
||||
assert-plus "1.0.0"
|
||||
extsprintf "1.3.0"
|
||||
json-schema "0.2.3"
|
||||
verror "1.10.0"
|
||||
|
||||
lodash@^4.15.0, lodash@^4.17.11:
|
||||
version "4.17.15"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
|
||||
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
|
||||
|
||||
mime-db@~1.38.0:
|
||||
version "1.38.0"
|
||||
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.38.0.tgz#1a2aab16da9eb167b49c6e4df2d9c68d63d8e2ad"
|
||||
integrity sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==
|
||||
|
||||
mime-types@^2.1.12, mime-types@~2.1.19:
|
||||
version "2.1.22"
|
||||
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.22.tgz#fe6b355a190926ab7698c9a0556a11199b2199bd"
|
||||
integrity sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==
|
||||
dependencies:
|
||||
mime-db "~1.38.0"
|
||||
|
||||
mime@^2.0.3:
|
||||
version "2.4.0"
|
||||
resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.0.tgz#e051fd881358585f3279df333fe694da0bcffdd6"
|
||||
integrity sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w==
|
||||
|
||||
minimatch@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
|
||||
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
|
||||
dependencies:
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
minimist@0.0.8:
|
||||
version "0.0.8"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
|
||||
integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=
|
||||
|
||||
mkdirp@0.5.1:
|
||||
version "0.5.1"
|
||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
|
||||
integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=
|
||||
dependencies:
|
||||
minimist "0.0.8"
|
||||
|
||||
ms@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
|
||||
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
|
||||
|
||||
ms@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"
|
||||
integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==
|
||||
|
||||
nth-check@~1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c"
|
||||
integrity sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==
|
||||
dependencies:
|
||||
boolbase "~1.0.0"
|
||||
|
||||
oauth-sign@~0.9.0:
|
||||
version "0.9.0"
|
||||
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455"
|
||||
integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==
|
||||
|
||||
once@^1.3.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||
integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
|
||||
dependencies:
|
||||
wrappy "1"
|
||||
|
||||
parse5@^3.0.1:
|
||||
version "3.0.3"
|
||||
resolved "https://registry.yarnpkg.com/parse5/-/parse5-3.0.3.tgz#042f792ffdd36851551cf4e9e066b3874ab45b5c"
|
||||
integrity sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA==
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
path-is-absolute@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||
integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
|
||||
|
||||
pend@~1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50"
|
||||
integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA=
|
||||
|
||||
performance-now@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
|
||||
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
|
||||
|
||||
process-nextick-args@~2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa"
|
||||
integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==
|
||||
|
||||
progress@^2.0.1:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
|
||||
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==
|
||||
|
||||
proxy-from-env@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee"
|
||||
integrity sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4=
|
||||
|
||||
psl@^1.1.24, psl@^1.1.28:
|
||||
version "1.1.31"
|
||||
resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184"
|
||||
integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==
|
||||
|
||||
punycode@^1.4.1:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
|
||||
integrity sha1-wNWmOycYgArY4esPpSachN1BhF4=
|
||||
|
||||
punycode@^2.1.0, punycode@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
|
||||
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
|
||||
|
||||
puppeteer@^1.14.0:
|
||||
version "1.14.0"
|
||||
resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-1.14.0.tgz#828c1926b307200d5fc8289b99df4e13e962d339"
|
||||
integrity sha512-SayS2wUX/8LF8Yo2Rkpc5nkAu4Jg3qu+OLTDSOZtisVQMB2Z5vjlY2TdPi/5CgZKiZroYIiyUN3sRX63El9iaw==
|
||||
dependencies:
|
||||
debug "^4.1.0"
|
||||
extract-zip "^1.6.6"
|
||||
https-proxy-agent "^2.2.1"
|
||||
mime "^2.0.3"
|
||||
progress "^2.0.1"
|
||||
proxy-from-env "^1.0.0"
|
||||
rimraf "^2.6.1"
|
||||
ws "^6.1.0"
|
||||
|
||||
qs@~6.5.2:
|
||||
version "6.5.2"
|
||||
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
|
||||
integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==
|
||||
|
||||
readable-stream@^2.2.2:
|
||||
version "2.3.6"
|
||||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf"
|
||||
integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==
|
||||
dependencies:
|
||||
core-util-is "~1.0.0"
|
||||
inherits "~2.0.3"
|
||||
isarray "~1.0.0"
|
||||
process-nextick-args "~2.0.0"
|
||||
safe-buffer "~5.1.1"
|
||||
string_decoder "~1.1.1"
|
||||
util-deprecate "~1.0.1"
|
||||
|
||||
readable-stream@^3.1.1:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.2.0.tgz#de17f229864c120a9f56945756e4f32c4045245d"
|
||||
integrity sha512-RV20kLjdmpZuTF1INEb9IA3L68Nmi+Ri7ppZqo78wj//Pn62fCoJyV9zalccNzDD/OuJpMG4f+pfMl8+L6QdGw==
|
||||
dependencies:
|
||||
inherits "^2.0.3"
|
||||
string_decoder "^1.1.1"
|
||||
util-deprecate "^1.0.1"
|
||||
|
||||
request-promise-core@1.1.2:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.2.tgz#339f6aababcafdb31c799ff158700336301d3346"
|
||||
integrity sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag==
|
||||
dependencies:
|
||||
lodash "^4.17.11"
|
||||
|
||||
request-promise-native@^1.0.7:
|
||||
version "1.0.7"
|
||||
resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.7.tgz#a49868a624bdea5069f1251d0a836e0d89aa2c59"
|
||||
integrity sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w==
|
||||
dependencies:
|
||||
request-promise-core "1.1.2"
|
||||
stealthy-require "^1.1.1"
|
||||
tough-cookie "^2.3.3"
|
||||
|
||||
request@^2.88.0:
|
||||
version "2.88.0"
|
||||
resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef"
|
||||
integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==
|
||||
dependencies:
|
||||
aws-sign2 "~0.7.0"
|
||||
aws4 "^1.8.0"
|
||||
caseless "~0.12.0"
|
||||
combined-stream "~1.0.6"
|
||||
extend "~3.0.2"
|
||||
forever-agent "~0.6.1"
|
||||
form-data "~2.3.2"
|
||||
har-validator "~5.1.0"
|
||||
http-signature "~1.2.0"
|
||||
is-typedarray "~1.0.0"
|
||||
isstream "~0.1.2"
|
||||
json-stringify-safe "~5.0.1"
|
||||
mime-types "~2.1.19"
|
||||
oauth-sign "~0.9.0"
|
||||
performance-now "^2.1.0"
|
||||
qs "~6.5.2"
|
||||
safe-buffer "^5.1.2"
|
||||
tough-cookie "~2.4.3"
|
||||
tunnel-agent "^0.6.0"
|
||||
uuid "^3.3.2"
|
||||
|
||||
rimraf@^2.6.1:
|
||||
version "2.6.3"
|
||||
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab"
|
||||
integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==
|
||||
dependencies:
|
||||
glob "^7.1.3"
|
||||
|
||||
safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
|
||||
version "5.1.2"
|
||||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
|
||||
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
|
||||
|
||||
safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
|
||||
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
|
||||
|
||||
sshpk@^1.7.0:
|
||||
version "1.16.1"
|
||||
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877"
|
||||
integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==
|
||||
dependencies:
|
||||
asn1 "~0.2.3"
|
||||
assert-plus "^1.0.0"
|
||||
bcrypt-pbkdf "^1.0.0"
|
||||
dashdash "^1.12.0"
|
||||
ecc-jsbn "~0.1.1"
|
||||
getpass "^0.1.1"
|
||||
jsbn "~0.1.0"
|
||||
safer-buffer "^2.0.2"
|
||||
tweetnacl "~0.14.0"
|
||||
|
||||
stealthy-require@^1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b"
|
||||
integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=
|
||||
|
||||
string_decoder@^1.1.1:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d"
|
||||
integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==
|
||||
dependencies:
|
||||
safe-buffer "~5.1.0"
|
||||
|
||||
string_decoder@~1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
|
||||
integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==
|
||||
dependencies:
|
||||
safe-buffer "~5.1.0"
|
||||
|
||||
tough-cookie@^2.3.3:
|
||||
version "2.5.0"
|
||||
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2"
|
||||
integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==
|
||||
dependencies:
|
||||
psl "^1.1.28"
|
||||
punycode "^2.1.1"
|
||||
|
||||
tough-cookie@~2.4.3:
|
||||
version "2.4.3"
|
||||
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781"
|
||||
integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==
|
||||
dependencies:
|
||||
psl "^1.1.24"
|
||||
punycode "^1.4.1"
|
||||
|
||||
tunnel-agent@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
|
||||
integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=
|
||||
dependencies:
|
||||
safe-buffer "^5.0.1"
|
||||
|
||||
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
|
||||
version "0.14.5"
|
||||
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
|
||||
integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=
|
||||
|
||||
typedarray@^0.0.6:
|
||||
version "0.0.6"
|
||||
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
||||
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
|
||||
|
||||
uri-js@^4.2.2:
|
||||
version "4.2.2"
|
||||
resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0"
|
||||
integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==
|
||||
dependencies:
|
||||
punycode "^2.1.0"
|
||||
|
||||
util-deprecate@^1.0.1, util-deprecate@~1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
|
||||
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
|
||||
|
||||
uuid@^3.3.2:
|
||||
version "3.3.2"
|
||||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
|
||||
integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==
|
||||
|
||||
verror@1.10.0:
|
||||
version "1.10.0"
|
||||
resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"
|
||||
integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
core-util-is "1.0.2"
|
||||
extsprintf "^1.2.0"
|
||||
|
||||
wrappy@1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
|
||||
|
||||
ws@^6.1.0:
|
||||
version "6.2.1"
|
||||
resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.1.tgz#442fdf0a47ed64f59b6a5d8ff130f4748ed524fb"
|
||||
integrity sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==
|
||||
dependencies:
|
||||
async-limiter "~1.0.0"
|
||||
|
||||
yauzl@2.4.1:
|
||||
version "2.4.1"
|
||||
resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.4.1.tgz#9528f442dab1b2284e58b4379bb194e22e0c4005"
|
||||
integrity sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=
|
||||
dependencies:
|
||||
fd-slicer "~1.0.1"
|
Loading…
Reference in a new issue