diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index af571a2c861a105e05a22b678a3aa9380f351b4c..ecfb34c5b1e8a8d14e94289fc3ab27ceda46f488 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -53,12 +53,6 @@ jobs: # run: | # npx package-lock-check - - name: Cache cypress - id: cache-cypress - uses: actions/cache@v2 - with: - path: /home/runner/.cache/Cypress - key: ${{ runner.OS }}-cache-cypress-${{ hashFiles('**/package-lock.json', '.github/workflows/build_and_test.yml') }} - uses: c-hive/gha-yarn-cache@v2 - name: Cache turbo id: cache-turbo @@ -118,7 +112,6 @@ jobs: git version - name: yarn install - # if: steps.cache-nodemodules.outputs.cache-hit != 'true' || steps.cache-cypress.outputs.cache-hit != 'true' run: yarn - run: yarn lint @@ -212,15 +205,6 @@ jobs: - uses: actions/checkout@v3 - - name: Cache cypress - id: cache-cypress - uses: actions/cache@v2 - with: - path: /home/runner/.cache/Cypress - key: ${{ runner.OS }}-cache-cypress-${{ hashFiles('**/package-lock.json', '.github/workflows/build_and_test.yml') }} - restore-keys: | - ${{ runner.os }}-cache-cypress- - ${{ runner.os }}- - uses: c-hive/gha-yarn-cache@v2 - name: Cache turbo id: cache-turbo @@ -256,17 +240,6 @@ jobs: Xvfb -screen 0 1024x768x24 :99 & for i in $(seq 1 5); do (docker exec mongo mongo rocketchat --eval 'db.dropDatabase()') && npm run testci -- --test=testapi && s=0 && break || s=$? && sleep 1; done; (exit $s) - - name: E2E Test UI (Legacy - Cypress) - env: - TEST_MODE: 'true' - MONGO_URL: mongodb://localhost:27017/rocketchat - MONGO_OPLOG_URL: mongodb://localhost:27017/local - run: | - cd ./apps/meteor - echo -e 'pcm.!default {\n type hw\n card 0\n}\n\nctl.!default {\n type hw\n card 0\n}' > ~/.asoundrc - Xvfb -screen 0 1024x768x24 :99 & - for i in $(seq 1 2); do (docker exec mongo mongo rocketchat --eval 'db.dropDatabase()') && npm run testci -- --test=testui && s=0 && break || s=$? && ([ ! -w tests/cypress/screenshots ] || mv tests/cypress/screenshots tests/cypress/screenshots-$i) && ([ ! -w tests/cypress/videos ] || mv tests/cypress/videos tests/cypress/videos-$i) && sleep 1; done; (exit $s) - - name: E2E Test UI env: TEST_MODE: 'true' @@ -285,20 +258,6 @@ jobs: name: playwright-test-trace path: ./apps/meteor/tests/e2e/test-failures* - - name: Store cypress test screenshots - uses: actions/upload-artifact@v2 - if: failure() - with: - name: cypress-test-screenshots - path: ./apps/meteor/tests/cypress/screenshots* - - - name: Store cypress test videos - uses: actions/upload-artifact@v2 - if: failure() - with: - name: cypress-test-videos - path: ./apps/meteor/tests/cypress/videos* - test-ee: runs-on: ubuntu-20.04 needs: build @@ -345,12 +304,6 @@ jobs: - uses: actions/checkout@v3 - - name: Cache cypress - id: cache-cypress - uses: actions/cache@v2 - with: - path: /home/runner/.cache/Cypress - key: ${{ runner.OS }}-cache-cypress-${{ hashFiles('**/package-lock.json', '.github/workflows/build_and_test.yml') }} - uses: c-hive/gha-yarn-cache@v2 - name: Cache turbo id: cache-turbo @@ -364,7 +317,6 @@ jobs: ${{ runner.os }}- - name: Yarn install - # if: steps.cache-nodemodules.outputs.cache-hit != 'true' || steps.cache-cypress.outputs.cache-hit != 'true' run: yarn - name: Build micro services @@ -386,25 +338,6 @@ jobs: for i in $(seq 1 5); do (docker exec mongo mongo rocketchat --eval 'db.dropDatabase()') && npm run testci -- --enterprise --test=testapi && s=0 && break || s=$? && sleep 1; done; (exit $s) - - name: E2E Test UI (Legacy - Cypress) - env: - TEST_MODE: 'true' - MONGO_URL: mongodb://localhost:27017/rocketchat - MONGO_OPLOG_URL: mongodb://localhost:27017/local - ENTERPRISE_LICENSE: ${{ secrets.ENTERPRISE_LICENSE }} - TRANSPORTER: nats://localhost:4222 - CYPRESS_BASE_URL: http://localhost:4000 - CYPRESS_TEST_API_URL: http://localhost:4000 - OVERWRITE_SETTING_Site_Url: http://localhost:4000 - SKIP_PROCESS_EVENT_REGISTRATION: 'true' - run: | - echo -e 'pcm.!default {\n type hw\n card 0\n}\n\nctl.!default {\n type hw\n card 0\n}' > ~/.asoundrc - Xvfb -screen 0 1024x768x24 :99 & - - cd ./apps/meteor/ - - for i in $(seq 1 2); do (docker exec mongo mongo rocketchat --eval 'db.dropDatabase()') && npm run testci -- --enterprise --test=testui && s=0 && break || s=$? && ([ ! -w tests/cypress/screenshots ] || mv tests/cypress/screenshots tests/cypress/screenshots-$i) && ([ ! -w tests/cypress/videos ] || mv tests/cypress/videos tests/cypress/videos-$i) && sleep 1; done; (exit $s) - - name: Install Playwright run: | cd ./apps/meteor/ @@ -417,8 +350,7 @@ jobs: MONGO_OPLOG_URL: mongodb://localhost:27017/local ENTERPRISE_LICENSE: ${{ secrets.ENTERPRISE_LICENSE }} TRANSPORTER: nats://localhost:4222 - CYPRESS_BASE_URL: http://localhost:4000 - CYPRESS_TEST_API_URL: http://localhost:4000 + TEST_API_URL: http://localhost:4000 OVERWRITE_SETTING_Site_Url: http://localhost:4000 SKIP_PROCESS_EVENT_REGISTRATION: 'true' run: | @@ -436,19 +368,6 @@ jobs: name: ee-playwright-test-trace path: ./apps/meteor/tests/e2e/test-failures* - - name: Store cypress test screenshots - uses: actions/upload-artifact@v2 - if: failure() - with: - name: ee-cypress-test-screenshots - path: ./apps/meteor/tests/cypress/screenshots* - - - name: Store cypress test videos - uses: actions/upload-artifact@v2 - if: failure() - with: - name: ee-cypress-test-videos - path: ./apps/meteor/tests/cypress/videos* # notification: # runs-on: ubuntu-20.04 # needs: test diff --git a/.yarnrc.yml b/.yarnrc.yml index 8abafc3d6310abce07e51e560c234a4d7aaf55b9..155880f91223d3018ce44e3f0d296673982456f1 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1,5 +1,7 @@ nodeLinker: node-modules +checksumBehavior: "update" + plugins: - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs spec: '@yarnpkg/plugin-workspace-tools' diff --git a/apps/meteor/.gitignore b/apps/meteor/.gitignore index f99fb3d2ccd9cc39d112e819207395abf7dae2a8..3fc755f6bb5bfd7bc1a204a916885d90fd4686d3 100644 --- a/apps/meteor/.gitignore +++ b/apps/meteor/.gitignore @@ -78,8 +78,6 @@ tests/end-to-end/temporary_staged_test .screenshots /private/livechat /storybook-static -/tests/cypress/screenshots -/tests/cypress/videos /tests/e2e/test-failures coverage .nyc_output diff --git a/apps/meteor/cypress.json b/apps/meteor/cypress.json deleted file mode 100644 index 28f2c5dfe960bda4262163304fa984d39e36689c..0000000000000000000000000000000000000000 --- a/apps/meteor/cypress.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "baseUrl": "http://localhost:3000", - "defaultCommandTimeout": 10000, - "video": false, - "trashAssetsBeforeRuns": false, - "retries": 2, - "projectId": "99zfrs", - "screenshotsFolder": "tests/cypress/screenshots", - "videosFolder": "tests/cypress/videos", - "fixturesFolder": "tests/cypress/fixtures", - "pluginsFile": "tests/cypress/plugins", - "supportFile": "tests/cypress/support", - "integrationFolder": "tests/cypress/integration" -} diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 3effa60ed996d86b820c6b6ca4dfc006db8034b9..7aa3c80937be451d897a6381dfb33376a570b41c 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -34,10 +34,6 @@ "testci": "node .scripts/start.js", "test:playwright": "playwright test", "test:playwright:ee": "cross-env ENTERPRISE=true yarn test:playwright", - "testui": "cypress run", - "testui-pass": "cypress run --spec ./tests/cypress/integration/01-pass/**/*.spec.js", - "testui-intermittent": "cypress run --spec ./tests/cypress/integration/02-intermittent/**/*.spec.js", - "testui-skip": "cypress run --spec ./tests/cypress/integration/03-skip/**/*.spec.js", "testapi": "mocha --config ./.mocharc.api.js", "testunit": "npm run .testunit:definition && npm run .testunit:client && npm run .testunit:server", ".testunit:server": "mocha --config ./.mocharc.js", @@ -145,7 +141,6 @@ "chai-dom": "^1.11.0", "chai-spies": "^1.0.0", "cross-env": "^7.0.3", - "cypress": "^7.7.0", "emojione-assets": "^4.5.0", "eslint": "^6.8.0", "eslint-config-prettier": "^8.5.0", @@ -244,8 +239,6 @@ "cors": "^2.8.5", "css-vars-ponyfill": "^2.4.7", "csv-parse": "^5.0.4", - "cypress-real-events": "^1.7.0", - "cypress-wait-until": "^1.7.2", "date-fns": "^2.28.0", "dompurify": "^2.3.6", "ejson": "^2.2.2", diff --git a/apps/meteor/tests/.eslintrc b/apps/meteor/tests/.eslintrc index 72c84bef583be823b215ac0b5cc28c8fb544bf66..95b73a453271490e5f0324e5ed2893ee8f52719d 100644 --- a/apps/meteor/tests/.eslintrc +++ b/apps/meteor/tests/.eslintrc @@ -4,8 +4,6 @@ }, "globals": { "browser": false, - "Cypress": false, - "cy": false, "expect": false } } diff --git a/apps/meteor/tests/cypress/fixtures/example.json b/apps/meteor/tests/cypress/fixtures/example.json deleted file mode 100644 index da18d9352a17d427321962199a1fa43b8ab5cfe4..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/fixtures/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Using fixtures to represent data", - "email": "hello@cypress.io", - "body": "Fixtures are a great way to mock data for responses to routes" -} \ No newline at end of file diff --git a/apps/meteor/tests/cypress/integration/00-login.spec.js b/apps/meteor/tests/cypress/integration/00-login.spec.js deleted file mode 100644 index 895f75669298b0aa33a0367a903c501e0a7d6e5e..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/integration/00-login.spec.js +++ /dev/null @@ -1,158 +0,0 @@ -import loginPage from '../pageobjects/login.page'; -import setupWizard from '../pageobjects/setup-wizard.page'; - -describe('[Login]', () => { - before(() => { - localStorage.clear(); - loginPage.open(); - }); - - describe('[Render]', () => { - it('it should show email / username field', () => { - loginPage.emailOrUsernameField.should('be.visible'); - }); - - it('it should show password field', () => { - loginPage.passwordField.should('be.visible'); - }); - - it('it should show submit button', () => { - loginPage.submitButton.should('be.visible'); - }); - - it('it should show register button', () => { - loginPage.registerButton.should('be.visible'); - }); - - it('it should show forgot password button', () => { - loginPage.forgotPasswordButton.should('be.visible'); - }); - - it('it should not show name field', () => { - loginPage.nameField.should('not.exist'); - }); - - it('it should not show email field', () => { - loginPage.emailField.should('not.exist'); - }); - - it('it should not show confirm password field', () => { - loginPage.confirmPasswordField.should('not.exist'); - }); - - it('it should not show back to login button', () => { - loginPage.backToLoginButton.should('not.exist'); - }); - }); - - describe('[Required Fields]', () => { - before(() => { - loginPage.submit(); - }); - - describe('email / username: ', () => { - it('it should be required', () => { - loginPage.emailOrUsernameField.should('have.class', 'error'); - loginPage.emailOrUsernameInvalidText.get('text').should('not.be.empty'); - }); - }); - - describe('password: ', () => { - it('it should be required', () => { - loginPage.passwordField.should('have.class', 'error'); - loginPage.passwordInvalidText.get('text').should('not.be.empty'); - }); - }); - }); -}); - -describe('[Setup Wizard]', () => { - before(() => { - loginPage.open(); - setupWizard.login(); - }); - - describe('[Render - Step 2]', () => { - it('it should show organization name', () => { - setupWizard.organizationName.should('be.visible'); - }); - - it('it should show organization type', () => { - setupWizard.organizationType.should('be.visible'); - }); - - it('it should show industry', () => { - setupWizard.industry.should('be.visible'); - }); - - it('it should show size', () => { - setupWizard.size.should('be.visible'); - }); - - it('it should show country', () => { - setupWizard.country.should('be.visible'); - }); - - it('it should fill the form', () => { - setupWizard.organizationName.type('Org Name'); - setupWizard.size.click().wait(100); - cy.get('.rcx-options .rcx-option:first-child').click(); - cy.get('.rcx-options').should('not.exist'); - setupWizard.industry.click().wait(100); - cy.get('.rcx-options .rcx-option:first-child').click(); - cy.get('.rcx-options').should('not.exist'); - setupWizard.country.click().wait(100); - cy.get('.rcx-options .rcx-option:first-child').click(); - cy.get('.rcx-options').should('not.exist'); - }); - - after(() => { - setupWizard.goNext(); - }); - }); - - describe('[Render - Step 3]', () => { - it('it should have email field to register the server', () => { - setupWizard.registeredServer.should('be.visible'); - }); - - it('it should start with "Register" button disabled', () => { - setupWizard.registerButton.should('be.disabled'); - }); - - it('it should show an error on invalid email', () => { - setupWizard.registeredServer.type('a'); - setupWizard.registeredServer.clear(); - cy.get('.rcx-field__error:contains("This field is required")').should('be.visible'); - }); - - it('it should enable "Register" button when email is valid and terms checked', () => { - setupWizard.registeredServer.type('email@email.com'); - setupWizard.agreementField.click(); - setupWizard.registerButton.should('be.enabled'); - }); - - it('it should have option for standalone server', () => { - setupWizard.standaloneServer.should('be.visible'); - }); - - it('it should continue when clicking on "Continue as standalone"', () => { - setupWizard.standaloneServer.click(); - }); - }); - - describe('[Render - Final Step]', () => { - it('it should confirm the standalone option', () => { - setupWizard.goToWorkspace.should('be.visible'); - setupWizard.standaloneConfirmText.should('be.visible'); - }); - - it('it should confirm standalone', () => { - setupWizard.goToWorkspace.click(); - }); - }); - - after(() => { - cy.logout(); - }); -}); diff --git a/apps/meteor/tests/cypress/integration/01-register.spec.js b/apps/meteor/tests/cypress/integration/01-register.spec.js deleted file mode 100644 index c859a8cd3095e73767c8df975e5a8d5cf89dae83..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/integration/01-register.spec.js +++ /dev/null @@ -1,107 +0,0 @@ -import loginPage from '../pageobjects/login.page'; - -describe('[Register]', () => { - before(() => { - loginPage.open(); - loginPage.gotToRegister(); - }); - - describe('render:', () => { - it('it should show name field', () => { - loginPage.nameField.should('be.visible'); - }); - - it('it should show email field', () => { - loginPage.emailField.should('be.visible'); - }); - - it('it should show password field', () => { - loginPage.passwordField.should('be.visible'); - }); - - it('it should show confirm password field', () => { - loginPage.confirmPasswordField.should('be.visible'); - }); - - it('it should not show email / username field', () => { - loginPage.emailOrUsernameField.should('not.exist'); - }); - - it('it should show submit button', () => { - loginPage.submitButton.should('be.visible'); - }); - - it('it should not show register button', () => { - loginPage.registerButton.should('not.exist'); - }); - - it('it should not show forgot password button', () => { - loginPage.forgotPasswordButton.should('not.exist'); - }); - - it('it should show back to login button', () => { - loginPage.backToLoginButton.should('be.visible'); - }); - }); - - describe('name:', () => { - it('it should be required', () => { - loginPage.submit(); - loginPage.nameField.should('have.class', 'error'); - loginPage.nameInvalidText.get('text').should('not.be.empty'); - }); - }); - - describe('email:', () => { - it('it should be required', () => { - loginPage.submit(); - loginPage.emailField.should('have.class', 'error'); - loginPage.emailInvalidText.get('text').should('not.be.empty'); - }); - - it('it should be invalid for email without domain', () => { - loginPage.emailField.type('invalid-email'); - loginPage.submit(); - loginPage.emailField.should('have.class', 'error'); - loginPage.emailInvalidText.get('text').should('not.be.empty'); - }); - - it('it should be invalid for email with invalid domain', () => { - loginPage.emailField.type('invalid-email@mail'); - loginPage.submit(); - loginPage.emailField.should('have.class', 'error'); - loginPage.emailInvalidText.get('text').should('not.be.empty'); - }); - - it.skip('it should be invalid for email space', () => { - loginPage.emailField.type('invalid email@mail.com'); - loginPage.submit(); - loginPage.emailField.should('have.class', 'error'); - loginPage.emailInvalidText.get('text').should('not.be.empty'); - }); - }); - - describe('password:', () => { - it('it should be required', () => { - loginPage.submit(); - loginPage.passwordField.should('have.class', 'error'); - loginPage.passwordInvalidText.get('text').should('not.be.empty'); - }); - }); - - describe('confirm-password:', () => { - it('it should be invalid if different from password', () => { - loginPage.passwordField.type('password'); - loginPage.submit(); - loginPage.confirmPasswordField.should('have.class', 'error'); - loginPage.confirmPasswordInvalidText.get('text').should('not.be.empty'); - }); - - it('it should be valid if equal to password', () => { - loginPage.confirmPasswordField.type('password'); - loginPage.submit(); - loginPage.passwordField.should('not.have.class', 'error'); - loginPage.passwordInvalidText.should('not.have.text'); - }); - }); -}); diff --git a/apps/meteor/tests/cypress/integration/02-forgot-password.spec.js b/apps/meteor/tests/cypress/integration/02-forgot-password.spec.js deleted file mode 100644 index c9069ee34d4b682478e28e2206f01dba6fbf2afa..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/integration/02-forgot-password.spec.js +++ /dev/null @@ -1,75 +0,0 @@ -import loginPage from '../pageobjects/login.page'; - -describe('[Forgot Password]', () => { - before(() => { - loginPage.open(); - loginPage.gotToForgotPassword(); - }); - - describe('render:', () => { - it('it should not show name field', () => { - loginPage.nameField.should('not.exist'); - }); - - it('it should show email field', () => { - loginPage.emailField.should('be.visible'); - }); - - it('it should not show password field', () => { - loginPage.passwordField.should('not.exist'); - }); - - it('it should not show confirm password field', () => { - loginPage.confirmPasswordField.should('not.exist'); - }); - - it('it should not show email / username field', () => { - loginPage.emailOrUsernameField.should('not.exist'); - }); - - it('it should show submit button', () => { - loginPage.submitButton.should('be.visible'); - }); - - it('it should not show register button', () => { - loginPage.registerButton.should('not.exist'); - }); - - it('it should not show forgot password button', () => { - loginPage.forgotPasswordButton.should('not.exist'); - }); - - it('it should show back to login button', () => { - loginPage.backToLoginButton.should('be.visible'); - }); - }); - - describe('email:', () => { - it('it should be required', () => { - loginPage.submit(); - loginPage.emailField.should('have.class', 'error'); - loginPage.emailInvalidText.get('text').should('not.be.empty'); - }); - - it('it should be invalid for email without domain', () => { - loginPage.emailField.type('invalid-email'); - loginPage.submit(); - loginPage.emailField.should('have.class', 'error'); - loginPage.emailInvalidText.get('text').should('not.be.empty'); - }); - - it('it should be invalid for email with invalid domain', () => { - loginPage.emailField.type('invalid-email@mail'); - loginPage.submit(); - loginPage.emailField.should('have.class', 'error'); - loginPage.emailInvalidText.get('text').should('not.be.empty'); - }); - - it.skip('it should be invalid for email space', () => { - loginPage.emailField.type('invalid email@mail.com'); - loginPage.submit(); - loginPage.emailField.should('have.class', 'error'); - loginPage.emailInvalidText.get('text').should('not.be.empty'); - }); - }); -}); diff --git a/apps/meteor/tests/cypress/integration/03-user-creation.spec.js b/apps/meteor/tests/cypress/integration/03-user-creation.spec.js deleted file mode 100644 index bb64a3292ec3ca16c83636946eac65e9a35f0b0f..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/integration/03-user-creation.spec.js +++ /dev/null @@ -1,19 +0,0 @@ -import loginPage from '../pageobjects/login.page'; -import { username, email, password } from '../../data/user.js'; - -// Basic usage test start -describe('[User Creation]', function () { - before(() => { - loginPage.open(); - }); - - it('it should create user', () => { - loginPage.gotToRegister(); - - loginPage.registerNewUser({ username, email, password }); - - loginPage.usernameField.should('be.visible'); - - loginPage.submitButton.click(); - }); -}); diff --git a/apps/meteor/tests/cypress/integration/04-main-elements-render.spec.js b/apps/meteor/tests/cypress/integration/04-main-elements-render.spec.js deleted file mode 100644 index 4d8d5d67e6b1905248029c02ea2bd0aa917c6c3d..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/integration/04-main-elements-render.spec.js +++ /dev/null @@ -1,285 +0,0 @@ -import flexTab from '../pageobjects/flex-tab.page'; -import mainContent from '../pageobjects/main-content.page'; -import sideNav from '../pageobjects/side-nav.page'; -import { checkIfUserIsValid } from '../../data/checks'; -import { username, email, password } from '../../data/user.js'; - -describe('[Main Elements Render]', function () { - before(() => { - checkIfUserIsValid(username, email, password); - sideNav.spotlightSearchIcon.click(); - sideNav.searchChannel('general'); - }); - - describe('[Side Nav Bar]', () => { - describe('render:', () => { - it('it should show the new channel button', () => { - sideNav.newChannelBtnToolbar.should('be.visible'); - }); - - it('it should show "general" channel', () => { - sideNav.general.should('be.visible'); - }); - }); - - describe('spotlight search render:', () => { - after(() => { - mainContent.messageInput.click(); - }); - it('it should show spotlight search bar', () => { - sideNav.spotlightSearchIcon.click(); - sideNav.spotlightSearch.should('be.visible'); - }); - - it('it should click the spotlight and show the channel list', () => { - sideNav.spotlightSearch.click('center'); - sideNav.spotlightSearchPopUp.should('be.visible'); - }); - - it.skip('it should remove the list when the spotlight loses focus', () => { - sideNav.spotlightSearchPopUp.should('be.visible'); - mainContent.messageInput.click(); - mainContent.lastMessage.click(); - sideNav.spotlightSearchPopUp.should('not.exist'); - }); - - it('it should add text to the spotlight and show the channel list', () => { - sideNav.spotlightSearch.type('rocket.cat'); - sideNav.spotlightSearchPopUp.should('be.visible'); - }); - - it.skip('it should remove the text on the spotlight and the list when lost focus', () => { - sideNav.spotlightSearchPopUp.should('be.visible'); - mainContent.messageInput.click(); - sideNav.spotlightSearchPopUp.should('not.exist'); - sideNav.spotlightSearch.should('have.text', ''); - }); - }); - }); - - describe('[User Options]', () => { - describe('render:', () => { - before(() => { - sideNav.sidebarUserMenu.click(); - }); - - after(() => { - sideNav.sidebarUserMenu.click(); - }); - - it('it should show online button', () => { - sideNav.statusOnline.should('be.visible'); - }); - - it('it should show away button', () => { - sideNav.statusAway.should('be.visible'); - }); - - it('it should show busy button', () => { - sideNav.statusBusy.should('be.visible'); - }); - - it('it should show offline button', () => { - sideNav.statusOffline.should('be.visible'); - }); - - it('it should show my account button', () => { - sideNav.account.should('be.visible'); - }); - - it('it should show logout button', () => { - sideNav.logout.should('be.visible'); - }); - }); - }); - - describe('[Main Content]', () => { - describe('render:', () => { - before(() => { - sideNav.openChannel('general'); - }); - - it('it should show the title of the channel', () => { - mainContent.channelTitle.contains('general').should('be.visible'); - }); - - it('it should show the empty favorite star', () => { - mainContent.emptyFavoriteStar.should('be.visible'); - }); - - it('it should click the star', () => { - mainContent.emptyFavoriteStar.click(); - }); - - it('it should show the filled favorite star', () => { - mainContent.favoriteStar.should('be.visible'); - }); - - it('it should click the star', () => { - mainContent.favoriteStar.click(); - }); - - it('it should show the empty favorite star', () => { - mainContent.emptyFavoriteStar.should('be.visible'); - }); - - it('it should show the message input bar', () => { - mainContent.messageInput.should('be.visible'); - }); - - it('it should show the message box actions button', () => { - mainContent.messageBoxActions.should('be.visible'); - }); - - // issues with the new message box action button and the no animations on tests - - it('it should show the audio recording button', () => { - mainContent.recordBtn.should('be.visible'); - }); - - it('it should show the emoji button', () => { - mainContent.emojiBtn.should('be.visible'); - }); - }); - }); - - describe('[Flextab]', () => { - describe('[Render]', () => { - before(() => { - sideNav.openChannel('general'); - }); - - describe('Room Info Tab:', () => { - before(() => { - flexTab.operateFlexTab('info', true); - }); - - after(() => { - flexTab.operateFlexTab('info', false); - }); - - it('it should show the room info button', () => { - flexTab.channelTab.should('be.visible'); - }); - - it('it should show the room info tab content', () => { - flexTab.channelSettings.should('be.visible'); - }); - - it.skip('it should show the room name', () => { - flexTab.channelSettingName.should('have.attr', 'title', 'general'); - }); - }); - - describe('Search Tab:', () => { - before(() => { - flexTab.operateFlexTab('search', true); - }); - - after(() => { - flexTab.operateFlexTab('search', false); - }); - - it('it should show the message search button', () => { - flexTab.searchTab.should('be.visible'); - }); - - it('it should show the message tab content', () => { - flexTab.searchTabContent.should('be.visible'); - }); - }); - - describe('Members Tab:', () => { - before(() => { - flexTab.operateFlexTab('members', true); - }); - - after(() => { - flexTab.operateFlexTab('members', false); - }); - - it('it should show the members tab button', () => { - flexTab.membersTab.should('be.visible'); - }); - - it('it should show the members content', () => { - flexTab.membersTabContent.should('be.visible'); - }); - }); - - describe('Notifications Tab:', () => { - before(() => { - flexTab.operateFlexTab('notifications', true); - }); - - after(() => { - flexTab.operateFlexTab('notifications', false); - }); - - it('it should not show the notifications button', () => { - flexTab.notificationsTab.should('not.exist'); - }); - - it('it should show the notifications Tab content', () => { - flexTab.notificationsSettings.should('be.visible'); - }); - }); - - describe('Files Tab:', () => { - before(() => { - flexTab.operateFlexTab('files', true); - }); - - after(() => { - flexTab.operateFlexTab('files', false); - }); - - it('it should show the files Tab content', () => { - flexTab.filesTabContent.should('be.visible'); - }); - }); - - describe('Mentions Tab:', () => { - before(() => { - flexTab.operateFlexTab('mentions', true); - }); - - after(() => { - flexTab.operateFlexTab('mentions', false); - }); - - it('it should show the mentions Tab content', () => { - flexTab.mentionsTabContent.should('be.visible'); - }); - }); - - describe('Starred Messages Tab:', () => { - before(() => { - flexTab.operateFlexTab('starred', true); - }); - - after(() => { - flexTab.operateFlexTab('starred', false); - }); - - it('it should show the starred messages Tab content', () => { - flexTab.starredTabContent.should('be.visible'); - }); - }); - - describe('Pinned Messages Tab:', () => { - before(() => { - flexTab.operateFlexTab('pinned', true); - }); - - after(() => { - flexTab.operateFlexTab('pinned', false); - }); - - it('it should show the pinned messages Tab content', () => { - flexTab.pinnedTabContent.should('be.visible'); - }); - }); - }); - }); -}); diff --git a/apps/meteor/tests/cypress/integration/05-channel-creation.spec.js b/apps/meteor/tests/cypress/integration/05-channel-creation.spec.js deleted file mode 100644 index 89f906d72bf2be15033a76198910f98567d4778e..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/integration/05-channel-creation.spec.js +++ /dev/null @@ -1,34 +0,0 @@ -import sideNav from '../pageobjects/side-nav.page'; -import { publicChannelName, privateChannelName } from '../../data/channel.js'; -import { targetUser } from '../../data/interactions.js'; -import { checkIfUserIsValid, setPublicChannelCreated, setPrivateChannelCreated, setDirectMessageCreated } from '../../data/checks'; -import { username, email, password } from '../../data/user.js'; - -// Basic usage test start -describe('[Channel creation]', function () { - before(() => { - checkIfUserIsValid(username, email, password); - }); - - describe('public channel:', function () { - it('it should create a public channel', function () { - sideNav.createChannel(publicChannelName, false, false); - setPublicChannelCreated(true); - }); - }); - - describe('private channel:', function () { - it('it should create a private channel', function () { - sideNav.createChannel(privateChannelName, true, false); - setPrivateChannelCreated(true); - }); - }); - - describe('direct message:', function () { - it('it should start a direct message with rocket.cat', function () { - sideNav.spotlightSearchIcon.click(); - sideNav.searchChannel(targetUser); - setDirectMessageCreated(true); - }); - }); -}); diff --git a/apps/meteor/tests/cypress/integration/06-messaging.spec.js b/apps/meteor/tests/cypress/integration/06-messaging.spec.js deleted file mode 100644 index 79d4aaf7d1f6c075fc6ccf287a916cc6423a5102..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/integration/06-messaging.spec.js +++ /dev/null @@ -1,423 +0,0 @@ -import mainContent from '../pageobjects/main-content.page'; -import sideNav from '../pageobjects/side-nav.page'; -import flexTab from '../pageobjects/flex-tab.page'; -import Global from '../pageobjects/global'; -import { username, email, password } from '../../data/user.js'; -import { publicChannelName, privateChannelName } from '../../data/channel.js'; -import { targetUser, imgURL } from '../../data/interactions.js'; -import { - checkIfUserIsValid, - publicChannelCreated, - privateChannelCreated, - directMessageCreated, - setPublicChannelCreated, - setPrivateChannelCreated, - setDirectMessageCreated, -} from '../../data/checks'; -import { updatePermission } from '../../data/permissions.helper'; -import { api, getCredentials, credentials, request } from '../../data/api-data'; -import { createUser, login } from '../../data/users.helper'; - -// Test data -const message = `message from ${username}`; -let testDMUsername; - -function messagingTest(currentTest) { - describe('Normal message:', () => { - it('it should send a message', () => { - mainContent.sendMessage(message); - }); - - it('it should show the last message', () => { - mainContent.lastMessage.should('be.visible'); - }); - - if (currentTest !== 'direct') { - it('it should be that the last message is from the logged user', () => { - mainContent.lastMessage.should('contain', username); - }); - } - - if (currentTest === 'general') { - it('it should not show the Admin tag', () => { - mainContent.lastMessageUserTag.should('not.exist'); - }); - } - }); - - describe.skip('fileUpload:', () => { - after(() => {}); - it('it should send a attachment', () => { - mainContent.fileUpload(imgURL); - }); - - it('it should show the confirm button', () => { - Global.modalConfirm.should('be.visible'); - }); - - it('it should show the cancel button', () => { - Global.modalCancel.should('be.visible'); - }); - - it('it should show the file preview', () => { - Global.modalFilePreview.should('be.visible'); - }); - - it('it should show the confirm button', () => { - Global.modalConfirm.should('be.visible'); - }); - - it('it should show the file title', () => { - Global.modalFileTitle.should('be.visible'); - }); - - it('it should show the file name input', () => { - Global.modalFileName.should('be.visible'); - }); - - it('it should fill the file name input', () => { - Global.modalFileName.type('File Name'); - }); - - it('it should show the file name input', () => { - Global.modalFileDescription.should('be.visible'); - }); - - it('it should fill the file name input', () => { - Global.modalFileDescription.type('File Description'); - }); - - it('it should click the confirm', () => { - Global.modalConfirm.click(); - Global.modalConfirm.waitForVisible(5000, true); - }); - - it('it should show the file in the message', () => { - mainContent.lastMessageDesc.waitForVisible(10000); - mainContent.lastMessageDesc.getText().should.equal('File Description'); - }); - }); -} - -function grantCreateDPermission() { - return new Promise((resolve) => { - getCredentials(() => { - updatePermission('create-d', ['user']).then(resolve); - }); - }); -} - -function revokeCreateDPermission() { - return new Promise((resolve) => { - getCredentials(() => { - updatePermission('create-d', []).then(resolve); - }); - }); -} - -function toggleOpenMessageActionMenu() { - mainContent.closeMessageActionMenu(); - mainContent.openMessageActionMenu(); -} - -function createDMUserAndPost(testChannel, done) { - getCredentials(() => { - createUser().then((createdUser) => { - testDMUsername = createdUser.username; - - request - .post(api('users.setActiveStatus')) - .set(credentials) - .send({ - activeStatus: true, - userId: createdUser._id, - }) - .then(() => { - login(testDMUsername, password).then((userCredentials) => { - request - .post(api('chat.postMessage')) - .set(userCredentials) - .send({ - channel: testChannel, - text: 'Message from Test DM user', - }) - .end(done); - }); - }); - }); - }); -} - -function leaveTestDM() { - // Leave the existing DM - const dmElement = sideNav.getChannelFromList(testDMUsername).scrollIntoView().rightclick().wait(800); - dmElement.closest('.rcx-sidebar-item--clickable').find('.rcx-sidebar-item__menu-wrapper > button').click(); - sideNav.popOverHideOption.click(); - - Global.modal.should('be.visible'); - Global.modalConfirm.click(); -} - -function messageActionsTest(currentTest, testChannel) { - describe('[Actions]', () => { - before(() => { - mainContent.sendMessage('Message for Message Actions Tests'); - }); - describe('Render:', () => { - before(() => { - mainContent.openMessageActionMenu(); - }); - - after(() => { - mainContent.closeMessageActionMenu(); - }); - - it('it should show the message action menu', () => { - mainContent.messageActionMenu.should('be.visible'); - }); - - it('it should show the edit action', () => { - mainContent.messageEdit.scrollIntoView().should('be.visible'); - }); - - it('it should show the delete action', () => { - mainContent.messageDelete.scrollIntoView().should('be.visible'); - }); - - it('it should show the permalink action', () => { - mainContent.messagePermalink.scrollIntoView().should('be.visible'); - }); - - it('it should show the copy action', () => { - mainContent.messageCopy.scrollIntoView().should('be.visible'); - }); - - it('it should show the quote the action', () => { - mainContent.messageQuote.scrollIntoView().should('be.visible'); - }); - - it('it should show the star action', () => { - mainContent.messageStar.scrollIntoView().should('be.visible'); - }); - - if (currentTest === 'general') { - it('it should not show the pin action', () => { - mainContent.messagePin.should('not.exist'); - }); - } - - it('it should not show the mark as unread action', () => { - mainContent.messageUnread.should('not.exist'); - }); - - if (currentTest === 'direct') { - it('it should not show the Reply to DM action', () => { - mainContent.messageReplyInDM.should('not.exist'); - }); - } else if (currentTest !== 'private') { - context('when the channel last message was posted by someone else', () => { - before((done) => { - revokeCreateDPermission().then(() => { - createDMUserAndPost(testChannel, done); - }); - }); - - it('it should not show the Reply to DM action', () => { - toggleOpenMessageActionMenu(); - // We don't have the test DM user in a DM channel or have the `create-d` permission - mainContent.messageReplyInDM.should('not.exist'); - }); - - context('when the user has permission to create DMs', () => { - before(() => grantCreateDPermission()); - after(() => revokeCreateDPermission()); - - it('it should show the Reply to DM action', () => { - toggleOpenMessageActionMenu(); - - mainContent.messageReplyInDM.should('be.visible'); - }); - }); - - context('when the user already has a created DM', () => { - // Grant Create DM permission, create a DM, then revoke the permission - before(() => grantCreateDPermission()); - - before(() => { - mainContent.closeMessageActionMenu(); - sideNav.spotlightSearchIcon.click(); - sideNav.searchChannel(testDMUsername); - }); - - before(() => revokeCreateDPermission()); - - before(() => { - sideNav.openChannel(testChannel); - mainContent.openMessageActionMenu(); - }); - - after(() => { - mainContent.closeMessageActionMenu(); - leaveTestDM(); - }); - - it('it should show the Reply to DM action', () => { - mainContent.messageReplyInDM.should('be.visible'); - }); - }); - }); - } - }); - - describe('[Usage]', () => { - describe('Reply:', () => { - it('it should reply the message', () => { - toggleOpenMessageActionMenu(); - - mainContent.selectAction('reply'); - flexTab.sendBtn.click(); - }); - - it('it should check if the message was replied', () => { - mainContent.beforeLastMessageQuote.then(($el) => { - const text = $el.data('id'); - mainContent.lastMessageQuote.should('has.attr', 'data-tmid', text); - }); - flexTab.threadTab.click(); - }); - }); - - describe('Edit:', () => { - before(() => { - mainContent.sendMessage('Message for Message edit Tests'); - mainContent.openMessageActionMenu(); - }); - - it('it should edit the message', () => { - mainContent.selectAction('edit'); - mainContent.sendBtn.click(); - }); - }); - - describe('Delete:', () => { - before(() => { - mainContent.sendMessage('Message for Message Delete Tests'); - mainContent.openMessageActionMenu(); - }); - - it('it should delete the message', () => { - mainContent.selectAction('delete'); - Global.modalConfirm.click(); - Global.modalOverlay.should('not.exist'); - }); - - it('it should not show the deleted message', () => { - mainContent.lastMessage.should('not.contain', 'Message for Message Delete Tests'); - }); - }); - - describe('Quote:', () => { - const message = `Message for quote Tests - ${Date.now()}`; - - before(() => { - mainContent.sendMessage(message); - mainContent.openMessageActionMenu(); - }); - - it('it should quote the message', () => { - mainContent.selectAction('quote'); - mainContent.sendBtn.click(); - mainContent.waitForLastMessageTextAttachmentEqualsText(message); - }); - }); - - describe('Star:', () => { - before(() => { - mainContent.sendMessage('Message for star Tests'); - mainContent.openMessageActionMenu(); - }); - - it('it should star the message', () => { - mainContent.selectAction('star'); - }); - }); - - describe('Copy:', () => { - before(() => { - mainContent.sendMessage('Message for copy Tests'); - mainContent.openMessageActionMenu(); - }); - - it('it should copy the message', () => { - mainContent.selectAction('copy'); - }); - }); - - describe('Permalink:', () => { - before(() => { - mainContent.sendMessage('Message for permalink Tests'); - mainContent.openMessageActionMenu(); - }); - - it('it should permalink the message', () => { - mainContent.selectAction('permalink'); - }); - }); - }); - }); -} - -describe('[Message]', () => { - before(() => { - checkIfUserIsValid(username, email, password); - }); - - describe('[GENERAL Channel]', () => { - before(() => { - sideNav.spotlightSearchIcon.click(); - sideNav.searchChannel('general'); - }); - messagingTest('general'); - messageActionsTest('general', 'general'); - }); - - describe('[Public Channel]', () => { - before(() => { - if (!publicChannelCreated) { - sideNav.createChannel(publicChannelName, false, false); - setPublicChannelCreated(true); - console.log(' public channel not found, creating one...'); - } - sideNav.openChannel(publicChannelName); - }); - messagingTest('public'); - messageActionsTest('public', publicChannelName); - }); - - describe('[Private Channel]', () => { - before(() => { - if (!privateChannelCreated) { - sideNav.createChannel(privateChannelName, true, false); - setPrivateChannelCreated(true); - console.log(' private channel not found, creating one...'); - } - sideNav.openChannel(privateChannelName); - }); - messagingTest('private'); - messageActionsTest('private', privateChannelName); - }); - - describe('[Direct Message]', () => { - before(() => { - if (!directMessageCreated) { - sideNav.spotlightSearchIcon.click(); - sideNav.searchChannel(targetUser); - setDirectMessageCreated(true); - console.log(' Direct message not found, creating one...'); - } - sideNav.openChannel(targetUser); - }); - messagingTest('direct'); - messageActionsTest('direct'); - }); -}); diff --git a/apps/meteor/tests/cypress/integration/07-emoji.spec.js b/apps/meteor/tests/cypress/integration/07-emoji.spec.js deleted file mode 100644 index 6d52bc7fc4780dbc35fcb7e23f01789cd1fd3670..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/integration/07-emoji.spec.js +++ /dev/null @@ -1,147 +0,0 @@ -import mainContent from '../pageobjects/main-content.page'; -import sideNav from '../pageobjects/side-nav.page'; -import { username, email, password } from '../../data/user.js'; -import { checkIfUserIsValid } from '../../data/checks'; - -describe('[Emoji]', () => { - before(() => { - checkIfUserIsValid(username, email, password); - sideNav.spotlightSearchIcon.click(); - sideNav.searchChannel('general'); - }); - - describe('Render:', () => { - before(() => { - mainContent.emojiBtn.click(); - }); - - after(() => { - mainContent.emojiSmile.first().click(); - mainContent.setTextToInput(''); - }); - - it('it should show the emoji picker menu', () => { - mainContent.emojiPickerMainScreen.should('be.visible'); - }); - - it('it should click the emoji picker people tab', () => { - mainContent.emojiPickerPeopleIcon.click(); - }); - - it('it should show the emoji picker people tab', () => { - mainContent.emojiPickerPeopleIcon.should('be.visible'); - }); - - it('it should show the emoji picker nature tab', () => { - mainContent.emojiPickerNatureIcon.should('be.visible'); - }); - - it('it should show the emoji picker food tab', () => { - mainContent.emojiPickerFoodIcon.should('be.visible'); - }); - - it('it should show the emoji picker activity tab', () => { - mainContent.emojiPickerActivityIcon.should('be.visible'); - }); - - it('it should show the emoji picker travel tab', () => { - mainContent.emojiPickerTravelIcon.should('be.visible'); - }); - - it('it should show the emoji picker objects tab', () => { - mainContent.emojiPickerObjectsIcon.should('be.visible'); - }); - - it('it should show the emoji picker symbols tab', () => { - mainContent.emojiPickerSymbolsIcon.should('be.visible'); - }); - - it('it should show the emoji picker flags tab', () => { - mainContent.emojiPickerFlagsIcon.should('be.visible'); - }); - - it('it should show the emoji picker custom tab', () => { - mainContent.emojiPickerCustomIcon.should('be.visible'); - }); - - it('it should show the emoji picker change tone button', () => { - mainContent.emojiPickerChangeTone.should('be.visible'); - }); - - it('it should show the emoji picker search bar', () => { - mainContent.emojiPickerFilter.should('be.visible'); - }); - }); - - describe('[Usage]', () => { - describe('send emoji via screen:', () => { - before(() => { - mainContent.emojiBtn.click(); - mainContent.emojiPickerPeopleIcon.click(); - }); - - it('it should select a grinning emoji', () => { - mainContent.emojiGrinning.first().click(); - }); - - it('it should be that the value on the message input is the same as the emoji clicked', () => { - mainContent.messageInput.should('have.value', ':grinning: '); - }); - - it('it should send the emoji', () => { - mainContent.addTextToInput(' '); - mainContent.sendBtn.click(); - }); - - it('it should be that the value on the message is the same as the emoji clicked', () => { - mainContent.lastMessage.should('contain', '😀'); - }); - }); - - describe('send emoji via text:', () => { - it('it should add emoji text to the message input', () => { - mainContent.addTextToInput(':smile'); - }); - - it('it should show the emoji popup bar', () => { - mainContent.messagePopUp.should('be.visible'); - }); - - it('it should be that the emoji popup bar title is emoji', () => { - mainContent.messagePopUpTitle.should('contain', 'Emoji'); - }); - - it('it should show the emoji popup bar items', () => { - mainContent.messagePopUpItems.should('be.visible'); - }); - - it('it should click the first emoji on the popup list', () => { - mainContent.messagePopUpFirstItem.click(); - }); - - it('it should be that the value on the message input is the same as the emoji clicked', () => { - mainContent.messageInput.should('have.value', ':smile: '); - }); - - it('it should send the emoji', () => { - mainContent.sendBtn.click(); - }); - - it('it should be that the value on the message is the same as the emoji clicked', () => { - mainContent.lastMessage.should('contain', '😄'); - }); - }); - - describe("send texts and make sure they're not converted to emojis:", () => { - it('should render numbers', () => { - mainContent.sendMessage('0 1 2 3 4 5 6 7 8 9'); - mainContent.waitForLastMessageEqualsHtml('0 1 2 3 4 5 6 7 8 9'); - }); - - it('should render special characters', () => { - mainContent.sendMessage('® * © â„¢ #'); - mainContent.waitForLastMessageEqualsHtml('® * © â„¢ #'); - }); - }); - }); -}); diff --git a/apps/meteor/tests/cypress/integration/08-resolutions.spec.js b/apps/meteor/tests/cypress/integration/08-resolutions.spec.js deleted file mode 100644 index 3c5b431d8beacced85e860f2609f439cb99c3ad3..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/integration/08-resolutions.spec.js +++ /dev/null @@ -1,92 +0,0 @@ -import Global from '../pageobjects/global'; -import mainContent from '../pageobjects/main-content.page'; -import sideNav from '../pageobjects/side-nav.page'; -import { username, email, password } from '../../data/user.js'; -import { checkIfUserIsValid } from '../../data/checks'; - -// skipping this since the main content its not moved anymore, instead there is a overlay of the side nav over the main content -describe('[Resolution]', () => { - describe('[Mobile Render]', () => { - before(() => { - checkIfUserIsValid(username, email, password); - }); - - beforeEach(() => { - Global.setWindowSize(650, 800); - cy.wait(500); - }); - - after(() => { - Global.setWindowSize(1600, 1600); - // cy.wait(500); - sideNav.spotlightSearchIcon.should('be.visible'); - }); - - it('it should close the sidenav', () => { - mainContent.mainContent.should('be.visible').getLocation().its('x').should('be.equal', 0); - sideNav.sideNavBar.should('not.have.attr', 'data-qa-opened', 'false'); - }); - - describe('moving elements:', () => { - beforeEach(() => { - sideNav.sideNavBar - .parent() - .find('.sidebar') - .then((el) => { - if (!el[0].hasAttribute('data-qa-opened')) { - sideNav.burgerBtn.click({ force: true }); - } - }); - - cy.waitUntil(() => { - return browser.element('.menu-opened').then((el) => el.length); - }); - }); - - it('it should open the sidenav', () => { - cy.waitUntil(() => { - return browser.element('.menu-opened').then((el) => el.length); - }); - mainContent.mainContent.should('be.visible').getLocation().its('x').should('be.equal', 0); - sideNav.sideNavBar.should('have.attr', 'data-qa-opened', 'true'); - }); - - it('it should not close sidebar on pressing the sidebar item menu', () => { - sideNav.firstSidebarItemMenu.click({ force: true }); - cy.wait(800); - mainContent.mainContent.should('be.visible').getLocation().its('x').should('be.equal', 0); - sideNav.sideNavBar.should('have.attr', 'data-qa-opened', 'true'); - sideNav.firstSidebarItemMenu.click({ force: true }); - cy.wait(800); - }); - - it('it should close the sidenav when open general channel', () => { - sideNav.openChannel('general'); - cy.wait(1200); - sideNav.sideNavBar.should('not.have.attr', 'data-qa-opened'); - }); - - // Skipped because it's not closing sidebar after opening an item - describe.skip('Preferences', () => { - it('it should open the user preferences screen', () => { - sideNav.sidebarUserMenu.click(); - sideNav.account.click(); - }); - - it('it should close the sidenav when press the preferences link', () => { - sideNav.preferences.click(); - sideNav.sideNavBar.should('not.have.attr', 'data-qa-opened'); - }); - - it('it should close the sidenav when press the profile link', () => { - sideNav.profile.click(); - sideNav.sideNavBar.should('not.have.attr', 'data-qa-opened'); - }); - - it('it should close the preferences nav', () => { - sideNav.preferencesClose.click(); - }); - }); - }); - }); -}); diff --git a/apps/meteor/tests/cypress/integration/09-channel.spec.js b/apps/meteor/tests/cypress/integration/09-channel.spec.js deleted file mode 100644 index 7a88f0b0cb230e95fef6a5684aafc27ee7c4b2d4..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/integration/09-channel.spec.js +++ /dev/null @@ -1,359 +0,0 @@ -import flexTab from '../pageobjects/flex-tab.page'; -import mainContent from '../pageobjects/main-content.page'; -import sideNav from '../pageobjects/side-nav.page'; -import Global from '../pageobjects/global'; -import { username, email, password } from '../../data/user.js'; -import { checkIfUserIsValid, publicChannelCreated, setPublicChannelCreated } from '../../data/checks'; -import { publicChannelName } from '../../data/channel.js'; -import { targetUser } from '../../data/interactions.js'; - -describe('[Channel]', () => { - before(() => { - checkIfUserIsValid(username, email, password); - if (!publicChannelCreated) { - sideNav.createChannel(publicChannelName, false, false); - setPublicChannelCreated(true); - console.log('public channel not found, creating one...'); - } - sideNav.openChannel('general'); - }); - describe('[Search]', () => { - describe('[SpotlightSearch]', () => { - describe('rocket.cat:', () => { - it('it should search rocket cat', () => { - sideNav.spotlightSearchIcon.click(); - sideNav.searchChannel('rocket.cat'); - }); - - it('it should start a direct message with rocket.cat', () => { - mainContent.channelTitle.should('contain', 'rocket.cat'); - }); - }); - - describe('general:', () => { - it('it should search general', () => { - sideNav.spotlightSearchIcon.click(); - sideNav.searchChannel('general'); - }); - - it('it should go to general', () => { - mainContent.channelTitle.should('contain', 'general'); - }); - }); - - describe('user created channel:', () => { - it('it should search the user created channel', () => { - sideNav.spotlightSearchIcon.click(); - sideNav.searchChannel(publicChannelName); - }); - - it('it should go to the user created channel', () => { - mainContent.channelTitle.should('contain', publicChannelName); - }); - }); - }); - - describe('[SideNav Channel List]', () => { - before(() => { - mainContent.messageInput.click(); - }); - describe('rocket.cat:', () => { - it('it should show the rocket cat in the direct messages list', () => { - sideNav.getChannelFromList('rocket.cat').scrollIntoView().should('be.visible'); - }); - - it('it should go to the rocket cat direct message', () => { - sideNav.openChannel('rocket.cat'); - }); - }); - - describe('general:', () => { - it('it should show the general in the channel list', () => { - sideNav.getChannelFromList('general').scrollIntoView().should('be.visible'); - }); - - it('it should go to the general channel', () => { - sideNav.openChannel('general'); - }); - }); - - describe('user created channel:', () => { - it('it should show the user created channel in the channel list', () => { - sideNav.getChannelFromList(publicChannelName).scrollIntoView().should('be.visible'); - }); - - it('it should go to the user created channel', () => { - sideNav.openChannel(publicChannelName); - }); - }); - }); - }); - - describe.skip('[Usage]', () => { - before(() => { - sideNav.openChannel(publicChannelName); - }); - - describe('Adding a user to the room:', () => { - before(() => { - if (Global.toastAlert.isVisible()) { - Global.dismissToast(); - } - flexTab.operateFlexTab('members', true); - }); - - after(() => { - if (Global.toastAlert.isVisible()) { - Global.dismissToast(); - } - flexTab.operateFlexTab('members', false); - }); - - it('it should add people to the room', () => { - flexTab.addPeopleToChannel(targetUser); - }); - }); - - describe('Channel settings:', () => { - describe('Channel name edit', () => { - before(() => { - if (Global.toastAlert.isVisible()) { - Global.dismissToast(); - } - flexTab.operateFlexTab('info', true); - }); - - after(() => { - if (Global.toastAlert.isVisible()) { - Global.dismissToast(); - } - flexTab.operateFlexTab('info', false); - }); - - it('it should show the old name', () => { - flexTab.firstSetting.getText().should.equal(publicChannelName); - }); - - it('it should click the edit name', () => { - flexTab.editNameBtn.click(); - }); - - it('it should edit the name input', () => { - flexTab.editNameTextInput.type(`NAME-EDITED-${publicChannelName}`); - }); - - it('it should save the name', () => { - flexTab.editNameSave.click(); - }); - - it('it should show the new name', () => { - const channelName = sideNav.getChannelFromList(`NAME-EDITED-${publicChannelName}`); - channelName.getText().should.equal(`NAME-EDITED-${publicChannelName}`); - }); - }); - - describe('Channel topic edit', () => { - before(() => { - flexTab.operateFlexTab('info', true); - }); - - after(() => { - if (Global.toastAlert.isVisible()) { - Global.dismissToast(); - } - flexTab.operateFlexTab('info', false); - }); - - it('it should click the edit topic', () => { - flexTab.editTopicBtn.click(); - }); - - it('it should edit the topic input', () => { - flexTab.editTopicTextInput.type('TOPIC EDITED'); - }); - - it('it should save the topic', () => { - flexTab.editNameSave.click(); - }); - - it('it should show the new topic', () => { - flexTab.secondSetting.getText().should.equal('TOPIC EDITED'); - }); - }); - - describe('Channel announcement edit', () => { - before(() => { - flexTab.operateFlexTab('info', true); - }); - - after(() => { - if (Global.toastAlert.isVisible()) { - Global.dismissToast(); - } - flexTab.operateFlexTab('info', false); - }); - - it('it should click the edit announcement', () => { - flexTab.editAnnouncementBtn.click(); - }); - - it('it should edit the announcement input', () => { - flexTab.editAnnouncementTextInput.type('ANNOUNCEMENT EDITED'); - }); - - it('it should save the announcement', () => { - flexTab.editNameSave.click(); - }); - - it('it should show the new announcement', () => { - flexTab.thirdSetting.getText().should.equal('ANNOUNCEMENT EDITED'); - }); - }); - - describe('Channel description edit', () => { - before(() => { - flexTab.operateFlexTab('info', true); - }); - - after(() => { - if (Global.toastAlert.isVisible()) { - Global.dismissToast(); - } - flexTab.operateFlexTab('info', false); - }); - - it('it should click the edit description', () => { - flexTab.editDescriptionBtn.click(); - }); - - it('it should edit the description input', () => { - flexTab.editDescriptionTextInput.type('DESCRIPTION EDITED'); - }); - - it('it should save the description', () => { - flexTab.editNameSave.click(); - }); - - it('it should show the new description', () => { - flexTab.fourthSetting.getText().should.equal('DESCRIPTION EDITED'); - }); - }); - }); - - describe('Members tab usage:', () => { - describe('User muted', () => { - before(() => { - flexTab.operateFlexTab('members', true); - }); - - after(() => { - flexTab.operateFlexTab('members', false); - }); - - it('it should mute rocket cat', () => { - flexTab.muteUser(targetUser); - }); - }); - - describe('Owner added', () => { - before(() => { - if (Global.toastAlert.isVisible()) { - Global.dismissToast(); - } - flexTab.operateFlexTab('members', true); - }); - - after(() => { - if (Global.toastAlert.isVisible()) { - Global.dismissToast(); - } - flexTab.operateFlexTab('members', false); - }); - - it('it should set rocket cat as owner', () => { - flexTab.setUserOwner(targetUser); - }); - - it('it should dismiss the toast', () => { - if (Global.toastAlert.isVisible()) { - Global.dismissToast(); - } - }); - - it('it should the last message should be a subscription role added', () => { - mainContent.lastMessageRoleAdded.should('be.visible'); - }); - - it('it should show the target username in owner add message', () => { - mainContent.lastMessage.getText().should.have.string(targetUser); - }); - }); - - describe('Moderator added', () => { - before(() => { - if (Global.toastAlert.isVisible()) { - Global.dismissToast(); - } - flexTab.operateFlexTab('members', true); - }); - - after(() => { - if (Global.toastAlert.isVisible()) { - Global.dismissToast(); - } - flexTab.operateFlexTab('members', false); - }); - - it('it should set rocket cat as moderator', () => { - flexTab.setUserModerator(targetUser); - }); - - it('it should dismiss the toast', () => { - if (Global.toastAlert.isVisible()) { - Global.dismissToast(); - } - }); - - it('it should be that the last message is a subscription role added', () => { - mainContent.lastMessageRoleAdded.should('be.visible'); - }); - - it('it should show the target username in moderator add message', () => { - mainContent.lastMessage.getText().should.have.string(targetUser); - }); - }); - - // no channel quit at the moment - describe.skip('channel quit and enter', () => { - it('it should leave the channel', () => { - const channel = sideNav.getChannelFromList(`NAME-EDITED-${publicChannelName}`); - channel.click(); - channel.moveToObject(); - sideNav.channelLeave.click(); - }); - - it('it should show the modal alert popup', () => { - Global.modal.should('be.visible'); - Global.modalConfirm.should('be.visible'); - }); - - it('it should close the popup', () => { - Global.confirmPopup(); - }); - - it('it should not show the channel on the list', () => { - sideNav.getChannelFromList(`NAME-EDITED-${publicChannelName}`).should('not.exist'); - }); - - it('it should search and enter the channel with the spotlight', () => { - sideNav.searchChannel(`NAME-EDITED-${publicChannelName}`); - mainContent.joinChannelBtn.click(); - }); - - it('it should show the channel on the list', () => { - sideNav.getChannelFromList(`NAME-EDITED-${publicChannelName}`).should('be.visible'); - }); - }); - }); - }); -}); diff --git a/apps/meteor/tests/cypress/integration/10-user-preferences.spec.js b/apps/meteor/tests/cypress/integration/10-user-preferences.spec.js deleted file mode 100644 index f8461080c73f5693ad7a3607560c1a27e2ee4255..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/integration/10-user-preferences.spec.js +++ /dev/null @@ -1,148 +0,0 @@ -import flexTab from '../pageobjects/flex-tab.page'; -import mainContent from '../pageobjects/main-content.page'; -import sideNav from '../pageobjects/side-nav.page'; -import preferencesMainContent from '../pageobjects/preferences-main-content.page'; -import admin from '../pageobjects/administration.page'; -import { username, password, email, adminUsername, adminEmail, adminPassword } from '../../data/user.js'; -import { checkIfUserIsValid } from '../../data/checks'; - -describe('[User Preferences]', () => { - describe('default', () => { - before(() => { - checkIfUserIsValid(username, email, password); - sideNav.sidebarUserMenu.click(); - sideNav.account.click(); - }); - - describe('render:', () => { - it('it should show the preferences link', () => { - sideNav.preferences.should('be.visible'); - }); - - it('it should show the profile link', () => { - sideNav.profile.should('be.visible'); - }); - - it('it should click on the profile link', () => { - sideNav.profile.click(); - }); - - it('it should show the username input', () => { - preferencesMainContent.userNameTextInput.should('be.visible'); - }); - - it('it should show the real name input', () => { - preferencesMainContent.realNameTextInput.should('be.visible'); - }); - - it('it should show the email input', () => { - preferencesMainContent.emailTextInput.scrollIntoView().should('be.visible'); - }); - - it('it should show the password input', () => { - preferencesMainContent.passwordTextInput.scrollIntoView().should('be.visible'); - }); - - it('it should show the submit button', () => { - preferencesMainContent.submitBtn.should('be.visible').should('be.disabled'); - }); - }); - - describe('user info change:', () => { - it('it should click on the profile link', () => { - sideNav.profile.click(); - }); - - it('it should change the name field', () => { - preferencesMainContent.changeRealName(`EditedRealName${username}`); - }); - - it('it should change the Username field', () => { - preferencesMainContent.changeUsername(`EditedUserName${username}`); - }); - - it.skip('it should change the email field', () => { - preferencesMainContent.changeEmail(`EditedUserEmail${username}@gmail.com`); - }); - - it.skip('it should put the password in the modal input', () => { - preferencesMainContent.acceptPasswordOverlay(password); - }); - - it('it should save the settings', () => { - preferencesMainContent.saveChanges(); - }); - - it.skip('it should put the password in the modal input', () => { - preferencesMainContent.acceptPasswordOverlay(password); - }); - - it('it should close the preferences menu', () => { - sideNav.preferencesClose.click(); - sideNav.getChannelFromList('general').scrollIntoView().click(); - }); - - it('it should send a message to be tested', () => { - mainContent.sendMessage('HI'); - mainContent.waitForLastMessageEqualsText('HI'); - }); - - it.skip('it should be that the name on the last message is the edited one', () => { - mainContent.waitForLastMessageUserEqualsText(`EditedUserName${username}`); - mainContent.lastMessageUser.getText().should.equal(`EditedUserName${username}`); - }); - - it.skip('it should be that the user name on the members flex tab is the edited one', () => { - mainContent.lastMessageUser.click(); - flexTab.memberUserName.getText().should.equal(`EditedUserName${username}`); - }); - - it.skip('it should that the real name on the members flex tab is the edited one', () => { - flexTab.memberRealName.getText().should.equal(`EditedRealName${username}`); - }); - }); - }); - - describe('admin', () => { - describe.skip('user info change forbidden:', () => { - before(() => { - checkIfUserIsValid(adminUsername, adminEmail, adminPassword); - admin.open('admin/Accounts'); - admin.accountsRealNameChangeFalse.click(); - admin.adminSaveChanges(); - admin.accountsUsernameChangeFalse.click(); - admin.adminSaveChanges(); - admin.settingsSearch.type(''); - sideNav.preferencesClose.click(); - }); - - after(() => { - admin.open('admin/Accounts'); - admin.accountsRealNameChangeTrue.click(); - admin.adminSaveChanges(); - admin.accountsUsernameChangeTrue.click(); - admin.adminSaveChanges(); - admin.settingsSearch.type(''); - sideNav.preferencesClose.click(); - }); - - it('it should open profile', () => { - sideNav.accountMenu.click(); - sideNav.account.click(); - sideNav.profile.click(); - }); - - it('it should be that the name field is disabled', () => { - preferencesMainContent.realNameTextInputEnabled().should.be.false; - }); - - it('it should be that the Username field is disabled', () => { - preferencesMainContent.userNameTextInputEnabled().should.be.false; - }); - - it('it should close profile', () => { - sideNav.preferencesClose.click(); - }); - }); - }); -}); diff --git a/apps/meteor/tests/cypress/integration/11-admin.spec.js b/apps/meteor/tests/cypress/integration/11-admin.spec.js deleted file mode 100644 index edc654836036e319fe9ad1803fa09f88962e8277..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/integration/11-admin.spec.js +++ /dev/null @@ -1,838 +0,0 @@ -import sideNav from '../pageobjects/side-nav.page'; -import flexTab from '../pageobjects/flex-tab.page'; -import admin from '../pageobjects/administration.page'; -import { checkIfUserIsValid } from '../../data/checks'; -import { adminUsername, adminEmail, adminPassword } from '../../data/user.js'; - -describe('[Administration]', () => { - before(() => { - checkIfUserIsValid(adminUsername, adminEmail, adminPassword); - }); - - after(() => { - sideNav.preferencesClose.click(); - }); - - describe('[Admin View]', () => { - before(() => { - sideNav.sidebarUserMenu.click(); - }); - - it('it should enter the admin view', () => { - sideNav.admin.click(); - }); - - describe('info:', () => { - before(() => { - admin.infoLink.click(); - }); - - it('should show Deployment box', () => { - admin.infoDeployment.should('be.visible'); - }); - - it('should show License box', () => { - admin.infoLicense.should('be.visible'); - }); - - it('should show Usage box', () => { - admin.infoUsage.should('be.visible'); - }); - - it('should show Federation box', () => { - admin.infoFederation.scrollIntoView().should('be.visible'); - }); - }); - - describe.skip('[Rooms]', () => { - before(() => { - admin.roomsLink.click(); - }); - - after(() => { - admin.infoLink.click(); - }); - - describe('render:', () => { - it('it should show the search form', () => { - admin.roomsSearchForm.should('be.visible'); - }); - - it('it should show the rooms Filter', () => { - admin.roomsFilter.should('be.visible'); - }); - - it('it should show the channel checkbox', () => { - admin.roomsChannelsCheckbox.should('be.visible'); - }); - - it('it should show the direct message checkbox', () => { - admin.roomsDirectCheckbox.should('be.visible'); - }); - - it('it should show the Private channel checkbox', () => { - admin.roomsPrivateCheckbox.should('be.visible'); - }); - - it('it should show the general channel', () => { - admin.roomsGeneralChannel.should('be.visible'); - }); - }); - - describe('filter text:', () => { - before(() => { - admin.roomsFilter.click(); - admin.roomsFilter.type('general'); - }); - - after(() => { - admin.roomsFilter.click(); - admin.roomsFilter.type(''); - }); - - it('it should show the general channel', () => { - admin.roomsGeneralChannel.should('be.visible'); - }); - }); - - describe('filter text with wrong channel:', () => { - before(() => { - admin.roomsFilter.click(); - admin.roomsFilter.type('something else'); - }); - - after(() => { - admin.roomsFilter.click(); - admin.roomsFilter.type(''); - }); - - it('it should not show the general channel', () => { - admin.roomsGeneralChannel.should('not.exist'); - }); - }); - - describe('filter checkbox:', () => { - let checkbox = 1; - before(() => { - admin.roomsFilter.type(''); - // add value triggers a key event that changes search±±±±±±±±± - admin.roomsFilter.addValue(' '); - admin.roomsGeneralChannel.waitForVisible(5000); - }); - beforeEach(() => { - switch (checkbox) { - case 1: - admin.roomsChannelsCheckbox.click(); - break; - case 2: - admin.roomsDirectCheckbox.click(); - break; - case 3: - admin.roomsPrivateCheckbox.click(); - break; - } - }); - - afterEach(() => { - switch (checkbox) { - case 1: - admin.roomsChannelsCheckbox.click(); - checkbox++; - break; - case 2: - admin.roomsDirectCheckbox.click(); - checkbox++; - break; - case 3: - admin.roomsPrivateCheckbox.click(); - break; - } - }); - - it('it should show the general channel', () => { - admin.roomsGeneralChannel.should('be.visible'); - }); - - it('it should not show the general channel', () => { - admin.roomsGeneralChannel.should('not.exist'); - }); - - it('it should not show the general channel', () => { - admin.roomsGeneralChannel.should('not.exist'); - }); - }); - }); - - describe.skip('[Users]', () => { - before(() => { - admin.usersLink.waitForVisible(5000); - admin.usersLink.click(); - admin.usersFilter.waitForVisible(5000); - }); - - after(() => { - admin.infoLink.click(); - }); - - it('it should show the search form', () => { - admin.usersFilter.should('be.visible'); - }); - - it('it should show rocket.cat', () => { - // it cant find the user if there is too many users - admin.usersRocketCat.should('be.visible'); - }); - - describe('filter text:', () => { - before(() => { - admin.usersFilter.click(); - admin.usersFilter.type('Rocket.Cat'); - }); - - after(() => { - admin.usersFilter.click(); - admin.usersFilter.type(''); - }); - - it('it should show rocket.cat', () => { - admin.usersRocketCat.waitForVisible(); - admin.usersRocketCat.should('be.visible'); - }); - }); - - describe('filter text with wrong user:', () => { - before(() => { - admin.usersFilter.click(); - admin.usersFilter.type('something else'); - }); - - after(() => { - admin.usersFilter.click(); - admin.usersFilter.type(''); - }); - - it('it should not show rocket.cat', () => { - admin.usersRocketCat.should('not.exist'); - }); - }); - - describe('[Flex Tab] ', () => { - describe('send invitation:', () => { - before(() => { - flexTab.usersSendInvitationTab.waitForVisible(5000); - flexTab.usersSendInvitationTab.click(); - flexTab.usersSendInvitationTextArea.waitForVisible(5000); - }); - - after(() => { - flexTab.usersSendInvitationTab.waitForVisible(5000); - flexTab.usersSendInvitationTab.click(); - flexTab.usersSendInvitationTextArea.waitForVisible(5000, true); - }); - - it('it should show the send invitation text area', () => { - flexTab.usersSendInvitationTextArea.should('be.visible'); - }); - - it('it should show the cancel button', () => { - flexTab.usersButtonCancel.should('be.visible'); - }); - - it('it should show the send button', () => { - flexTab.usersSendInvitationSend.should('be.visible'); - }); - }); - - describe('create user:', () => { - before(() => { - flexTab.usersAddUserTab.waitForVisible(5000); - flexTab.usersAddUserTab.click(); - flexTab.usersAddUserName.waitForVisible(5000); - }); - - after(() => { - flexTab.usersAddUserTab.waitForVisible(5000); - flexTab.usersAddUserTab.click(); - flexTab.usersAddUserName.waitForVisible(5000, true); - }); - - it('it should show the name field', () => { - flexTab.usersAddUserName.should('be.visible'); - }); - - it('it should show the username field', () => { - flexTab.usersAddUserUsername.should('be.visible'); - }); - - it('it should show the email field', () => { - flexTab.usersAddUserEmail.should('be.visible'); - }); - - it('it should show the verified checkbox', () => { - flexTab.usersAddUserVerifiedCheckbox.should('be.visible'); - }); - - it('it should show the password field', () => { - flexTab.usersAddUserPassword.should('be.visible'); - }); - - it('it should show the random password button', () => { - flexTab.usersAddUserRandomPassword.should('be.visible'); - }); - - it('it should show the require password change button', () => { - flexTab.usersAddUserChangePasswordCheckbox.should('be.visible'); - }); - - it('it should show the role dropdown', () => { - flexTab.usersAddUserRoleList.waitForVisible(5000); - flexTab.usersAddUserRoleList.should('be.visible'); - }); - - it('Ãt should show the add role button', () => { - flexTab.usersAddUserRoleButton.waitForVisible(5000); - flexTab.usersAddUserRoleButton.should('be.visible'); - }); - - it('it should show the join default channel checkbox', () => { - flexTab.usersAddUserDefaultChannelCheckbox.should('be.visible'); - }); - - it('it should show the send welcome checkbox', () => { - flexTab.usersAddUserWelcomeEmailCheckbox.should('be.visible'); - }); - - it('it should show the save button', () => { - flexTab.usersButtonSave.should('be.visible'); - }); - - it('it should show the cancel button', () => { - flexTab.usersButtonCancel.should('be.visible'); - }); - }); - }); - }); - - describe('[Roles]', () => { - before(() => { - admin.permissionsLink.click(); - }); - - after(() => { - admin.infoLink.click(); - }); - - it('it should show the permissions grid', () => { - admin.rolesPermissionGrid.should('be.visible'); - }); - - it('it should show the new role button', () => { - admin.rolesNewRolesButton.should('be.visible'); - }); - - it('it should show the admin link', () => { - admin.rolesAdmin.should('be.visible'); - }); - - describe('new role:', () => { - before(() => { - admin.rolesNewRolesButton.click(); - }); - - after(() => { - admin.rolesReturnLink.first().click(); - }); - - it('it should show the return to permissions', () => { - admin.rolesReturnLink.should('be.visible'); - }); - - it('it should show the new role name field', () => { - admin.rolesNewRoleName.should('be.visible'); - }); - - it('it should show the new role description field', () => { - admin.rolesNewRoleDesc.should('be.visible'); - }); - - it('it should show the new role scope', () => { - admin.rolesNewRoleScope.should('be.visible'); - }); - }); - - describe('admin role:', () => { - before(() => { - admin.rolesAdmin.click(); - admin.usersInRole.click(); - }); - - after(() => { - admin.rolesReturnLink.first().click(); - }); - - it('it should show internal admin', () => { - admin.usersInternalAdmin.should('be.visible'); - }); - }); - }); - - describe('[General Settings]', () => { - before(() => { - admin.settingsLink.click(); - admin.settingsSearch.type('general'); - admin.generalSettingsButton.click(); - }); - - describe('general:', () => { - it('it should show site url field', () => { - admin.generalSiteUrl.should('be.visible'); - }); - - it('it should change site url field', () => { - admin.generalSiteUrl.type('something'); - }); - - it('it should show the reset button', () => { - admin.generalSiteUrlReset.scrollIntoView().should('be.visible'); - }); - - it('it should click the reset button', () => { - admin.generalSiteUrlReset.click(); - }); - - it('it should that the site url field is different from the last input', () => { - admin.generalSiteUrl.should('not.contain', 'something'); - }); - - it('it should show site name field', () => { - admin.generalSiteName.should('be.visible'); - }); - - it('it should change site name field', () => { - admin.generalSiteName.type('something'); - }); - - it('it should show the reset button', () => { - admin.generalSiteNameReset.scrollIntoView().should('be.visible'); - }); - - it('it should click the reset button', () => { - admin.generalSiteNameReset.click(); - }); - - it('it should be that the name field is different from the last input', () => { - admin.generalSiteName.should('not.contain', 'something'); - }); - - it('it should show language field', () => { - admin.generalLanguage.should('be.visible'); - }); - - it('it should change the language ', () => { - admin.generalLanguage.click(); - cy.get('.rcx-option__content:contains("English")').scrollIntoView().click(); - }); - - it('it should show the reset button', () => { - admin.generalLanguageReset.scrollIntoView().should('be.visible'); - }); - - it('it should click the reset button', () => { - admin.generalLanguageReset.click(); - }); - - it('it should show invalid self signed certs toggle', () => { - admin.generalSelfSignedCerts.parent().should('be.visible'); - }); - - it('it should change the invalid self signed certs toggle', () => { - admin.generalSelfSignedCerts.parent().click(); - }); - - it('it should show the reset button', () => { - admin.generalSelfSignedCertsReset.should('be.visible'); - }); - - it('it should click the reset button', () => { - admin.generalSelfSignedCertsReset.click(); - }); - - it('it should show favorite rooms checkboxes', () => { - admin.generalFavoriteRoom.scrollIntoView().parent().should('be.visible'); - }); - - it('it should change the favorite rooms toggle', () => { - admin.generalFavoriteRoom.parent().click(); - }); - - it('it should show the reset button', () => { - admin.generalFavoriteRoomReset.scrollIntoView().should('be.visible'); - }); - - it('it should click the reset button', () => { - admin.generalFavoriteRoomReset.click(); - }); - - it('it should show open first channel field', () => { - admin.generalOpenFirstChannel.should('be.visible'); - }); - - it('it should change open first channel field', () => { - admin.generalOpenFirstChannel.type('something'); - }); - - it('it should show the reset button', () => { - admin.generalOpenFirstChannelReset.scrollIntoView().should('be.visible'); - }); - - it('it should click the reset button', () => { - admin.generalOpenFirstChannelReset.click(); - }); - - it('it should show cdn prefix field', () => { - admin.generalCdnPrefix.should('be.visible'); - }); - - it('it should change site url field', () => { - admin.generalCdnPrefix.type('something'); - }); - - it('it should show the reset button', () => { - admin.generalCdnPrefixReset.scrollIntoView().should('be.visible'); - }); - - it('it should click the reset button', () => { - admin.generalCdnPrefixReset.click(); - }); - - it('it should show the force SSL toggle', () => { - admin.generalForceSSL.parent().should('be.visible'); - }); - - it('it should change the force ssl toggle', () => { - admin.generalForceSSL.parent().click(); - }); - - it('it should show the reset button', () => { - admin.generalForceSSLReset.scrollIntoView().should('be.visible'); - }); - - it('it should click the reset button', () => { - admin.generalForceSSLReset.click(); - }); - - it('it should show google tag id field', () => { - admin.generalGoogleTagId.should('be.visible'); - }); - - it('it should change google tag id field', () => { - admin.generalGoogleTagId.type('something'); - }); - - it('it should show the reset button', () => { - admin.generalGoogleTagIdReset.scrollIntoView().should('be.visible'); - }); - - it('it should click the reset button', () => { - admin.generalGoogleTagIdReset.click(); - }); - - it.skip('it should show bugsnag key field', () => { - admin.generalBugsnagKey.should('be.visible'); - }); - - it.skip('it should change bugsnag key id field', () => { - admin.generalBugsnagKey.type('something'); - }); - - it.skip('it should show the reset button', () => { - admin.generalBugsnagKeyReset.scrollIntoView().should('be.visible'); - }); - - it.skip('it should click the reset button', () => { - admin.generalBugsnagKeyReset.click(); - }); - }); - - describe('iframe:', () => { - before(() => { - admin.generalSectionIframeIntegration.find('[aria-expanded="false"]').click(); - admin.generalIframeSend.parent().scrollIntoView(); - }); - - it('it should show iframe send toggle', () => { - admin.generalIframeSend.parent().should('be.visible'); - }); - - it('it should show send origin field', () => { - admin.generalIframeSendTargetOrigin.should('be.visible'); - }); - - it('it should show iframe send toggle', () => { - admin.generalIframeRecieve.parent().should('be.visible'); - }); - - it('it should show send origin field', () => { - admin.generalIframeRecieveOrigin.should('be.visible'); - }); - }); - - describe('notifications:', () => { - before(() => { - admin.generalSectionNotifications.find('[aria-expanded="false"]').click(); - admin.generalNotificationsMaxRoomMembers.scrollIntoView(); - }); - - it('it should show the max room members field', () => { - admin.generalNotificationsMaxRoomMembers.should('be.visible'); - }); - }); - - describe('rest api:', () => { - before(() => { - admin.generalSectionRestApi.find('[aria-expanded="false"]').click(); - admin.generalRestApiUserLimit.scrollIntoView(); - }); - - it('it should show the API user add limit field', () => { - admin.generalRestApiUserLimit.should('be.visible'); - }); - }); - - describe('reporting:', () => { - before(() => { - admin.generalSectionReporting.find('[aria-expanded="false"]').click(); - admin.generalReporting.parent().scrollIntoView(); - }); - - it('it should show the report to rocket.chat toggle', () => { - admin.generalReporting.parent().should('be.visible'); - }); - }); - - describe('stream cast:', () => { - before(() => { - admin.generalSectionStreamCast.find('[aria-expanded="false"]').click(); - admin.generalStreamCastAdress.scrollIntoView(); - }); - - it('it should show the stream cast adress field', () => { - admin.generalStreamCastAdress.should('be.visible'); - }); - }); - - describe('utf8:', () => { - before(() => { - admin.generalSectionUTF8.find('[aria-expanded="false"]').click(); - }); - - it('it should show the usernames utf8 regex field', () => { - admin.generalUTF8UsernamesRegex.scrollIntoView().should('be.visible'); - }); - - it('it should show the channels utf8 regex field', () => { - admin.generalUTF8ChannelsRegex.scrollIntoView().should('be.visible'); - }); - - it('it should show the utf8 names slug checkboxes', () => { - admin.generalUTF8NamesSlug.parent().should('be.visible'); - }); - }); - }); - - describe('[Accounts]', () => { - before(() => { - admin.groupSettingsPageBack.click(); - admin.settingsSearch.type('accounts'); - admin.accountsSettingsButton.click(); - }); - - describe('default user preferences', () => { - before(() => { - admin.accountsSectionDefaultUserPreferences.find('[aria-expanded="false"]').click(); - }); - - it('it should show the enable auto away field', () => { - admin.accountsEnableAutoAway.parent().scrollIntoView(); - admin.accountsEnableAutoAway.parent().should('be.visible'); - }); - - it('the enable auto away field value should be true', () => { - admin.accountsEnableAutoAway.find('input').should('be.checked'); - }); - - it('it should show the idle timeout limit field', () => { - admin.accountsidleTimeLimit.click(); - admin.accountsidleTimeLimit.should('be.visible'); - }); - - it('the idle timeout limit field value should be 300', () => { - admin.accountsidleTimeLimit.should('have.value', '300'); - }); - - it('it should show the desktop audio notifications select field', () => { - admin.accountsDesktopNotifications.scrollIntoView(); - admin.accountsDesktopNotifications.should('be.visible'); - }); - - it('the desktop audio notifications field value should be all', () => { - admin.accountsDesktopNotifications.find('.rcx-select__item').should('have.text', 'All messages'); - }); - - it('it should show the mobile notifications select field', () => { - admin.accountsMobileNotifications.scrollIntoView(); - admin.accountsMobileNotifications.should('be.visible'); - }); - - it('the mobile notifications field value should be all', () => { - admin.accountsMobileNotifications.find('.rcx-select__item').should('have.text', 'All messages'); - }); - - it('it should show the unread tray icon alert field', () => { - admin.accountsUnreadAlert.parent().scrollIntoView(); - admin.accountsUnreadAlert.parent().should('be.visible'); - }); - - it('the unread tray icon alert field value should be true', () => { - admin.accountsUnreadAlert.find('input').should('be.checked'); - }); - - it('it should show the use emojis field', () => { - admin.accountsUseEmojis.parent().scrollIntoView(); - admin.accountsUseEmojis.parent().should('be.visible'); - }); - - it('the use emojis field value should be true', () => { - admin.accountsUseEmojis.find('input').should('be.checked'); - }); - - it('it should show the convert ascii to emoji field', () => { - admin.accountsConvertAsciiEmoji.parent().scrollIntoView(); - admin.accountsConvertAsciiEmoji.parent().should('be.visible'); - }); - - it('the convert ascii to emoji field value should be true', () => { - admin.accountsConvertAsciiEmoji.find('input').should('be.checked'); - }); - - it('it should show the auto load images field', () => { - admin.accountsAutoImageLoad.parent().scrollIntoView(); - admin.accountsAutoImageLoad.parent().should('be.visible'); - }); - - it('the auto load images field value should be true', () => { - admin.accountsAutoImageLoad.find('input').should('be.checked'); - }); - - it('it should show the save mobile bandwidth field', () => { - admin.accountsSaveMobileBandwidth.parent().scrollIntoView(); - admin.accountsSaveMobileBandwidth.parent().should('be.visible'); - }); - - it('the save mobile bandwidth field value should be true', () => { - admin.accountsSaveMobileBandwidth.find('input').should('be.checked'); - }); - - it('it should show the collapse embedded media by default field', () => { - admin.accountsCollapseMediaByDefault.parent().scrollIntoView(); - admin.accountsCollapseMediaByDefault.parent().should('be.visible'); - }); - - it('the collapse embedded media by default field value should be false', () => { - admin.accountsCollapseMediaByDefault.should('not.be.checked'); - }); - - it('it should show the hide usernames field', () => { - admin.accountsHideUsernames.parent().scrollIntoView(); - admin.accountsHideUsernames.parent().should('be.visible'); - }); - - it('the hide usernames field value should be false', () => { - admin.accountsHideUsernames.should('not.be.checked'); - }); - - it('it should show the hide roles field', () => { - admin.accountsHideRoles.parent().scrollIntoView(); - admin.accountsHideRoles.parent().should('be.visible'); - }); - - it('the hide roles field value should be false', () => { - admin.accountsHideRoles.should('not.be.checked'); - }); - - it('it should show the hide right sidebar with click field', () => { - admin.accountsHideFlexTab.parent().scrollIntoView(); - admin.accountsHideFlexTab.parent().should('be.visible'); - }); - - it('the hide right sidebar with click field value should be false', () => { - admin.accountsHideFlexTab.should('not.be.checked'); - }); - - it('it should show the display avatars field', () => { - admin.accountsDisplayAvatars.parent().scrollIntoView(); - admin.accountsDisplayAvatars.parent().should('be.visible'); - }); - - it('the display avatars field value should be true', () => { - admin.accountsDisplayAvatars.find('input').should('be.checked'); - }); - - it('it should show the enter key behavior field', () => { - admin.accountsSendOnEnter.scrollIntoView(); - admin.accountsSendOnEnter.should('be.visible'); - }); - - it('the enter key behavior field value should be normal', () => { - admin.accountsSendOnEnter.find('.rcx-select__item').should('have.text', 'Normal mode (send with Enter)'); - }); - - it('it should show the messagebox view mode field', () => { - admin.accountsMessageViewMode.scrollIntoView(); - admin.accountsMessageViewMode.should('be.visible'); - }); - - // Not working on CI. May be because the setting is a select with a integer value - it.skip('the view mode field value should be 0', () => { - admin.accountsMessageViewMode.find('.rcx-select__item').should('have.text', 'Normal'); - }); - - it('it should show the offline email notification field', () => { - admin.accountsEmailNotificationMode.scrollIntoView(); - admin.accountsEmailNotificationMode.should('be.visible'); - }); - - it('the offline email notification field value should be all', () => { - admin.accountsEmailNotificationMode.find('.rcx-select__item').should('have.text', 'Every Mention/DM'); - }); - - it('it should show the new room notification field', () => { - admin.accountsNewRoomNotification.scrollIntoView(); - admin.accountsNewRoomNotification.should('be.visible'); - }); - - it('the new room notification field value should be door', () => { - admin.accountsNewRoomNotification.find('.rcx-select__item').should('have.text', 'Default'); - }); - - it('it should show the new message notification field', () => { - admin.accountsNewMessageNotification.scrollIntoView(); - admin.accountsNewMessageNotification.should('be.visible'); - }); - - it('the new message notification field value should be chime', () => { - admin.accountsNewMessageNotification.find('.rcx-select__item').should('have.text', 'Default'); - }); - - it('it should show the notification sound volume field', () => { - admin.accountsNotificationsSoundVolume.scrollIntoView(); - admin.accountsNotificationsSoundVolume.should('be.visible'); - }); - - it('the notification sound volume field value should be 100', () => { - admin.accountsNotificationsSoundVolume.should('have.value', '100'); - }); - }); - }); - }); -}); diff --git a/apps/meteor/tests/cypress/integration/12-settings.spec.js b/apps/meteor/tests/cypress/integration/12-settings.spec.js deleted file mode 100644 index 13018d558252f8b7f0ed636b8a2e69a4864465bb..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/integration/12-settings.spec.js +++ /dev/null @@ -1,505 +0,0 @@ -import supertest from 'supertest'; - -import loginPage from '../pageobjects/login.page'; -import flexTab from '../pageobjects/flex-tab.page'; -import mainContent from '../pageobjects/main-content.page'; -import sideNav from '../pageobjects/side-nav.page'; -import admin from '../pageobjects/administration.page'; -import { checkIfUserIsValid } from '../../data/checks'; -import { adminUsername, adminEmail, adminPassword, username, email, password, reason } from '../../data/user.js'; -import { wait } from '../../data/api-data'; - -const apiUrl = (typeof Cypress !== 'undefined' && Cypress.env('TEST_API_URL')) || process.env.TEST_API_URL || 'http://localhost:3000'; - -const request = supertest(apiUrl); -const prefix = '/api/v1/'; - -function api(path) { - return prefix + path; -} - -const credentials = { - 'X-Auth-Token': undefined, - 'X-User-Id': undefined, -}; - -const login = { - user: adminUsername, - password: adminPassword, -}; - -const settingUserPrefix = `setting${Date.now()}`; - -describe('[Api Settings Change]', () => { - before((done) => { - checkIfUserIsValid(username, email, password).then(() => { - request - .post(api('login')) - .send(login) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - credentials['X-Auth-Token'] = res.body.data.authToken; - credentials['X-User-Id'] = res.body.data.userId; - }) - .end(done); - }); - }); - - after(() => { - sideNav.preferencesClose.click(); - }); - - it('/login', () => { - expect(credentials).to.have.property('X-Auth-Token').with.lengthOf.at.least(1); - expect(credentials).to.have.property('X-User-Id').with.lengthOf.at.least(1); - }); - - describe('message edit:', () => { - it('it should change the message editing via api', (done) => { - request - .post(api('settings/Message_AllowEditing')) - .set(credentials) - .send({ value: false }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it.skip('it should not show the edit messages', () => { - // the page needs a refresh to show the changes in the client - mainContent.sendMessage('Message for Message Edit Block'); - mainContent.openMessageActionMenu(); - mainContent.messageEdit.should('not.exist'); - }); - - it('it should change the message editing via api', (done) => { - request - .post(api('settings/Message_AllowEditing')) - .set(credentials) - .send({ value: true }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - }); - - describe('message delete:', () => { - it('it should change the message deleting via api', (done) => { - request - .post(api('settings/Message_AllowDeleting')) - .set(credentials) - .send({ value: false }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it.skip('it should not show the delete messages', () => { - // the page needs a refresh to show the changes in the client - mainContent.sendMessage('Message for Message delete Block'); - mainContent.openMessageActionMenu(); - mainContent.messageDelete.should('not.exist'); - }); - - it('it should change the message deleting via api', (done) => { - request - .post(api('settings/Message_AllowDeleting')) - .set(credentials) - .send({ value: true }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - }); - - describe('block audio files:', () => { - it('it should change the message audio files via api', (done) => { - request - .post(api('settings/Message_AudioRecorderEnabled')) - .set(credentials) - .send({ value: false }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it.skip('it should not show the audo file button', () => { - // the page needs a refresh to show the changes in the client - mainContent.recordBtn.should('not.exist'); - }); - - it('it should change the message audio files via api', (done) => { - request - .post(api('settings/Message_AudioRecorderEnabled')) - .set(credentials) - .send({ value: true }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - }); - - describe('block video files:', () => { - it('it should change the message video files via api', (done) => { - request - .post(api('settings/Message_VideoRecorderEnabled')) - .set(credentials) - .send({ value: false }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('it should change the message video files via api', (done) => { - request - .post(api('settings/Message_VideoRecorderEnabled')) - .set(credentials) - .send({ value: true }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - }); - - describe('bad words filter:', () => { - it('it should change the bad words filter via api', (done) => { - request - .post(api('settings/Message_AllowBadWordsFilter')) - .set(credentials) - .send({ value: true }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('it should add bad words to the filter via api', (done) => { - request - .post(api('settings/Message_BadWordsFilterList')) - .set(credentials) - .send({ value: 'badword' }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('it should send a bad word', () => { - sideNav.general.click(); - mainContent.setTextToInput('badword'); - mainContent.sendBtn.click(); - mainContent.waitForLastMessageEqualsText('*******'); - }); - - it('it should change the bad words filter via api', (done) => { - request - .post(api('settings/Message_AllowBadWordsFilter')) - .set(credentials) - .send({ value: false }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - }); - - describe('block message pin:', () => { - it('it should change the message pin via api', (done) => { - request - .post(api('settings/Message_AllowPinning')) - .set(credentials) - .send({ value: false }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it.skip('it should not show the pinned tab button', () => { - // the page needs a refresh to show the changes in the client - flexTab.pinnedTab.should('not.exist'); - }); - - it.skip('it should not show the pin message action', () => { - // the page needs a refresh to show the changes in the client - mainContent.sendMessage('Message for Message pin Block'); - mainContent.openMessageActionMenu(); - mainContent.pinMessage.should('not.exist'); - }); - - it('it should change the message pin via api', (done) => { - request - .post(api('settings/Message_AllowPinning')) - .set(credentials) - .send({ value: true }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - }); - - describe('block message star:', () => { - it('it should change the message star via api', (done) => { - request - .post(api('settings/Message_AllowStarring')) - .set(credentials) - .send({ value: false }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it.skip('it should not show the starred tab button', () => { - // the page needs a refresh to show the changes in the client - flexTab.starredTab.should('not.exist'); - }); - - it.skip('it should not show the star message action', () => { - // the page needs a refresh to show the changes in the client - mainContent.sendMessage('Message for Message pin Block'); - mainContent.openMessageActionMenu(); - mainContent.starMessage.should('not.exist'); - }); - - it('it should change the message star via api', (done) => { - request - .post(api('settings/Message_AllowStarring')) - .set(credentials) - .send({ value: true }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - }); - - describe.skip('block file upload:', () => { - it('it should change the file upload via api', (done) => { - request - .post(api('settings/FileUpload_Enabled')) - .set(credentials) - .send({ value: false }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('it should not show file upload icon', () => { - mainContent.fileAttachment.should('not.exist'); - }); - - it('it should change the file upload via api', (done) => { - request - .post(api('settings/FileUpload_Enabled')) - .set(credentials) - .send({ value: true }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - }); - - describe.skip('profile changes:', () => { - before(() => { - sideNav.sidebarUserMenu.click(); - sideNav.account.click(); - }); - - after(() => { - sideNav.preferencesClose.click(); - sideNav.searchChannel('general'); - }); - describe('block profile change', () => { - it('it should change the allow user profile change via api', (done) => { - request - .post(api('settings/Accounts_AllowUserProfileChange')) - .set(credentials) - .send({ value: false }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('it should not show profile link', () => { - sideNav.profile.should('not.exist'); - }); - - it('it should change the allow user profile change via api', (done) => { - request - .post(api('settings/Accounts_AllowUserProfileChange')) - .set(credentials) - .send({ value: true }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - }); - - describe('block avatar change', () => { - it('it should change the allow user avatar change via api', (done) => { - request - .post(api('settings/Accounts_AllowUserAvatarChange')) - .set(credentials) - .send({ value: false }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('it should not show avatar link', () => { - sideNav.avatar.should('not.exist'); - }); - - it('it should change the allow user avatar change via api', (done) => { - request - .post(api('settings/Accounts_AllowUserAvatarChange')) - .set(credentials) - .send({ value: true }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - }); - }); - - describe('Manually Approve New Users:', () => { - before(() => { - sideNav.sidebarUserMenu.click(); - sideNav.logout.click(); - - // loginPage.open(); - }); - - it('it should change the Manually Approve New Users via api', (done) => { - request - .post(api('settings/Accounts_ManuallyApproveNewUsers')) - .set(credentials) - .send({ value: true }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('register the user', () => { - loginPage.registerButton.click(); - loginPage.nameField.type(`${settingUserPrefix}${username}`); - loginPage.emailField.type(`${settingUserPrefix}${email}`); - loginPage.passwordField.type(password); - loginPage.confirmPasswordField.type(password); - loginPage.reasonField.type(reason); - - loginPage.submit(); - - loginPage.registrationSucceededCard.should('have.attr', 'data-i18n', 'Registration_Succeeded'); - loginPage.backToLoginButton.click(); - }); - - it('login as admin and go to users', () => { - checkIfUserIsValid(adminUsername, adminEmail, adminPassword); - sideNav.sidebarUserMenu.click(); - sideNav.admin.click(); - admin.usersLink.click(); - cy.get('h2:contains("Users")').should('be.visible'); - }); - - it('search the user', () => { - admin.usersFilter.click(); - admin.usersFilter.type(`${settingUserPrefix}${username}`); - cy.wait(1000); - }); - - it('opens the user', () => { - admin.getUserFromList(`${settingUserPrefix}${username}`).click().wait(100); - flexTab.usersView.should('be.visible'); - }); - - it('it should show the activate user btn', () => { - flexTab.moreActions.click().wait(200); - flexTab.usersActivate.should('be.visible'); - }); - - it('it should activate the user', () => { - flexTab.usersActivate.click().wait(200); - }); - - it('it should show the deactivate btn', () => { - flexTab.moreActions.click().wait(200); - flexTab.usersDeactivate.should('be.visible'); - }); - - it('it should change the Manually Approve New Users via api', (done) => { - request - .post(api('settings/Accounts_ManuallyApproveNewUsers')) - .set(credentials) - .send({ value: false }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(wait(done, 100)); - }); - }); -}); diff --git a/apps/meteor/tests/cypress/integration/13-permissions.spec.js b/apps/meteor/tests/cypress/integration/13-permissions.spec.js deleted file mode 100644 index 6d2a90e06e24ecc0ec241f93732085af6b623fbf..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/integration/13-permissions.spec.js +++ /dev/null @@ -1,155 +0,0 @@ -import sideNav from '../pageobjects/side-nav.page'; -import flexTab from '../pageobjects/flex-tab.page'; -import admin from '../pageobjects/administration.page'; -import mainContent from '../pageobjects/main-content.page'; -import { checkIfUserIsValid } from '../../data/checks'; -import { username, email, password, adminUsername, adminEmail, adminPassword } from '../../data/user.js'; - -describe.skip('[Permissions]', () => { - before(() => { - checkIfUserIsValid(adminUsername, adminEmail, adminPassword); - sideNav.general.click(); - sideNav.accountMenu.click(); - sideNav.admin.click(); - }); - - after(() => { - checkIfUserIsValid(adminUsername, adminEmail, adminPassword); - sideNav.general.click(); - sideNav.accountMenu.click(); - sideNav.admin.click(); - admin.permissionsLink.click(); - - if (!admin.rolesUserCreateC.isSelected()) { - admin.rolesUserCreateC.scrollIntoView(); - admin.rolesUserCreateC.click(); - } - - if (!admin.rolesUserCreateD.isSelected()) { - admin.rolesUserCreateD.scrollIntoView(); - admin.rolesUserCreateD.click(); - } - - if (!admin.rolesUserCreateP.isSelected()) { - admin.rolesUserCreateP.scrollIntoView(); - admin.rolesUserCreateP.click(); - } - - if (!admin.rolesUserMentionAll.isSelected()) { - admin.rolesUserMentionAll.scrollIntoView(); - admin.rolesUserMentionAll.click(); - } - - if (!admin.rolesOwnerDeleteMessage.isSelected()) { - admin.rolesOwnerDeleteMessage.scrollIntoView(); - admin.rolesOwnerDeleteMessage.click(); - } - - if (!admin.rolesOwnerEditMessage.isSelected()) { - admin.rolesOwnerEditMessage.scrollIntoView(); - admin.rolesOwnerEditMessage.click(); - } - }); - - describe('user creation via admin view:', () => { - before(() => { - admin.usersLink.click(); - flexTab.usersAddUserTab.click(); - }); - - after(() => { - admin.infoLink.click(); - }); - - it('it should create a user', () => { - flexTab.usersAddUserName.type(`adminCreated${username}`); - flexTab.usersAddUserUsername.type(`adminCreated${username}`); - flexTab.usersAddUserEmail.type(`adminCreated${email}`); - flexTab.usersAddUserVerifiedCheckbox.click(); - flexTab.usersAddUserPassword.type(password); - flexTab.usersAddUserChangePasswordCheckbox.click(); - flexTab.addRole('user'); - flexTab.usersButtonSave.click(); - }); - - it('it should show the user in the list', () => { - admin.checkUserList(username).should.be.true; - }); - }); - - describe('change the permissions:', () => { - before(() => { - admin.permissionsLink.click(); - }); - - it('it should change the create c room permission', () => { - if (admin.rolesUserCreateC.isSelected()) { - admin.rolesUserCreateC.scrollIntoView(); - admin.rolesUserCreateC.click(); - } - }); - - it('it should change the create d room permission', () => { - if (admin.rolesUserCreateD.isSelected()) { - admin.rolesUserCreateD.scrollIntoView(); - admin.rolesUserCreateD.click(); - } - }); - - it('it should change the create p room permission', () => { - if (admin.rolesUserCreateP.isSelected()) { - admin.rolesUserCreateP.scrollIntoView(); - admin.rolesUserCreateP.click(); - } - }); - - it('it should change the mention all permission', () => { - if (admin.rolesUserMentionAll.isSelected()) { - admin.rolesUserMentionAll.scrollIntoView(); - admin.rolesUserMentionAll.click(); - } - }); - - it('it should change the delete message all permission for owners', () => { - if (admin.rolesOwnerDeleteMessage.isSelected()) { - admin.rolesOwnerDeleteMessage.scrollIntoView(); - admin.rolesOwnerDeleteMessage.click(); - } - }); - - it('it should change the edit message all permission for owners', () => { - if (admin.rolesOwnerEditMessage.isSelected()) { - admin.rolesOwnerEditMessage.scrollIntoView(); - admin.rolesOwnerEditMessage.click(); - } - }); - }); - - describe('test the permissions:', () => { - before(() => { - sideNav.preferencesClose.click(); - - checkIfUserIsValid(`adminCreated${username}`, `adminCreated${email}`, password); - }); - - it('it should not show the plus icon on toolbar ', () => { - sideNav.newChannelIcon.should('not.exist'); - }); - - it('it should go to general', () => { - sideNav.searchChannel('general'); - }); - - it('it should try to use @all and should be warned by rocket.cat ', () => { - mainContent.tryToMentionAll(); - }); - - it.skip('it should not be able to delete own message ', () => { - // waiting for changes in the delete-message permission - }); - - it.skip('it should not be able to edit own message ', () => { - // waiting for changes in the edit-message permission - }); - }); -}); diff --git a/apps/meteor/tests/cypress/integration/14-setting-permissions.spec.js b/apps/meteor/tests/cypress/integration/14-setting-permissions.spec.js deleted file mode 100644 index 07895380e3beb5dd543d5945f42d5cfea977a6cc..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/integration/14-setting-permissions.spec.js +++ /dev/null @@ -1,118 +0,0 @@ -import { assert } from 'chai'; - -import { adminUsername, adminEmail, adminPassword, username, email, password } from '../../data/user.js'; -import admin from '../pageobjects/administration.page'; -import { checkIfUserIsValid } from '../../data/checks'; -import sideNav from '../pageobjects/side-nav.page'; - -function openAdminView() { - admin.open('admin/Layout'); -} - -function logoutRocketchat() { - // sideNav.sidebarUserMenu.waitForVisible(5000); - sideNav.sidebarUserMenu.click(); - // sideNav.logout.waitForVisible(5000); - sideNav.logout.click(); -} - -describe.skip('[Rocket.Chat Settings based permissions]', function () { - const newTitle = 'Testtitle'; - - describe('Give User Permissions', function () { - before(() => { - try { - // If the tests run as a suite,a user may already be logged-in - logoutRocketchat(); - } catch (e) { - // most possibly already logged off since started seperately => try to continue - } - checkIfUserIsValid(adminUsername, adminEmail, adminPassword); - openAdminView(); - admin.permissionsLink.click(); - }); - - it('Set permission for user to manage settings', function (done) { - if (!admin.rolesManageSettingsPermissions.isSelected()) { - admin.rolesManageSettingsPermissions.click(); - } - admin.rolesManageSettingsPermissions.isSelected().should.equal(true); - done(); - }); - - it('Set Permission for user to change titlepage title', function (done) { - admin.rolesSettingsTab.click(); - admin.rolesSettingsFindInput.type('Layout'); - if (!admin.rolesSettingLayoutTitle.isSelected()) { - admin.rolesSettingLayoutTitle.click(); - } - admin.rolesSettingLayoutTitle.isSelected().should.equal(true); - done(); - }); - - after(() => { - sideNav.preferencesClose.click(); - logoutRocketchat(); - }); - }); - - describe('Test new user setting permissions', function () { - before(() => { - try { - checkIfUserIsValid(username, email, password); - } catch (e) { - console.log(' User could not be logged in - trying again'); - checkIfUserIsValid(username, email, password); - } - openAdminView(); - }); - - it('Change titlepage title is allowed', function (done) { - admin.layoutLink.click(); - admin.generalLayoutTitle.type(newTitle); - browser.pause(2000); - admin.buttonSave.click(); - done(); - }); - - after(() => { - sideNav.preferencesClose.click(); - logoutRocketchat(); - }); - }); - - describe('Verify settings change and cleanup', function () { - before(() => { - console.log('Switching back to Admin'); - checkIfUserIsValid(adminUsername, adminEmail, adminPassword); - openAdminView(); - }); - - it('New settings value visible for admin as well', function (done) { - admin.layoutLink.click(); - admin.layoutButtonExpandContent.click(); - assert(admin.generalLayoutTitle.getValue() === newTitle, 'Title setting value not changed properly'); - browser.pause(2000); - admin.buttonSave.click(); - done(); - }); - - it('Cleanup permissions', function (done) { - admin.permissionsLink.click(); - - admin.rolesManageSettingsPermissions.click(); - admin.rolesManageSettingsPermissions.isSelected().should.equal(false); - - admin.rolesSettingsTab.click(); - admin.rolesSettingsFindInput.type('Layout'); - admin.rolesSettingLayoutTitle.click(); - admin.rolesSettingLayoutTitle.isSelected().should.equal(false); - done(); - }); - - after(() => { - sideNav.preferencesClose.click(); - logoutRocketchat(); - }); - }); -}); diff --git a/apps/meteor/tests/cypress/integration/15-message-popup.spec.js b/apps/meteor/tests/cypress/integration/15-message-popup.spec.js deleted file mode 100644 index 964bf3fe491d79e3dcb8a6eed8f4ee06bcfa83cb..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/integration/15-message-popup.spec.js +++ /dev/null @@ -1,119 +0,0 @@ -import { adminEmail, adminPassword } from '../../data/user.js'; -import { api, request, getCredentials, credentials } from '../../data/api-data.js'; -import loginPage from '../pageobjects/login.page'; -import sideNav from '../pageobjects/side-nav.page'; -import mainContent from '../pageobjects/main-content.page'; - -const users = new Array(10) - .fill(null) - .map(() => `${Date.now()}.${Math.random().toString(36).slice(2)}`) - .map((uniqueId, i) => ({ - name: `User #${uniqueId}`, - username: `user.test.mentions.${uniqueId}`, - email: `user.test.mentions.${uniqueId}@rocket.chat`, - password: 'rocket.chat', - isMentionable: i % 2 === 0, - })); - -const createTestUser = async ({ email, name, username, password, isMentionable }) => { - await new Promise((done) => getCredentials(done)); - - await new Promise((done) => - request - .post(api('users.create')) - .set(credentials) - .send({ - email, - name, - username, - password, - active: true, - roles: ['user'], - joinDefaultChannels: true, - verified: true, - }) - .end(done), - ); - - if (isMentionable) { - const userCredentials = {}; - - await new Promise((done) => - request - .post(api('login')) - .send({ user: username, password }) - .expect((res) => { - userCredentials['X-Auth-Token'] = res.body.data.authToken; - userCredentials['X-User-Id'] = res.body.data.userId; - }) - .end(done), - ); - - await new Promise((done) => - request - .post(api('chat.postMessage')) - .set(userCredentials) - .send({ - channel: 'general', - text: 'Test', - }) - .end(done), - ); - } -}; - -describe('[Message Popup]', () => { - before(() => { - loginPage.open(); - - cy.logout(); - - cy.window().then({ timeout: 10000 }, async () => { - for (const user of users) { - await createTestUser(user); // eslint-disable-line no-await-in-loop - } - }); - - // loginPage.open(); - loginPage.login({ email: adminEmail, password: adminPassword }); - - sideNav.general.click(); - }); - - after(() => { - cy.logout(); - }); - - describe('test user mentions in message popup', () => { - it('should add "@" to the message input', () => { - mainContent.setTextToInput('@'); - }); - - it('should show the message popup', () => { - mainContent.messagePopUp.should('be.visible'); - }); - - it('should be that the message popup bar title is people', () => { - mainContent.messagePopUpTitle.should('contain', 'People'); - }); - - it('should show the message popup bar items', () => { - mainContent.messagePopUpItems.should('be.visible'); - }); - - const mentionableUsers = users.filter(({ isMentionable }) => isMentionable); - for (let i = 1; i <= 5; ++i) { - it(`should show mentionable user #${5 - i + 1} as message popup bar item #${i}`, () => { - mainContent.messagePopUpItems.find(`.popup-item:nth-child(${i}) strong`).should('contain', mentionableUsers[5 - i].username); - }); - } - - it('should show "all" as message popup bar item #6', () => { - mainContent.messagePopUpItems.find('.popup-item:nth-child(6) strong').should('contain', 'all'); - }); - - it('should show "here" as message popup bar item #7', () => { - mainContent.messagePopUpItems.find('.popup-item:nth-child(7) strong').should('contain', 'here'); - }); - }); -}); diff --git a/apps/meteor/tests/cypress/integration/16-discussion.spec.js b/apps/meteor/tests/cypress/integration/16-discussion.spec.js deleted file mode 100644 index 4276e01cd14e9bdee83e285002baccacebc503d0..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/integration/16-discussion.spec.js +++ /dev/null @@ -1,62 +0,0 @@ -/* eslint-disable func-names, prefer-arrow-callback, no-var, space-before-function-paren, -quotes, prefer-template, no-undef, no-unused-vars*/ - -import mainContent from '../pageobjects/main-content.page'; -import sideNav from '../pageobjects/side-nav.page'; -import { sendEscape } from '../pageobjects/keyboard'; -import { discussion } from '../pageobjects/discussion.page'; -import { username, email, password } from '../../data/user.js'; -import { checkIfUserIsValid } from '../../data/checks'; - -const parentChannelName = 'unit-testing-' + Date.now(); -const discussionName = 'Lorem ipsum dolor sit amet'; -const message = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'; - -describe('[Discussion]', function () { - before(function () { - checkIfUserIsValid(username, email, password); - sideNav.createChannel(parentChannelName, true, false); - cy.wait(1000); - }); - - describe('via creation screen', function () { - it('Create a discussion', function () { - discussion.createDiscussion(parentChannelName, discussionName, message); - cy.wait(1000); - }); - }); - - describe('from context menu', function () { - before(() => { - mainContent.sendMessage(message); - cy.wait(1000); - }); - - it('it should show a dialog for starting a discussion', () => { - cy.wait(1000); - mainContent.openMessageActionMenu(); - cy.waitUntil(() => { - return discussion.startDiscussionContextItem.then((el) => el.length); - }); - discussion.startDiscussionContextItem.click(); - discussion.saveDiscussionButton.should('be.enabled'); - discussion.saveDiscussionButton.click(); - cy.wait(1000); - }); - - it('it should have create a new room', function () { - mainContent.channelTitle.should('contain', message); - }); - - it('The message should be copied', function () { - cy.wait(1200); - mainContent.waitForLastMessageQuoteEqualsText(message); - }); - }); - - after(function () { - it('remove parent channel', () => { - discussion.deleteRoom(parentChannelName); - }); - }); -}); diff --git a/apps/meteor/tests/cypress/pageobjects/Page.js b/apps/meteor/tests/cypress/pageobjects/Page.js deleted file mode 100644 index e9c0b3f3dff3c48127bdb42b0546be8f95a21de5..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/pageobjects/Page.js +++ /dev/null @@ -1,10 +0,0 @@ -class Page { - get body() { - return browser.element('body'); - } - - open(path) { - cy.visit(`/${path}`); - } -} -export default Page; diff --git a/apps/meteor/tests/cypress/pageobjects/administration.page.js b/apps/meteor/tests/cypress/pageobjects/administration.page.js deleted file mode 100644 index eea2a11dd0d2416f7789c5de33fa412d324a4c9b..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/pageobjects/administration.page.js +++ /dev/null @@ -1,657 +0,0 @@ -import Page from './Page'; - -class Administration extends Page { - get flexNav() { - return browser.element('.flex-nav'); - } - - get flexNavContent() { - return browser.element('.flex-nav'); - } - - get settingsSearch() { - return browser.element('input[type=search]'); - } - - get settingsLink() { - return browser.element('.flex-nav [href="/admin/settings"]'); - } - - get groupSettingsPageBack() { - return browser.element('button[title="Back"]'); - } - - get layoutLink() { - return browser.element('.flex-nav [href="/admin/Layout"]'); - } - - get infoLink() { - return browser.element('.flex-nav [href="/admin/info"]'); - } - - get roomsLink() { - return browser.element('.flex-nav [href="/admin/rooms"]'); - } - - get usersLink() { - return browser.element('.flex-nav [href="/admin/users"]'); - } - - get accountsSettingsButton() { - return browser.element('[data-qa-id="Accounts"] button:contains("Open")'); - } - - get generalSettingsButton() { - return browser.element('[data-qa-id="General"] button:contains("Open")'); - } - - get permissionsLink() { - return browser.element('.flex-nav [href="/admin/permissions"]'); - } - - get customScriptBtn() { - return browser.element('.section:nth-of-type(6) .collapse'); - } - - get customScriptLoggedOutTextArea() { - return browser.element('.section:nth-of-type(6) .CodeMirror-scroll'); - } - - get customScriptLoggedInTextArea() { - return browser.element('.CodeMirror.cm-s-default:nth-of-type(2)'); - } - - get infoDeployment() { - return browser.element('[data-qa-id="deployment-card"]'); - } - - get infoLicense() { - return browser.element('[data-qa-id="license-card"]'); - } - - get infoUsage() { - return browser.element('[data-qa-id="usage-card"]'); - } - - get infoFederation() { - return browser.element('[data-qa-id="federation-card"]'); - } - - get roomsSearchForm() { - return browser.element('.content .search'); - } - - get roomsFilter() { - return browser.element('#rooms-filter'); - } - - get roomsChannelsCheckbox() { - return browser.element('label:nth-of-type(1) input[name="room-type"]'); - } - - get roomsDirectCheckbox() { - return browser.element('label:nth-of-type(2) input[name="room-type"]'); - } - - get roomsPrivateCheckbox() { - return browser.element('label:nth-of-type(3) input[name="room-type"]'); - } - - get roomsGeneralChannel() { - return browser.element('td=general'); - } - - get usersRocketCat() { - return browser.element('td=Rocket.Cat'); - } - - get usersInternalAdmin() { - return browser.element('.rcx-table__cell:contains("@rocketchat.internal.admin.test")'); - } - - get usersInRole() { - return browser.element('button:contains("Users in role")'); - } - - get usersFilter() { - return browser.element('input[placeholder="Search Users"]'); - } - - get rolesNewRolesButton() { - return browser.element('button[aria-label="New"]'); - } - - get rolesPermissionGrid() { - return browser.element('[role=tab]:contains("Permission")'); - } - - get rolesAdmin() { - return browser.element('.rcx-table__cell--header:contains("Admin")'); - } - - get rolesModerator() { - return browser.element('[title="Moderator"]'); - } - - get rolesOwner() { - return browser.element('[title="Owner"]'); - } - - get rolesReturnLink() { - return browser.element('[href="/admin/permissions"]'); - } - - get rolesNewRoleName() { - return browser.element('input[placeholder="Role"]'); - } - - get rolesNewRoleDesc() { - return browser.element('input[placeholder="Description"]'); - } - - get rolesNewRoleScope() { - return browser.element('label:contains("Scope")'); - } - - get rolesAddBtn() { - return browser.element('button.add'); - } - - get rolesRoomsSearchForm() { - return browser.element('.search [name="room"]'); - } - - get rolesSettingsFindInput() { - return browser.element('input#permissions-filter'); - } - - get rolesSettingsTab() { - return browser.element('button[data-value="settings"]'); - } - - get rolesPermissionsTab() { - return browser.element('button[data-value="permissions"]'); - } - - // permissions grids checkboxes - - get rolesUserCreateC() { - return browser.element('[name="perm[user][create-c]"]'); - } - - get rolesUserCreateP() { - return browser.element('[name="perm[user][create-p]"]'); - } - - get rolesUserCreateD() { - return browser.element('[name="perm[user][create-d]"]'); - } - - get rolesUserMentionAll() { - return browser.element('[name="perm[user][mention-all]"]'); - } - - get rolesUserPreviewC() { - return browser.element('[name="perm[user][preview-c-room]"]'); - } - - get rolesUserViewC() { - return browser.element('[name="perm[user][view-c-room]"]'); - } - - get rolesUserViewD() { - return browser.element('[name="perm[user][view-d-room]"]'); - } - - get rolesUserViewP() { - return browser.element('[name="perm[user][view-p-room]"]'); - } - - get rolesUserHistory() { - return browser.element('[name="perm[user][view-history]"]'); - } - - get rolesOwnerDeleteMessage() { - return browser.element('[name="perm[owner][delete-message]"]'); - } - - get rolesOwnerEditMessage() { - return browser.element('[name="perm[owner][edit-message]"]'); - } - - get rolesManageSettingsPermissions() { - return browser.element('[name="perm[user][manage-selected-settings]"]'); - } - - get rolesSettingLayoutTitle() { - return browser.element('[name="perm[user][change-setting-Layout_Home_Title]"'); - } - - get emojiFilter() { - return browser.element('#emoji-filter'); - } - - // settings - get buttonSave() { - return browser.element('button.save'); - } - - get generalSectionIframeIntegration() { - return browser.element('[data-qa-section="Iframe_Integration"]'); - } - - get generalSectionNotifications() { - return browser.element('[data-qa-section="Notifications"]'); - } - - get generalSectionRestApi() { - return browser.element('[data-qa-section="REST API"]'); - } - - get generalSectionReporting() { - return browser.element('[data-qa-section="Reporting"]'); - } - - get generalSectionStreamCast() { - return browser.element('[data-qa-section="Stream_Cast"]'); - } - - get generalSectionUTF8() { - return browser.element('[data-qa-section="UTF8"]'); - } - - get generalSiteUrl() { - return browser.element('[data-qa-setting-id="Site_Url"]'); - } - - get generalSiteUrlReset() { - return browser.element('[data-qa-reset-setting-id="Site_Url"]'); - } - - get generalSiteName() { - return browser.element('[data-qa-setting-id="Site_Name"]'); - } - - get generalSiteNameReset() { - return browser.element('[data-qa-reset-setting-id="Site_Name"]'); - } - - get generalLanguage() { - return browser.element('[data-qa-setting-id="Language"]'); - } - - get generalLanguagePtOption() { - return browser.element('[value="pt"]'); - } - - get generalLanguageReset() { - return browser.element('[data-qa-reset-setting-id="Language"]'); - } - - get generalSelfSignedCerts() { - return browser.element('[data-qa-setting-id="Allow_Invalid_SelfSigned_Certs"]'); - } - - get generalSelfSignedCertsReset() { - return browser.element('[data-qa-reset-setting-id="Allow_Invalid_SelfSigned_Certs"]'); - } - - get generalFavoriteRoom() { - return browser.element('[data-qa-setting-id="Favorite_Rooms"]'); - } - - get generalFavoriteRoomReset() { - return browser.element('[data-qa-reset-setting-id="Favorite_Rooms"]'); - } - - get generalOpenFirstChannel() { - return browser.element('[data-qa-setting-id="First_Channel_After_Login"]'); - } - - get generalOpenFirstChannelReset() { - return browser.element('[data-qa-reset-setting-id="First_Channel_After_Login"]'); - } - - get generalCdnPrefix() { - return browser.element('[data-qa-setting-id="CDN_PREFIX"]'); - } - - get generalCdnPrefixReset() { - return browser.element('[data-qa-reset-setting-id="CDN_PREFIX"]'); - } - - get generalForceSSL() { - return browser.element('[data-qa-setting-id="Force_SSL"]'); - } - - get generalForceSSLReset() { - return browser.element('[data-qa-reset-setting-id="Force_SSL"]'); - } - - get generalGoogleTagId() { - return browser.element('[data-qa-setting-id="GoogleTagManager_id"]'); - } - - get generalGoogleTagIdReset() { - return browser.element('[data-qa-reset-setting-id="GoogleTagManager_id"]'); - } - - get generalBugsnagKey() { - return browser.element('[data-qa-setting-id="Bugsnag_api_key"]'); - } - - get generalBugsnagKeyReset() { - return browser.element('[data-qa-reset-setting-id="Bugsnag_api_key"]'); - } - - get generalIframeSend() { - return browser.element('[data-qa-setting-id="Iframe_Integration_send_enable"]'); - } - - get generalIframeSendReset() { - return browser.element('[data-qa-reset-setting-id="Iframe_Integration_send_enable"]'); - } - - get generalIframeSendTargetOrigin() { - return browser.element('[data-qa-setting-id="Iframe_Integration_send_target_origin"]'); - } - - get generalIframeSendTargetOriginReset() { - return browser.element('[data-qa-reset-setting-id="Iframe_Integration_send_target_origin"]'); - } - - get generalIframeRecieve() { - return browser.element('[data-qa-setting-id="Iframe_Integration_receive_enable"]'); - } - - get generalIframeRecieveOrigin() { - return browser.element('[data-qa-setting-id="Iframe_Integration_receive_origin"]'); - } - - get generalIframeRecieveOriginReset() { - return browser.element('[data-qa-reset-setting-id="Iframe_Integration_receive_origin"]'); - } - - get generalNotificationsMaxRoomMembers() { - return browser.element('[data-qa-setting-id="Notifications_Max_Room_Members"]'); - } - - get generalNotificationsMaxRoomMembersReset() { - return browser.element('[data-qa-reset-setting-id="Notifications_Max_Room_Members"]'); - } - - get generalRestApiUserLimit() { - return browser.element('[data-qa-setting-id="API_User_Limit"]'); - } - - get generalRestApiUserLimitReset() { - return browser.element('[data-qa-reset-setting-id="API_User_Limit"]'); - } - - get generalReporting() { - return browser.element('[data-qa-setting-id="Statistics_reporting"]'); - } - - get generalReportingReset() { - return browser.element('[data-qa-reset-setting-id="Statistics_reporting"]'); - } - - get generalStreamCastAdress() { - return browser.element('[data-qa-setting-id="Stream_Cast_Address"]'); - } - - get generalStreamCastAdressReset() { - return browser.element('[data-qa-reset-setting-id="Stream_Cast_Address"]'); - } - - get generalUTF8UsernamesRegex() { - return browser.element('[data-qa-setting-id="UTF8_User_Names_Validation"]'); - } - - get generalUTF8ChannelsRegex() { - return browser.element('[data-qa-setting-id="UTF8_Channel_Names_Validation"]'); - } - - get generalUTF8RegexReset() { - return browser.element('[data-qa-reset-setting-id="UTF8_User_Names_Validation"]'); - } - - get generalUTF8NamesSlug() { - return browser.element('[data-qa-setting-id="UTF8_Names_Slugify"]'); - } - - get generalUTF8NamesSlugReset() { - return browser.element('[data-qa-reset-setting-id="UTF8_Names_Slugify"]'); - } - - get generalLayoutTitle() { - return browser.element('[data-qa-setting-id="Layout_Home_Title"]'); - } - - // accounts - get accountsSectionDefaultUserPreferences() { - return browser.element('[data-qa-section="Accounts_Default_User_Preferences"]'); - } - - get accountsEnableAutoAway() { - return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_enableAutoAway"]'); - } - - get accountsEnableAutoAwayReset() { - return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_enableAutoAway"]'); - } - - get accountsidleTimeLimit() { - return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_idleTimeLimit"]'); - } - - get accountsidleTimeLimitReset() { - return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_idleTimeLimit"]'); - } - - get accountsDesktopNotifications() { - return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_desktopNotifications"]'); - } - - get accountsDesktopNotificationsReset() { - return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_desktopNotifications"]'); - } - - get accountsMobileNotifications() { - return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_pushNotifications"]'); - } - - get accountsMobileNotificationsReset() { - return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_pushNotifications"]'); - } - - get accountsUnreadAlert() { - return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_unreadAlert"]'); - } - - get accountsUnreadAlertReset() { - return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_unreadAlert"]'); - } - - get accountsUseEmojis() { - return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_useEmojis"]'); - } - - get accountsUseEmojisReset() { - return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_useEmojis"]'); - } - - get accountsConvertAsciiEmoji() { - return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_convertAsciiEmoji"]'); - } - - get accountsConvertAsciiEmojiReset() { - return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_convertAsciiEmoji"]'); - } - - get accountsAutoImageLoad() { - return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_autoImageLoad"]'); - } - - get accountsAutoImageLoadReset() { - return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_autoImageLoad"]'); - } - - get accountsSaveMobileBandwidth() { - return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_saveMobileBandwidth"]'); - } - - get accountsSaveMobileBandwidthReset() { - return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_saveMobileBandwidth"]'); - } - - get accountsCollapseMediaByDefault() { - return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_collapseMediaByDefault"]'); - } - - get accountsCollapseMediaByDefaultReset() { - return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_collapseMediaByDefault"]'); - } - - get accountsHideUsernames() { - return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_hideUsernames"]'); - } - - get accountsHideUsernamesReset() { - return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_hideUsernames"]'); - } - - get accountsHideRoles() { - return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_hideRoles"]'); - } - - get accountsHideRolesReset() { - return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_hideRoles"]'); - } - - get accountsHideFlexTab() { - return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_hideFlexTab"]'); - } - - get accountsHideFlexTabReset() { - return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_hideFlexTab"]'); - } - - get DisplayAvatars() { - return browser.element('[data-qa-setting-id="displayAvatars"]'); - } - - get DisplayAvatarsReset() { - return browser.element('[data-qa-reset-setting-id="displayAvatars"]'); - } - - get accountsDisplayAvatars() { - return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_displayAvatars"]'); - } - - get accountsMergeChannels() { - return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_mergeChannels"]'); - } - - get accountsMergeChannelsReset() { - return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_mergeChannels"]'); - } - - get accountsSendOnEnter() { - return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_sendOnEnter"]'); - } - - get accountsSendOnEnterReset() { - return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_sendOnEnter"]'); - } - - get accountsMessageViewMode() { - return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_messageViewMode"]'); - } - - get accountsMessageViewModeReset() { - return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_messageViewMode"]'); - } - - get accountsEmailNotificationMode() { - return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_emailNotificationMode"]'); - } - - get accountsEmailNotificationModeReset() { - return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_emailNotificationMode"]'); - } - - get accountsNewRoomNotification() { - return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_newRoomNotification"]'); - } - - get accountsNewRoomNotificationReset() { - return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_newRoomNotification"]'); - } - - get accountsNewMessageNotification() { - return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_newMessageNotification"]'); - } - - get accountsNewMessageNotificationReset() { - return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_newMessageNotification"]'); - } - - get accountsMuteFocusedConversations() { - return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_muteFocusedConversations"]'); - } - - get accountsMuteFocusedConversationsReset() { - return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_muteFocusedConversations"]'); - } - - get accountsNotificationsSoundVolume() { - return browser.element('[data-qa-setting-id="Accounts_Default_User_Preferences_notificationsSoundVolume"]'); - } - - get accountsNotificationsSoundVolumeReset() { - return browser.element('[data-qa-reset-setting-id="Accounts_Default_User_Preferences_notificationsSoundVolume"]'); - } - - get accountsRealNameChange() { - return browser.element('[data-qa-setting-id="Accounts_AllowRealNameChange"]'); - } - - get accountsUserStatusMessageChange() { - return browser.element('[data-qa-setting-id="Accounts_AllowUserStatusMessageChange"]'); - } - - get accountsUsernameChange() { - return browser.element('[data-qa-setting-id="Accounts_AllowUsernameChange"]'); - } - - get layoutButtonExpandContent() { - return browser.element('.section:nth-of-type(2) .rc-button.rc-button--nude'); - } - - checkUserList(user) { - const element = browser.element(`td=adminCreated${user}`); - element.waitForVisible(5000); - browser.pause(500); - const result = element.isVisible(); - if (Array.isArray(result)) { - return result[0]; - } - - return result; - } - - getUserFromList(user) { - return browser.element(`.rcx-table__cell:first-child:contains(${user}) figure`).should('be.visible'); - } - - adminSaveChanges() { - this.buttonSave.waitForVisible(5000); - browser.waitUntil(function () { - return browser.isEnabled('button.save'); - }, 5000); - this.buttonSave.click(); - } -} - -export default new Administration(); diff --git a/apps/meteor/tests/cypress/pageobjects/discussion.page.js b/apps/meteor/tests/cypress/pageobjects/discussion.page.js deleted file mode 100644 index 02131e9ad573c60c5c9f46ab6713fd6b6951e16f..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/pageobjects/discussion.page.js +++ /dev/null @@ -1,69 +0,0 @@ -import Page from './Page'; -import sideNav from './side-nav.page'; -import flexTab from './flex-tab.page'; -import global from './global'; - -class Discussion extends Page { - // Sidebar - this should actually be part of the sidebar-file - leaving it here for mergability - get newDiscussionButton() { - return browser.element('.menu-nav .js-create-discussion'); - } - - // Global - this should actually be part of the global-file - leaving it here for mergability - deleteRoom(roomName) { - if (roomName) { - sideNav.openChannel(roomName); - } - flexTab.operateFlexTab('info', true); - flexTab.deleteBtn.click(); - global.modal.waitForVisible(5000); - global.confirmPopup(); - } - - // Action Menu - get startDiscussionContextItem() { - return browser.element('[data-qa-id="start-discussion"][data-qa-type="message-action"]'); - } - - // Modal - get createDiscussionModal() { - return browser.element('#create-discussion'); - } - - get discussionName() { - return browser.element('.rcx-field:contains("Discussion name") input'); - } - - get discussionMessage() { - return browser.element('.rcx-field:contains("Your message") textarea'); - } - - get parentChannelName() { - return browser.element('.rcx-field:contains("Parent channel or group") input'); - } - - get saveDiscussionButton() { - return browser.element('button:contains("Create")'); - } - - // Sequences - - createDiscussion(parentChannelName, name, message) { - sideNav.newChannelBtnToolbar.click(); - sideNav.newDiscussionBtn.click(); - this.discussionName.type(name); - this.discussionMessage.type(message); - - this.parentChannelName.type(parentChannelName); - - browser.element('.rcx-options .rcx-option:first-child').click(); - - this.saveDiscussionButton.should('be.enabled'); - - this.saveDiscussionButton.click(); - } -} - -const discussion = new Discussion(); - -export { discussion }; diff --git a/apps/meteor/tests/cypress/pageobjects/flex-tab.page.js b/apps/meteor/tests/cypress/pageobjects/flex-tab.page.js deleted file mode 100644 index aa4c61368f366b465b4c7f9cd66d3664db8cdabf..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/pageobjects/flex-tab.page.js +++ /dev/null @@ -1,478 +0,0 @@ -import Page from './Page'; -import Global from './global'; - -class FlexTab extends Page { - get headerMoreActions() { - return browser.element('.rcx-room-header .rcx-button-group__item:not(.hidden) .rcx-icon--name-kebab'); - } - - get moreActions() { - return browser.element('.rcx-button-group__item:not(.hidden) .rcx-icon--name-kebab'); - } - - get sendBtn() { - return browser.element('.rcx-vertical-bar .rc-message-box__icon.js-send'); - } - - get messageInput() { - return browser.element('.rcx-vertical-bar .js-input-message'); - } - - get threadTab() { - return browser.element('.rcx-room-header .rcx-button-group__item:not(.hidden) .rcx-icon--name-thread'); - } - - // Channel Info Tab - get channelTab() { - return browser.element('.rcx-room-header .rcx-button-group__item:not(.hidden) .rcx-icon--name-info-circled'); - } - - get channelSettings() { - return browser.element('aside > h3 > div > i.rcx-box--full.rcx-icon--name-info-circled'); - } - - get channelSettingName() { - return browser.element('.channel-settings .rc-user-info__name'); - } - - get archiveBtn() { - return browser.element('.clearfix:last-child .icon-pencil'); - } - - get archiveRadio() { - return browser.element('.editing'); - } - - get archiveSave() { - return browser.element('.save'); - } - - get editNameBtn() { - return browser.element('[data-edit="name"]'); - } - - get editTopicBtn() { - return browser.element('[data-edit="topic"]'); - } - - get editAnnouncementBtn() { - return browser.element('[data-edit="announcement"]'); - } - - get editDescriptionBtn() { - return browser.element('[data-edit="description"]'); - } - - get editNotificationBtn() { - return browser.element('[data-edit="desktopNotifications"]'); - } - - get editMobilePushBtn() { - return browser.element('[data-edit="mobilePushNotifications"]'); - } - - get editEmailNotificationBtn() { - return browser.element('[data-edit="emailNotifications"]'); - } - - get editUnreadAlertBtn() { - return browser.element('[data-edit="unreadAlert"]'); - } - - get editNameTextInput() { - return browser.element('.channel-settings input[name="name"]'); - } - - get editTopicTextInput() { - return browser.element('.channel-settings input[name="topic"]'); - } - - get editAnnouncementTextInput() { - return browser.element('.channel-settings input[name="announcement"]'); - } - - get editDescriptionTextInput() { - return browser.element('.channel-settings input[name="description"]'); - } - - get editNameSave() { - return browser.element('.channel-settings .save'); - } - - get deleteBtn() { - return browser.element('.channel-settings .js-delete'); - } - - // Members Tab - get membersTab() { - return browser.element('.rcx-room-header .rcx-button-group__item:not(.hidden) .rcx-icon--name-members'); - } - - get membersTabContent() { - return browser.element('aside > h3 > div > i.rcx-box--full.rcx-icon--name-members'); - } - - get userSearchBar() { - return browser.element('#user-add-search'); - } - - get removeUserBtn() { - return browser.element('.remove-user'); - } - - get setOwnerBtn() { - return browser.element('.set-owner'); - } - - get setModeratorBtn() { - return browser.element('.set-moderator'); - } - - get muteUserBtn() { - return browser.element('.mute-user'); - } - - get viewAllBtn() { - return browser.element('.button.back'); - } - - get startVideoCall() { - return browser.element('.start-video-call'); - } - - get startAudioCall() { - return browser.element('.start-audio-call'); - } - - get showAll() { - return browser.element('.see-all'); - } - - get membersUserInfo() { - return browser.element('.flex-tab-container .info'); - } - - get avatarImage() { - return browser.element('aside.rcx-vertical-bar .rcx-avatar'); - } - - get memberUserName() { - return browser.element('.info h3'); - } - - get memberRealName() { - return browser.element('.info p'); - } - - // Search Tab - get searchTab() { - return browser.element('.rcx-room-header .rcx-button-group__item:not(.hidden) .rcx-icon--name-magnifier'); - } - - get searchTabContent() { - return browser.element('.rocket-search-result'); - } - - get messageSearchBar() { - return browser.element('#message-search'); - } - - get searchResult() { - return browser.element('.new-day'); - } - - // Notifications Tab - get notificationsTab() { - return browser.element('.rcx-option__content:contains("Notifications Preferences")'); - } - - get notificationsSettings() { - return browser.element('aside > h3 > div > i.rcx-box--full.rcx-icon--name-bell'); - } - - // Files Tab - get filesTab() { - return browser.element('.rcx-room-header .rcx-button-group__item:not(.hidden) .rcx-icon--name-clip'); - } - - get fileItem() { - return browser.element('.uploaded-files-list ul:first-child'); - } - - get filesTabContent() { - return browser.element('aside > h3 > div > i.rcx-icon--name-attachment'); - } - - get fileDelete() { - return browser.element('.uploaded-files-list ul:first-child .file-delete'); - } - - get fileDownload() { - return browser.element('.uploaded-files-list ul:first-child .file-download'); - } - - get fileName() { - return browser.element('.uploaded-files-list ul:first-child .room-file-item'); - } - - // Mentions Tab - get mentionsTab() { - return browser.element('.rcx-option__content:contains("Mentions")'); - } - - get mentionsTabContent() { - return browser.element('aside > h3 > div > i.rcx-icon--name-at'); - } - - // Starred Tab - get starredTab() { - return browser.element('.rcx-option__content:contains("Starred Messages")'); - } - - get starredTabContent() { - return browser.element('aside > h3 > div > i.rcx-icon--name-star'); - } - - // Pinned Tab - get pinnedTab() { - return browser.element('.rcx-option__content:contains("Pinned Messages")'); - } - - get pinnedTabContent() { - return browser.element('aside > h3 > div > i.rcx-icon--name-pin'); - } - - get firstSetting() { - return browser.element('.clearfix li:nth-child(1) .current-setting'); - } - - get secondSetting() { - return browser.element('.clearfix li:nth-child(2) .current-setting'); - } - - get thirdSetting() { - return browser.element('.clearfix li:nth-child(3) .current-setting'); - } - - get fourthSetting() { - return browser.element('.clearfix li:nth-child(4) .current-setting'); - } - - // admin view flextab items - get usersSendInvitationTab() { - return browser.element('.tab-button:not(.hidden) .tab-button-icon--send'); - } - - get usersAddUserTab() { - return browser.element('.tab-button:not(.hidden) .tab-button-icon--plus'); - } - - get usersSendInvitationTextArea() { - return browser.element('#inviteEmails'); - } - - get usersButtonCancel() { - return browser.element('.button.cancel'); - } - - get usersSendInvitationSend() { - return browser.element('.button.send'); - } - - get usersButtonSave() { - return browser.element('.button.save'); - } - - get usersAddUserName() { - return browser.element('#name'); - } - - get usersAddUserUsername() { - return browser.element('#username'); - } - - get usersAddUserEmail() { - return browser.element('#email'); - } - - get usersAddUserRoleList() { - return browser.element('#roleSelect'); - } - - get usersAddUserPassword() { - return browser.element('#password'); - } - - get usersAddUserRoleButton() { - return browser.element('#addRole'); - } - - get usersAddUserVerifiedCheckbox() { - return browser.element('#verified'); - } - - get usersAddUserChangePasswordCheckbox() { - return browser.element('#changePassword'); - } - - get usersAddUserDefaultChannelCheckbox() { - return browser.element('#joinDefaultChannels'); - } - - get usersAddUserWelcomeEmailCheckbox() { - return browser.element('#sendWelcomeEmail'); - } - - get usersAddUserRandomPassword() { - return browser.element('#randomPassword'); - } - - get emojiNewAliases() { - return browser.element('#aliases'); - } - - get emojiNewImageInput() { - return browser.element('#image'); - } - - get usersView() { - return browser.element('.rcx-vertical-bar:contains("User Info")'); - } - - get usersActivate() { - return browser.element('.rcx-option__content:contains("Activate")'); - } - - get usersDeactivate() { - return browser.element('.rcx-option__content:contains("Deactivate")'); - } - - getUserEl(username) { - return browser.element(`.flex-tab button[title="${username}"] > p`); - } - - archiveChannel() { - this.archiveBtn.waitForVisible(); - this.archiveBtn.click(); - this.archiveRadio.waitForVisible(); - this.archiveRadio.click(); - this.archiveSave.click(); - } - - addPeopleToChannel(user) { - this.userSearchBar.waitForVisible(); - this.userSearchBar.setValue(user); - browser.waitForVisible('.-autocomplete-item', 5000); - browser.click('.-autocomplete-item'); - } - - removePeopleFromChannel(user) { - this.enterUserView(user); - this.removeUserBtn.waitForVisible(5000); - this.removeUserBtn.click(); - } - - addRole(role) { - this.usersAddUserRoleList.waitForVisible(5000); - this.usersAddUserRoleList.click(); - browser.waitForVisible(`option[value=${role}]`, 5000); - browser.click(`option[value=${role}]`); - this.usersAddUserRoleButton.waitForVisible(5000); - this.usersAddUserRoleButton.click(); - browser.waitForVisible(`.remove-role=${role}`); - } - - operateFlexTab(desiredTab, desiredState) { - // desiredState true=open false=closed - - const operate = (tab, panel, more) => { - this[panel].should(!desiredState ? 'be.visible' : 'not.exist'); - - if (more) { - this.headerMoreActions.click(); - } - - this[tab].click(); - - // The button "more" keeps the focus when popover is closed from a click - // on an item, need to click again to change the status to unselected and - // allow the next click to open the popover again - if (more) { - this.headerMoreActions.click(); - } - - this[panel].should(desiredState ? 'be.visible' : 'not.exist'); - }; - - const tabs = { - info() { - operate('channelTab', 'channelSettings'); - }, - - search() { - operate('searchTab', 'messageSearchBar'); - }, - - members() { - operate('membersTab', 'avatarImage'); - }, - - notifications() { - operate('notificationsTab', 'notificationsSettings', true); - }, - - files() { - operate('filesTab', 'filesTabContent'); - }, - - mentions() { - operate('mentionsTab', 'mentionsTabContent', true); - }, - - starred() { - operate('starredTab', 'starredTabContent', true); - }, - - pinned() { - operate('pinnedTab', 'pinnedTabContent', true); - }, - }; - - tabs[desiredTab].call(this); - } - - setUserOwner(user) { - this.enterUserView(user); - this.setOwnerBtn.waitForVisible(5000); - this.setOwnerBtn.click(); - this.viewAllBtn.click(); - browser.pause(100); - } - - setUserModerator(user) { - this.enterUserView(user); - this.setModeratorBtn.waitForVisible(); - this.setModeratorBtn.click(); - this.viewAllBtn.click(); - browser.pause(100); - } - - muteUser(user) { - this.enterUserView(user); - this.muteUserBtn.waitForVisible(5000); - this.muteUserBtn.click(); - Global.confirmPopup(); - this.viewAllBtn.click(); - browser.pause(100); - } - - enterUserView(user) { - if (!this.membersUserInfo.isVisible()) { - const userEl = this.getUserEl(user); - userEl.waitForVisible(); - userEl.click(); - } - } -} - -export default new FlexTab(); diff --git a/apps/meteor/tests/cypress/pageobjects/global.js b/apps/meteor/tests/cypress/pageobjects/global.js deleted file mode 100644 index ad4d8dbfb55c7c11521f7852b6bf71212b7bc549..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/pageobjects/global.js +++ /dev/null @@ -1,59 +0,0 @@ -class Global { - // Modal - get modalOverlay() { - return browser.element('.rc-modal-wrapper'); - } - - get modal() { - return browser.element('.rcx-modal'); - } - - get modalConfirm() { - return browser.element('.rcx-modal .rcx-button--primary-danger'); - } - - get modalCancel() { - return browser.element('.rc-modal .js-modal'); - } - - get modalPasswordField() { - return browser.element('.rc-modal [type="password"]'); - } - - get modalFileName() { - return browser.element('.rc-modal #file-name'); - } - - get modalFileDescription() { - return browser.element('.rc-modal #file-description'); - } - - get modalFilePreview() { - return browser.element('.rc-modal .upload-preview-file'); - } - - get modalFileTitle() { - return browser.element('.rc-modal .upload-preview-title'); - } - - get toastAlert() { - return browser.element('.toast'); - } - - confirmPopup() { - this.modalConfirm.waitForVisible(5000); - browser.pause(500); - this.modalConfirm.click(); - this.modal.waitForVisible(5000, true); - } - - setWindowSize(width, height) { - cy.viewport(width, height); - } - - dismissToast() { - this.toastAlert.click(); - } -} - -export default new Global(); diff --git a/apps/meteor/tests/cypress/pageobjects/keyboard.js b/apps/meteor/tests/cypress/pageobjects/keyboard.js deleted file mode 100644 index 1fd552a838d628a7929700529ee9c1edac9a3a08..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/pageobjects/keyboard.js +++ /dev/null @@ -1,19 +0,0 @@ -const Keys = { - TAB: '\uE004', - ENTER: '\uE007', - ESCAPE: 'u\ue00c', -}; - -const sendEnter = function () { - browser.keys(Keys.ENTER); -}; - -const sendEscape = function () { - browser.keys(Keys.ESCAPE); -}; - -const sendTab = function () { - browser.keys(Keys.TAB); -}; - -export { sendEnter, sendEscape, sendTab }; diff --git a/apps/meteor/tests/cypress/pageobjects/login.page.js b/apps/meteor/tests/cypress/pageobjects/login.page.js deleted file mode 100644 index eac892d6ace8a6965467bb17d6930419bef9c4b9..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/pageobjects/login.page.js +++ /dev/null @@ -1,124 +0,0 @@ -import Page from './Page'; - -class LoginPage extends Page { - get registerButton() { - return cy.get('button.register'); - } - - get forgotPasswordButton() { - return cy.get('.forgot-password'); - } - - get backToLoginButton() { - return cy.get('.back-to-login'); - } - - get submitButton() { - return cy.get('.login'); - } - - get emailOrUsernameField() { - return cy.get('[name=emailOrUsername]'); - } - - get nameField() { - return cy.get('[name=name]'); - } - - get usernameField() { - return cy.get('[name=username]'); - } - - get emailField() { - return cy.get('[name=email]'); - } - - get passwordField() { - return cy.get('[name=pass]'); - } - - get confirmPasswordField() { - return cy.get('[name=confirm-pass]'); - } - - get reasonField() { - return cy.get('[name=reason]'); - } - - get inputUsername() { - return cy.get('form#login-card input#username'); - } - - get emailOrUsernameInvalidText() { - return cy.get('[name=emailOrUsername]~.input-error'); - } - - get nameInvalidText() { - return cy.get('[name=name]~.input-error'); - } - - get emailInvalidText() { - return cy.get('[name=email]~.input-error'); - } - - get passwordInvalidText() { - return cy.get('[name=pass]~.input-error'); - } - - get confirmPasswordInvalidText() { - return cy.get('[name=confirm-pass]~.input-error'); - } - - get registrationSucceededCard() { - return cy.get('#login-card h2'); - } - - open() { - localStorage.clear(); - super.open(''); - cy.wait(1000); - } - - gotToRegister() { - this.registerButton.click(); - } - - gotToForgotPassword() { - this.forgotPasswordButton.click(); - } - - registerNewUser({ username, email, password }) { - this.nameField.type(username); - this.emailField.type(email); - this.passwordField.type(password); - this.confirmPasswordField.type(password); - - this.submit(); - } - - registerNewAdmin({ adminUsername, adminEmail, adminPassword }) { - this.nameField.type(adminUsername); - this.emailField.type(adminEmail); - this.passwordField.type(adminPassword); - this.confirmPasswordField.type(adminPassword); - - this.submit(); - } - - login({ email, password }) { - this.emailOrUsernameField.type(email); - this.passwordField.type(password); - - this.submit(); - } - - loginSucceded({ email, password }) { - this.login({ email, password }); - } - - submit() { - this.submitButton.click(); - } -} - -export default new LoginPage(); diff --git a/apps/meteor/tests/cypress/pageobjects/main-content.page.js b/apps/meteor/tests/cypress/pageobjects/main-content.page.js deleted file mode 100644 index b9ab46a52211816982e4b0997e1aac520e6842f5..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/pageobjects/main-content.page.js +++ /dev/null @@ -1,361 +0,0 @@ -import Page from './Page'; -import flexTab from './flex-tab.page'; - -class MainContent extends Page { - get mainContent() { - return browser.element('.main-content'); - } - - // Main Content Header (Channel Title Area) - get emptyFavoriteStar() { - return browser.element('.rcx-room-header .rcx-icon--name-star'); - } - - get favoriteStar() { - return browser.element('.rcx-room-header .rcx-icon--name-star-filled'); - } - - get channelTitle() { - return browser.element('.rcx-room-header'); - } - - // Main Content Footer (Message Input Area) - get messageInput() { - return browser.element('.js-input-message'); - } - - get sendBtn() { - return browser.element('.rc-message-box__icon.js-send'); - } - - get messageBoxActions() { - return browser.element('.rc-message-box__icon'); - } - - get recordBtn() { - return browser.element('.js-audio-message-record'); - } - - get emojiBtn() { - return browser.element('.rc-message-box__icon.emoji-picker-icon'); - } - - get messagePopUp() { - return browser.element('.message-popup'); - } - - get messagePopUpTitle() { - return browser.element('.message-popup-title'); - } - - get messagePopUpItems() { - return browser.element('.message-popup-items'); - } - - get messagePopUpFirstItem() { - return browser.element('.popup-item.selected'); - } - - get mentionAllPopUp() { - return browser.element('.popup-item[data-id="all"]'); - } - - get joinChannelBtn() { - return browser.element('.button.join'); - } - - // Messages - get lastMessageUser() { - return browser.element('[data-qa-type="message"]:last-child [data-username]'); - } - - get lastMessage() { - return browser.element('[data-qa-type="message"]:last-child'); - } - - get lastMessageDesc() { - return browser.element('[data-qa-type="message"]:last-child .body .attachment-description'); - } - - get lastMessageRoleAdded() { - return browser.element('[data-qa-type="message"]:last-child.subscription-role-added .body'); - } - - get beforeLastMessage() { - return browser.element('[data-qa-type="message"]:nth-last-child(2) [data-qa-type="message-body"]'); - } - - get lastMessageUserTag() { - return browser.element('[data-qa-type="message"]:last-child .role-tag'); - } - - get lastMessageImg() { - return browser.element('[data-qa-type="message"]:last-child .attachment-image img'); - } - - get lastMessageTextAttachment() { - return browser.element('[data-qa-type="message"]:last-child .attachment-text'); - } - - get beforeLastMessageQuote() { - return browser.element('[data-qa-type="message"]:nth-last-child(2)'); - } - - get lastMessageQuote() { - return browser.element('[data-qa-type="message"]:last-child'); - } - - get messageOptionsBtn() { - return browser.element('[data-qa-type="message"]:last-child [data-qa-type="message-action-menu"][data-qa-id="menu"]'); - } - - get messageOptionsBtns() { - return browser.element('[data-qa-type="message"]:last-child [data-qa-type="message-action-menu"]'); - } - - get messageActionMenu() { - return browser.element('[data-qa-type="message-action-menu-options"]'); - } - - get messageActionMenuBtns() { - return browser.element('[data-qa-type="message-action-menu-options"] [data-qa-type="message-action"]'); - } - - get messageReply() { - return browser.element('[data-qa-type="message-action"][data-qa-id="reply-in-thread"]'); - } - - get messageEdit() { - return browser.element('[data-qa-id="edit-message"][data-qa-type="message-action"]'); - } - - get messageDelete() { - return browser.element('[data-qa-id="delete-message"][data-qa-type="message-action"]'); - } - - get messagePermalink() { - return browser.element('[data-qa-id="permalink"][data-qa-type="message-action"]'); - } - - get messageCopy() { - return browser.element('[data-qa-id="copy"][data-qa-type="message-action"]'); - } - - get messageQuote() { - return browser.element('[data-qa-id="quote-message"][data-qa-type="message-action"]'); - } - - get messageStar() { - return browser.element('[data-qa-id="star-message"][data-qa-type="message-action"]'); - } - - get messageUnread() { - return browser.element('[data-qa-id="mark-message-as-unread"][data-qa-type="message-action"]'); - } - - get messageReplyInDM() { - return browser.element('[data-qa-id="reply-directly"][data-qa-type="message-action"]'); - } - - get messagePin() { - return browser.element('[data-qa-id="pin-message"][data-qa-type="message-action"]'); - } - - // Emojis - get emojiPickerMainScreen() { - return browser.element('.emoji-picker'); - } - - get emojiPickerPeopleIcon() { - return browser.element('.emoji-picker .icon-people'); - } - - get emojiPickerNatureIcon() { - return browser.element('.emoji-picker .icon-nature'); - } - - get emojiPickerFoodIcon() { - return browser.element('.emoji-picker .icon-food'); - } - - get emojiPickerActivityIcon() { - return browser.element('.emoji-picker .icon-activity'); - } - - get emojiPickerTravelIcon() { - return browser.element('.emoji-picker .icon-travel'); - } - - get emojiPickerObjectsIcon() { - return browser.element('.emoji-picker .icon-objects'); - } - - get emojiPickerSymbolsIcon() { - return browser.element('.emoji-picker .icon-symbols'); - } - - get emojiPickerFlagsIcon() { - return browser.element('.emoji-picker .icon-flags'); - } - - get emojiPickerModifierIcon() { - return browser.element('.emoji-picker .icon-symbols'); - } - - get emojiPickerChangeTone() { - return browser.element('.emoji-picker .change-tone'); - } - - get emojiPickerCustomIcon() { - return browser.element('.emoji-picker .icon-rocket'); - } - - get emojiPickerRecentIcon() { - return browser.element('.emoji-picker .icon-recent'); - } - - get emojiPickerFilter() { - return browser.element('.emoji-picker .js-emojipicker-search'); - } - - get emojiPickerEmojiContainer() { - return browser.element('.emoji-picker .emojis'); - } - - get emojiGrinning() { - return browser.element('.emoji-picker .emoji-grinning'); - } - - get emojiSmile() { - return browser.element('.emoji-picker .emoji-smile'); - } - - // Popover - get popoverWrapper() { - return browser.element('.rc-popover'); - } - - // Sends a message and wait for the message to equal the text sent - sendMessage(text) { - this.setTextToInput(text); - this.sendBtn.click(); - cy.wait(300); - this.lastMessage.should('be.visible'); - cy.get('[data-qa-type="message"]:last-child [data-qa-type="message-body"]').should('contain', text); - } - - // adds text to the input - addTextToInput(text) { - this.messageInput.type(text); - } - - // Clear and sets the text to the input - setTextToInput(text) { - cy.wait(400); - this.messageInput.clear(text); - if (text) { - this.messageInput.type(text); - } - } - - // uploads a file in the given filepath (url). - fileUpload(filePath) { - this.sendMessage('Prepare for the file'); - this.fileAttachment.chooseFile(filePath); - } - - waitForLastMessageEqualsText(text) { - cy.get('[data-qa-type="message"]:last-child [data-qa-type="message-body"]').should('contain', text); - } - - waitForLastMessageQuoteEqualsText(text) { - cy.get('[data-qa-type="message"]:last-child .rcx-attachment__details').should('contain', text); - } - - waitForLastMessageEqualsHtml(text) { - cy.wait(200); - cy.get('[data-qa-type="message"]:last-child [data-qa-type="message-body"]').should('contain.html', text); - } - - waitForLastMessageTextAttachmentEqualsText(text) { - return cy.get('[data-qa-type="message"]:last-child .rcx-attachment__details .rcx-box--with-inline-elements').should('contain', text); - } - - openMessageActionMenu() { - this.lastMessage.realHover().should('be.visible'); - - cy.waitUntil(() => { - return this.messageOptionsBtns.then((el) => el.length); - }); - - this.messageOptionsBtns.should('be.visible'); - - this.messageOptionsBtn.click().wait(100); - - cy.waitUntil(() => { - return this.messageActionMenuBtns.then((el) => el.length); - }); - - this.messageActionMenuBtns.should('be.visible'); - } - - closeMessageActionMenu() { - // Old popover closes only on click outside - cy.get('body').realHover({ position: 'topLeft' }).click(); - } - - setLanguageToEnglish() { - this.settingLanguageSelect.click(); - this.settingLanguageEnglish.click(); - this.settingSaveBtn.click(); - } - - tryToMentionAll() { - this.addTextToInput('@all'); - this.sendBtn.click(); - this.waitForLastMessageEqualsText('Notify all in this room is not allowed'); - } - - // Do one of the message actions, based on the "action" parameter inserted. - selectAction(action) { - switch (action) { - case 'edit': - this.messageEdit.click().wait(100); - this.messageInput.type('this message was edited'); - break; - case 'reply': - this.messageReply.click().wait(100); - flexTab.messageInput.type('this is a reply message'); - break; - case 'delete': - this.messageDelete.click(); - break; - case 'permalink': - this.messagePermalink.click(); - break; - case 'copy': - this.messageCopy.click(); - break; - case 'quote': - this.messageQuote.click().wait(100); - this.messageInput.type('this is a quote message'); - break; - case 'star': - this.messageStar.click(); - break; - case 'unread': - this.messageUnread.click(); - break; - case 'reaction': - this.messageReply.click(); - this.emojiPickerPeopleIcon.click(); - this.emojiGrinning.click(); - break; - case 'close': - this.messageClose.click(); - break; - } - } -} - -export default new MainContent(); diff --git a/apps/meteor/tests/cypress/pageobjects/preferences-main-content.page.js b/apps/meteor/tests/cypress/pageobjects/preferences-main-content.page.js deleted file mode 100644 index a5f32c9d48bcdc7592cb411ae5222b6cf1f7f002..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/pageobjects/preferences-main-content.page.js +++ /dev/null @@ -1,71 +0,0 @@ -import Page from './Page'; - -class PreferencesMainContent extends Page { - get formTextInput() { - return browser.element('.rocket-form'); - } - - get realNameTextInput() { - return browser.element('label:contains("Name")').closest('.rcx-field').find('input'); - } - - get userNameTextInput() { - return browser.element('label:contains("Username")').closest('.rcx-field').find('input'); - } - - get emailTextInput() { - return browser.element('label:contains("Email")').closest('.rcx-field').find('input'); - } - - get passwordTextInput() { - return browser.element('label:contains("Password")').closest('.rcx-field').find('input'); - } - - get resendVerificationEmailBtn() { - return browser.element('#resend-verification-email'); - } - - get avatarFileInput() { - return browser.element('.avatar-file-input'); - } - - get useUploadedAvatar() { - return browser.element('.avatar-suggestion-item:nth-of-type(2) .select-service'); - } - - get submitBtn() { - return browser.element('button:contains("Save changes")'); - } - - realNameTextInputEnabled() { - return browser.isEnabled('input[name="realname"]'); - } - - userNameTextInputEnabled() { - return browser.isEnabled('input[name="username"]'); - } - - changeUsername(userName) { - this.userNameTextInput.clear().type(userName); - } - - changeRealName(realName) { - this.realNameTextInput.clear().type(realName); - } - - changeEmail(email) { - this.emailTextInput.clear().type(email); - } - - saveChanges() { - this.submitBtn.should('be.enabled'); - this.submitBtn.click(); - } - - changeAvatarUpload(url) { - this.avatarFileInput.chooseFile(url); - this.useUploadedAvatar.click(); - } -} - -export default new PreferencesMainContent(); diff --git a/apps/meteor/tests/cypress/pageobjects/settings.js b/apps/meteor/tests/cypress/pageobjects/settings.js deleted file mode 100644 index d62825e1b278b90bfd95565b90a759bd0f0f15f0..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/pageobjects/settings.js +++ /dev/null @@ -1,42 +0,0 @@ -import supertest from 'supertest'; - -import { adminUsername, adminPassword } from '../../data/user.js'; - -const testUrl = (typeof Cypress !== 'undefined' && Cypress.env('TEST_API_URL')) || process.env.TEST_API_URL || 'http://localhost:3000'; - -const request = supertest(testUrl); -const prefix = '/api/v1/'; - -const login = { - user: adminUsername, - password: adminPassword, -}; - -function api(path) { - return prefix + path; -} - -export async function getSettingValue(name) { - let credentials = { - 'X-Auth-Token': undefined, - 'X-User-Id': undefined, - }; - - // login - const reponseLogin = await request.post(api('login')).send(login).expect('Content-Type', 'application/json').expect(200); - - credentials = { - 'X-Auth-Token': reponseLogin.body.data.authToken, - 'X-User-Id': reponseLogin.body.data.userId, - }; - - const responseGetSetting = await request - .get(api(`settings/${name}`)) - .set(credentials) - .expect('Content-Type', 'application/json') - .expect(200); - - await request.post(api('logout')).set(credentials).expect('Content-Type', 'application/json').expect(200); - - return responseGetSetting.body.value; -} diff --git a/apps/meteor/tests/cypress/pageobjects/setup-wizard.page.js b/apps/meteor/tests/cypress/pageobjects/setup-wizard.page.js deleted file mode 100644 index 70db966e757a327cdb84d26894c52693314c75e6..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/pageobjects/setup-wizard.page.js +++ /dev/null @@ -1,66 +0,0 @@ -import Page from './Page'; -import { adminEmail, adminPassword } from '../../data/user'; - -class SetupWizard extends Page { - get nextStep() { - return browser.element('button:contains("Next"):visible'); - } - - get goToWorkspace() { - return browser.element('button:contains("Confirm")'); - } - - get organizationType() { - return browser.element('[name="organizationType"]'); - } - - get organizationName() { - return browser.element('[name="organizationName"]'); - } - - get industry() { - return browser.element('[name="organizationIndustry"]'); - } - - get size() { - return browser.element('[name="organizationSize"]'); - } - - get country() { - return browser.element('[name="country"]'); - } - - get registeredServer() { - return browser.element('input[name=email]'); - } - - get registerButton() { - return browser.element('button:contains("Register")'); - } - - get agreementField() { - return browser.element('input[name=agreement]').closest('.rcx-check-box'); - } - - get standaloneServer() { - return browser.element('button:contains("Continue as standalone")'); - } - - get standaloneConfirmText() { - return browser.element('.rcx-box:contains("Standalone Server Confirmation")'); - } - - login() { - cy.login(adminEmail, adminPassword); - } - - goNext() { - this.nextStep.click(); - } - - goToHome() { - this.goToWorkspace.click(); - } -} - -export default new SetupWizard(); diff --git a/apps/meteor/tests/cypress/pageobjects/side-nav.page.js b/apps/meteor/tests/cypress/pageobjects/side-nav.page.js deleted file mode 100644 index 2d7d3546821b01eb44a67345694e89e6bff4a343..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/pageobjects/side-nav.page.js +++ /dev/null @@ -1,222 +0,0 @@ -import Page from './Page'; -import mainContent from './main-content.page'; - -class SideNav extends Page { - // New channel - get channelType() { - return browser.element('#modal-root .rcx-field:contains("Private") .rcx-toggle-switch__fake'); - } - - get channelReadOnly() { - return browser.elements('.create-channel__switches .rc-switch__button').value[1]; - } - - get channelName() { - return browser.element('#modal-root [placeholder="Channel Name"]'); - } - - get saveChannelBtn() { - return browser.element('#modal-root button:contains("Create")'); - } - - // Account box - getPopOverContent() { - return browser.element('.rc-popover__content'); - } - - get accountBoxUserName() { - return browser.element('.sidebar__account-username'); - } - - get accountBoxUserAvatar() { - return browser.element('.sidebar__account .avatar-image'); - } - - get accountMenu() { - return browser.element('.sidebar__account'); - } - - get sidebarHeader() { - return browser.element('.sidebar__header'); - } - - get sidebarUserMenu() { - return browser.element('[data-qa="sidebar-avatar-button"]'); - } - - get sidebarMenu() { - return browser.element('.sidebar__toolbar-button-icon--menu'); - } - - get popOverContent() { - return browser.element('.rc-popover__content'); - } - - get popOverHideOption() { - return browser.element('.rcx-option__content:contains("Hide")'); - } - - get statusOnline() { - return browser.element('.rcx-box--with-inline-elements:contains("online")'); - } - - get statusAway() { - return browser.element('.rcx-box--with-inline-elements:contains("away")'); - } - - get statusBusy() { - return browser.element('.rcx-box--with-inline-elements:contains("busy")'); - } - - get statusOffline() { - return browser.element('.rcx-box--with-inline-elements:contains("offline")'); - } - - get account() { - return browser.element('.rcx-option__content:contains("My Account")'); - } - - get admin() { - return browser.element('.rcx-option__content:contains("Administration")'); - } - - get logout() { - return browser.element('.rcx-option__content:contains("Logout")'); - } - - get sideNavBar() { - return browser.element('.sidebar'); - } - - // Toolbar - get spotlightSearchIcon() { - return browser.element('[data-qa="sidebar-search"]'); - } - - get spotlightSearch() { - return browser.element('[data-qa="sidebar-search-input"]'); - } - - get spotlightSearchPopUp() { - return browser.element('[data-qa="sidebar-search-result"]'); - } - - get newChannelBtnToolbar() { - return browser.element('[data-qa="sidebar-create"]'); - } - - get newChannelBtn() { - return browser.element('.rcx-option__content:contains("Channel")'); - } - - get newDiscussionBtn() { - return browser.element('.rcx-option__content:contains("Discussion")'); - } - - get newChannelIcon() { - return browser.element('[data-qa="sidebar-create-channel"]'); - } - - // Rooms List - get general() { - return this.getChannelFromList('general'); - } - - get channelLeave() { - return browser.element('.leave-room'); - } - - get channelHoverIcon() { - return browser.element('.rooms-list > .wrapper > ul [title="general"] .icon-eye-off'); - } - - // Account - get preferences() { - return browser.element('[href="/account/preferences"]'); - } - - get profile() { - return browser.element('[href="/account/profile"]'); - } - - get avatar() { - return browser.element('[href="/changeavatar"]'); - } - - get preferencesClose() { - return browser.element('.flex-nav i.rcx-icon--name-cross'); - } - - get burgerBtn() { - return browser.element('.burger, [aria-label="Open_menu"]'); - } - - get sidebarWrap() { - return browser.element('.sidebar-wrap'); - } - - get firstSidebarItem() { - return browser.element('.sidebar-item'); - } - - get firstSidebarItemMenu() { - return browser.element('[data-qa=sidebar-avatar-button]'); - } - - get popoverOverlay() { - return browser.element('.rc-popover.rc-popover--sidebar-item'); - } - - // Opens a channel via rooms list - openChannel(channelName) { - cy.contains('[data-qa="sidebar-item-title"]', channelName).scrollIntoView().click(); - cy.get('.rcx-room-header').should('contain', channelName); - } - - // Opens a channel via spotlight search - searchChannel(channelName) { - this.spotlightSearch.should('be.visible'); - - // Should have focus automatically, but some times it's not happening - this.spotlightSearch.click(); - - this.spotlightSearch.should('have.focus'); - this.spotlightSearch.type(channelName); - cy.wait(500); - - cy.get( - `[data-qa="sidebar-search-result"] .rcx-sidebar-item--clickable:contains("${channelName}"), [data-qa="sidebar-search-result"] .rcx-sidebar-item[aria-label='${channelName}']`, - ).click(); - - cy.get('.rcx-room-header').should('contain', channelName); - } - - // Gets a channel from the rooms list - getChannelFromList(channelName) { - return cy.contains('[data-qa="sidebar-item-title"]', channelName).scrollIntoView(); - } - - createChannel(channelName, isPrivate /* isReadOnly*/) { - this.newChannelBtnToolbar.click(); - - this.newChannelBtn.click(); - - if (!isPrivate) { - this.channelType.click({ multiple: true }); - } - - this.channelName.type(channelName); - - this.saveChannelBtn.should('be.enabled'); - - // if (isReadOnly) { - // this.channelReadOnly.click(); - // } - - this.saveChannelBtn.click(); - this.channelType.should('not.exist'); - mainContent.messageInput.should('be.focused'); - } -} - -export default new SideNav(); diff --git a/apps/meteor/tests/cypress/plugins/index.js b/apps/meteor/tests/cypress/plugins/index.js deleted file mode 100644 index f2c89a867a7e50559d4e92a2efd239312ab3409e..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/plugins/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// *********************************************************** -// This example plugins/index.js can be used to load plugins -// -// You can change the location of this file or turn off loading -// the plugins file with the 'pluginsFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/plugins-guide -// *********************************************************** - -// This function is called when a project is opened or re-opened (e.g. due to -// the project's config changing) - -module.exports = (/* on, config*/) => { - // `on` is used to hook into various events Cypress emits - // `config` is the resolved Cypress config -}; diff --git a/apps/meteor/tests/cypress/support/commands.js b/apps/meteor/tests/cypress/support/commands.js deleted file mode 100644 index df259223850bb4cd5ce1d4830a5bea6ebe19d608..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/support/commands.js +++ /dev/null @@ -1,62 +0,0 @@ -// *********************************************** -// This example commands.js shows you how to -// create various custom commands and overwrite -// existing commands. -// -// For more comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** -// -// -import 'cypress-wait-until'; - -// -- This is a parent command -- -Cypress.Commands.add('login', (email, password) => - cy.window().then( - ({ Meteor }) => - new Promise((resolve) => { - Meteor.loginWithPassword(email, password, resolve); - }), - ), -); - -Cypress.Commands.add('logout', () => - cy.window().then( - ({ Meteor, FlowRouter }) => - new Promise((resolve) => { - Meteor.startup(() => { - setTimeout(() => { - const user = Meteor.user(); - if (!user) { - return resolve(); - } - - Meteor.logout(() => { - Meteor.call('logoutCleanUp', user); - FlowRouter.go('home'); - resolve(); - }); - }, 500); - }); - }), - ), -); - -// -// -- This is a child command -- -Cypress.Commands.add('getLocation', { prevSubject: 'element' }, (subject) => subject.get(0).getBoundingClientRect()); -// -// -// -- This is a dual command -- -// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) -// -// -// -- This will overwrite an existing command -- -// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) - -global.browser = { - element(attr) { - return cy.get(attr); - }, -}; diff --git a/apps/meteor/tests/cypress/support/index.js b/apps/meteor/tests/cypress/support/index.js deleted file mode 100644 index 7d3c23ed6a40c9b63fd1109288f7b492d0d9a1ca..0000000000000000000000000000000000000000 --- a/apps/meteor/tests/cypress/support/index.js +++ /dev/null @@ -1,47 +0,0 @@ -// *********************************************************** -// This example support/index.js is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -import 'cypress-real-events/support'; - -// Import commands.js using ES2015 syntax: -import './commands'; - -// Cypress.Cookies.debug(true); - -Cypress.Cookies.defaults({ - preserve: ['rc_uid', 'rc_token'], -}); - -Cypress.LocalStorage.clear = function () {}; - -Cypress.on('uncaught:exception', (error) => { - console.error(error); - return false; -}); - -// Disable CSS animations -// Cypress.on('window:load', (win) => { -// win.document.querySelector('head').insertAdjacentHTML( -// 'beforeend', -// ` -// <style> -// * { transition-duration: 0.001s !important; animation-duration: 0.001s !important;} -// </style> -// `, -// ); -// }); - -// Alternatively you can use CommonJS syntax: -// require('./commands') diff --git a/apps/meteor/tests/data/api-data.js b/apps/meteor/tests/data/api-data.js index 92e45852cac4a373fb07db4f5aa91c6c28196378..701d2bbfac4fc86c726437c000f8c31cda5d389e 100644 --- a/apps/meteor/tests/data/api-data.js +++ b/apps/meteor/tests/data/api-data.js @@ -4,7 +4,7 @@ import { publicChannelName, privateChannelName } from './channel.js'; import { roleNameUsers, roleNameSubscriptions, roleScopeUsers, roleScopeSubscriptions, roleDescription } from './role.js'; import { username, email, adminUsername, adminPassword } from './user.js'; -const apiUrl = (typeof Cypress !== 'undefined' && Cypress.env('TEST_API_URL')) || process.env.TEST_API_URL || 'http://localhost:3000'; +const apiUrl = process.env.TEST_API_URL || 'http://localhost:3000'; export const request = supertest(apiUrl); const prefix = '/api/v1/'; diff --git a/apps/meteor/tests/data/checks.js b/apps/meteor/tests/data/checks.js index 4895530d23a1bc29c2c668c70bd302780ca07c06..abfe171915ab48c785789951fd5bc24558352360 100644 --- a/apps/meteor/tests/data/checks.js +++ b/apps/meteor/tests/data/checks.js @@ -1,5 +1,3 @@ -import loginPage from '../cypress/pageobjects/login.page'; - export let publicChannelCreated = false; export let privateChannelCreated = false; export let directMessageCreated = false; @@ -15,28 +13,3 @@ export function setPrivateChannelCreated(status) { export function setDirectMessageCreated(status) { directMessageCreated = status; } - -export function checkIfUserIsValid(username, email, password) { - loginPage.open(); - - return cy.window().then(({ Meteor }) => { - const user = Meteor.user(); - if (!user || user.username !== username) { - return new Promise((resolve) => { - Meteor.loginWithPassword(email, password, (error) => { - if (error && error.error === 403) { - Meteor.logout(() => { - loginPage.gotToRegister(); - loginPage.registerNewUser({ username, email, password }); - cy.get('form#login-card input#username').should('be.visible'); - cy.get('#login-card button.login').click(); - resolve(); - }); - } else { - resolve(); - } - }); - }); - } - }); -} diff --git a/apps/meteor/tests/e2e/utils/pageobjects/Global.ts b/apps/meteor/tests/e2e/utils/pageobjects/Global.ts index 64a3c4a297793d8a2a686ce880fc89ad73516332..f6750773844c50362badc0bab7724ee5d45d3489 100644 --- a/apps/meteor/tests/e2e/utils/pageobjects/Global.ts +++ b/apps/meteor/tests/e2e/utils/pageobjects/Global.ts @@ -50,10 +50,6 @@ class Global extends BasePage { await this.modalConfirm().click(); } - // public async setWindowSize(width, height): Promise<void> { - // cy.viewport(width, height); - // } - // public async dismissToast(): Promise<void> { await this.toastAlert().click(); } diff --git a/apps/meteor/tests/mocks/client/jsdom.ts b/apps/meteor/tests/mocks/client/jsdom.ts index ead125473f78b3e77f19482ce193cab59b32aeee..3398a619a93225494393496b2dcf5da26627f47b 100644 --- a/apps/meteor/tests/mocks/client/jsdom.ts +++ b/apps/meteor/tests/mocks/client/jsdom.ts @@ -1,6 +1,6 @@ import globalJsdom from 'jsdom-global'; -const testUrl = process.env.CYPRESS_BASE_URL || 'http://localhost:3000'; +const testUrl = process.env.TEST_API_URL || 'http://localhost:3000'; export const enableJsdom = (): void => { globalJsdom('<!doctype html><html><head><meta charset="utf-8"></head><body></body></html>', { diff --git a/yarn.lock b/yarn.lock index e4a840710703cdc45b9430c0b63e51483e5fce76..b9e6dd6120913c47c77478435e15569845e23914 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2411,42 +2411,6 @@ __metadata: languageName: node linkType: hard -"@cypress/request@npm:^2.88.5": - version: 2.88.10 - resolution: "@cypress/request@npm:2.88.10" - 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 - http-signature: ~1.3.6 - is-typedarray: ~1.0.0 - isstream: ~0.1.2 - json-stringify-safe: ~5.0.1 - mime-types: ~2.1.19 - performance-now: ^2.1.0 - qs: ~6.5.2 - safe-buffer: ^5.1.2 - tough-cookie: ~2.5.0 - tunnel-agent: ^0.6.0 - uuid: ^8.3.2 - checksum: 69c3e3b332e9be4866a900f6bcca5d274d8cea6c99707fbcce061de8dbab11c9b1e39f4c017f6e83e6e682717781d4f6106fd6b7cf9546580fcfac353b6676cf - languageName: node - linkType: hard - -"@cypress/xvfb@npm:^1.2.4": - version: 1.2.4 - resolution: "@cypress/xvfb@npm:1.2.4" - dependencies: - debug: ^3.1.0 - lodash.once: ^4.1.1 - checksum: 7bdcdaeb1bb692ec9d9bf8ec52538aa0bead6764753f4a067a171a511807a43fab016f7285a56bef6a606c2467ff3f1365e1ad2d2d583b81beed849ee1573fd1 - languageName: node - linkType: hard - "@dabh/diagnostics@npm:^2.0.2": version: 2.0.3 resolution: "@dabh/diagnostics@npm:2.0.3" @@ -4909,9 +4873,6 @@ __metadata: cross-env: ^7.0.3 css-vars-ponyfill: ^2.4.7 csv-parse: ^5.0.4 - cypress: ^7.7.0 - cypress-real-events: ^1.7.0 - cypress-wait-until: ^1.7.2 date-fns: ^2.28.0 dompurify: ^2.3.6 ejson: ^2.2.2 @@ -7545,7 +7506,7 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^14.0.10, @types/node@npm:^14.0.26, @types/node@npm:^14.14.31, @types/node@npm:^14.14.37, @types/node@npm:^14.18.12": +"@types/node@npm:^14.0.10, @types/node@npm:^14.0.26, @types/node@npm:^14.14.37, @types/node@npm:^14.18.12": version: 14.18.12 resolution: "@types/node@npm:14.18.12" checksum: 8a0273caa0584020adb8802784fc7d4f18f05e6c205335b7f3818a91d6b0c22736b9f51da3428d5bc54076ad47f1a4d6d57990a3ce8489a520ac66b2b3ff24bc @@ -7830,14 +7791,7 @@ __metadata: languageName: node linkType: hard -"@types/sinonjs__fake-timers@npm:^6.0.2": - version: 6.0.4 - resolution: "@types/sinonjs__fake-timers@npm:6.0.4" - checksum: 200cb24235409964269465e8a94ad735ec8bab98f3b2405cd6351fa6f6399be268cbbd4e824c9d361d9431ae11070cff4c3b6400b18aff03cb7933985853c0c9 - languageName: node - linkType: hard - -"@types/sizzle@npm:*, @types/sizzle@npm:^2.3.2": +"@types/sizzle@npm:*": version: 2.3.3 resolution: "@types/sizzle@npm:2.3.3" checksum: 586a9fb1f6ff3e325e0f2cc1596a460615f0bc8a28f6e276ac9b509401039dd242fa8b34496d3a30c52f5b495873922d09a9e76c50c2ab2bcc70ba3fb9c4e160 @@ -8113,15 +8067,6 @@ __metadata: languageName: node linkType: hard -"@types/yauzl@npm:^2.9.1": - version: 2.9.2 - resolution: "@types/yauzl@npm:2.9.2" - dependencies: - "@types/node": "*" - checksum: dfb49abe82605615712fc694eaa4f7068fe30aa03f38c085e2c2e74408beaad30471d36da9654a811482ece2ea4405575fd99b19c0aa327ed2a9736b554bbf43 - languageName: node - linkType: hard - "@types/yoga-layout@npm:1.9.2": version: 1.9.2 resolution: "@types/yoga-layout@npm:1.9.2" @@ -8904,7 +8849,7 @@ __metadata: languageName: node linkType: hard -"ansi-escapes@npm:^4.2.1, ansi-escapes@npm:^4.3.0": +"ansi-escapes@npm:^4.2.1": version: 4.3.2 resolution: "ansi-escapes@npm:4.3.2" dependencies: @@ -9076,7 +9021,7 @@ __metadata: languageName: node linkType: hard -"arch@npm:^2.1.0, arch@npm:^2.2.0": +"arch@npm:^2.1.0": version: 2.2.0 resolution: "arch@npm:2.2.0" checksum: e21b7635029fe8e9cdd5a026f9a6c659103e63fff423834323cdf836a1bb240a72d0c39ca8c470f84643385cf581bd8eda2cad8bf493e27e54bd9783abe9101f @@ -10454,13 +10399,6 @@ __metadata: languageName: node linkType: hard -"blob-util@npm:^2.0.2": - version: 2.0.2 - resolution: "blob-util@npm:2.0.2" - checksum: d543e6b92e4ca715ca33c78e89a07a2290d43e5b2bc897d7ec588c5c7bbf59df93e45225ac0c9258aa6ce4320358990f99c9288f1c48280f8ec5d7a2e088d19b - languageName: node - linkType: hard - "blockstack@npm:19.3.0": version: 19.3.0 resolution: "blockstack@npm:19.3.0" @@ -10487,7 +10425,7 @@ __metadata: languageName: node linkType: hard -"bluebird@npm:^3.1.5, bluebird@npm:^3.3.5, bluebird@npm:^3.5.0, bluebird@npm:^3.5.5, bluebird@npm:^3.7.2": +"bluebird@npm:^3.1.5, bluebird@npm:^3.3.5, bluebird@npm:^3.5.0, bluebird@npm:^3.5.5": version: 3.7.2 resolution: "bluebird@npm:3.7.2" checksum: 869417503c722e7dc54ca46715f70e15f4d9c602a423a02c825570862d12935be59ed9c7ba34a9b31f186c017c23cac6b54e35446f8353059c101da73eac22ef @@ -11137,13 +11075,6 @@ __metadata: languageName: node linkType: hard -"cachedir@npm:^2.3.0": - version: 2.3.0 - resolution: "cachedir@npm:2.3.0" - checksum: ec90cb0f2e6336e266aa748dbadf3da9e0b20e843e43f1591acab7a3f1451337dc2f26cb9dd833ae8cfefeffeeb43ef5b5ff62782a685f4e3c2305dd98482fcb - languageName: node - linkType: hard - "call-bind@npm:^1.0.0, call-bind@npm:^1.0.2": version: 1.0.2 resolution: "call-bind@npm:1.0.2" @@ -11573,13 +11504,6 @@ __metadata: languageName: node linkType: hard -"check-more-types@npm:^2.24.0": - version: 2.24.0 - resolution: "check-more-types@npm:2.24.0" - checksum: b09080ec3404d20a4b0ead828994b2e5913236ef44ed3033a27062af0004cf7d2091fbde4b396bf13b7ce02fb018bc9960b48305e6ab2304cd82d73ed7a51ef4 - languageName: node - linkType: hard - "cheerio-select@npm:^1.5.0": version: 1.6.0 resolution: "cheerio-select@npm:1.6.0" @@ -11832,7 +11756,7 @@ __metadata: languageName: node linkType: hard -"cli-table3@npm:^0.6.1, cli-table3@npm:~0.6.0": +"cli-table3@npm:^0.6.1": version: 0.6.1 resolution: "cli-table3@npm:0.6.1" dependencies: @@ -12209,13 +12133,6 @@ __metadata: languageName: node linkType: hard -"commander@npm:^5.1.0": - version: 5.1.0 - resolution: "commander@npm:5.1.0" - checksum: 0b7fec1712fbcc6230fcb161d8d73b4730fa91a21dc089515489402ad78810547683f058e2a9835929c212fead1d6a6ade70db28bbb03edbc2829a9ab7d69447 - languageName: node - linkType: hard - "commander@npm:^6.1.0, commander@npm:^6.2.1": version: 6.2.1 resolution: "commander@npm:6.2.1" @@ -12230,13 +12147,6 @@ __metadata: languageName: node linkType: hard -"common-tags@npm:^1.8.0": - version: 1.8.2 - resolution: "common-tags@npm:1.8.2" - checksum: 767a6255a84bbc47df49a60ab583053bb29a7d9687066a18500a516188a062c4e4cd52de341f22de0b07062e699b1b8fe3cfa1cb55b241cb9301aeb4f45b4dff - languageName: node - linkType: hard - "commondir@npm:^1.0.1": version: 1.0.1 resolution: "commondir@npm:1.0.1" @@ -13277,73 +13187,6 @@ __metadata: languageName: node linkType: hard -"cypress-real-events@npm:^1.7.0": - version: 1.7.0 - resolution: "cypress-real-events@npm:1.7.0" - peerDependencies: - cypress: ^4.x || ^5.x || ^6.x || ^7.x || ^8.x || ^9.x - checksum: 92981b05c44faa72e9785bc6d748a29a77373c3c784261b4e3b0e9e67f055a1d502c7573e786a4e25df040fc50961e5897f6d55ffa33ae08246f8a9518ca9a4b - languageName: node - linkType: hard - -"cypress-wait-until@npm:^1.7.2": - version: 1.7.2 - resolution: "cypress-wait-until@npm:1.7.2" - checksum: e3fe3c35ef8cfda39fb8919ae63a238bd580a98f5c02120306b32d6502ddfa9bfc3afde733cd9b282035b9f67e8386bd6c58bd59ca5fd2ea65291e6d9bac1ed7 - languageName: node - linkType: hard - -"cypress@npm:^7.7.0": - version: 7.7.0 - resolution: "cypress@npm:7.7.0" - dependencies: - "@cypress/request": ^2.88.5 - "@cypress/xvfb": ^1.2.4 - "@types/node": ^14.14.31 - "@types/sinonjs__fake-timers": ^6.0.2 - "@types/sizzle": ^2.3.2 - arch: ^2.2.0 - blob-util: ^2.0.2 - bluebird: ^3.7.2 - cachedir: ^2.3.0 - chalk: ^4.1.0 - check-more-types: ^2.24.0 - cli-cursor: ^3.1.0 - cli-table3: ~0.6.0 - commander: ^5.1.0 - common-tags: ^1.8.0 - dayjs: ^1.10.4 - debug: ^4.3.2 - enquirer: ^2.3.6 - eventemitter2: ^6.4.3 - execa: 4.1.0 - executable: ^4.1.1 - extract-zip: 2.0.1 - figures: ^3.2.0 - fs-extra: ^9.1.0 - getos: ^3.2.1 - is-ci: ^3.0.0 - is-installed-globally: ~0.4.0 - lazy-ass: ^1.6.0 - listr2: ^3.8.3 - lodash: ^4.17.21 - log-symbols: ^4.0.0 - minimist: ^1.2.5 - ospath: ^1.2.2 - pretty-bytes: ^5.6.0 - ramda: ~0.27.1 - request-progress: ^3.0.0 - supports-color: ^8.1.1 - tmp: ~0.2.1 - untildify: ^4.0.0 - url: ^0.11.0 - yauzl: ^2.10.0 - bin: - cypress: bin/cypress - checksum: 8ad8700d448949941801b6ff25549ef93e593b659b1605a936a8021032acb50f1849c9b8f8d1ba7df713de803b8203a1978231ccd0443f2e819bd9cf1b23d562 - languageName: node - linkType: hard - "d3-array@npm:2, d3-array@npm:^2.3.0": version: 2.12.1 resolution: "d3-array@npm:2.12.1" @@ -13548,7 +13391,7 @@ __metadata: languageName: node linkType: hard -"dayjs@npm:^1.10.4, dayjs@npm:^1.8.29": +"dayjs@npm:^1.8.29": version: 1.11.0 resolution: "dayjs@npm:1.11.0" checksum: 2d36f6d71345114cdcd89147adf9e05b4f8fe81684e08c8bf1f86b140aa0b86ecc3cae661a9348d96feb7fbefd03e1bc3697303688e95209670abcb36b4ece15 @@ -14740,7 +14583,7 @@ __metadata: languageName: node linkType: hard -"enquirer@npm:2.3.6, enquirer@npm:^2.3.5, enquirer@npm:^2.3.6": +"enquirer@npm:2.3.6, enquirer@npm:^2.3.5": version: 2.3.6 resolution: "enquirer@npm:2.3.6" dependencies: @@ -15644,7 +15487,7 @@ __metadata: languageName: node linkType: hard -"eventemitter2@npm:^6.3.1, eventemitter2@npm:^6.4.3, eventemitter2@npm:^6.4.5": +"eventemitter2@npm:^6.3.1, eventemitter2@npm:^6.4.5": version: 6.4.5 resolution: "eventemitter2@npm:6.4.5" checksum: 84504f9cf0cc30205cdd46783fe9df3733435e5097f13070b678023110b5ef07847651808ae280cd94c42cd5976880211c7a40321a8ff8fa56f7c5f9c5c11960 @@ -15726,23 +15569,6 @@ __metadata: languageName: node linkType: hard -"execa@npm:4.1.0": - version: 4.1.0 - resolution: "execa@npm:4.1.0" - dependencies: - cross-spawn: ^7.0.0 - get-stream: ^5.0.0 - human-signals: ^1.1.1 - is-stream: ^2.0.0 - merge-stream: ^2.0.0 - npm-run-path: ^4.0.0 - onetime: ^5.1.0 - signal-exit: ^3.0.2 - strip-final-newline: ^2.0.0 - checksum: e30d298934d9c52f90f3847704fd8224e849a081ab2b517bbc02f5f7732c24e56a21f14cb96a08256deffeb2d12b2b7cb7e2b014a12fb36f8d3357e06417ed55 - languageName: node - linkType: hard - "execa@npm:^0.10.0": version: 0.10.0 resolution: "execa@npm:0.10.0" @@ -15844,7 +15670,7 @@ __metadata: languageName: node linkType: hard -"executable@npm:^4.1.0, executable@npm:^4.1.1": +"executable@npm:^4.1.0": version: 4.1.1 resolution: "executable@npm:4.1.1" dependencies: @@ -16040,23 +15866,6 @@ __metadata: languageName: node linkType: hard -"extract-zip@npm:2.0.1": - version: 2.0.1 - resolution: "extract-zip@npm:2.0.1" - dependencies: - "@types/yauzl": ^2.9.1 - debug: ^4.1.1 - get-stream: ^5.1.0 - yauzl: ^2.10.0 - dependenciesMeta: - "@types/yauzl": - optional: true - bin: - extract-zip: cli.js - checksum: 8cbda9debdd6d6980819cc69734d874ddd71051c9fe5bde1ef307ebcedfe949ba57b004894b585f758b7c9eeeea0e3d87f2dda89b7d25320459c2c9643ebb635 - languageName: node - linkType: hard - "extsprintf@npm:1.3.0": version: 1.3.0 resolution: "extsprintf@npm:1.3.0" @@ -16318,7 +16127,7 @@ __metadata: languageName: node linkType: hard -"figures@npm:^3.0.0, figures@npm:^3.2.0": +"figures@npm:^3.0.0": version: 3.2.0 resolution: "figures@npm:3.2.0" dependencies: @@ -16966,7 +16775,7 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:^9.0.0, fs-extra@npm:^9.0.1, fs-extra@npm:^9.1.0": +"fs-extra@npm:^9.0.0, fs-extra@npm:^9.0.1": version: 9.1.0 resolution: "fs-extra@npm:9.1.0" dependencies: @@ -17358,15 +17167,6 @@ __metadata: languageName: node linkType: hard -"get-stream@npm:^5.0.0, get-stream@npm:^5.1.0": - version: 5.2.0 - resolution: "get-stream@npm:5.2.0" - dependencies: - pump: ^3.0.0 - checksum: 8bc1a23174a06b2b4ce600df38d6c98d2ef6d84e020c1ddad632ad75bac4e092eeb40e4c09e0761c35fc2dbc5e7fff5dab5e763a383582c4a167dd69a905bd12 - languageName: node - linkType: hard - "get-stream@npm:^6.0.0": version: 6.0.1 resolution: "get-stream@npm:6.0.1" @@ -17405,15 +17205,6 @@ __metadata: languageName: node linkType: hard -"getos@npm:^3.2.1": - version: 3.2.1 - resolution: "getos@npm:3.2.1" - dependencies: - async: ^3.2.0 - checksum: 42fd78a66d47cebd3e09de5566cc0044e034b08f4a000a310dbd89a77b02c65d8f4002554bfa495ea5bdc4fa9d515f5ac785a7cc474ba45383cc697f865eeaf1 - languageName: node - linkType: hard - "getpass@npm:^0.1.1": version: 0.1.7 resolution: "getpass@npm:0.1.7" @@ -17618,15 +17409,6 @@ __metadata: languageName: node linkType: hard -"global-dirs@npm:^3.0.0": - version: 3.0.0 - resolution: "global-dirs@npm:3.0.0" - dependencies: - ini: 2.0.0 - checksum: 953c17cf14bf6ee0e2100ae82a0d779934eed8a3ec5c94a7a4f37c5b3b592c31ea015fb9a15cf32484de13c79f4a814f3015152f3e1d65976cfbe47c1bfe4a88 - languageName: node - linkType: hard - "global-modules@npm:^1.0.0": version: 1.0.0 resolution: "global-modules@npm:1.0.0" @@ -18820,17 +18602,6 @@ __metadata: languageName: node linkType: hard -"http-signature@npm:~1.3.6": - version: 1.3.6 - resolution: "http-signature@npm:1.3.6" - dependencies: - assert-plus: ^1.0.0 - jsprim: ^2.0.2 - sshpk: ^1.14.1 - checksum: 10be2af4764e71fee0281392937050201ee576ac755c543f570d6d87134ce5e858663fe999a7adb3e4e368e1e356d0d7fec6b9542295b875726ff615188e7a0c - languageName: node - linkType: hard - "http2@https://github.com/node-apn/node-http2/archive/apn-2.1.4.tar.gz": version: 3.3.6 resolution: "http2@https://github.com/node-apn/node-http2/archive/apn-2.1.4.tar.gz" @@ -18872,13 +18643,6 @@ __metadata: languageName: node linkType: hard -"human-signals@npm:^1.1.1": - version: 1.1.1 - resolution: "human-signals@npm:1.1.1" - checksum: d587647c9e8ec24e02821b6be7de5a0fc37f591f6c4e319b3054b43fd4c35a70a94c46fc74d8c1a43c47fde157d23acd7421f375e1c1365b09a16835b8300205 - languageName: node - linkType: hard - "human-signals@npm:^2.1.0": version: 2.1.0 resolution: "human-signals@npm:2.1.0" @@ -19411,13 +19175,6 @@ __metadata: languageName: node linkType: hard -"ini@npm:2.0.0": - version: 2.0.0 - resolution: "ini@npm:2.0.0" - checksum: e7aadc5fb2e4aefc666d74ee2160c073995a4061556b1b5b4241ecb19ad609243b9cceafe91bae49c219519394bbd31512516cb22a3b1ca6e66d869e0447e84e - languageName: node - linkType: hard - "ini@npm:^1.3.4, ini@npm:^1.3.5, ini@npm:~1.3.0": version: 1.3.8 resolution: "ini@npm:1.3.8" @@ -19784,17 +19541,6 @@ __metadata: languageName: node linkType: hard -"is-ci@npm:^3.0.0": - version: 3.0.1 - resolution: "is-ci@npm:3.0.1" - dependencies: - ci-info: ^3.2.0 - bin: - is-ci: bin.js - checksum: 192c66dc7826d58f803ecae624860dccf1899fc1f3ac5505284c0a5cf5f889046ffeb958fa651e5725d5705c5bcb14f055b79150ea5fcad7456a9569de60260e - languageName: node - linkType: hard - "is-color-stop@npm:^1.0.0": version: 1.1.0 resolution: "is-color-stop@npm:1.1.0" @@ -20029,16 +19775,6 @@ __metadata: languageName: node linkType: hard -"is-installed-globally@npm:~0.4.0": - version: 0.4.0 - resolution: "is-installed-globally@npm:0.4.0" - dependencies: - global-dirs: ^3.0.0 - is-path-inside: ^3.0.2 - checksum: 3359840d5982d22e9b350034237b2cda2a12bac1b48a721912e1ab8e0631dd07d45a2797a120b7b87552759a65ba03e819f1bd63f2d7ab8657ec0b44ee0bf399 - languageName: node - linkType: hard - "is-jpg@npm:^2.0.0": version: 2.0.0 resolution: "is-jpg@npm:2.0.0" @@ -20191,13 +19927,6 @@ __metadata: languageName: node linkType: hard -"is-path-inside@npm:^3.0.2": - version: 3.0.3 - resolution: "is-path-inside@npm:3.0.3" - checksum: abd50f06186a052b349c15e55b182326f1936c89a78bf6c8f2b707412517c097ce04bc49a0ca221787bc44e1049f51f09a2ffb63d22899051988d3a618ba13e9 - languageName: node - linkType: hard - "is-plain-obj@npm:^1.0.0, is-plain-obj@npm:^1.1.0": version: 1.1.0 resolution: "is-plain-obj@npm:1.1.0" @@ -21554,18 +21283,6 @@ __metadata: languageName: node linkType: hard -"jsprim@npm:^2.0.2": - version: 2.0.2 - resolution: "jsprim@npm:2.0.2" - dependencies: - assert-plus: 1.0.0 - extsprintf: 1.3.0 - json-schema: 0.4.0 - verror: 1.10.0 - checksum: d175f6b1991e160cb0aa39bc857da780e035611986b5492f32395411879fdaf4e513d98677f08f7352dac93a16b66b8361c674b86a3fa406e2e7af6b26321838 - languageName: node - linkType: hard - "jsrsasign@npm:^10.5.19": version: 10.5.22 resolution: "jsrsasign@npm:10.5.22" @@ -21797,13 +21514,6 @@ __metadata: languageName: node linkType: hard -"lazy-ass@npm:^1.6.0": - version: 1.6.0 - resolution: "lazy-ass@npm:1.6.0" - checksum: 5a3ebb17915b03452320804466345382a6c25ac782ec4874fecdb2385793896cd459be2f187dc7def8899180c32ee0ab9a1aa7fe52193ac3ff3fe29bb0591729 - languageName: node - linkType: hard - "lazy-universal-dotenv@npm:^3.0.1": version: 3.0.1 resolution: "lazy-universal-dotenv@npm:3.0.1" @@ -22055,27 +21765,6 @@ __metadata: languageName: node linkType: hard -"listr2@npm:^3.8.3": - version: 3.14.0 - resolution: "listr2@npm:3.14.0" - dependencies: - cli-truncate: ^2.1.0 - colorette: ^2.0.16 - log-update: ^4.0.0 - p-map: ^4.0.0 - rfdc: ^1.3.0 - rxjs: ^7.5.1 - through: ^2.3.8 - wrap-ansi: ^7.0.0 - peerDependencies: - enquirer: ">= 2.3.0 < 3" - peerDependenciesMeta: - enquirer: - optional: true - checksum: fdb8b2d6bdf5df9371ebd5082bee46c6d0ca3d1e5f2b11fbb5a127839855d5f3da9d4968fce94f0a5ec67cac2459766abbb1faeef621065ebb1829b11ef9476d - languageName: node - linkType: hard - "load-json-file@npm:^1.0.0": version: 1.1.0 resolution: "load-json-file@npm:1.1.0" @@ -22340,7 +22029,7 @@ __metadata: languageName: node linkType: hard -"lodash.once@npm:^4.0.0, lodash.once@npm:^4.1.1": +"lodash.once@npm:^4.0.0": version: 4.1.1 resolution: "lodash.once@npm:4.1.1" checksum: d768fa9f9b4e1dc6453be99b753906f58990e0c45e7b2ca5a3b40a33111e5d17f6edf2f768786e2716af90a8e78f8f91431ab8435f761fef00f9b0c256f6d245 @@ -22438,7 +22127,7 @@ __metadata: languageName: node linkType: hard -"log-symbols@npm:4.1.0, log-symbols@npm:^4.0.0, log-symbols@npm:^4.1.0": +"log-symbols@npm:4.1.0, log-symbols@npm:^4.1.0": version: 4.1.0 resolution: "log-symbols@npm:4.1.0" dependencies: @@ -22459,18 +22148,6 @@ __metadata: languageName: node linkType: hard -"log-update@npm:^4.0.0": - version: 4.0.0 - resolution: "log-update@npm:4.0.0" - dependencies: - ansi-escapes: ^4.3.0 - cli-cursor: ^3.1.0 - slice-ansi: ^4.0.0 - wrap-ansi: ^6.2.0 - checksum: ae2f85bbabc1906034154fb7d4c4477c79b3e703d22d78adee8b3862fa913942772e7fa11713e3d96fb46de4e3cabefbf5d0a544344f03b58d3c4bff52aa9eb2 - languageName: node - linkType: hard - "logalot@npm:^2.0.0, logalot@npm:^2.1.0": version: 2.1.0 resolution: "logalot@npm:2.1.0" @@ -24836,7 +24513,7 @@ __metadata: languageName: node linkType: hard -"npm-run-path@npm:^4.0.0, npm-run-path@npm:^4.0.1": +"npm-run-path@npm:^4.0.1": version: 4.0.1 resolution: "npm-run-path@npm:4.0.1" dependencies: @@ -25353,13 +25030,6 @@ __metadata: languageName: node linkType: hard -"ospath@npm:^1.2.2": - version: 1.2.2 - resolution: "ospath@npm:1.2.2" - checksum: 505f48a4f4f1c557d6c656ec985707726e3714721680139be037613e903aa8c8fa4ddd8d1342006f9b2dc0065e6e20f8b7bea2ee05354f31257044790367b347 - languageName: node - linkType: hard - "outdent@npm:~0.8.0": version: 0.8.0 resolution: "outdent@npm:0.8.0" @@ -27400,13 +27070,6 @@ __metadata: languageName: node linkType: hard -"pretty-bytes@npm:^5.6.0": - version: 5.6.0 - resolution: "pretty-bytes@npm:5.6.0" - checksum: 9c082500d1e93434b5b291bd651662936b8bd6204ec9fa17d563116a192d6d86b98f6d328526b4e8d783c07d5499e2614a807520249692da9ec81564b2f439cd - languageName: node - linkType: hard - "pretty-error@npm:^2.1.1": version: 2.1.2 resolution: "pretty-error@npm:2.1.2" @@ -27974,13 +27637,6 @@ __metadata: languageName: node linkType: hard -"ramda@npm:~0.27.1": - version: 0.27.2 - resolution: "ramda@npm:0.27.2" - checksum: 28d6735dd1eea1a796c56cf6111f3673c6105bbd736e521cdd7826c46a18eeff337c2dba4668f6eed990d539b9961fd6db19aa46ccc1530ba67a396c0a9f580d - languageName: node - linkType: hard - "randexp@npm:0.4.6": version: 0.4.6 resolution: "randexp@npm:0.4.6" @@ -29211,15 +28867,6 @@ __metadata: languageName: node linkType: hard -"request-progress@npm:^3.0.0": - version: 3.0.0 - resolution: "request-progress@npm:3.0.0" - dependencies: - throttleit: ^1.0.0 - checksum: 6ea1761dcc8a8b7b5894afd478c0286aa31bd69438d7050294bd4fd0d0b3e09b5cde417d38deef9c49809039c337d8744e4bb49d8632b0c3e4ffa5e8a687e0fd - languageName: node - linkType: hard - "request-promise-core@npm:1.1.4": version: 1.1.4 resolution: "request-promise-core@npm:1.1.4" @@ -29729,15 +29376,6 @@ __metadata: languageName: node linkType: hard -"rxjs@npm:^7.5.1": - version: 7.5.5 - resolution: "rxjs@npm:7.5.5" - dependencies: - tslib: ^2.1.0 - checksum: e034f60805210cce756dd2f49664a8108780b117cf5d0e2281506e9e6387f7b4f1532d974a8c8b09314fa7a16dd2f6cff3462072a5789672b5dcb45c4173f3c6 - languageName: node - linkType: hard - "safe-buffer@npm:5.1.1": version: 5.1.1 resolution: "safe-buffer@npm:5.1.1" @@ -30947,7 +30585,7 @@ __metadata: languageName: node linkType: hard -"sshpk@npm:^1.14.1, sshpk@npm:^1.7.0": +"sshpk@npm:^1.7.0": version: 1.17.0 resolution: "sshpk@npm:1.17.0" dependencies: @@ -31769,7 +31407,7 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:8.1.1, supports-color@npm:^8.0.0, supports-color@npm:^8.1.1": +"supports-color@npm:8.1.1, supports-color@npm:^8.0.0": version: 8.1.1 resolution: "supports-color@npm:8.1.1" dependencies: @@ -32234,13 +31872,6 @@ __metadata: languageName: node linkType: hard -"throttleit@npm:^1.0.0": - version: 1.0.0 - resolution: "throttleit@npm:1.0.0" - checksum: 1b2db4d2454202d589e8236c07a69d2fab838876d370030ebea237c34c0a7d1d9cf11c29f994531ebb00efd31e9728291042b7754f2798a8352ec4463455b659 - languageName: node - linkType: hard - "through2@npm:^2.0.0, through2@npm:~2.0.3": version: 2.0.5 resolution: "through2@npm:2.0.5" @@ -32358,7 +31989,7 @@ __metadata: languageName: node linkType: hard -"tmp@npm:^0.2.1, tmp@npm:~0.2.1": +"tmp@npm:^0.2.1": version: 0.2.1 resolution: "tmp@npm:0.2.1" dependencies: @@ -32753,7 +32384,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.0.0, tslib@npm:^2.0.1, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.2.0, tslib@npm:^2.3.0, tslib@npm:^2.3.1, tslib@npm:~2.3.1": +"tslib@npm:^2.0.0, tslib@npm:^2.0.1, tslib@npm:^2.0.3, tslib@npm:^2.2.0, tslib@npm:^2.3.0, tslib@npm:^2.3.1, tslib@npm:~2.3.1": version: 2.3.1 resolution: "tslib@npm:2.3.1" checksum: de17a98d4614481f7fcb5cd53ffc1aaf8654313be0291e1bfaee4b4bb31a20494b7d218ff2e15017883e8ea9626599b3b0e0229c18383ba9dce89da2adf15cb9 @@ -33546,13 +33177,6 @@ __metadata: languageName: node linkType: hard -"untildify@npm:^4.0.0": - version: 4.0.0 - resolution: "untildify@npm:4.0.0" - checksum: 39ced9c418a74f73f0a56e1ba4634b4d959422dff61f4c72a8e39f60b99380c1b45ed776fbaa0a4101b157e4310d873ad7d114e8534ca02609b4916bb4187fb9 - languageName: node - linkType: hard - "unzip-response@npm:^2.0.1": version: 2.0.1 resolution: "unzip-response@npm:2.0.1"