Room list: add release announcement for sections (#33800)
* feat: add release announcement for sections * test: update screenshot * test: update tests * test: add release annoucement utils to close it * test: close release announcement in custom section tests * test: update release announcement e2e test * test: add more tests * feat: update Ra labels * test: update screenshot * chore: remove stale screenshot
This commit is contained in:
+4
-1
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
import { type Page } from "@playwright/test";
|
||||
import { rejectToast } from "@element-hq/element-web-playwright-common";
|
||||
import { closeReleaseAnnouncement, rejectToast } from "@element-hq/element-web-playwright-common";
|
||||
|
||||
import { expect, test } from "../../../element-web-test";
|
||||
import { assertRoomInSection, dragRoomToSection, getRoomList, getRoomListHeader, getSectionHeader } from "./utils";
|
||||
@@ -46,6 +46,9 @@ test.describe("Room list custom sections", () => {
|
||||
await rejectToast(page, "Verify this device");
|
||||
await rejectToast(page, "Notifications");
|
||||
|
||||
// Close the release announcement about the new room list sections
|
||||
await closeReleaseAnnouncement(page, "Introducing Sections");
|
||||
|
||||
// Focus the user menu to avoid hover decoration
|
||||
await page.getByRole("button", { name: "User menu" }).focus();
|
||||
});
|
||||
|
||||
@@ -6,15 +6,12 @@
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
import { test, expect } from "./";
|
||||
import { rejectToast } from "@element-hq/element-web-playwright-common";
|
||||
|
||||
import { test } from "./";
|
||||
|
||||
test.describe("Release announcement", () => {
|
||||
test.use({
|
||||
config: {
|
||||
features: {
|
||||
feature_release_announcement: true,
|
||||
},
|
||||
},
|
||||
room: async ({ app, user }, use) => {
|
||||
const roomId = await app.client.createRoom({
|
||||
name: "Test room",
|
||||
@@ -22,37 +19,31 @@ test.describe("Release announcement", () => {
|
||||
await app.viewRoomById(roomId);
|
||||
await use({ roomId });
|
||||
},
|
||||
labsFlags: ["feature_new_room_list"],
|
||||
labsFlags: ["feature_room_list_sections"],
|
||||
});
|
||||
|
||||
test.beforeEach(async ({ page, app, user }) => {
|
||||
// The toasts are displayed above the search section
|
||||
await rejectToast(page, "Verify this device");
|
||||
await rejectToast(page, "Notifications");
|
||||
});
|
||||
|
||||
// There is no release announcement currently live
|
||||
test.skip(
|
||||
"should display the new room list release announcement",
|
||||
test(
|
||||
"should display the room list section release announcement",
|
||||
{ tag: "@screenshot" },
|
||||
async ({ page, app, room, util }) => {
|
||||
// dismiss the toast so the announcement appears
|
||||
await page.getByRole("button", { name: "Dismiss" }).click();
|
||||
const sectionName = "Introducing Sections";
|
||||
// The section release announcement should be displayed
|
||||
await util.assertReleaseAnnouncementIsVisible(sectionName);
|
||||
// Hide the section release announcement
|
||||
const dialog = util.getReleaseAnnouncement(sectionName);
|
||||
await dialog.getByRole("button", { name: "Ok" }).click();
|
||||
|
||||
const newSoundsName = "We’ve refreshed your sounds";
|
||||
// The new sounds release announcement should be displayed
|
||||
await util.assertReleaseAnnouncementIsVisible(newSoundsName);
|
||||
// Hide the new sounds release announcement
|
||||
const newSoundsDialog = util.getReleaseAnnouncement(newSoundsName);
|
||||
await newSoundsDialog.getByRole("button", { name: "OK" }).click();
|
||||
|
||||
const newRoomListName = "Chats has a new look!";
|
||||
// The new room list release announcement should be displayed
|
||||
await util.assertReleaseAnnouncementIsVisible(newRoomListName);
|
||||
// Hide the new room list release announcement
|
||||
const dialog = util.getReleaseAnnouncement(newRoomListName);
|
||||
await dialog.getByRole("button", { name: "Next" }).click();
|
||||
|
||||
await util.assertReleaseAnnouncementIsNotVisible(newRoomListName);
|
||||
await util.assertReleaseAnnouncementIsNotVisible(sectionName);
|
||||
|
||||
await page.reload();
|
||||
await expect(page.getByRole("button", { name: "Room options" })).toBeVisible();
|
||||
// Check that once the release announcements has been marked as viewed, it does not appear again
|
||||
await util.assertReleaseAnnouncementIsNotVisible(newRoomListName);
|
||||
await util.assertReleaseAnnouncementIsNotVisible(sectionName);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user