Files
b6f80ae12e E2E/Playwright: Migrate RFQA browser tests (batch 5, 81-100) (#37417)
* E2E/Playwright: Migrate RFQA browser tests (batch 4, 61-80)

Migrate the fourth batch of Rainforest QA browser tests into Playwright
(migration plan None-core #34-53, keys MM-T480..MM-T1257): 17 new/covered
specs across notifications, search, channel_settings, sidebar_left,
keyboard_shortcuts, and direct_messages_modal, plus 3 duplicate keys folded
into existing tests (MM-T480, MM-T1256, MM-T1257).

POM/infra: add a ChannelMenu page object for the channel header dropdown, an
EditChannelHeaderModal, a header field on the channel-settings info tab, a
channel-wide-mentions checkbox on NotificationsSettings, a getConfirmModal
helper, and a clickNotification browser-API mock helper. Give the channel
header menu and the confirm modal proper accessible names so they can be
targeted semantically. Notification specs run on all browsers now that the
Notification API stub works headless on Chromium and Firefox.

* E2E/Playwright: Migrate RFQA browser tests (batch 5, 81-100)

Migrate the fifth batch of Rainforest QA browser tests into Playwright across
keyboard_shortcuts, search, archived_channels, channel_settings,
plugin_marketplace, messaging, and emoji_picker (keys MM-T1247..MM-T2365),
folding duplicate coverage into existing keyboard-shortcut specs and
documenting skipped cases inline.

POM/infra: add AddPeopleToChannelModal and MarketplaceModal page objects,
manage/add member buttons on the channel members RHS, and an App Marketplace
entry on the global header; target the search "Jump" link through the existing
SearchResultsPanel POM.

Also fix a webapp bug where a post body disappeared when an inline edit was
cancelled mid-animation (found via the up-arrow edit shortcut spec).

* E2E/Playwright: Fail on missing scroll bounding boxes

* E2E/Playwright: Group related batch 5 specs

* E2E/Playwright: Avoid duplicate creator membership

* E2E/Playwright: Group Rainforest batches 1 through 4

---------

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-13 17:14:42 +08:00

65 lines
2.9 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {expect, test} from '@mattermost/playwright-lib';
/**
* @objective Verify the member list of an archived channel is viewable but read-only (no member management).
*/
test('MM-T1671 shows a read-only member list for an archived channel', {tag: '@channels'}, async ({pw}) => {
const {adminClient, adminUser, team, user} = await pw.initSetup();
const channel = await adminClient.createPublicChannel(team.id, `Archive ${pw.random.id()}`);
await adminClient.addToChannel(user.id, channel.id);
const {channelsPage} = await pw.testBrowser.login(user);
await channelsPage.goto(team.name, channel.name);
await channelsPage.toBeVisible();
// # Archive the channel
await channelsPage.archiveChannel();
// # Open the channel members list
const channelMenu = await channelsPage.openChannelMenu();
await channelMenu.members.click();
await channelsPage.sidebarRight.toBeVisible();
// * Verify the member list is shown with the channel members
await expect(channelsPage.sidebarRight.container.getByText(adminUser.username).first()).toBeVisible();
// * Verify member management controls are not available for the archived channel
await expect(channelsPage.sidebarRight.manageMembersButton).not.toBeVisible();
await expect(channelsPage.sidebarRight.addMembersButton).not.toBeVisible();
});
/**
* @objective Verify a post from an archived channel can be found in search and its Jump link opens the
* archived channel in read-only mode.
*/
test('MM-T1679 opens an archived channel by jumping from search results', {tag: '@channels'}, async ({pw}) => {
const {adminClient, team, user} = await pw.initSetup();
const channel = await adminClient.createPublicChannel(team.id, `Archived ${pw.random.id()}`);
await adminClient.addToChannel(user.id, channel.id);
const message = `archived post ${pw.random.id()}`;
await adminClient.createPost({channel_id: channel.id, user_id: user.id, message});
const {channelsPage} = await pw.testBrowser.login(user);
await channelsPage.goto(team.name, channel.name);
await channelsPage.toBeVisible();
// # Archive the channel, then move to another channel
await channelsPage.archiveChannel();
await channelsPage.sidebarLeft.goToItem('town-square');
await channelsPage.centerView.header.toHaveTitle('Town Square');
// # Search for the message posted in the archived channel
await channelsPage.searchFor(message);
// # Jump to the post from the search results
await expect(channelsPage.searchResultsPanel.getResultByText(message)).toBeVisible();
await channelsPage.searchResultsPanel.jumpToResultWithText(message);
// * Verify the archived channel is opened in read-only mode
await channelsPage.centerView.header.toHaveTitle(channel.display_name);
await expect(channelsPage.archivedChannelMessage).toBeVisible();
});