From 8a01552b4ba77bd06a7db2c79cc0c81f032afb1a Mon Sep 17 00:00:00 2001 From: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Date: Mon, 7 Mar 2022 20:26:13 -0300 Subject: [PATCH] [FIX] Hardcoded E2E password for Detox workflow (#3809) * [FIX] Removed account from E2E Data and create a file responsible for this account * Updated e2e/README.md * minor tweak * Update e2e/README.md Co-authored-by: Gerzon Z. Co-authored-by: Gerzon Z. --- .gitignore | 1 + e2e/README.md | 2 +- e2e/data.js | 5 +++-- e2e/data/data.cloud.js | 5 +++-- e2e/e2e_account.example.js | 6 ++++++ 5 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 e2e/e2e_account.example.js diff --git a/.gitignore b/.gitignore index 4ffd99aa9..efb752943 100644 --- a/.gitignore +++ b/.gitignore @@ -64,5 +64,6 @@ artifacts .vscode/ e2e/docker/rc_test_env/docker-compose.yml e2e/docker/data/db +e2e/e2e_account.js *.p8 \ No newline at end of file diff --git a/e2e/README.md b/e2e/README.md index f2ae5651b..f95f99837 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -28,7 +28,7 @@ Or * If you're running your own Rocket.Chat server, ensure it's started (e.g. `meteor npm start` in the server project directory). * Edit `e2e/data.js`: * Set the `server` to the address of the server under test - * Set the `adminUser` and `adminPassword` to an admin user on that environment (or a user with at least `create-user` and `create-c`). + * Create a file called `e2e_account.js`, in the same folder as `data.js`. Set the `adminUser` and `adminPassword` to an admin user on that environment (or a user with at least `create-user` and `create-c` permissions). The example of how to create this file is on `e2e/e2e_account.example.js` * Working example configs exist in `./e2e/data/`. Setting `FORCE_DEFAULT_DOCKER_DATA` to `1` in the `runTestsInDocker.sh` script will use the example config automatically ### 3. Running tests diff --git a/e2e/data.js b/e2e/data.js index 800239e76..c95651dc1 100644 --- a/e2e/data.js +++ b/e2e/data.js @@ -1,10 +1,11 @@ const random = require('./helpers/random'); +// eslint-disable-next-line import/no-unresolved +const account = require('./e2e_account'); const value = random(20); const data = { server: 'https://mobile.rocket.chat', - adminUser: 'e2e_admin', - adminPassword: 'p7mFh4yLwCRXSnMvG', + ...account, alternateServer: 'https://stable.rocket.chat', users: { regular: { diff --git a/e2e/data/data.cloud.js b/e2e/data/data.cloud.js index 2f4c5d8d5..a9b1671e6 100644 --- a/e2e/data/data.cloud.js +++ b/e2e/data/data.cloud.js @@ -1,11 +1,12 @@ // eslint-disable-next-line import/no-unresolved const random = require('./helpers/random'); +// eslint-disable-next-line import/no-unresolved +const account = require('./e2e_account'); const value = random(20); const data = { server: 'https://mobile.rocket.chat', - adminUser: 'e2e_admin', - adminPassword: 'p7mFh4yLwCRXSnMvG', + ...account, alternateServer: 'https://stable.rocket.chat', users: { regular: { diff --git a/e2e/e2e_account.example.js b/e2e/e2e_account.example.js new file mode 100644 index 000000000..4294d6b08 --- /dev/null +++ b/e2e/e2e_account.example.js @@ -0,0 +1,6 @@ +const account = { + adminUser: 'Change_here', + adminPassword: 'Change_here' +}; + +module.exports = account;