Some checks failed
Server CI / Postgres (shard 0) (push) Has been skipped
Server CI / Postgres (shard 3) (push) Has been skipped
BuildEnv Docker Image / build-image (push) Failing after 4s
BuildEnv Docker Image / build-image-fips (push) Failing after 4s
Migration Review & Release Notes / Generate migration review & release notes (push) Failing after 3s
Server CI / Build Environment (push) Failing after 3s
Server CI / Postgres (shard 1) (push) Has been skipped
Tools CI / check-style (mattermost-govet) (push) Failing after 4s
Server CI / Postgres (shard 2) (push) Has been skipped
Tools CI / check-style (mmgotool) (push) Failing after 3s
Server CI / Elasticsearch v8 Compatibility (push) Has been skipped
Server CI / OpenSearch v2 Compatibility (push) Has been skipped
Server CI / Postgres FIPS (shard 0) (push) Has been skipped
Tools CI / Test (mattermost-govet) (push) Failing after 3s
Server CI / Postgres FIPS (shard 1) (push) Has been skipped
Server CI / Postgres FIPS (shard 2) (push) Has been skipped
Tools CI / Test (mmgotool) (push) Failing after 3s
Server CI / Postgres FIPS (shard 3) (push) Has been skipped
Server CI / Run mmctl tests (push) Has been skipped
Server CI / Run mmctl tests (FIPS) (push) Has been skipped
Server CI / Merge Postgres Test Results (push) Has been skipped
Server CI / Merge Postgres FIPS Test Results (push) Has been skipped
Server CI / Check backport migrations (push) Has been skipped
Server CI / Check generated files (push) Has been skipped
Server CI / check-style (push) Has been skipped
Server CI / Vet API (push) Has been skipped
Server CI / Build mattermost server app (push) Has been skipped
Server CI / Server CI Complete (push) Failing after 2s
Server CI / Server CI Artifacts (push) Has been skipped
Server CI / Sentry Upload (push) Has been skipped
Server CI / Server CI Report (push) Failing after 5m1s
Server CI Nightly Race / Race Detector (push) Has been skipped
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Webapp CI Cache Warm / Warm Webapp node_modules Cache (push) Has been cancelled
E2E CI Cache Warm / Warm E2E npm Registry Cache (push) Has been cancelled
API / build (push) Has been cancelled
Web App CI / check-types (push) Has been cancelled
Web App CI / check-lint (push) Has been cancelled
Web App CI / check-i18n (push) Has been cancelled
Web App CI / check-external-links (push) Has been cancelled
Web App CI / test (platform) (push) Has been cancelled
Web App CI / test (mattermost-redux) (push) Has been cancelled
Web App CI / test (channels shard 1/4) (push) Has been cancelled
Web App CI / test (channels shard 2/4) (push) Has been cancelled
Web App CI / test (channels shard 3/4) (push) Has been cancelled
Web App CI / test (channels shard 4/4) (push) Has been cancelled
Web App CI / upload-coverage (push) Has been cancelled
Web App CI / build (push) Has been cancelled
YAML Lint / yamllint (push) Has been cancelled
Push mirrored docker images / cd/Push mirrored docker images (push) Has been cancelled
docs-cd / Build and deploy docs (push) Has been cancelled
Docs CI / build (push) Has been cancelled
E2E Cache Warm: Cypress deps / Warm Cypress deps cache (push) Has been cancelled
Scorecards supply-chain security / Scorecard analysis (push) Has been cancelled
Server CI Weekly / Postgres FIPS (push) Has been skipped
Server CI Weekly / Run mmctl tests (FIPS) (push) Has been skipped
Server CI Weekly / Postgres with binary parameters (push) Has been skipped
Server CI Weekly / Build Environment (push) Failing after 1s
Server CI Cache Warm / Warm Go Module and Build Cache (push) Failing after 2s
Server CI Nightly Race / Build Environment (push) Failing after 1s
157 lines
5.5 KiB
JavaScript
157 lines
5.5 KiB
JavaScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
// ***************************************************************
|
|
// - [#] indicates a test step (e.g. # Go to a page)
|
|
// - [*] indicates an assertion (e.g. * Check the title)
|
|
// - Use element ID when selecting an element. Create one if none.
|
|
// ***************************************************************
|
|
|
|
// Stage: @prod
|
|
// Group: @channels @messaging
|
|
|
|
import * as TIMEOUTS from '@/fixtures/timeouts';
|
|
import {getAdminAccount} from '@/support/env';
|
|
|
|
describe('Messaging', () => {
|
|
const admin = getAdminAccount();
|
|
let testUser;
|
|
let testTeam;
|
|
|
|
before(() => {
|
|
// # Set the configuration on Link Previews
|
|
cy.apiUpdateConfig({
|
|
ServiceSettings: {
|
|
EnableLinkPreviews: true,
|
|
},
|
|
});
|
|
|
|
// # Login as test user and go to town-square
|
|
cy.apiInitSetup().then(({team, user}) => {
|
|
testUser = user;
|
|
testTeam = team;
|
|
|
|
cy.visit(`/${testTeam.name}/channels/town-square`);
|
|
});
|
|
});
|
|
|
|
it('MM-T114_1 Delete a GIF from RHS reply thread, other user viewing in center and RHS sees GIF preview disappear from both', () => {
|
|
// # Type message to use
|
|
cy.postMessage('123');
|
|
|
|
// # Click Reply button
|
|
cy.clickPostCommentIcon();
|
|
|
|
// # Write message on reply box
|
|
cy.postMessageReplyInRHS('https://media1.giphy.com/media/l41lM6sJvwmZNruLe/giphy.gif');
|
|
|
|
// # Change user and go to Town Square
|
|
cy.apiLogin(testUser);
|
|
cy.visit(`/${testTeam.name}/channels/town-square`);
|
|
|
|
// # Click Reply button to open the RHS
|
|
cy.clickPostCommentIcon();
|
|
|
|
// # Remove message from the other user
|
|
cy.getLastPostId().as('postId').then((postId) => {
|
|
// * Can view the gif on main view
|
|
cy.get(`#post_${postId}`).find('.attachment__image').should('exist');
|
|
|
|
// * Can view the gif on RHS
|
|
cy.get(`#rhsPost_${postId}`).find('.attachment__image').should('exist');
|
|
|
|
// # Delete the message
|
|
cy.externalRequest({user: admin, method: 'DELETE', path: `posts/${postId}`});
|
|
|
|
// # Wait for the message to be deleted
|
|
cy.wait(TIMEOUTS.HALF_SEC);
|
|
|
|
// * Cannot view the gif on main channel
|
|
cy.get(`#post_${postId}`).find('.attachment__image').should('not.exist');
|
|
|
|
// * Should see (message deleted)
|
|
cy.get(`#post_${postId}`).should('contain', '(message deleted');
|
|
|
|
// * Cannot view the gif on RHS
|
|
cy.get(`#rhsPost_${postId}`).find('.attachment__image').should('not.exist');
|
|
|
|
// * Should see (message deleted)
|
|
cy.get(`#rhsPost_${postId}`).should('contain', '(message deleted');
|
|
|
|
// # Refresh the website and wait for it to be loaded
|
|
cy.reload();
|
|
cy.wait(TIMEOUTS.FIVE_SEC);
|
|
|
|
// * The RHS is closed
|
|
cy.get('#rhsCloseButton').should('not.exist');
|
|
|
|
// * Should see (message deleted)
|
|
cy.get(`#post_${postId}`).should('not.exist');
|
|
|
|
// # Log in as the other user and go to town square
|
|
cy.apiAdminLogin();
|
|
cy.visit(`/${testTeam.name}/channels/town-square`);
|
|
|
|
// * The post should not exist
|
|
cy.get(`#post_${postId}`).should('not.exist');
|
|
});
|
|
});
|
|
|
|
it('MM-T114_2 Delete a GIF from RHS reply thread, other user viewing in center and RHS sees GIF preview disappear from both (mobile view)', () => {
|
|
cy.apiAdminLogin();
|
|
|
|
// # Type message to use
|
|
cy.postMessage('123');
|
|
|
|
// # Click Reply button
|
|
cy.clickPostCommentIcon();
|
|
|
|
// # Write message on reply box
|
|
cy.postMessageReplyInRHS('https://media1.giphy.com/media/l41lM6sJvwmZNruLe/giphy.gif');
|
|
|
|
// # Change user and go to Town Square
|
|
cy.apiLogin(testUser);
|
|
cy.visit(`/${testTeam.name}/channels/town-square`);
|
|
|
|
// # Change viewport so it has mobile view
|
|
cy.viewport('iphone-6');
|
|
|
|
// # Click Reply button to open the Message Details
|
|
cy.clickPostCommentIcon();
|
|
|
|
// # Remove message from the other user
|
|
cy.getLastPostId().as('postId').then((postId) => {
|
|
// * Can view the gif on Message Details
|
|
cy.get(`#rhsPost_${postId}`).find('.attachment__image').should('exist').and('be.visible');
|
|
|
|
// # Close Message Details
|
|
cy.get('#sbrSidebarCollapse').click();
|
|
|
|
// * Can view the gif on main view
|
|
cy.get(`#post_${postId}`).find('.attachment__image').should('exist').and('be.visible');
|
|
|
|
// # Click Reply button to open the Message Details
|
|
cy.clickPostCommentIcon();
|
|
|
|
// # Delete the message
|
|
cy.externalRequest({user: admin, method: 'DELETE', path: `posts/${postId}`});
|
|
|
|
// # Wait for the message to be deleted
|
|
cy.wait(TIMEOUTS.HALF_SEC);
|
|
|
|
// * Cannot view the gif on main channel
|
|
cy.get(`#post_${postId}`).find('.attachment__image').should('not.exist');
|
|
|
|
// * Cannot view the gif on RHS
|
|
cy.get(`#rhsPost_${postId}`).find('.attachment__image').should('not.exist');
|
|
|
|
// # Log in as the other user and go to town square
|
|
cy.apiAdminLogin();
|
|
cy.visit(`/${testTeam.name}/channels/town-square`);
|
|
|
|
// * The post should not exist
|
|
cy.get(`#post_${postId}`).should('not.exist');
|
|
});
|
|
});
|
|
});
|