Skip to content

Commit

Permalink
Iterate
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Telatynski <[email protected]>
  • Loading branch information
t3chguy committed Dec 17, 2024
1 parent ad6d8f9 commit 15cf95f
Show file tree
Hide file tree
Showing 15 changed files with 63 additions and 22 deletions.
3 changes: 3 additions & 0 deletions playwright/e2e/crypto/dehydration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ test.describe("Dehydration", () => {

test.use({
displayName: NAME,
// This is needed to work around an issue between Playwright, Firefox, and Service workers
// https://github.com/microsoft/playwright/issues/33561#issuecomment-2471642120
serviceWorkers: "block",
});

test("Create dehydrated device", async ({ page, user, app }, workerInfo) => {
Expand Down
3 changes: 3 additions & 0 deletions playwright/e2e/integration-manager/get-openid-token.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ test.describe("Integration Manager: Get OpenID Token", () => {
});
await use({ roomId });
},
// This is needed to work around an issue between Playwright, Firefox, and Service workers
// https://github.com/microsoft/playwright/issues/33561#issuecomment-2471642120
serviceWorkers: "block",
});

let integrationManagerUrl: string;
Expand Down
3 changes: 3 additions & 0 deletions playwright/e2e/integration-manager/kick.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ test.describe("Integration Manager: Kick", () => {
displayName: BOT_DISPLAY_NAME,
autoAcceptInvites: true,
},
// This is needed to work around an issue between Playwright, Firefox, and Service workers
// https://github.com/microsoft/playwright/issues/33561#issuecomment-2471642120
serviceWorkers: "block",
});

let integrationManagerUrl: string;
Expand Down
3 changes: 3 additions & 0 deletions playwright/e2e/integration-manager/read_events.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ test.describe("Integration Manager: Read Events", () => {
});
await use({ roomId });
},
// This is needed to work around an issue between Playwright, Firefox, and Service workers
// https://github.com/microsoft/playwright/issues/33561#issuecomment-2471642120
serviceWorkers: "block",
});

let integrationManagerUrl: string;
Expand Down
3 changes: 3 additions & 0 deletions playwright/e2e/integration-manager/send_event.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ test.describe("Integration Manager: Send Event", () => {
});
await use({ roomId });
},
// This is needed to work around an issue between Playwright, Firefox, and Service workers
// https://github.com/microsoft/playwright/issues/33561#issuecomment-2471642120
serviceWorkers: "block",
});

let integrationManagerUrl: string;
Expand Down
3 changes: 2 additions & 1 deletion playwright/e2e/location/location.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { Locator, Page } from "@playwright/test";

import { test, expect } from "../../element-web-test";

test.describe("Location sharing", () => {
// Firefox headless lacks WebGL support https://bugzilla.mozilla.org/show_bug.cgi?id=1375585
test.describe("Location sharing", { tag: "@no-firefox" }, () => {
const selectLocationShareTypeOption = (page: Page, shareType: string): Locator => {
return page.getByTestId(`share-location-option-${shareType}`);
};
Expand Down
3 changes: 3 additions & 0 deletions playwright/e2e/login/soft_logout.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ test.describe("Soft logout", () => {
template: "default",
oAuthServerPort: oAuthServer.port,
}),
// This is needed to work around an issue between Playwright, Firefox, and Service workers
// https://github.com/microsoft/playwright/issues/33561#issuecomment-2471642120
serviceWorkers: "block",
});

test.describe("with password user", () => {
Expand Down
3 changes: 3 additions & 0 deletions playwright/e2e/oidc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ export const test = base.extend<{
default_server_config: wellKnown,
});
},
// This is needed to work around an issue between Playwright, Firefox, and Service workers
// https://github.com/microsoft/playwright/issues/33561#issuecomment-2471642120
serviceWorkers: "block",
});

export { expect };
Expand Down
7 changes: 6 additions & 1 deletion playwright/e2e/register/register.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ Please see LICENSE files in the repository root for full details.
import { test, expect } from "../../element-web-test";

test.describe("Registration", () => {
test.use({ startHomeserverOpts: "consent" });
test.use({
startHomeserverOpts: "consent",
// This is needed to work around an issue between Playwright, Firefox, and Service workers
// https://github.com/microsoft/playwright/issues/33561#issuecomment-2471642120
serviceWorkers: "block",
});

test.beforeEach(async ({ page }) => {
await page.goto("/#/register");
Expand Down
3 changes: 3 additions & 0 deletions playwright/e2e/settings/account-user-settings-tab.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ test.describe("Account user settings tab", () => {
const locator = await app.settings.openUserSettings("Account");
await use(locator);
},
// This is needed to work around an issue between Playwright, Firefox, and Service workers
// https://github.com/microsoft/playwright/issues/33561#issuecomment-2471642120
serviceWorkers: "block",
});

test("should be rendered properly", { tag: "@screenshot" }, async ({ uut, user }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test.describe("Preferences user settings tab", () => {
await expect(tab).toMatchScreenshot("Preferences-user-settings-tab-should-be-rendered-properly-1.png");
});

test("should be able to change the app language", async ({ uut, user }) => {
test("should be able to change the app language", { tag: "@no-firefox" }, async ({ uut, user }) => {
// Check language and region setting dropdown
const languageInput = uut.getByRole("button", { name: "Language Dropdown" });
await languageInput.scrollIntoViewIfNeeded();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,26 @@ test.describe("Threads Activity Centre", () => {
await util.assertHighlightIndicator();
});

test("should show the rooms with unread threads", { tag: "@screenshot" }, async ({ room1, room2, util, msg }) => {
await util.goTo(room2);
await util.populateThreads(room1, room2, msg);
// The indicator should be shown
await util.assertHighlightIndicator();

// Verify that we have the expected rooms in the TAC
await util.openTac();
await util.assertRoomsInTac([
{ room: room2.name, notificationLevel: "highlight" },
{ room: room1.name, notificationLevel: "notification" },
]);

// Verify that we don't have a visual regression
await expect(util.getTacPanel()).toMatchScreenshot("tac-panel-mix-unread.png");
});
test(
"should show the rooms with unread threads",
{ tag: ["@screenshot", "@no-firefox"] },
async ({ room1, room2, util, msg }) => {
await util.goTo(room2);
await util.populateThreads(room1, room2, msg);
// The indicator should be shown
await util.assertHighlightIndicator();

// Verify that we have the expected rooms in the TAC
await util.openTac();
await util.assertRoomsInTac([
{ room: room2.name, notificationLevel: "highlight" },
{ room: room1.name, notificationLevel: "notification" },
]);

// Verify that we don't have a visual regression
await expect(util.getTacPanel()).toMatchScreenshot("tac-panel-mix-unread.png");
},
);

test("should update with a thread is read", { tag: "@screenshot" }, async ({ room1, room2, util, msg }) => {
await util.goTo(room2);
Expand Down
1 change: 0 additions & 1 deletion playwright/e2e/timeline/timeline.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,6 @@ test.describe("Timeline", () => {
});

test("can reply with a voice message", async ({ page, app, room, context }) => {
await context.grantPermissions(["microphone"]);
await viewRoomSendMessageAndSetupReply(page, app, room.roomId);

const composerOptions = await app.openMessageComposerOptions();
Expand Down
3 changes: 3 additions & 0 deletions playwright/e2e/update/update.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ test.describe("Update", () => {

test.use({
displayName: "Ursa",
// This is needed to work around an issue between Playwright, Firefox, and Service workers
// https://github.com/microsoft/playwright/issues/33561#issuecomment-2471642120
serviceWorkers: "block",
});

test.beforeEach(async ({ context }) => {
Expand Down
9 changes: 7 additions & 2 deletions playwright/plugins/docker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import * as os from "os";
import * as crypto from "crypto";
import * as childProcess from "child_process";
import * as fse from "fs-extra";
import { runtime } from "webpack";

Check failure on line 13 in playwright/plugins/docker/index.ts

View workflow job for this annotation

GitHub Actions / ESLint

'runtime' is defined but never used

/**
* @param cmd - command to execute
Expand Down Expand Up @@ -140,8 +141,12 @@ export class Docker {
* Detects whether the docker command is actually podman.
* To do this, it looks for "podman" in the output of "docker --help".
*/
static _isPodman?: boolean;
static async isPodman(): Promise<boolean> {
const { stdout } = await exec("docker", ["--help"], true);
return stdout.toLowerCase().includes("podman");
if (Docker._isPodman === undefined) {
const { stdout } = await exec("docker", ["--help"], true);
Docker._isPodman = stdout.toLowerCase().includes("podman");
}
return Docker._isPodman;
}
}

0 comments on commit 15cf95f

Please sign in to comment.