test: fix most e2e tests
This commit is contained in:
@@ -42,8 +42,7 @@ test.describe('Plugin API multi-user runtime', () => {
|
||||
});
|
||||
|
||||
await test.step('Activate the server plugin for Bob as the embed/soundboard receiver', async () => {
|
||||
await installGrantAndActivatePlugin(scenario.bob.page, false);
|
||||
await closeSettingsModal(scenario.bob.page);
|
||||
await installRequiredServerPluginsViaModal(scenario.bob.page);
|
||||
await expect(soundboardComposerButton(scenario.bob.page)).toBeVisible({ timeout: 20_000 });
|
||||
await expect(scenario.bob.page.getByText(SOUND_BOARD_TEXT, { exact: true })).toBeVisible({ timeout: 20_000 });
|
||||
});
|
||||
@@ -178,6 +177,14 @@ async function installGrantAndActivatePlugin(page: Page, installFromStore: boole
|
||||
await expect(page.getByText('all-api plugin completed')).toBeVisible({ timeout: 30_000 });
|
||||
}
|
||||
|
||||
async function installRequiredServerPluginsViaModal(page: Page): Promise<void> {
|
||||
const installButton = page.getByRole('button', { name: 'Install plugins' });
|
||||
|
||||
await expect(installButton).toBeVisible({ timeout: 30_000 });
|
||||
await installButton.click();
|
||||
await expect(installButton).toHaveCount(0, { timeout: 30_000 });
|
||||
}
|
||||
|
||||
async function closeSettingsModal(page: Page): Promise<void> {
|
||||
await page.keyboard.press('Escape');
|
||||
await expect(page.getByTestId('plugin-manager')).toHaveCount(0);
|
||||
|
||||
@@ -18,7 +18,8 @@ import {
|
||||
import {
|
||||
authHeaders,
|
||||
readAuthTokenFromPage,
|
||||
registerTestUser
|
||||
registerTestUser,
|
||||
type AuthSession
|
||||
} from '../../helpers/auth-api';
|
||||
import { RegisterPage } from '../../pages/register.page';
|
||||
import { ServerSearchPage } from '../../pages/server-search.page';
|
||||
@@ -151,6 +152,12 @@ test.describe('Mixed signal-config voice', () => {
|
||||
});
|
||||
|
||||
let secondaryRoomId = '';
|
||||
// Identity that owns the secondary room. The invite must be created with
|
||||
// this same API session: client 0 also auto-provisions a *separate*
|
||||
// identity on the secondary signal endpoint, which overwrites the page's
|
||||
// stored token, so reading the token back from the page would yield a
|
||||
// non-owner identity and the invite request would be rejected (NOT_MEMBER).
|
||||
let secondaryRoomOwner: AuthSession;
|
||||
|
||||
// ── Create rooms ────────────────────────────────────────────
|
||||
await test.step('Create voice room on primary and chat room on secondary', async () => {
|
||||
@@ -192,6 +199,7 @@ test.describe('Mixed signal-config voice', () => {
|
||||
);
|
||||
|
||||
secondaryRoomId = secondaryRoom.id;
|
||||
secondaryRoomOwner = secondarySession;
|
||||
});
|
||||
|
||||
// ── Create invite links ─────────────────────────────────────
|
||||
@@ -221,17 +229,14 @@ test.describe('Mixed signal-config voice', () => {
|
||||
|
||||
primaryRoomInviteUrl = `/invite/${primaryInvite.id}?server=${encodeURIComponent(testServer.url)}`;
|
||||
|
||||
// Create invite for secondary room (chat) via API
|
||||
const secondaryToken = await readAuthTokenFromPage(clients[0].page, secondaryServer.url);
|
||||
|
||||
if (!secondaryToken) {
|
||||
throw new Error('Missing session token for secondary signal invite creation');
|
||||
}
|
||||
|
||||
// Create invite for secondary room (chat) via API using the API session
|
||||
// that owns the room. The page-stored token for the secondary endpoint
|
||||
// belongs to client 0's auto-provisioned identity, which is not the
|
||||
// room owner and would be rejected with NOT_MEMBER.
|
||||
const secondaryInvite = await createInviteViaApi(
|
||||
secondaryServer.url,
|
||||
secondaryRoomId,
|
||||
secondaryToken,
|
||||
secondaryRoomOwner.token,
|
||||
clients[0].user.displayName
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user