Files
sabrilandGitHub 23af2531fa SEC-10098 E2E/Cypress chore(cypress): upgrade to v15.13 and to [email protected] (#36091)
* chore(cypress): upgrade to v15.13 and to [email protected]

* fix comments and update exposing cypress env
2026-04-16 13:35:26 +08:00

25 lines
851 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import * as TIMEOUTS from '@/fixtures/timeouts';
export function createArchivedChannel(channelOptions: Record<string, unknown>, messages: string[], memberUsernames?: string[]) {
return cy.uiCreateChannel(channelOptions).then((newChannel) => {
if (memberUsernames) {
cy.uiAddUsersToCurrentChannel(memberUsernames);
}
messages.forEach((message) => {
cy.postMessage(message);
});
cy.uiArchiveChannel();
// # Wait for sometime and verify that the archived message is shown
cy.wait(TIMEOUTS.FIVE_SEC);
cy.get('#channelArchivedMessage', {timeout: TIMEOUTS.ONE_MIN}).should('be.visible');
return cy.wrap({name: newChannel.name});
});
}