use node's native fetch, add ensureLicense flag and update snapshots (#28279)
@@ -217,14 +217,13 @@ $(if mme2e_is_token_in_list "webhook-interactions" "$ENABLED_DOCKER_SERVICES"; t
|
|||||||
$(if mme2e_is_token_in_list "playwright" "$ENABLED_DOCKER_SERVICES"; then
|
$(if mme2e_is_token_in_list "playwright" "$ENABLED_DOCKER_SERVICES"; then
|
||||||
echo '
|
echo '
|
||||||
playwright:
|
playwright:
|
||||||
image: mcr.microsoft.com/playwright:v1.43.0-jammy
|
image: mcr.microsoft.com/playwright:v1.46.1
|
||||||
entrypoint: ["/bin/bash", "-c"]
|
entrypoint: ["/bin/bash", "-c"]
|
||||||
command: ["until [ -f /var/run/mm_terminate ]; do sleep 5; done"]
|
command: ["until [ -f /var/run/mm_terminate ]; do sleep 5; done"]
|
||||||
env_file:
|
env_file:
|
||||||
- "./.env.playwright"
|
- "./.env.playwright"
|
||||||
environment:
|
environment:
|
||||||
CI: "true"
|
CI: "true"
|
||||||
NODE_OPTIONS: --no-experimental-fetch
|
|
||||||
PW_BASE_URL: http://localhost:8065
|
PW_BASE_URL: http://localhost:8065
|
||||||
PW_ADMIN_USERNAME: sysadmin
|
PW_ADMIN_USERNAME: sysadmin
|
||||||
PW_ADMIN_PASSWORD: Sys@dmin-sample1
|
PW_ADMIN_PASSWORD: Sys@dmin-sample1
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ cd server && make run-server
|
|||||||
|
|
||||||
#### 2. Install dependencies and run the test.
|
#### 2. Install dependencies and run the test.
|
||||||
|
|
||||||
Note: If you're using Node.js version 18 and above, you may need to set `NODE_OPTIONS='--no-experimental-fetch'`.
|
|
||||||
|
|
||||||
```
|
```
|
||||||
# Install npm packages
|
# Install npm packages
|
||||||
npm i
|
npm i
|
||||||
@@ -51,7 +49,6 @@ docker run -it --rm -v "$(pwd):/mattermost/" --ipc=host mcr.microsoft.com/playwr
|
|||||||
#### 2. Inside the docker container
|
#### 2. Inside the docker container
|
||||||
|
|
||||||
```
|
```
|
||||||
export NODE_OPTIONS='--no-experimental-fetch'
|
|
||||||
export PW_BASE_URL=http://host.docker.internal:8065
|
export PW_BASE_URL=http://host.docker.internal:8065
|
||||||
export PW_HEADLESS=true
|
export PW_HEADLESS=true
|
||||||
cd mattermost/e2e-tests/playwright
|
cd mattermost/e2e-tests/playwright
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ async function printClientInfo(client: Client) {
|
|||||||
- LogSettings.EnableDiagnostics = ${LogSettings?.EnableDiagnostics}`);
|
- LogSettings.EnableDiagnostics = ${LogSettings?.EnableDiagnostics}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function ensurePluginsLoaded(client: Client) {
|
export async function ensurePluginsLoaded(client: Client) {
|
||||||
const pluginStatus = await client.getPluginStatuses();
|
const pluginStatus = await client.getPluginStatuses();
|
||||||
const plugins = await client.getPlugins();
|
const plugins = await client.getPlugins();
|
||||||
|
|
||||||
|
|||||||
237
e2e-tests/playwright/package-lock.json
сгенерированный
@@ -16,8 +16,8 @@
|
|||||||
"chalk": "4.1.2",
|
"chalk": "4.1.2",
|
||||||
"deepmerge": "4.3.1",
|
"deepmerge": "4.3.1",
|
||||||
"dotenv": "16.4.5",
|
"dotenv": "16.4.5",
|
||||||
"form-data": "4.0.0",
|
"form-data-encoder": "4.0.2",
|
||||||
"isomorphic-unfetch": "4.0.2",
|
"formdata-node": "6.0.3",
|
||||||
"uuid": "10.0.0"
|
"uuid": "10.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -837,11 +837,6 @@
|
|||||||
"npm": ">= 1.0.0"
|
"npm": ">= 1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/asynckit": {
|
|
||||||
"version": "0.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
|
||||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
|
||||||
},
|
|
||||||
"node_modules/axe-core": {
|
"node_modules/axe-core": {
|
||||||
"version": "4.10.0",
|
"version": "4.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.10.0.tgz",
|
||||||
@@ -968,17 +963,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
||||||
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
|
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
|
||||||
},
|
},
|
||||||
"node_modules/combined-stream": {
|
|
||||||
"version": "1.0.8",
|
|
||||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
|
||||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
|
||||||
"dependencies": {
|
|
||||||
"delayed-stream": "~1.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 0.8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/concat-map": {
|
"node_modules/concat-map": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||||
@@ -1081,14 +1065,6 @@
|
|||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/delayed-stream": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.4.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/dir-glob": {
|
"node_modules/dir-glob": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
|
||||||
@@ -1421,28 +1397,6 @@
|
|||||||
"pend": "~1.2.0"
|
"pend": "~1.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/fetch-blob": {
|
|
||||||
"version": "3.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
|
|
||||||
"integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
|
|
||||||
"funding": [
|
|
||||||
{
|
|
||||||
"type": "github",
|
|
||||||
"url": "https://github.com/sponsors/jimmywarting"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "paypal",
|
|
||||||
"url": "https://paypal.me/jimmywarting"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"dependencies": {
|
|
||||||
"node-domexception": "^1.0.0",
|
|
||||||
"web-streams-polyfill": "^3.0.3"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "^12.20 || >= 14.13"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/file-entry-cache": {
|
"node_modules/file-entry-cache": {
|
||||||
"version": "6.0.1",
|
"version": "6.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
|
||||||
@@ -1502,28 +1456,22 @@
|
|||||||
"integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==",
|
"integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/form-data": {
|
"node_modules/form-data-encoder": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-4.0.2.tgz",
|
||||||
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
|
"integrity": "sha512-KQVhvhK8ZkWzxKxOr56CPulAhH3dobtuQ4+hNQ+HekH/Wp5gSOafqRAeTphQUJAIk0GBvHZgJ2ZGRWd5kphMuw==",
|
||||||
"dependencies": {
|
"license": "MIT",
|
||||||
"asynckit": "^0.4.0",
|
|
||||||
"combined-stream": "^1.0.8",
|
|
||||||
"mime-types": "^2.1.12"
|
|
||||||
},
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 6"
|
"node": ">= 18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/formdata-polyfill": {
|
"node_modules/formdata-node": {
|
||||||
"version": "4.0.10",
|
"version": "6.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
|
"resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-6.0.3.tgz",
|
||||||
"integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
|
"integrity": "sha512-8e1++BCiTzUno9v5IZ2J6bv4RU+3UKDmqWUQD0MIMVCd9AdhWkO1gw57oo1mNEX1dMq2EGI+FbWz4B92pscSQg==",
|
||||||
"dependencies": {
|
"license": "MIT",
|
||||||
"fetch-blob": "^3.1.2"
|
|
||||||
},
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12.20.0"
|
"node": ">= 18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/fs.realpath": {
|
"node_modules/fs.realpath": {
|
||||||
@@ -1765,40 +1713,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||||
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
|
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
|
||||||
},
|
},
|
||||||
"node_modules/isomorphic-unfetch": {
|
|
||||||
"version": "4.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/isomorphic-unfetch/-/isomorphic-unfetch-4.0.2.tgz",
|
|
||||||
"integrity": "sha512-1Yd+CF/7al18/N2BDbsLBcp6RO3tucSW+jcLq24dqdX5MNbCNTw1z4BsGsp4zNmjr/Izm2cs/cEqZPp4kvWSCA==",
|
|
||||||
"dependencies": {
|
|
||||||
"node-fetch": "^3.2.0",
|
|
||||||
"unfetch": "^5.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/isomorphic-unfetch/node_modules/data-uri-to-buffer": {
|
|
||||||
"version": "4.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",
|
|
||||||
"integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/isomorphic-unfetch/node_modules/node-fetch": {
|
|
||||||
"version": "3.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.0.tgz",
|
|
||||||
"integrity": "sha512-BKwRP/O0UvoMKp7GNdwPlObhYGB5DQqwhEDQlNKuoqwVYSxkSZCSbHjnFFmUEtwSKRPU4kNK8PbDYYitwaE3QA==",
|
|
||||||
"dependencies": {
|
|
||||||
"data-uri-to-buffer": "^4.0.0",
|
|
||||||
"fetch-blob": "^3.1.4",
|
|
||||||
"formdata-polyfill": "^4.0.10"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/node-fetch"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/js-tokens": {
|
"node_modules/js-tokens": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
|
||||||
@@ -1962,24 +1876,6 @@
|
|||||||
"integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
|
"integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/node-domexception": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
|
|
||||||
"funding": [
|
|
||||||
{
|
|
||||||
"type": "github",
|
|
||||||
"url": "https://github.com/sponsors/jimmywarting"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "github",
|
|
||||||
"url": "https://paypal.me/jimmywarting"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10.5.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/once": {
|
"node_modules/once": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||||
@@ -2454,11 +2350,6 @@
|
|||||||
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
|
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"node_modules/unfetch": {
|
|
||||||
"version": "5.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/unfetch/-/unfetch-5.0.0.tgz",
|
|
||||||
"integrity": "sha512-3xM2c89siXg0nHvlmYsQ2zkLASvVMBisZm5lF3gFDqfF2xonNStDJyMpvaOBe0a1Edxmqrf2E0HBdmy9QyZaeg=="
|
|
||||||
},
|
|
||||||
"node_modules/uri-js": {
|
"node_modules/uri-js": {
|
||||||
"version": "4.4.1",
|
"version": "4.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
|
||||||
@@ -2480,14 +2371,6 @@
|
|||||||
"uuid": "dist/bin/uuid"
|
"uuid": "dist/bin/uuid"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/web-streams-polyfill": {
|
|
||||||
"version": "3.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz",
|
|
||||||
"integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/which": {
|
"node_modules/which": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||||
@@ -3137,11 +3020,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/async-wait-until/-/async-wait-until-2.0.12.tgz",
|
"resolved": "https://registry.npmjs.org/async-wait-until/-/async-wait-until-2.0.12.tgz",
|
||||||
"integrity": "sha512-SXy/vDs6UPJMG6YeEYOQ4ilA/JnGxk187KPGqFx9O+qVxsjkSl+jH+3P50qSNyMpEmDgr8qOFGOKCJckWb1i7A=="
|
"integrity": "sha512-SXy/vDs6UPJMG6YeEYOQ4ilA/JnGxk187KPGqFx9O+qVxsjkSl+jH+3P50qSNyMpEmDgr8qOFGOKCJckWb1i7A=="
|
||||||
},
|
},
|
||||||
"asynckit": {
|
|
||||||
"version": "0.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
|
||||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
|
||||||
},
|
|
||||||
"axe-core": {
|
"axe-core": {
|
||||||
"version": "4.10.0",
|
"version": "4.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.10.0.tgz",
|
||||||
@@ -3237,14 +3115,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
||||||
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
|
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
|
||||||
},
|
},
|
||||||
"combined-stream": {
|
|
||||||
"version": "1.0.8",
|
|
||||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
|
||||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
|
||||||
"requires": {
|
|
||||||
"delayed-stream": "~1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"concat-map": {
|
"concat-map": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||||
@@ -3307,11 +3177,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
|
||||||
"integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A=="
|
"integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A=="
|
||||||
},
|
},
|
||||||
"delayed-stream": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
|
|
||||||
},
|
|
||||||
"dir-glob": {
|
"dir-glob": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
|
||||||
@@ -3570,15 +3435,6 @@
|
|||||||
"pend": "~1.2.0"
|
"pend": "~1.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"fetch-blob": {
|
|
||||||
"version": "3.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
|
|
||||||
"integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
|
|
||||||
"requires": {
|
|
||||||
"node-domexception": "^1.0.0",
|
|
||||||
"web-streams-polyfill": "^3.0.3"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"file-entry-cache": {
|
"file-entry-cache": {
|
||||||
"version": "6.0.1",
|
"version": "6.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
|
||||||
@@ -3623,23 +3479,15 @@
|
|||||||
"integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==",
|
"integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"form-data": {
|
"form-data-encoder": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-4.0.2.tgz",
|
||||||
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
|
"integrity": "sha512-KQVhvhK8ZkWzxKxOr56CPulAhH3dobtuQ4+hNQ+HekH/Wp5gSOafqRAeTphQUJAIk0GBvHZgJ2ZGRWd5kphMuw=="
|
||||||
"requires": {
|
|
||||||
"asynckit": "^0.4.0",
|
|
||||||
"combined-stream": "^1.0.8",
|
|
||||||
"mime-types": "^2.1.12"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"formdata-polyfill": {
|
"formdata-node": {
|
||||||
"version": "4.0.10",
|
"version": "6.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
|
"resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-6.0.3.tgz",
|
||||||
"integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
|
"integrity": "sha512-8e1++BCiTzUno9v5IZ2J6bv4RU+3UKDmqWUQD0MIMVCd9AdhWkO1gw57oo1mNEX1dMq2EGI+FbWz4B92pscSQg=="
|
||||||
"requires": {
|
|
||||||
"fetch-blob": "^3.1.2"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"fs.realpath": {
|
"fs.realpath": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
@@ -3812,32 +3660,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||||
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
|
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
|
||||||
},
|
},
|
||||||
"isomorphic-unfetch": {
|
|
||||||
"version": "4.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/isomorphic-unfetch/-/isomorphic-unfetch-4.0.2.tgz",
|
|
||||||
"integrity": "sha512-1Yd+CF/7al18/N2BDbsLBcp6RO3tucSW+jcLq24dqdX5MNbCNTw1z4BsGsp4zNmjr/Izm2cs/cEqZPp4kvWSCA==",
|
|
||||||
"requires": {
|
|
||||||
"node-fetch": "^3.2.0",
|
|
||||||
"unfetch": "^5.0.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"data-uri-to-buffer": {
|
|
||||||
"version": "4.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",
|
|
||||||
"integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A=="
|
|
||||||
},
|
|
||||||
"node-fetch": {
|
|
||||||
"version": "3.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.0.tgz",
|
|
||||||
"integrity": "sha512-BKwRP/O0UvoMKp7GNdwPlObhYGB5DQqwhEDQlNKuoqwVYSxkSZCSbHjnFFmUEtwSKRPU4kNK8PbDYYitwaE3QA==",
|
|
||||||
"requires": {
|
|
||||||
"data-uri-to-buffer": "^4.0.0",
|
|
||||||
"fetch-blob": "^3.1.4",
|
|
||||||
"formdata-polyfill": "^4.0.10"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"js-tokens": {
|
"js-tokens": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
|
||||||
@@ -3968,11 +3790,6 @@
|
|||||||
"integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
|
"integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node-domexception": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ=="
|
|
||||||
},
|
|
||||||
"once": {
|
"once": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||||
@@ -4267,11 +4084,6 @@
|
|||||||
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
|
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"unfetch": {
|
|
||||||
"version": "5.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/unfetch/-/unfetch-5.0.0.tgz",
|
|
||||||
"integrity": "sha512-3xM2c89siXg0nHvlmYsQ2zkLASvVMBisZm5lF3gFDqfF2xonNStDJyMpvaOBe0a1Edxmqrf2E0HBdmy9QyZaeg=="
|
|
||||||
},
|
|
||||||
"uri-js": {
|
"uri-js": {
|
||||||
"version": "4.4.1",
|
"version": "4.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
|
||||||
@@ -4286,11 +4098,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz",
|
||||||
"integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ=="
|
"integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ=="
|
||||||
},
|
},
|
||||||
"web-streams-polyfill": {
|
|
||||||
"version": "3.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz",
|
|
||||||
"integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q=="
|
|
||||||
},
|
|
||||||
"which": {
|
"which": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
{
|
{
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "cross-env NODE_OPTIONS='--no-experimental-fetch' PW_SNAPSHOT_ENABLE=true playwright test",
|
"test": "cross-env PW_SNAPSHOT_ENABLE=true playwright test",
|
||||||
"test:update-snapshots": "cross-env NODE_OPTIONS='--no-experimental-fetch' PW_SNAPSHOT_ENABLE=true playwright test --update-snapshots",
|
"test:update-snapshots": "cross-env PW_SNAPSHOT_ENABLE=true playwright test --update-snapshots",
|
||||||
"percy": "cross-env NODE_OPTIONS='--no-experimental-fetch' PERCY_TOKEN=$PERCY_TOKEN PW_PERCY_ENABLE=true percy exec -- playwright test --project=chrome --project=ipad",
|
"percy": "cross-env PERCY_TOKEN=$PERCY_TOKEN PW_PERCY_ENABLE=true percy exec -- playwright test --project=chrome --project=ipad",
|
||||||
"tsc": "tsc -b",
|
"tsc": "tsc -b",
|
||||||
"lint": "eslint . --ext .js,.ts",
|
"lint": "eslint . --ext .js,.ts",
|
||||||
"prettier": "prettier . --check",
|
"prettier": "prettier . --check",
|
||||||
"prettier:fix": "prettier --write .",
|
"prettier:fix": "prettier --write .",
|
||||||
"check": "npm run tsc && npm run lint && npm run prettier",
|
"check": "npm run tsc && npm run lint && npm run prettier",
|
||||||
"codegen": "cross-env playwright codegen $PW_BASE_URL",
|
"codegen": "cross-env playwright codegen $PW_BASE_URL",
|
||||||
"playwright-ui": "cross-env NODE_OPTIONS='--no-experimental-fetch' playwright test --ui",
|
"playwright-ui": "cross-env playwright test --ui",
|
||||||
"test-slomo": "cross-env NODE_OPTIONS='--no-experimental-fetch' PW_SNAPSHOT_ENABLE=true PW_SLOWMO=1000 playwright test",
|
"test-slomo": "cross-env PW_SNAPSHOT_ENABLE=true PW_SLOWMO=1000 playwright test",
|
||||||
"show-report": "npx playwright show-report",
|
"show-report": "npx playwright show-report",
|
||||||
"postinstall": "script/post_install.sh"
|
"postinstall": "script/post_install.sh"
|
||||||
},
|
},
|
||||||
@@ -24,8 +24,8 @@
|
|||||||
"chalk": "4.1.2",
|
"chalk": "4.1.2",
|
||||||
"deepmerge": "4.3.1",
|
"deepmerge": "4.3.1",
|
||||||
"dotenv": "16.4.5",
|
"dotenv": "16.4.5",
|
||||||
"form-data": "4.0.0",
|
"form-data-encoder": "4.0.2",
|
||||||
"isomorphic-unfetch": "4.0.2",
|
"formdata-node": "6.0.3",
|
||||||
"uuid": "10.0.0"
|
"uuid": "10.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -35,6 +35,41 @@ export async function shouldRunInLinux() {
|
|||||||
await expect(platform, 'Run in Linux or Playwright docker image only').toBe('linux');
|
await expect(platform, 'Run in Linux or Playwright docker image only').toBe('linux');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function ensureLicense() {
|
||||||
|
const {adminClient} = await getAdminClient();
|
||||||
|
let license = await adminClient.getClientLicenseOld();
|
||||||
|
|
||||||
|
if (license?.IsLicensed !== 'true') {
|
||||||
|
const config = await adminClient.getClientConfigOld();
|
||||||
|
await expect(
|
||||||
|
config.ServiceEnvironment === 'dev',
|
||||||
|
'The trial license request fails in the local development environment. Please manually upload the test license.',
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
await requestTrialLicense();
|
||||||
|
|
||||||
|
license = await adminClient.getClientLicenseOld();
|
||||||
|
}
|
||||||
|
|
||||||
|
await expect(license?.IsLicensed === 'true', 'Ensure server has license').toBeTruthy();
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function requestTrialLicense() {
|
||||||
|
const {adminClient} = await getAdminClient();
|
||||||
|
try {
|
||||||
|
// @ts-expect-error This may fail requesting for trial license
|
||||||
|
await adminClient.requestTrialLicense({
|
||||||
|
receive_emails_accepted: true,
|
||||||
|
terms_accepted: true,
|
||||||
|
users: 100,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
expect(error, 'Failed to request trial license').toBeFalsy();
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export async function skipIfNoLicense() {
|
export async function skipIfNoLicense() {
|
||||||
const {adminClient} = await getAdminClient();
|
const {adminClient} = await getAdminClient();
|
||||||
const license = await adminClient.getClientLicenseOld();
|
const license = await adminClient.getClientLicenseOld();
|
||||||
|
|||||||
@@ -6,9 +6,10 @@
|
|||||||
|
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
|
import stream from 'stream';
|
||||||
|
|
||||||
import FormData from 'form-data';
|
import {FormData} from 'formdata-node';
|
||||||
import 'isomorphic-unfetch';
|
import {FormDataEncoder} from 'form-data-encoder';
|
||||||
|
|
||||||
import testConfig from '@e2e-test.config';
|
import testConfig from '@e2e-test.config';
|
||||||
import Client4 from '@mattermost/client/client4';
|
import Client4 from '@mattermost/client/client4';
|
||||||
@@ -20,115 +21,89 @@ import {UserProfile} from '@mattermost/types/users';
|
|||||||
|
|
||||||
export default class Client extends Client4 {
|
export default class Client extends Client4 {
|
||||||
getFormDataOptions = (formData: FormData): Options => {
|
getFormDataOptions = (formData: FormData): Options => {
|
||||||
|
const encoder = new FormDataEncoder(formData);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
method: 'post',
|
method: 'post',
|
||||||
body: formData,
|
body: stream.Readable.from(encoder.encode()),
|
||||||
headers: {
|
headers: encoder.headers,
|
||||||
'Content-Type': `multipart/form-data; boundary=${formData.getBoundary()}`,
|
duplex: 'half',
|
||||||
},
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
uploadProfileImageX = (userId: string, filePath: string) => {
|
readFileAsFormData = (filePath: string, key: string, additionalFields: Record<string, any> = {}) => {
|
||||||
const fileData = fs.readFileSync(filePath);
|
const fileData = fs.readFileSync(filePath);
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append('image', fileData, path.basename(filePath));
|
formData.append(key, new Blob([fileData]), path.basename(filePath));
|
||||||
const options = this.getFormDataOptions(formData);
|
|
||||||
|
|
||||||
|
// Append additional fields if provided
|
||||||
|
for (const [field, value] of Object.entries(additionalFields)) {
|
||||||
|
formData.append(field, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return formData;
|
||||||
|
};
|
||||||
|
|
||||||
|
uploadProfileImageX = (userId: string, filePath: string) => {
|
||||||
|
const formData = this.readFileAsFormData(filePath, 'image');
|
||||||
|
const options = this.getFormDataOptions(formData);
|
||||||
return this.doFetch<StatusOK>(`${this.getUserRoute(userId)}/image`, options);
|
return this.doFetch<StatusOK>(`${this.getUserRoute(userId)}/image`, options);
|
||||||
};
|
};
|
||||||
|
|
||||||
setTeamIconX = (teamId: string, filePath: string) => {
|
setTeamIconX = (teamId: string, filePath: string) => {
|
||||||
const fileData = fs.readFileSync(filePath);
|
const formData = this.readFileAsFormData(filePath, 'image');
|
||||||
const formData = new FormData();
|
|
||||||
formData.append('image', fileData, path.basename(filePath));
|
|
||||||
const options = this.getFormDataOptions(formData);
|
const options = this.getFormDataOptions(formData);
|
||||||
|
|
||||||
return this.doFetch<StatusOK>(`${this.getTeamRoute(teamId)}/image`, options);
|
return this.doFetch<StatusOK>(`${this.getTeamRoute(teamId)}/image`, options);
|
||||||
};
|
};
|
||||||
|
|
||||||
createCustomEmojiX = (emoji: CustomEmoji, filePath: string) => {
|
createCustomEmojiX = (emoji: CustomEmoji, filePath: string) => {
|
||||||
const fileData = fs.readFileSync(filePath);
|
const formData = this.readFileAsFormData(filePath, 'image', {emoji: JSON.stringify(emoji)});
|
||||||
const formData = new FormData();
|
|
||||||
formData.append('image', fileData, path.basename(filePath));
|
|
||||||
formData.append('emoji', JSON.stringify(emoji));
|
|
||||||
const options = this.getFormDataOptions(formData);
|
const options = this.getFormDataOptions(formData);
|
||||||
|
|
||||||
return this.doFetch<CustomEmoji>(`${this.getEmojisRoute()}`, options);
|
return this.doFetch<CustomEmoji>(`${this.getEmojisRoute()}`, options);
|
||||||
};
|
};
|
||||||
|
|
||||||
uploadBrandImageX = (filePath: string) => {
|
uploadBrandImageX = (filePath: string) => {
|
||||||
const fileData = fs.readFileSync(filePath);
|
const formData = this.readFileAsFormData(filePath, 'image');
|
||||||
const formData = new FormData();
|
|
||||||
formData.append('image', fileData, path.basename(filePath));
|
|
||||||
const options = this.getFormDataOptions(formData);
|
const options = this.getFormDataOptions(formData);
|
||||||
|
|
||||||
return this.doFetch<StatusOK>(`${this.getBrandRoute()}/image`, options);
|
return this.doFetch<StatusOK>(`${this.getBrandRoute()}/image`, options);
|
||||||
};
|
};
|
||||||
|
|
||||||
uploadPublicSamlCertificateX = (filePath: string) => {
|
uploadCertificateX = (filePath: string, route: string) => {
|
||||||
const fileData = fs.readFileSync(filePath);
|
const formData = this.readFileAsFormData(filePath, 'certificate');
|
||||||
const formData = new FormData();
|
|
||||||
formData.append('certificate', fileData, path.basename(filePath));
|
|
||||||
const options = this.getFormDataOptions(formData);
|
const options = this.getFormDataOptions(formData);
|
||||||
|
return this.doFetch<StatusOK>(route, options);
|
||||||
|
};
|
||||||
|
|
||||||
return this.doFetch<StatusOK>(`${this.getBaseRoute()}/saml/certificate/public`, options);
|
uploadPublicSamlCertificateX = (filePath: string) => {
|
||||||
|
return this.uploadCertificateX(filePath, `${this.getBaseRoute()}/saml/certificate/public`);
|
||||||
};
|
};
|
||||||
|
|
||||||
uploadPrivateSamlCertificateX = (filePath: string) => {
|
uploadPrivateSamlCertificateX = (filePath: string) => {
|
||||||
const fileData = fs.readFileSync(filePath);
|
return this.uploadCertificateX(filePath, `${this.getBaseRoute()}/saml/certificate/private`);
|
||||||
const formData = new FormData();
|
|
||||||
formData.append('certificate', fileData, path.basename(filePath));
|
|
||||||
const options = this.getFormDataOptions(formData);
|
|
||||||
|
|
||||||
return this.doFetch<StatusOK>(`${this.getBaseRoute()}/saml/certificate/private`, options);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
uploadPublicLdapCertificateX = (filePath: string) => {
|
uploadPublicLdapCertificateX = (filePath: string) => {
|
||||||
const fileData = fs.readFileSync(filePath);
|
return this.uploadCertificateX(filePath, `${this.getBaseRoute()}/ldap/certificate/public`);
|
||||||
const formData = new FormData();
|
|
||||||
formData.append('certificate', fileData, path.basename(filePath));
|
|
||||||
const options = this.getFormDataOptions(formData);
|
|
||||||
|
|
||||||
return this.doFetch<StatusOK>(`${this.getBaseRoute()}/ldap/certificate/public`, options);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
uploadPrivateLdapCertificateX = (filePath: string) => {
|
uploadPrivateLdapCertificateX = (filePath: string) => {
|
||||||
const fileData = fs.readFileSync(filePath);
|
return this.uploadCertificateX(filePath, `${this.getBaseRoute()}/ldap/certificate/private`);
|
||||||
const formData = new FormData();
|
|
||||||
formData.append('certificate', fileData, path.basename(filePath));
|
|
||||||
const options = this.getFormDataOptions(formData);
|
|
||||||
|
|
||||||
return this.doFetch<StatusOK>(`${this.getBaseRoute()}/ldap/certificate/private`, options);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
uploadIdpSamlCertificateX = (filePath: string) => {
|
uploadIdpSamlCertificateX = (filePath: string) => {
|
||||||
const fileData = fs.readFileSync(filePath);
|
return this.uploadCertificateX(filePath, `${this.getBaseRoute()}/saml/certificate/idp`);
|
||||||
const formData = new FormData();
|
|
||||||
formData.append('certificate', fileData, path.basename(filePath));
|
|
||||||
const options = this.getFormDataOptions(formData);
|
|
||||||
|
|
||||||
return this.doFetch<StatusOK>(`${this.getBaseRoute()}/saml/certificate/idp`, options);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
uploadLicenseX = (filePath: string) => {
|
uploadLicenseX = (filePath: string) => {
|
||||||
const fileData = fs.readFileSync(filePath);
|
const formData = this.readFileAsFormData(filePath, 'license');
|
||||||
const formData = new FormData();
|
|
||||||
formData.append('license', fileData, path.basename(filePath));
|
|
||||||
const options = this.getFormDataOptions(formData);
|
const options = this.getFormDataOptions(formData);
|
||||||
|
|
||||||
return this.doFetch<License>(`${this.getBaseRoute()}/license`, options);
|
return this.doFetch<License>(`${this.getBaseRoute()}/license`, options);
|
||||||
};
|
};
|
||||||
|
|
||||||
uploadPluginX = async (filePath: string, force = false) => {
|
uploadPluginX = async (filePath: string, force = false) => {
|
||||||
const fileData = fs.readFileSync(filePath);
|
const additionalFields = force ? {force: 'true'} : {};
|
||||||
const formData = new FormData();
|
const formData = this.readFileAsFormData(filePath, 'plugin', additionalFields);
|
||||||
if (force) {
|
|
||||||
formData.append('force', 'true');
|
|
||||||
}
|
|
||||||
formData.append('plugin', fileData, path.basename(filePath));
|
|
||||||
const options = this.getFormDataOptions(formData);
|
const options = this.getFormDataOptions(formData);
|
||||||
|
|
||||||
return this.doFetch<PluginManifest>(this.getPluginsRoute(), options);
|
return this.doFetch<PluginManifest>(this.getPluginsRoute(), options);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,7 @@
|
|||||||
|
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import {expect} from '@playwright/test';
|
import {expect} from '@playwright/test';
|
||||||
import chalk from 'chalk';
|
|
||||||
|
|
||||||
import {ClientError} from '@mattermost/client/client4';
|
|
||||||
import {PreferenceType} from '@mattermost/types/preferences';
|
import {PreferenceType} from '@mattermost/types/preferences';
|
||||||
import testConfig from '@e2e-test.config';
|
import testConfig from '@e2e-test.config';
|
||||||
|
|
||||||
@@ -73,22 +71,8 @@ export async function initSetup({
|
|||||||
townSquareUrl: getUrl(team.name, 'town-square'),
|
townSquareUrl: getUrl(team.name, 'town-square'),
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// log an error for debugging
|
expect(error, 'Should not throw an error').toBeFalsy();
|
||||||
// eslint-disable-next-line no-console
|
throw error;
|
||||||
const err = error as ClientError;
|
|
||||||
if (err.message === 'Could not parse multipart form.') {
|
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log(chalk.yellow(`node version: ${process.version}\nNODE_OPTIONS: ${process.env.NODE_OPTIONS}`));
|
|
||||||
|
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log(
|
|
||||||
chalk.green(
|
|
||||||
`This failed due to the experimental fetch support in Node.js starting v18.0.0.\nYou may set environment variable: "export NODE_OPTIONS='--no-experimental-fetch'", then try again.'`,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
expect(err, 'Should not throw an error').toBeFalsy();
|
|
||||||
throw err;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {AxeResults} from 'axe-core';
|
|||||||
import AxeBuilder from '@axe-core/playwright';
|
import AxeBuilder from '@axe-core/playwright';
|
||||||
|
|
||||||
import {TestBrowser} from './browser_context';
|
import {TestBrowser} from './browser_context';
|
||||||
import {shouldHaveCallsEnabled, shouldHaveFeatureFlag, shouldRunInLinux, skipIfNoLicense} from './flag';
|
import {shouldHaveCallsEnabled, shouldHaveFeatureFlag, shouldRunInLinux, ensureLicense, skipIfNoLicense} from './flag';
|
||||||
import {initSetup, getAdminClient} from './server';
|
import {initSetup, getAdminClient} from './server';
|
||||||
import {hideDynamicChannelsContent, waitForAnimationEnd, waitUntil} from './test_action';
|
import {hideDynamicChannelsContent, waitForAnimationEnd, waitUntil} from './test_action';
|
||||||
import {pages} from './ui/pages';
|
import {pages} from './ui/pages';
|
||||||
@@ -47,6 +47,7 @@ class PlaywrightExtended {
|
|||||||
readonly shouldHaveCallsEnabled;
|
readonly shouldHaveCallsEnabled;
|
||||||
readonly shouldHaveFeatureFlag;
|
readonly shouldHaveFeatureFlag;
|
||||||
readonly shouldRunInLinux;
|
readonly shouldRunInLinux;
|
||||||
|
readonly ensureLicense;
|
||||||
readonly skipIfNoLicense;
|
readonly skipIfNoLicense;
|
||||||
|
|
||||||
// ./server
|
// ./server
|
||||||
@@ -72,6 +73,7 @@ class PlaywrightExtended {
|
|||||||
this.shouldHaveCallsEnabled = shouldHaveCallsEnabled;
|
this.shouldHaveCallsEnabled = shouldHaveCallsEnabled;
|
||||||
this.shouldHaveFeatureFlag = shouldHaveFeatureFlag;
|
this.shouldHaveFeatureFlag = shouldHaveFeatureFlag;
|
||||||
this.shouldRunInLinux = shouldRunInLinux;
|
this.shouldRunInLinux = shouldRunInLinux;
|
||||||
|
this.ensureLicense = ensureLicense;
|
||||||
this.skipIfNoLicense = skipIfNoLicense;
|
this.skipIfNoLicense = skipIfNoLicense;
|
||||||
|
|
||||||
// ./server
|
// ./server
|
||||||
|
|||||||
|
До Ширина: | Высота: | Размер: 107 KiB После Ширина: | Высота: | Размер: 96 KiB |
|
До Ширина: | Высота: | Размер: 170 KiB После Ширина: | Высота: | Размер: 172 KiB |
|
До Ширина: | Высота: | Размер: 93 KiB После Ширина: | Высота: | Размер: 84 KiB |
|
До Ширина: | Высота: | Размер: 153 KiB После Ширина: | Высота: | Размер: 138 KiB |
|
До Ширина: | Высота: | Размер: 150 KiB После Ширина: | Высота: | Размер: 136 KiB |
|
До Ширина: | Высота: | Размер: 271 KiB После Ширина: | Высота: | Размер: 274 KiB |
|
До Ширина: | Высота: | Размер: 136 KiB После Ширина: | Высота: | Размер: 124 KiB |
|
До Ширина: | Высота: | Размер: 278 KiB После Ширина: | Высота: | Размер: 278 KiB |
|
До Ширина: | Высота: | Размер: 131 KiB После Ширина: | Высота: | Размер: 119 KiB |
|
До Ширина: | Высота: | Размер: 296 KiB После Ширина: | Высота: | Размер: 300 KiB |
|
До Ширина: | Высота: | Размер: 175 KiB После Ширина: | Высота: | Размер: 161 KiB |
|
До Ширина: | Высота: | Размер: 291 KiB После Ширина: | Высота: | Размер: 295 KiB |
|
До Ширина: | Высота: | Размер: 168 KiB После Ширина: | Высота: | Размер: 155 KiB |
@@ -22,6 +22,7 @@ export type Options = {
|
|||||||
body?: any;
|
body?: any;
|
||||||
signal?: RequestInit['signal'];
|
signal?: RequestInit['signal'];
|
||||||
ignoreStatus?: boolean; /** If true, status codes > 300 are ignored and don't cause an error */
|
ignoreStatus?: boolean; /** If true, status codes > 300 are ignored and don't cause an error */
|
||||||
|
duplex?: 'half'; /** Optional, but required for node clients. Must be 'half' for half-duplex fetch; 'full' is reserved for future use. See https://fetch.spec.whatwg.org/#dom-requestinit-duplex */
|
||||||
};
|
};
|
||||||
|
|
||||||
export type StatusOK = {
|
export type StatusOK = {
|
||||||
|
|||||||