Playwright: Convert lazy-loading test to playwright (#11988)
* Implement method to wait for next sync * Add timeline coded to app page * Convert network plugin * Add createBot fixture * Convert lazy-loading test * Remove cypress test * Remove converted files * Remove imports * Fix date in copyright header Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> * Fix date in copyright header Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> * Use proper method to send messages * Fix sliding-sync test * Address comments * Move code to timeline --------- Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
24cda5fc59
commit
4c2efc3637
11 changed files with 279 additions and 358 deletions
|
@ -498,7 +498,7 @@ test.describe("Timeline", () => {
|
|||
.getByText(`${OLD_NAME} created and configured the room.`),
|
||||
).toBeVisible();
|
||||
|
||||
await app.scrollToBottom(page);
|
||||
await app.timeline.scrollToBottom();
|
||||
await expect(
|
||||
page.locator(".mx_RoomView").getByText("This message has an inline emoji 👒"),
|
||||
).toBeInViewport();
|
||||
|
@ -514,7 +514,7 @@ test.describe("Timeline", () => {
|
|||
await app.settings.setValue("layout", null, SettingLevel.DEVICE, Layout.Group);
|
||||
|
||||
// Check that the last EventTile is rendered
|
||||
await app.scrollToBottom(page);
|
||||
await app.timeline.scrollToBottom();
|
||||
await expect(
|
||||
page.locator(".mx_RoomView").getByText("This message has an inline emoji 👒"),
|
||||
).toBeInViewport();
|
||||
|
@ -527,7 +527,7 @@ test.describe("Timeline", () => {
|
|||
await app.settings.setValue("useCompactLayout", null, SettingLevel.DEVICE, true);
|
||||
|
||||
// Check that the last EventTile is rendered
|
||||
await app.scrollToBottom(page);
|
||||
await app.timeline.scrollToBottom();
|
||||
await expect(
|
||||
page.locator(".mx_RoomView").getByText("This message has an inline emoji 👒"),
|
||||
).toBeInViewport();
|
||||
|
@ -542,7 +542,7 @@ test.describe("Timeline", () => {
|
|||
|
||||
await app.settings.setValue("layout", null, SettingLevel.DEVICE, Layout.Bubble);
|
||||
|
||||
await app.scrollToBottom(page);
|
||||
await app.timeline.scrollToBottom();
|
||||
await expect(
|
||||
page.locator(".mx_RoomView").getByText("This message has an inline emoji 👒"),
|
||||
).toBeInViewport();
|
||||
|
@ -741,7 +741,7 @@ test.describe("Timeline", () => {
|
|||
|
||||
await checkA11y();
|
||||
|
||||
await app.scrollToBottom(page);
|
||||
await app.timeline.scrollToBottom();
|
||||
await expect(page.locator(".mx_EventTile_last")).toMatchScreenshot("url-preview.png", {
|
||||
// Exclude timestamp and read marker from snapshot
|
||||
mask: [page.locator(".mx_MessageTimestamp")],
|
||||
|
@ -1090,7 +1090,7 @@ test.describe("Timeline", () => {
|
|||
// Make sure the strings do not overflow on IRC layout
|
||||
await app.settings.setValue("layout", null, SettingLevel.DEVICE, Layout.IRC);
|
||||
// Scroll to the bottom to have Percy take a snapshot of the whole viewport
|
||||
await app.scrollToBottom(page);
|
||||
await app.timeline.scrollToBottom();
|
||||
// Assert that both avatar in the introduction and the last message are visible at the same time
|
||||
await expect(page.locator(".mx_NewRoomIntro .mx_BaseAvatar")).toBeVisible();
|
||||
const lastEventTileIrc = page.locator(".mx_EventTile_last[data-layout='irc']");
|
||||
|
@ -1104,7 +1104,7 @@ test.describe("Timeline", () => {
|
|||
|
||||
// Make sure the strings do not overflow on modern layout
|
||||
await app.settings.setValue("layout", null, SettingLevel.DEVICE, Layout.Group);
|
||||
await app.scrollToBottom(page); // Scroll again in case
|
||||
await app.timeline.scrollToBottom(); // Scroll again in case
|
||||
await expect(page.locator(".mx_NewRoomIntro .mx_BaseAvatar")).toBeVisible();
|
||||
const lastEventTileGroup = page.locator(".mx_EventTile_last[data-layout='group']");
|
||||
await expect(lastEventTileGroup.locator(".mx_MTextBody").first()).toBeVisible();
|
||||
|
@ -1116,7 +1116,7 @@ test.describe("Timeline", () => {
|
|||
|
||||
// Make sure the strings do not overflow on bubble layout
|
||||
await app.settings.setValue("layout", null, SettingLevel.DEVICE, Layout.Bubble);
|
||||
await app.scrollToBottom(page); // Scroll again in case
|
||||
await app.timeline.scrollToBottom(); // Scroll again in case
|
||||
await expect(page.locator(".mx_NewRoomIntro .mx_BaseAvatar")).toBeVisible();
|
||||
const lastEventTileBubble = page.locator(".mx_EventTile_last[data-layout='bubble']");
|
||||
await expect(lastEventTileBubble.locator(".mx_MTextBody").first()).toBeVisible();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue