Playwright/E2E: Add method to stub notification in Playwright and automate MM-T483 (#29203)

Этот коммит содержится в:
Saturnino Abril
2024-11-19 22:16:33 +08:00
коммит произвёл GitHub
родитель 05abb39019
Коммит 80289a0d8c
6 изменённых файлов: 176 добавлений и 2 удалений

Просмотреть файл

@@ -63,6 +63,14 @@ export default class ChannelsPost {
await this.removePostButton.waitFor();
await this.removePostButton.click();
}
/**
* `toContainText` verifies if the post contains the specified text.
* @param text Text to be verified in the post
*/
async toContainText(text: string) {
await expect(this.container).toContainText(text);
}
}
export {ChannelsPost};

Просмотреть файл

@@ -69,12 +69,20 @@ export default class ChannelsPage {
if (teamName) {
channelsUrl += `${teamName}`;
if (channelName) {
const prefix = channelName.startsWith('@') ? '/messages' : '';
const prefix = channelName.startsWith('@') ? '/messages' : '/channels';
channelsUrl += `${prefix}/${channelName}`;
}
}
await this.page.goto(channelsUrl);
}
/**
* `postMessage` posts a message in the current channel
* @param message Message to post
*/
async postMessage(message: string) {
await this.centerView.postCreate.postMessage(message);
}
}
export {ChannelsPage};