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 Jan 7, 2025
1 parent 757a22a commit 048563a
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 16 deletions.
2 changes: 0 additions & 2 deletions playwright/e2e/crypto/backups.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ async function expectBackupVersionToBe(page: Page, version: string) {
// which is faster but leaves us without crypto set up.
test.describe("Encryption state after registration", () => {
test.use(masHomeserver);
test.skip(isDendrite, "does not yet support MAS");

test("Key backup is enabled by default", async ({ page, mailhogClient, app }) => {
await page.goto("/#/login");
Expand All @@ -54,7 +53,6 @@ test.describe("Encryption state after registration", () => {

test.describe("Key backup reset from elsewhere", () => {
test.use(masHomeserver);
test.skip(isDendrite, "does not yet support MAS");

test("Key backup is disabled when reset from elsewhere", async ({ page, mailhogClient, request, homeserver }) => {
const testUsername = "alice";
Expand Down
2 changes: 2 additions & 0 deletions playwright/e2e/crypto/decryption-failure-messages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ test.describe("Cryptography", function () {
});

test.describe("decryption failure messages", () => {
test.skip(isDendrite, "Dendrite lacks support for MSC3967 so requires additional auth here");

test("should handle device-relative historical messages", async ({
homeserver,
page,
Expand Down
2 changes: 0 additions & 2 deletions playwright/e2e/oidc/oidc-native.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ Please see LICENSE files in the repository root for full details.
import { test, expect } from "../../element-web-test.ts";
import { registerAccountMas } from ".";
import { ElementAppPage } from "../../pages/ElementAppPage.ts";
import { isDendrite } from "../../plugins/homeserver/dendrite";
import { masHomeserver } from "../../plugins/homeserver/synapse/masHomeserver.ts";

test.describe("OIDC Native", { tag: ["@no-firefox", "@no-webkit"] }, () => {
test.use(masHomeserver);
test.skip(isDendrite, "does not yet support MAS");
test.slow(); // trace recording takes a while here

test("can register the oauth2 client and an account", async ({ context, page, homeserver, mailhogClient, mas }) => {
Expand Down
8 changes: 5 additions & 3 deletions playwright/plugins/homeserver/synapse/consentHomeserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ Please see LICENSE files in the repository root for full details.

import { Fixtures } from "@playwright/test";

import { Services } from "../../../services.ts";
import { Options, Services } from "../../../services.ts";

export const consentHomeserver: Fixtures<Services & Options, {}, Services & Options> = {
_homeserver: async ({ homeserverType, _homeserver: container, mailhog }, use, testInfo) => {
testInfo.skip(homeserverType !== "synapse", "does not yet support MAS");

export const consentHomeserver: Fixtures<Services, {}, Services> = {
_homeserver: async ({ _homeserver: container, mailhog }, use) => {
container
.withCopyDirectoriesToContainer([
{ source: "playwright/plugins/homeserver/synapse/res", target: "/data/res" },
Expand Down
7 changes: 4 additions & 3 deletions playwright/plugins/homeserver/synapse/emailHomeserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ Please see LICENSE files in the repository root for full details.

import { Fixtures } from "@playwright/test";

import { Services } from "../../../services.ts";
import { Options, Services } from "../../../services.ts";

export const emailHomeserver: Fixtures<Services, {}, Services> = {
_homeserver: async ({ _homeserver: container, mailhog }, use) => {
export const emailHomeserver: Fixtures<Services & Options, {}, Services & Options> = {
_homeserver: async ({ homeserverType, _homeserver: container, mailhog }, use, testInfo) => {
testInfo.skip(homeserverType !== "synapse", "does not yet support MAS");
container.withConfig({
enable_registration_without_verification: undefined,
disable_msisdn_registration: undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ Please see LICENSE files in the repository root for full details.
import { Fixtures } from "@playwright/test";
import { TestContainers } from "testcontainers";

import { Services } from "../../../services.ts";
import { Options, Services } from "../../../services.ts";
import { OAuthServer } from "../../oauth_server";

export const legacyOAuthHomeserver: Fixtures<Services, {}, Services> = {
_homeserver: async ({ _homeserver: container }, use) => {
export const legacyOAuthHomeserver: Fixtures<Services & Options, {}, Services & Options> = {
_homeserver: async ({ homeserverType, _homeserver: container }, use, testInfo) => {
testInfo.skip(homeserverType !== "synapse", "does not yet support MAS");
const server = new OAuthServer();
const port = server.start();

Expand Down
8 changes: 5 additions & 3 deletions playwright/plugins/homeserver/synapse/masHomeserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ Please see LICENSE files in the repository root for full details.

import { Fixtures, PlaywrightTestArgs } from "@playwright/test";

import { Services } from "../../../services.ts";
import { Options, Services } from "../../../services.ts";
import { Fixtures as BaseFixtures } from "../../../element-web-test.ts";
import { MatrixAuthenticationServiceContainer } from "../../../testcontainers/mas.ts";

type Fixture = PlaywrightTestArgs & Services & BaseFixtures;
type Fixture = PlaywrightTestArgs & Services & BaseFixtures & Options;
export const masHomeserver: Fixtures<Fixture, {}, Fixture> = {
mas: async ({ _homeserver: homeserver, logger, network, postgres, mailhog }, use) => {
mas: async ({ homeserverType, _homeserver: homeserver, logger, network, postgres, mailhog }, use, testInfo) => {
testInfo.skip(homeserverType !== "synapse", "does not yet support MAS");

const config = {
clients: [
{
Expand Down

0 comments on commit 048563a

Please sign in to comment.