e2e: update room creation logic to use roomName instead of roomIdPrefix and use roomId as identifier for elements in room list

This commit is contained in:
juancarmore 2025-08-05 17:41:42 +02:00
parent 459537ecfb
commit adcd5d8e8d
8 changed files with 150 additions and 151 deletions

View File

@ -1,6 +1,7 @@
import { expect, test } from '@playwright/test'; import { expect, test } from '@playwright/test';
import { MEET_TESTAPP_URL } from '../../config'; import { MEET_TESTAPP_URL } from '../../config';
import { import {
createTestRoom,
deleteAllRecordings, deleteAllRecordings,
deleteAllRooms, deleteAllRooms,
joinRoomAs, joinRoomAs,
@ -11,21 +12,12 @@ import {
let subscribedToAppErrors = false; let subscribedToAppErrors = false;
test.describe('Web Component E2E Tests', () => { test.describe('Web Component E2E Tests', () => {
const testRoomPrefix = 'test-room'; let roomId: string;
let participantName: string; let participantName: string;
test.beforeAll(async ({ browser }) => { test.beforeAll(async () => {
// Create a test room before all tests // Create a test room before all tests
const tempContext = await browser.newContext(); roomId = await createTestRoom('test-room');
const tempPage = await tempContext.newPage();
await tempPage.goto(MEET_TESTAPP_URL);
await tempPage.waitForSelector('.create-room');
await tempPage.fill('#room-id-prefix', testRoomPrefix);
await tempPage.click('.create-room-btn');
await tempPage.waitForSelector(`#${testRoomPrefix}`);
await tempPage.close();
await tempContext.close();
}); });
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
@ -38,7 +30,7 @@ test.describe('Web Component E2E Tests', () => {
subscribedToAppErrors = true; subscribedToAppErrors = true;
} }
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, testRoomPrefix); await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
participantName = `P-${Math.random().toString(36).substring(2, 9)}`; participantName = `P-${Math.random().toString(36).substring(2, 9)}`;
}); });

View File

@ -5,6 +5,7 @@ import { PNG } from 'pngjs';
import { MEET_TESTAPP_URL } from '../../config.js'; import { MEET_TESTAPP_URL } from '../../config.js';
import { import {
applyVirtualBackground, applyVirtualBackground,
createTestRoom,
deleteAllRecordings, deleteAllRecordings,
deleteAllRooms, deleteAllRooms,
interactWithElementInIframe, interactWithElementInIframe,
@ -22,26 +23,16 @@ let subscribedToAppErrors = false;
// Test suite for room functionality in OpenVidu Meet // Test suite for room functionality in OpenVidu Meet
test.describe('Room Functionality Tests', () => { test.describe('Room Functionality Tests', () => {
const testRoomPrefix = 'testing-room'; let roomId: string;
let participantName: string; let participantName: string;
// ========================================== // ==========================================
// SETUP & TEARDOWN // SETUP & TEARDOWN
// ========================================== // ==========================================
test.beforeAll(async ({ browser }) => { test.beforeAll(async () => {
// Create a test room before all tests // Create a test room before all tests
const tempContext = await browser.newContext(); roomId = await createTestRoom('test-room');
const tempPage = await tempContext.newPage();
await tempPage.goto(MEET_TESTAPP_URL);
await tempPage.waitForSelector('.create-room');
await tempPage.fill('#room-id-prefix', testRoomPrefix);
await tempPage.click('.create-room-btn');
await tempPage.waitForTimeout(1000);
await tempPage.waitForSelector(`#${testRoomPrefix}`);
await tempPage.close();
await tempContext.close();
}); });
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
@ -54,7 +45,7 @@ test.describe('Room Functionality Tests', () => {
subscribedToAppErrors = true; subscribedToAppErrors = true;
} }
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, testRoomPrefix); await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
participantName = `P-${Math.random().toString(36).substring(2, 9)}`; participantName = `P-${Math.random().toString(36).substring(2, 9)}`;
}); });
@ -121,7 +112,7 @@ test.describe('Room Functionality Tests', () => {
// Second participant (moderator) joins // Second participant (moderator) joins
const context = await browser.newContext(); const context = await browser.newContext();
const moderatorPage = await context.newPage(); const moderatorPage = await context.newPage();
await prepareForJoiningRoom(moderatorPage, MEET_TESTAPP_URL, testRoomPrefix); await prepareForJoiningRoom(moderatorPage, MEET_TESTAPP_URL, roomId);
await joinRoomAs('moderator', 'moderator', moderatorPage); await joinRoomAs('moderator', 'moderator', moderatorPage);

View File

@ -1,6 +1,7 @@
import { expect, test } from '@playwright/test'; import { expect, test } from '@playwright/test';
import { MEET_TESTAPP_URL } from '../../config.js'; import { MEET_TESTAPP_URL } from '../../config.js';
import { import {
createTestRoom,
deleteAllRecordings, deleteAllRecordings,
deleteAllRooms, deleteAllRooms,
joinRoomAs, joinRoomAs,
@ -11,21 +12,12 @@ import {
let subscribedToAppErrors = false; let subscribedToAppErrors = false;
test.describe('Web Component E2E Tests', () => { test.describe('Web Component E2E Tests', () => {
const testRoomPrefix = 'test-room'; let roomId: string;
let participantName: string; let participantName: string;
test.beforeAll(async ({ browser }) => { test.beforeAll(async () => {
// Create a test room before all tests // Create a test room before all tests
const tempContext = await browser.newContext(); roomId = await createTestRoom('test-room');
const tempPage = await tempContext.newPage();
await tempPage.goto(MEET_TESTAPP_URL);
await tempPage.waitForSelector('.create-room');
await tempPage.fill('#room-id-prefix', testRoomPrefix);
await tempPage.click('.create-room-btn');
await tempPage.waitForSelector(`#${testRoomPrefix}`);
await tempPage.close();
await tempContext.close();
}); });
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
@ -38,7 +30,7 @@ test.describe('Web Component E2E Tests', () => {
subscribedToAppErrors = true; subscribedToAppErrors = true;
} }
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, testRoomPrefix); await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
participantName = `P-${Math.random().toString(36).substring(2, 9)}`; participantName = `P-${Math.random().toString(36).substring(2, 9)}`;
}); });

View File

@ -20,22 +20,16 @@ let subscribedToAppErrors = false;
let recordingCreated = false; let recordingCreated = false;
test.describe('Recording Access Tests', () => { test.describe('Recording Access Tests', () => {
const testRoomPrefix = 'recording-access-test';
let participantName: string;
let roomId: string; let roomId: string;
let participantName: string;
let adminCookie: string; let adminCookie: string;
test.beforeAll(async () => { test.beforeAll(async () => {
// Login as admin to get authentication cookie
adminCookie = await loginAsAdmin(); adminCookie = await loginAsAdmin();
// Ensure the test room is created before running tests
roomId = await createTestRoom(testRoomPrefix, { // Create a test room before all tests
chatPreferences: { enabled: true }, roomId = await createTestRoom('test-room');
recordingPreferences: {
enabled: true,
allowAccessTo: MeetRecordingAccess.ADMIN
},
virtualBackgroundPreferences: { enabled: true }
});
}); });
test.beforeEach(async ({ browser, page }) => { test.beforeEach(async ({ browser, page }) => {
@ -53,7 +47,7 @@ test.describe('Recording Access Tests', () => {
if (!recordingCreated) { if (!recordingCreated) {
const tempContext = await browser.newContext(); const tempContext = await browser.newContext();
const tempPage = await tempContext.newPage(); const tempPage = await tempContext.newPage();
await prepareForJoiningRoom(tempPage, MEET_TESTAPP_URL, testRoomPrefix); await prepareForJoiningRoom(tempPage, MEET_TESTAPP_URL, roomId);
await joinRoomAs('moderator', participantName, tempPage); await joinRoomAs('moderator', participantName, tempPage);
await startStopRecording(tempPage, 'start'); await startStopRecording(tempPage, 'start');
@ -92,7 +86,7 @@ test.describe('Recording Access Tests', () => {
); );
await page.goto(MEET_TESTAPP_URL); await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, testRoomPrefix); await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await accessRoomAs('moderator', page); await accessRoomAs('moderator', page);
await waitForElementInIframe(page, '#view-recordings-btn', { state: 'hidden' }); await waitForElementInIframe(page, '#view-recordings-btn', { state: 'hidden' });
@ -113,7 +107,7 @@ test.describe('Recording Access Tests', () => {
); );
await page.goto(MEET_TESTAPP_URL); await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, testRoomPrefix); await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await accessRoomAs('publisher', page); await accessRoomAs('publisher', page);
await waitForElementInIframe(page, '#view-recordings-btn', { state: 'hidden' }); await waitForElementInIframe(page, '#view-recordings-btn', { state: 'hidden' });
@ -134,7 +128,7 @@ test.describe('Recording Access Tests', () => {
); );
await page.goto(MEET_TESTAPP_URL); await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, testRoomPrefix); await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await viewRecordingsAs('moderator', page); await viewRecordingsAs('moderator', page);
await waitForElementInIframe(page, 'app-room-recordings', { state: 'visible' }); await waitForElementInIframe(page, 'app-room-recordings', { state: 'visible' });
@ -155,7 +149,7 @@ test.describe('Recording Access Tests', () => {
); );
await page.goto(MEET_TESTAPP_URL); await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, testRoomPrefix); await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await accessRoomAs('publisher', page); await accessRoomAs('publisher', page);
await waitForElementInIframe(page, '#view-recordings-btn', { state: 'hidden' }); await waitForElementInIframe(page, '#view-recordings-btn', { state: 'hidden' });
@ -176,7 +170,7 @@ test.describe('Recording Access Tests', () => {
); );
await page.goto(MEET_TESTAPP_URL); await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, testRoomPrefix); await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await viewRecordingsAs('moderator', page); await viewRecordingsAs('moderator', page);
await waitForElementInIframe(page, 'app-room-recordings', { state: 'visible' }); await waitForElementInIframe(page, 'app-room-recordings', { state: 'visible' });
@ -197,7 +191,7 @@ test.describe('Recording Access Tests', () => {
); );
await page.goto(MEET_TESTAPP_URL); await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, testRoomPrefix); await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await viewRecordingsAs('publisher', page); await viewRecordingsAs('publisher', page);
await waitForElementInIframe(page, 'app-room-recordings', { state: 'visible' }); await waitForElementInIframe(page, 'app-room-recordings', { state: 'visible' });

View File

@ -22,9 +22,8 @@ import {
let subscribedToAppErrors = false; let subscribedToAppErrors = false;
test.describe('UI Feature Preferences Tests', () => { test.describe('UI Feature Preferences Tests', () => {
const testRoomPrefix = 'ui-feature-testing-room';
let participantName: string;
let roomId: string; let roomId: string;
let participantName: string;
let adminCookie: string; let adminCookie: string;
// ========================================== // ==========================================
@ -34,6 +33,9 @@ test.describe('UI Feature Preferences Tests', () => {
test.beforeAll(async () => { test.beforeAll(async () => {
// Login as admin to get authentication cookie // Login as admin to get authentication cookie
adminCookie = await loginAsAdmin(); adminCookie = await loginAsAdmin();
// Create a test room before all tests
roomId = await createTestRoom('test-room');
}); });
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
@ -71,17 +73,21 @@ test.describe('UI Feature Preferences Tests', () => {
}); });
test('should show chat button when chat is enabled', async ({ page }) => { test('should show chat button when chat is enabled', async ({ page }) => {
roomId = await createTestRoom(testRoomPrefix, { await updateRoomPreferences(
roomId,
{
chatPreferences: { enabled: true }, chatPreferences: { enabled: true },
recordingPreferences: { recordingPreferences: {
enabled: true, enabled: true,
allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_PUBLISHER allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_PUBLISHER
}, },
virtualBackgroundPreferences: { enabled: true } virtualBackgroundPreferences: { enabled: true }
}); },
adminCookie
);
await page.reload(); await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, testRoomPrefix); await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await joinRoomAs('publisher', participantName, page); await joinRoomAs('publisher', participantName, page);
// Check that chat button is visible // Check that chat button is visible
@ -91,17 +97,21 @@ test.describe('UI Feature Preferences Tests', () => {
test('should hide chat button when chat is disabled', async ({ page }) => { test('should hide chat button when chat is disabled', async ({ page }) => {
// Disable chat via API // Disable chat via API
roomId = await createTestRoom(testRoomPrefix, { await updateRoomPreferences(
roomId,
{
chatPreferences: { enabled: false }, chatPreferences: { enabled: false },
recordingPreferences: { recordingPreferences: {
enabled: true, enabled: true,
allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_PUBLISHER allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_PUBLISHER
}, },
virtualBackgroundPreferences: { enabled: true } virtualBackgroundPreferences: { enabled: true }
}); },
adminCookie
);
await page.reload(); await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, testRoomPrefix); await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await joinRoomAs('publisher', participantName, page); await joinRoomAs('publisher', participantName, page);
// Check that chat button is not visible // Check that chat button is not visible
@ -116,17 +126,21 @@ test.describe('UI Feature Preferences Tests', () => {
test.describe('Recording Feature', () => { test.describe('Recording Feature', () => {
test('should show recording button for moderators', async ({ page }) => { test('should show recording button for moderators', async ({ page }) => {
roomId = await createTestRoom(testRoomPrefix, { await updateRoomPreferences(
roomId,
{
chatPreferences: { enabled: true }, chatPreferences: { enabled: true },
recordingPreferences: { recordingPreferences: {
enabled: true, enabled: true,
allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_PUBLISHER allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_PUBLISHER
}, },
virtualBackgroundPreferences: { enabled: true } virtualBackgroundPreferences: { enabled: true }
}); },
adminCookie
);
await page.reload(); await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, testRoomPrefix); await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await joinRoomAs('moderator', participantName, page); await joinRoomAs('moderator', participantName, page);
await openMoreOptionsMenu(page); await openMoreOptionsMenu(page);
@ -146,17 +160,21 @@ test.describe('UI Feature Preferences Tests', () => {
}); });
test('should not show recording button for publisher', async ({ page }) => { test('should not show recording button for publisher', async ({ page }) => {
roomId = await createTestRoom(testRoomPrefix, { await updateRoomPreferences(
roomId,
{
chatPreferences: { enabled: true }, chatPreferences: { enabled: true },
recordingPreferences: { recordingPreferences: {
enabled: true, enabled: true,
allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_PUBLISHER allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_PUBLISHER
}, },
virtualBackgroundPreferences: { enabled: true } virtualBackgroundPreferences: { enabled: true }
}); },
adminCookie
);
await page.reload(); await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, testRoomPrefix); await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await joinRoomAs('publisher', participantName, page); await joinRoomAs('publisher', participantName, page);
// Check that recording button is not visible for publisher // Check that recording button is not visible for publisher
@ -167,17 +185,21 @@ test.describe('UI Feature Preferences Tests', () => {
test('should not show recording button for moderators when recording is disabled', async ({ page }) => { test('should not show recording button for moderators when recording is disabled', async ({ page }) => {
// Disable recording via API // Disable recording via API
roomId = await createTestRoom(testRoomPrefix, { await updateRoomPreferences(
roomId,
{
chatPreferences: { enabled: true }, chatPreferences: { enabled: true },
recordingPreferences: { recordingPreferences: {
enabled: false, enabled: false,
allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_PUBLISHER allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_PUBLISHER
}, },
virtualBackgroundPreferences: { enabled: true } virtualBackgroundPreferences: { enabled: true }
}); },
adminCookie
);
await page.reload(); await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, testRoomPrefix); await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await joinRoomAs('moderator', participantName, page); await joinRoomAs('moderator', participantName, page);
// Check that recording button is not visible // Check that recording button is not visible
@ -204,17 +226,21 @@ test.describe('UI Feature Preferences Tests', () => {
}); });
test('should show virtual background button when enabled', async ({ page }) => { test('should show virtual background button when enabled', async ({ page }) => {
// Ensure virtual backgrounds are enabled // Ensure virtual backgrounds are enabled
roomId = await createTestRoom(testRoomPrefix, { await updateRoomPreferences(
roomId,
{
chatPreferences: { enabled: true }, chatPreferences: { enabled: true },
recordingPreferences: { recordingPreferences: {
enabled: true, enabled: true,
allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_PUBLISHER allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_PUBLISHER
}, },
virtualBackgroundPreferences: { enabled: true } virtualBackgroundPreferences: { enabled: true }
}); },
adminCookie
);
await page.reload(); await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, testRoomPrefix); await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await joinRoomAs('publisher', participantName, page); await joinRoomAs('publisher', participantName, page);
// Click more options to reveal virtual background button // Click more options to reveal virtual background button
@ -229,17 +255,21 @@ test.describe('UI Feature Preferences Tests', () => {
test('should hide virtual background button when disabled', async ({ page }) => { test('should hide virtual background button when disabled', async ({ page }) => {
// Disable virtual backgrounds via API // Disable virtual backgrounds via API
roomId = await createTestRoom(testRoomPrefix, { await updateRoomPreferences(
roomId,
{
chatPreferences: { enabled: true }, chatPreferences: { enabled: true },
recordingPreferences: { recordingPreferences: {
enabled: true, enabled: true,
allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_PUBLISHER allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_PUBLISHER
}, },
virtualBackgroundPreferences: { enabled: false } virtualBackgroundPreferences: { enabled: false }
}); },
adminCookie
);
await page.reload(); await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, testRoomPrefix); await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await joinRoomAs('publisher', participantName, page); await joinRoomAs('publisher', participantName, page);
// Click more options to reveal virtual background button // Click more options to reveal virtual background button
@ -254,17 +284,21 @@ test.describe('UI Feature Preferences Tests', () => {
page page
}) => { }) => {
// Ensure virtual backgrounds are enabled // Ensure virtual backgrounds are enabled
roomId = await createTestRoom(testRoomPrefix, { await updateRoomPreferences(
roomId,
{
chatPreferences: { enabled: true }, chatPreferences: { enabled: true },
recordingPreferences: { recordingPreferences: {
enabled: true, enabled: true,
allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_PUBLISHER allowAccessTo: MeetRecordingAccess.ADMIN_MODERATOR_PUBLISHER
}, },
virtualBackgroundPreferences: { enabled: true } virtualBackgroundPreferences: { enabled: true }
}); },
adminCookie
);
await page.reload(); await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, testRoomPrefix); await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await joinRoomAs('publisher', participantName, page); await joinRoomAs('publisher', participantName, page);
await applyVirtualBackground(page, '2'); await applyVirtualBackground(page, '2');
@ -288,7 +322,7 @@ test.describe('UI Feature Preferences Tests', () => {
await leaveRoom(page); await leaveRoom(page);
await page.reload(); await page.reload();
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, testRoomPrefix); await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await joinRoomAs('publisher', participantName, page); await joinRoomAs('publisher', participantName, page);
await page.waitForTimeout(2000); await page.waitForTimeout(2000);

View File

@ -100,7 +100,7 @@ const getDefaultRoomPreferences = (): MeetRoomPreferences => ({
// Helper function to create a room for testing // Helper function to create a room for testing
export const createTestRoom = async ( export const createTestRoom = async (
roomIdPrefix: string, roomName: string,
preferences: MeetRoomPreferences = getDefaultRoomPreferences() preferences: MeetRoomPreferences = getDefaultRoomPreferences()
) => { ) => {
const response = await fetch(`${MEET_API_URL}/api/v1/rooms`, { const response = await fetch(`${MEET_API_URL}/api/v1/rooms`, {
@ -110,7 +110,7 @@ export const createTestRoom = async (
'x-api-key': MEET_API_KEY 'x-api-key': MEET_API_KEY
}, },
body: JSON.stringify({ body: JSON.stringify({
roomIdPrefix, roomName,
autoDeletionDate: new Date(Date.now() + 61 * 60 * 1000).getTime(), // 1 hour from now autoDeletionDate: new Date(Date.now() + 61 * 60 * 1000).getTime(), // 1 hour from now
preferences preferences
}) })
@ -128,7 +128,7 @@ export const createTestRoom = async (
// Helper function to update room preferences via REST API // Helper function to update room preferences via REST API
export const updateRoomPreferences = async (roomId: string, preferences: any, adminCookie: string) => { export const updateRoomPreferences = async (roomId: string, preferences: any, adminCookie: string) => {
const response = await fetch(`${MEET_API_URL}/internal-api/v1/rooms/${roomId}`, { const response = await fetch(`${MEET_API_URL}/api/v1/rooms/${roomId}`, {
method: 'PUT', method: 'PUT',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
@ -216,10 +216,10 @@ export const startStopRecording = async (page: Page, action: 'start' | 'stop') =
} }
}; };
export const prepareForJoiningRoom = async (page: Page, url: string, roomPrefix: string) => { export const prepareForJoiningRoom = async (page: Page, url: string, roomId: string) => {
await page.goto(url); await page.goto(url);
await page.waitForSelector('.rooms-container'); await page.waitForSelector('.rooms-container');
await page.waitForSelector(`#${roomPrefix}`); await page.waitForSelector(`#${roomId}`);
await page.click('.dropdown-button'); await page.click('.dropdown-button');
await page.waitForSelector('#join-as-moderator'); await page.waitForSelector('#join-as-moderator');
await page.waitForSelector('#join-as-publisher'); await page.waitForSelector('#join-as-publisher');

View File

@ -50,7 +50,7 @@
<ul class="list-group"> <ul class="list-group">
{{#rooms}} {{#rooms}}
<li <li
id="{{ roomIdPrefix }}" id="{{ roomId }}"
class="list-group-item d-flex justify-content-between align-items-center" class="list-group-item d-flex justify-content-between align-items-center"
> >
<span>{{ roomId }}</span> <span>{{ roomId }}</span>
@ -159,13 +159,11 @@
<!-- Basic Information --> <!-- Basic Information -->
<div class="form-section"> <div class="form-section">
<div class="mb-3"> <div class="mb-3">
<label for="room-id-prefix" class="form-label" <label for="room-name" class="form-label">Room Name *</label>
>Room Prefix *</label
>
<input <input
type="text" type="text"
name="roomIdPrefix" name="roomName"
id="room-id-prefix" id="room-name"
class="form-control" class="form-control"
placeholder="e.g. Team meeting" placeholder="e.g. Team meeting"
required required
@ -173,9 +171,7 @@
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label for="expiration-date" class="form-label" <label for="expiration-date" class="form-label">Expiration Date</label>
>Expiration Date</label
>
<input <input
type="date" type="date"
name="autoDeletionDate" name="autoDeletionDate"

View File

@ -34,13 +34,13 @@ export const getHome = async (_req: Request, res: Response) => {
export const postCreateRoom = async (req: Request, res: Response) => { export const postCreateRoom = async (req: Request, res: Response) => {
try { try {
console.log('Creating room with body:', JSON.stringify(req.body, null, 2)); console.log('Creating room with body:', JSON.stringify(req.body, null, 2));
const { roomIdPrefix, autoDeletionDate } = req.body; const { roomName, autoDeletionDate } = req.body;
const preferences = processFormPreferences(req.body); const preferences = processFormPreferences(req.body);
console.log('Processed preferences:', JSON.stringify(preferences, null, 2)); console.log('Processed preferences:', JSON.stringify(preferences, null, 2));
console.log('Room creation parameters:', { roomIdPrefix, autoDeletionDate }); console.log('Room creation parameters:', { roomName, autoDeletionDate });
const result = await createRoom({ roomIdPrefix, autoDeletionDate, preferences }); const result = await createRoom({ roomName, autoDeletionDate, preferences });
console.log('Room created successfully:', result); console.log('Room created successfully:', result);
res.redirect('/'); res.redirect('/');
} catch (error) { } catch (error) {