Files
Harrison HealeyandGitHub daec1283e5 MM-69003 Mostly share ESLint config between web app and E2E tests (#36767)
* Switch Cypress to use shared ESLint config

* Run --fix in Cypress

* Manually fix remaining lint issues in Cypress

* Switch Playwright to use shared ESLint config

* Run --fix in Playwright

* Manually fix remaining lint issues in Playwright

* Install and cache web app deps during Cypress CI builds

This also caches the types and client package. That isn't needed currently
since it uses prepackaged versions of those, but I imagine we might change
that at some point.

* Run e2e-tests-check when ESLint plugin is updated

* Change E2E test GHA caching to cache all of web app node_modules

* Fix mismatch between cache save and restore

* Try bumping cache keys

* Copy step to install dependencies to server.run_cypress.sh

I don't know how this must've worked before, but if this fixes the issue,
it seems like neither Cypress nor Playwright actually use the cached
depenendencies.

* Try disabling caching entirely for Cypress tests

* Try bypassing makefile?

* Try also manually building dependencies in run_specs.sh

I don't know why this appears to duplicate run_cypress.sh and
run_playwright.sh, both of which are called run_test.sh which
might not be used any more as best I can tell.

* Try installing the web app dependencies in yet another place

* Disable the extra steps in server.prepare.sh specifically for Cypress

* Revert changes to update cache key and disable web app depenedency cache on Cypress builds
2026-06-09 20:50:58 +00:00

86 lines
3.1 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 @scroll
import {postListOfMessages, scrollCurrentChannelFromTop} from './helpers';
import * as TIMEOUTS from '@/fixtures/timeouts';
describe('Scroll', () => {
let firstPostBeforeScroll;
let lastPostBeforeScroll;
let testChannelId;
let testChannelLink;
let otherUser;
const multilineString = `A
multiline
message`;
const newMultilineMessage = `This
is
a new
multiline
message`;
before(() => {
cy.apiCreateUser().then(({user}) => {
otherUser = user;
});
cy.apiInitSetup().then(({team, channel}) => {
testChannelId = channel.id;
testChannelLink = `/${team.name}/channels/${channel.name}`;
cy.apiAddUserToTeam(team.id, otherUser.id).then(() => {
cy.apiAddUserToChannel(testChannelId, otherUser.id);
cy.visit(testChannelLink);
});
});
});
it('MM-T2371 Post list does not scroll when the offscreen post is edited', () => {
// # Other user posts a multiline message
cy.postMessageAs({sender: otherUser, message: multilineString, channelId: testChannelId});
cy.getLastPostId().then((postId) => {
const multilineMessageID = postId;
postListOfMessages({sender: otherUser, channelId: testChannelId});
scrollCurrentChannelFromTop('100%');
// # Get the text of the first visible post
cy.get('.post-message__text:visible').first().then((postMessage) => {
firstPostBeforeScroll = postMessage.text();
});
// # Get the text of the last visible post
cy.get('.post-message__text:visible').last().then((postMessage) => {
lastPostBeforeScroll = postMessage.text();
});
// # Edit a multiline message from the other user
cy.externalRequest({user: otherUser, method: 'PUT', path: `posts/${multilineMessageID}`, data: {id: multilineMessageID, message: newMultilineMessage}});
// # Wait for the message to be edited
cy.wait(TIMEOUTS.FIVE_SEC);
// * Verify the first post is the same after the editing
cy.get('.post-message__text:visible').first().then((firstPostAfterScroll) => {
expect(firstPostAfterScroll.text()).equal(firstPostBeforeScroll);
});
// * Verify the last post is the same after the editing
cy.get('.post-message__text:visible').last().then((lastPostAfterScroll) => {
expect(lastPostAfterScroll.text()).equal(lastPostBeforeScroll);
});
});
});
});