Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
297 changes: 160 additions & 137 deletions modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,23 @@
*/

import {
MatrixAuthenticationServiceContainer,
type MasConfig,
type StartedMatrixAuthenticationServiceContainer,
type StartedSynapseContainer,
type SynapseConfig,
type SynapseContainer,
} from "@element-hq/element-web-playwright-common/lib/testcontainers/index.js";
import type { Credentials } from "@element-hq/element-web-playwright-common/lib/utils/api";
import type { Fixtures } from "@playwright/test";
import { type Credentials } from "@element-hq/element-web-playwright-common/lib/utils/api";
import { makePostgres } from "@element-hq/element-web-playwright-common/lib/testcontainers/postgres.js";
import { makeMas } from "@element-hq/element-web-playwright-common/lib/testcontainers/mas.js";

import { test as base, expect } from "../../../../playwright/element-web-test";
import { RestrictedGuestsSynapseContainer, RestrictedGuestsSynapseWithMasContainer } from "./services";
import { test as subBase, expect } from "../../../../playwright/element-web-test";

const MAS_CLIENT_ID = "01ARZ3NDEKTSV4RRFFQ69G5FAV";
const MAS_CLIENT_SECRET = "restricted-guests-secret";
const MAS_SHARED_SECRET = "restricted-guests-shared-secret";
const MAS_INTERNAL_URL = "http://mas:8080";
const MAS_INTERNAL_URL = "http://guest-mas:8080";
const GUEST_HOMESERVER_NAME = "guest-homeserver";
const GUEST_HOMESERVER_INTERNAL_URL = "http://guest-homeserver:8008";

const MAS_HTTP_LISTENERS: NonNullable<MasConfig["http"]>["listeners"] = [
{
Expand Down Expand Up @@ -60,17 +59,11 @@
},
];

const MAS_CONFIG: Partial<MasConfig> = {
const BASE_MAS_CONFIG: Partial<MasConfig> = {
http: {
listeners: MAS_HTTP_LISTENERS,
public_base: "",
},
matrix: {
kind: "synapse",
homeserver: GUEST_HOMESERVER_NAME,
endpoint: GUEST_HOMESERVER_INTERNAL_URL,
secret: MAS_SHARED_SECRET,
},
policy: {
data: {
admin_clients: [MAS_CLIENT_ID],
Expand All @@ -88,17 +81,27 @@
],
};

const applySharedTestConfig = (testInstance: typeof base) => {
testInstance.use({
displayName: "Tommy",
synapseConfig: {
allow_guest_access: true,
},
labsFlags: ["feature_ask_to_join"],
});
};
declare module "@element-hq/element-web-module-api" {
export interface Config {
embedded_pages?: {
login_for_welcome?: boolean;
};
}
}

// We do some wacky things here in order to run the test suite against multiple homeserver configurations
const base = subBase.extend<
{
testRoomId: string;
},
{
auth: "mas" | "legacy";

const sharedFixtures: Fixtures<{ testRoomId: string }, { bot: Credentials }, any, any> = {
bot: Credentials;
guestMas?: StartedMatrixAuthenticationServiceContainer;
guestHomeserver: StartedSynapseContainer;
}
>({
testRoomId: [
async ({ homeserver, bot }, use) => {
const { room_id: roomId } = (await homeserver.csApi.request("POST", "/v3/createRoom", bot.accessToken, {
Expand All @@ -125,158 +128,178 @@
},
{ scope: "worker" },
],
};

const test = base.extend<
{
testRoomId: string;
},
{
guestHomeserver: StartedSynapseContainer;
bot: Credentials;
}
>({
...sharedFixtures,
guestHomeserver: [
async ({ logger, synapseConfig, network }, use) => {
const container = await new RestrictedGuestsSynapseContainer()
.withConfig(synapseConfig)
.withConfig({ server_name: GUEST_HOMESERVER_NAME })
.withNetwork(network)
.withNetworkAliases(GUEST_HOMESERVER_NAME)
.withLogConsumer(logger.getConsumer("guest_homeserver"))
.start();

auth: ["mas", { scope: "worker" }],
// Optional MAS on the default homeserver, enabled only when we are testing the non-guest login UX
mas: [
async ({ logger, network, postgres, auth, synapseConfig }, use) => {
if (auth !== "mas" || synapseConfig.allow_guest_access !== false) {
return use(undefined);
}
const container = await makeMas(
postgres,
network,
logger,
{
...BASE_MAS_CONFIG,
matrix: {
kind: "synapse",
homeserver: "homeserver",
endpoint: "http://homeserver:8008",
secret: MAS_SHARED_SECRET,
},
},
"mas",
);
await use(container);
await container.stop();
},
{ scope: "worker" },
],
});

const masTest = base.extend<
{
testRoomId: string;
},
{
guestHomeserver: StartedSynapseContainer;
guestMas: StartedMatrixAuthenticationServiceContainer;
bot: Credentials;
}
>({
...sharedFixtures,
// Optional MAS on the module homeserver
guestMas: [
async ({ logger, network, postgres }, use) => {
const container = await new MatrixAuthenticationServiceContainer(postgres)
.withNetwork(network)
.withNetworkAliases("mas")
.withLogConsumer(logger.getConsumer("guest_mas"))
.withConfig(MAS_CONFIG)
.start();
async ({ logger, network, auth }, use) => {
if (auth !== "mas") {
return use(undefined);
}

// We need a separate postgres so it doesn't fight with the default MAS
const postgres = await makePostgres(network, logger, "guest-mas-postgres");

const container = await makeMas(
postgres,
network,
logger,
{
...BASE_MAS_CONFIG,
matrix: {
kind: "synapse",
homeserver: GUEST_HOMESERVER_NAME,
endpoint: "http://guest-homeserver:8008",
secret: MAS_SHARED_SECRET,
},
},
"guest-mas",
);
await use(container);
await container.stop();
await postgres.stop();
},
{ scope: "worker" },
],
// Module homeserver
guestHomeserver: [
async ({ logger, synapseConfig, network, guestMas }, use) => {
const container = await new RestrictedGuestsSynapseWithMasContainer({
adminApiBaseUrl: MAS_INTERNAL_URL,
oauthBaseUrl: MAS_INTERNAL_URL,
clientId: MAS_CLIENT_ID,
clientSecret: MAS_CLIENT_SECRET,
})
let container: SynapseContainer;
if (guestMas) {
container = new RestrictedGuestsSynapseWithMasContainer({
adminApiBaseUrl: MAS_INTERNAL_URL,
oauthBaseUrl: MAS_INTERNAL_URL,
clientId: MAS_CLIENT_ID,
clientSecret: MAS_CLIENT_SECRET,
}).withMatrixAuthenticationService(guestMas);
} else {
container = new RestrictedGuestsSynapseContainer();
}

const startedContainer = await container
.withConfig(synapseConfig)
.withConfig({
server_name: GUEST_HOMESERVER_NAME,
matrix_authentication_service: {
enabled: true,
endpoint: `${MAS_INTERNAL_URL}/`,
secret: MAS_SHARED_SECRET,
},
// Must be disabled when using MAS.
password_config: {
enabled: false,
},
// Must be disabled when using MAS.
enable_registration: false,
} as Partial<SynapseConfig>)
.withMatrixAuthenticationService(guestMas)
})
.withNetwork(network)
.withNetworkAliases(GUEST_HOMESERVER_NAME)
.withLogConsumer(logger.getConsumer("guest_homeserver"))
.start();

await use(container);
await container.stop();
await use(startedContainer);
await startedContainer.stop();
},
{ scope: "worker" },
],
displayName: "Tommy",
labsFlags: ["feature_ask_to_join"],
config: {
embedded_pages: {
login_for_welcome: true,
},
},
});

type RestrictedGuestsTestInstance = typeof test;

const defineRestrictedGuestsTests = (testInstance: RestrictedGuestsTestInstance, suiteName: string) => {
applySharedTestConfig(testInstance);

testInstance.describe(suiteName, () => {
testInstance.use({
page: async ({ page }, use) => {
await page.goto("/");
await use(page);
base.slow();
for (const auth of ["mas", "legacy"] as const) {
for (const guestsEnabled of [true, false]) {
const test = base.extend({
auth,
synapseConfig: {
allow_guest_access: guestsEnabled,
},
});

testInstance("should error if config is missing", async ({ page }) => {
await expect(page.getByText("Your Element is misconfigured")).toBeVisible();
await expect(page.getByText("Errors in module configuration")).toBeVisible();
});

testInstance.describe("with config", () => {
testInstance.beforeEach(({ config, guestHomeserver }) => {
config["io.element.element-web-modules.restricted-guests"] = {
guest_user_homeserver_url: guestHomeserver.baseUrl,
};
test.describe(`Restricted guests auth=${auth} guests=${guestsEnabled}`, () => {
test("should error if config is missing", async ({ page }) => {
await page.goto("/");
await expect(page.getByText("Your Element is misconfigured")).toBeVisible();
await expect(page.getByText("Errors in module configuration")).toBeVisible();
});

testInstance(
"should show the default room preview bar for logged in users",
{ tag: ["@screenshot"] },
async ({ page, user, testRoomId }) => {
test.describe("with config", () => {
test.beforeEach(async ({ config, guestHomeserver, page, testRoomId }) => {
config["io.element.element-web-modules.restricted-guests"] = {
guest_user_homeserver_url: guestHomeserver.baseUrl,
};
// Go to a room we are not a member of
await page.goto(`/#/room/${testRoomId}`);
});

const button = page.getByRole("button", { name: "Join the discussion" });
await expect(button).toBeVisible();
},
);
if (guestsEnabled) {
// The screenshots between the two auth type tests for guests should be identical.
test(
"should show the default room preview bar for logged in users",
{ tag: ["@screenshot"] },
async ({ page, user, testRoomId }) => {
// Go to a room we are not a member of
await page.goto(`/#/room/${testRoomId}`);
const button = page.getByRole("button", { name: "Join the discussion" });
await expect(button).toBeVisible();
},
);

testInstance(
"should show the module's room preview bar for guests",
{ tag: ["@screenshot"] },
async ({ page, testRoomId }) => {
// Go to a room we are not a member of
await page.goto(`/#/room/${testRoomId}`);
test(
"should show the module's room preview bar for guests",
{ tag: ["@screenshot"] },
async ({ page }) => {
const button = page.getByRole("button", { name: "Join as guest", exact: true });
await expect(button).toBeVisible();
await expect(page.locator(".mx_RoomPreviewBar")).toMatchScreenshot(`preview-bar.png`);

const button = page.getByRole("button", { name: "Join", exact: true });
await expect(button).toBeVisible();
await expect(page.locator(".mx_RoomPreviewBar")).toMatchScreenshot(`preview-bar.png`);
await button.click();
const dialog = page.getByRole("dialog");
await expect(dialog).toMatchScreenshot(`dialog.png`);

Check failure on line 278 in modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts

View workflow job for this annotation

GitHub Actions / Run Playwright end-to-end tests & upload html report / Run Playwright end-to-end tests & upload html report

[restricted-guests] › modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:268:21 › Restricted guests auth=legacy guests=true › with config › should show the module's room preview bar for guests @screenshot

3) [restricted-guests] › modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:268:21 › Restricted guests auth=legacy guests=true › with config › should show the module's room preview bar for guests @screenshot Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator).toHaveScreenshot(expected) failed Locator: getByRole('dialog') Expected an image 704px by 186px, received 704px by 230px. 4840 pixels (ratio 0.03 of all image pixels) are different. Snapshot: dialog.png Call log: - Expect "toHaveScreenshot(dialog.png)" with timeout 5000ms - verifying given screenshot expectation - waiting for getByRole('dialog') - locator resolved to <div role="dialog" tabindex="-1" class="mx_Dialog_fixedWidth" data-focus-lock-disabled="false" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - Expected an image 704px by 186px, received 704px by 230px. 4840 pixels (ratio 0.03 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for getByRole('dialog') - locator resolved to <div role="dialog" tabindex="-1" class="mx_Dialog_fixedWidth" data-focus-lock-disabled="false" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - Expected an image 704px by 186px, received 704px by 230px. 4840 pixels (ratio 0.03 of all image pixels) are different. 276 | await button.click(); 277 | const dialog = page.getByRole("dialog"); > 278 | await expect(dialog).toMatchScreenshot(`dialog.png`); | ^ 279 | 280 | await dialog.getByPlaceholder("Name").fill("Jim"); 281 | await dialog.getByRole("button", { name: "Continue as guest" }).click(); at /home/runner/work/element-modules/element-modules/modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:278:50

Check failure on line 278 in modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts

View workflow job for this annotation

GitHub Actions / Run Playwright end-to-end tests & upload html report / Run Playwright end-to-end tests & upload html report

[restricted-guests] › modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:268:21 › Restricted guests auth=legacy guests=true › with config › should show the module's room preview bar for guests @screenshot

3) [restricted-guests] › modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:268:21 › Restricted guests auth=legacy guests=true › with config › should show the module's room preview bar for guests @screenshot Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator).toHaveScreenshot(expected) failed Locator: getByRole('dialog') Expected an image 704px by 186px, received 704px by 230px. 4840 pixels (ratio 0.03 of all image pixels) are different. Snapshot: dialog.png Call log: - Expect "toHaveScreenshot(dialog.png)" with timeout 5000ms - verifying given screenshot expectation - waiting for getByRole('dialog') - locator resolved to <div role="dialog" tabindex="-1" class="mx_Dialog_fixedWidth" data-focus-lock-disabled="false" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - Expected an image 704px by 186px, received 704px by 230px. 4840 pixels (ratio 0.03 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for getByRole('dialog') - locator resolved to <div role="dialog" tabindex="-1" class="mx_Dialog_fixedWidth" data-focus-lock-disabled="false" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - Expected an image 704px by 186px, received 704px by 230px. 4840 pixels (ratio 0.03 of all image pixels) are different. 276 | await button.click(); 277 | const dialog = page.getByRole("dialog"); > 278 | await expect(dialog).toMatchScreenshot(`dialog.png`); | ^ 279 | 280 | await dialog.getByPlaceholder("Name").fill("Jim"); 281 | await dialog.getByRole("button", { name: "Continue as guest" }).click(); at /home/runner/work/element-modules/element-modules/modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:278:50

Check failure on line 278 in modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts

View workflow job for this annotation

GitHub Actions / Run Playwright end-to-end tests & upload html report / Run Playwright end-to-end tests & upload html report

[restricted-guests] › modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:268:21 › Restricted guests auth=legacy guests=true › with config › should show the module's room preview bar for guests @screenshot

3) [restricted-guests] › modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:268:21 › Restricted guests auth=legacy guests=true › with config › should show the module's room preview bar for guests @screenshot Error: expect(locator).toHaveScreenshot(expected) failed Locator: getByRole('dialog') Expected an image 704px by 186px, received 704px by 230px. 4840 pixels (ratio 0.03 of all image pixels) are different. Snapshot: dialog.png Call log: - Expect "toHaveScreenshot(dialog.png)" with timeout 5000ms - verifying given screenshot expectation - waiting for getByRole('dialog') - locator resolved to <div role="dialog" tabindex="-1" class="mx_Dialog_fixedWidth" data-focus-lock-disabled="false" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - Expected an image 704px by 186px, received 704px by 230px. 4840 pixels (ratio 0.03 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for getByRole('dialog') - locator resolved to <div role="dialog" tabindex="-1" class="mx_Dialog_fixedWidth" data-focus-lock-disabled="false" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - Expected an image 704px by 186px, received 704px by 230px. 4840 pixels (ratio 0.03 of all image pixels) are different. 276 | await button.click(); 277 | const dialog = page.getByRole("dialog"); > 278 | await expect(dialog).toMatchScreenshot(`dialog.png`); | ^ 279 | 280 | await dialog.getByPlaceholder("Name").fill("Jim"); 281 | await dialog.getByRole("button", { name: "Continue as guest" }).click(); at /home/runner/work/element-modules/element-modules/modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:278:50

Check failure on line 278 in modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts

View workflow job for this annotation

GitHub Actions / Run Playwright end-to-end tests & upload html report / Run Playwright end-to-end tests & upload html report

[restricted-guests] › modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:268:21 › Restricted guests auth=mas guests=true › with config › should show the module's room preview bar for guests @screenshot

1) [restricted-guests] › modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:268:21 › Restricted guests auth=mas guests=true › with config › should show the module's room preview bar for guests @screenshot Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator).toHaveScreenshot(expected) failed Locator: getByRole('dialog') Expected an image 704px by 186px, received 704px by 230px. 4840 pixels (ratio 0.03 of all image pixels) are different. Snapshot: dialog.png Call log: - Expect "toHaveScreenshot(dialog.png)" with timeout 5000ms - verifying given screenshot expectation - waiting for getByRole('dialog') - locator resolved to <div role="dialog" tabindex="-1" class="mx_Dialog_fixedWidth" data-focus-lock-disabled="false" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - Expected an image 704px by 186px, received 704px by 230px. 4840 pixels (ratio 0.03 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for getByRole('dialog') - locator resolved to <div role="dialog" tabindex="-1" class="mx_Dialog_fixedWidth" data-focus-lock-disabled="false" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - Expected an image 704px by 186px, received 704px by 230px. 4840 pixels (ratio 0.03 of all image pixels) are different. 276 | await button.click(); 277 | const dialog = page.getByRole("dialog"); > 278 | await expect(dialog).toMatchScreenshot(`dialog.png`); | ^ 279 | 280 | await dialog.getByPlaceholder("Name").fill("Jim"); 281 | await dialog.getByRole("button", { name: "Continue as guest" }).click(); at /home/runner/work/element-modules/element-modules/modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:278:50

Check failure on line 278 in modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts

View workflow job for this annotation

GitHub Actions / Run Playwright end-to-end tests & upload html report / Run Playwright end-to-end tests & upload html report

[restricted-guests] › modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:268:21 › Restricted guests auth=mas guests=true › with config › should show the module's room preview bar for guests @screenshot

1) [restricted-guests] › modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:268:21 › Restricted guests auth=mas guests=true › with config › should show the module's room preview bar for guests @screenshot Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator).toHaveScreenshot(expected) failed Locator: getByRole('dialog') Expected an image 704px by 186px, received 704px by 230px. 4840 pixels (ratio 0.03 of all image pixels) are different. Snapshot: dialog.png Call log: - Expect "toHaveScreenshot(dialog.png)" with timeout 5000ms - verifying given screenshot expectation - waiting for getByRole('dialog') - locator resolved to <div role="dialog" tabindex="-1" class="mx_Dialog_fixedWidth" data-focus-lock-disabled="false" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - Expected an image 704px by 186px, received 704px by 230px. 4840 pixels (ratio 0.03 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for getByRole('dialog') - locator resolved to <div role="dialog" tabindex="-1" class="mx_Dialog_fixedWidth" data-focus-lock-disabled="false" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - Expected an image 704px by 186px, received 704px by 230px. 4840 pixels (ratio 0.03 of all image pixels) are different. 276 | await button.click(); 277 | const dialog = page.getByRole("dialog"); > 278 | await expect(dialog).toMatchScreenshot(`dialog.png`); | ^ 279 | 280 | await dialog.getByPlaceholder("Name").fill("Jim"); 281 | await dialog.getByRole("button", { name: "Continue as guest" }).click(); at /home/runner/work/element-modules/element-modules/modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:278:50

Check failure on line 278 in modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts

View workflow job for this annotation

GitHub Actions / Run Playwright end-to-end tests & upload html report / Run Playwright end-to-end tests & upload html report

[restricted-guests] › modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:268:21 › Restricted guests auth=mas guests=true › with config › should show the module's room preview bar for guests @screenshot

1) [restricted-guests] › modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:268:21 › Restricted guests auth=mas guests=true › with config › should show the module's room preview bar for guests @screenshot Error: expect(locator).toHaveScreenshot(expected) failed Locator: getByRole('dialog') Expected an image 704px by 186px, received 704px by 230px. 4840 pixels (ratio 0.03 of all image pixels) are different. Snapshot: dialog.png Call log: - Expect "toHaveScreenshot(dialog.png)" with timeout 5000ms - verifying given screenshot expectation - waiting for getByRole('dialog') - locator resolved to <div role="dialog" tabindex="-1" class="mx_Dialog_fixedWidth" data-focus-lock-disabled="false" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - Expected an image 704px by 186px, received 704px by 230px. 4840 pixels (ratio 0.03 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for getByRole('dialog') - locator resolved to <div role="dialog" tabindex="-1" class="mx_Dialog_fixedWidth" data-focus-lock-disabled="false" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - Expected an image 704px by 186px, received 704px by 230px. 4840 pixels (ratio 0.03 of all image pixels) are different. 276 | await button.click(); 277 | const dialog = page.getByRole("dialog"); > 278 | await expect(dialog).toMatchScreenshot(`dialog.png`); | ^ 279 | 280 | await dialog.getByPlaceholder("Name").fill("Jim"); 281 | await dialog.getByRole("button", { name: "Continue as guest" }).click(); at /home/runner/work/element-modules/element-modules/modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:278:50

await button.click();
const dialog = page.getByRole("dialog");
await expect(dialog).toMatchScreenshot(`dialog.png`);
await dialog.getByPlaceholder("Name").fill("Jim");
await dialog.getByRole("button", { name: "Continue as guest" }).click();

await dialog.getByPlaceholder("Name").fill("Jim");
await dialog.getByRole("button", { name: "Continue as guest" }).click();
await expect(page.getByText("Ask to join?")).toBeVisible();
},
);
} else {
test("should show the module login ux", { tag: ["@screenshot"] }, async ({ page }) => {
const button = page.getByRole("button", { name: "Join as guest", exact: true });
await expect(button).toBeVisible();
await expect(page.getByRole("main")).toMatchScreenshot(`login-${auth}.png`);

await expect(page.getByText("Ask to join?")).toBeVisible();
},
);
});
});
};
await button.click();
const dialog = page.getByRole("dialog");
await expect(dialog).toMatchScreenshot(`dialog.png`);

Check failure on line 294 in modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts

View workflow job for this annotation

GitHub Actions / Run Playwright end-to-end tests & upload html report / Run Playwright end-to-end tests & upload html report

[restricted-guests] › modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:287:21 › Restricted guests auth=legacy guests=false › with config › should show the module login ux @screenshot

4) [restricted-guests] › modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:287:21 › Restricted guests auth=legacy guests=false › with config › should show the module login ux @screenshot Error: expect(locator).toHaveScreenshot(expected) failed Locator: getByRole('dialog') 718 pixels (ratio 0.01 of all image pixels) are different. Snapshot: dialog.png Call log: - Expect "toHaveScreenshot(dialog.png)" with timeout 5000ms - verifying given screenshot expectation - waiting for getByRole('dialog') - locator resolved to <div role="dialog" tabindex="-1" class="mx_Dialog_fixedWidth" data-focus-lock-disabled="false" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - 718 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for getByRole('dialog') - locator resolved to <div role="dialog" tabindex="-1" class="mx_Dialog_fixedWidth" data-focus-lock-disabled="false" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - 718 pixels (ratio 0.01 of all image pixels) are different. 292 | await button.click(); 293 | const dialog = page.getByRole("dialog"); > 294 | await expect(dialog).toMatchScreenshot(`dialog.png`); | ^ 295 | 296 | await dialog.getByPlaceholder("Name").fill("Jim"); 297 | await dialog.getByRole("button", { name: "Continue as guest" }).click(); at /home/runner/work/element-modules/element-modules/modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:294:46

Check failure on line 294 in modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts

View workflow job for this annotation

GitHub Actions / Run Playwright end-to-end tests & upload html report / Run Playwright end-to-end tests & upload html report

[restricted-guests] › modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:287:21 › Restricted guests auth=mas guests=false › with config › should show the module login ux @screenshot

2) [restricted-guests] › modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:287:21 › Restricted guests auth=mas guests=false › with config › should show the module login ux @screenshot Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator).toHaveScreenshot(expected) failed Locator: getByRole('dialog') 718 pixels (ratio 0.01 of all image pixels) are different. Snapshot: dialog.png Call log: - Expect "toHaveScreenshot(dialog.png)" with timeout 5000ms - verifying given screenshot expectation - waiting for getByRole('dialog') - locator resolved to <div role="dialog" tabindex="-1" class="mx_Dialog_fixedWidth" data-focus-lock-disabled="false" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - 718 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for getByRole('dialog') - locator resolved to <div role="dialog" tabindex="-1" class="mx_Dialog_fixedWidth" data-focus-lock-disabled="false" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - 718 pixels (ratio 0.01 of all image pixels) are different. 292 | await button.click(); 293 | const dialog = page.getByRole("dialog"); > 294 | await expect(dialog).toMatchScreenshot(`dialog.png`); | ^ 295 | 296 | await dialog.getByPlaceholder("Name").fill("Jim"); 297 | await dialog.getByRole("button", { name: "Continue as guest" }).click(); at /home/runner/work/element-modules/element-modules/modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:294:46

Check failure on line 294 in modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts

View workflow job for this annotation

GitHub Actions / Run Playwright end-to-end tests & upload html report / Run Playwright end-to-end tests & upload html report

[restricted-guests] › modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:287:21 › Restricted guests auth=mas guests=false › with config › should show the module login ux @screenshot

2) [restricted-guests] › modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:287:21 › Restricted guests auth=mas guests=false › with config › should show the module login ux @screenshot Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator).toHaveScreenshot(expected) failed Locator: getByRole('dialog') 718 pixels (ratio 0.01 of all image pixels) are different. Snapshot: dialog.png Call log: - Expect "toHaveScreenshot(dialog.png)" with timeout 5000ms - verifying given screenshot expectation - waiting for getByRole('dialog') - locator resolved to <div role="dialog" tabindex="-1" class="mx_Dialog_fixedWidth" data-focus-lock-disabled="false" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - 718 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for getByRole('dialog') - locator resolved to <div role="dialog" tabindex="-1" class="mx_Dialog_fixedWidth" data-focus-lock-disabled="false" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - 718 pixels (ratio 0.01 of all image pixels) are different. 292 | await button.click(); 293 | const dialog = page.getByRole("dialog"); > 294 | await expect(dialog).toMatchScreenshot(`dialog.png`); | ^ 295 | 296 | await dialog.getByPlaceholder("Name").fill("Jim"); 297 | await dialog.getByRole("button", { name: "Continue as guest" }).click(); at /home/runner/work/element-modules/element-modules/modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:294:46

Check failure on line 294 in modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts

View workflow job for this annotation

GitHub Actions / Run Playwright end-to-end tests & upload html report / Run Playwright end-to-end tests & upload html report

[restricted-guests] › modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:287:21 › Restricted guests auth=mas guests=false › with config › should show the module login ux @screenshot

2) [restricted-guests] › modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:287:21 › Restricted guests auth=mas guests=false › with config › should show the module login ux @screenshot Error: expect(locator).toHaveScreenshot(expected) failed Locator: getByRole('dialog') 718 pixels (ratio 0.01 of all image pixels) are different. Snapshot: dialog.png Call log: - Expect "toHaveScreenshot(dialog.png)" with timeout 5000ms - verifying given screenshot expectation - waiting for getByRole('dialog') - locator resolved to <div role="dialog" tabindex="-1" class="mx_Dialog_fixedWidth" data-focus-lock-disabled="false" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - 718 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for getByRole('dialog') - locator resolved to <div role="dialog" tabindex="-1" class="mx_Dialog_fixedWidth" data-focus-lock-disabled="false" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - 718 pixels (ratio 0.01 of all image pixels) are different. 292 | await button.click(); 293 | const dialog = page.getByRole("dialog"); > 294 | await expect(dialog).toMatchScreenshot(`dialog.png`); | ^ 295 | 296 | await dialog.getByPlaceholder("Name").fill("Jim"); 297 | await dialog.getByRole("button", { name: "Continue as guest" }).click(); at /home/runner/work/element-modules/element-modules/modules/restricted-guests/element-web/e2e/restricted-guests.spec.ts:294:46

// The screenshots between the two tests should be identical.
defineRestrictedGuestsTests(test, "Restricted Guests");
defineRestrictedGuestsTests(masTest as RestrictedGuestsTestInstance, "Restricted Guests (MAS)");
await dialog.getByPlaceholder("Name").fill("Jim");
await dialog.getByRole("button", { name: "Continue as guest" }).click();

await expect(page.getByText("Join the discussion")).toBeVisible();
});
}
});
});
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading