test: reduce wait time for recording tests and improve cleanup process

This commit is contained in:
Carlos Santos 2025-11-11 19:43:23 +01:00
parent 32a9a31d8b
commit 5131f9e717
3 changed files with 8 additions and 19 deletions

View File

@ -46,7 +46,7 @@ test.describe('Recording Access Tests', () => {
await joinRoomAs('moderator', participantName, tempPage);
await startStopRecording(tempPage, 'start');
await tempPage.waitForTimeout(2000);
await tempPage.waitForTimeout(1000);
await startStopRecording(tempPage, 'stop');
recordingCreated = true;
@ -59,11 +59,9 @@ test.describe('Recording Access Tests', () => {
test.afterAll(async ({ browser }) => {
const tempContext = await browser.newContext();
const tempPage = await tempContext.newPage();
await deleteAllRooms(tempPage);
await deleteAllRecordings(tempPage);
await tempContext.close();
await tempPage.close();
await deleteAllRooms(tempPage);
await Promise.all([tempContext.close(), tempPage.close()]);
});
test('should moderator not be able to access recording when access level is set to admin', async ({ page }) => {
@ -76,7 +74,6 @@ test.describe('Recording Access Tests', () => {
virtualBackground: { enabled: true }
});
await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await accessRoomAs('moderator', page);
@ -93,7 +90,6 @@ test.describe('Recording Access Tests', () => {
virtualBackground: { enabled: true }
});
await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await accessRoomAs('speaker', page);
@ -110,7 +106,6 @@ test.describe('Recording Access Tests', () => {
virtualBackground: { enabled: true }
});
await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await viewRecordingsAs('moderator', page);
@ -127,7 +122,6 @@ test.describe('Recording Access Tests', () => {
virtualBackground: { enabled: true }
});
await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await accessRoomAs('speaker', page);
@ -144,7 +138,6 @@ test.describe('Recording Access Tests', () => {
virtualBackground: { enabled: true }
});
await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await viewRecordingsAs('moderator', page);
@ -161,7 +154,6 @@ test.describe('Recording Access Tests', () => {
virtualBackground: { enabled: true }
});
await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await viewRecordingsAs('speaker', page);

View File

@ -122,7 +122,6 @@ test.describe('UI Feature Config Tests', () => {
virtualBackground: { enabled: true }
});
await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await joinRoomAs('moderator', participantName, page);
@ -152,7 +151,6 @@ test.describe('UI Feature Config Tests', () => {
virtualBackground: { enabled: true }
});
await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await joinRoomAs('speaker', participantName, page);
@ -173,7 +171,6 @@ test.describe('UI Feature Config Tests', () => {
virtualBackground: { enabled: true }
});
await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await joinRoomAs('moderator', participantName, page);
@ -199,6 +196,7 @@ test.describe('UI Feature Config Tests', () => {
await leaveRoom(page);
} catch (error) {}
});
test('should show virtual background button when enabled', async ({ page }) => {
// Ensure virtual backgrounds are enabled
await updateRoomConfig(roomId, {
@ -210,7 +208,6 @@ test.describe('UI Feature Config Tests', () => {
virtualBackground: { enabled: true }
});
await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await joinRoomAs('speaker', participantName, page);
@ -260,13 +257,15 @@ test.describe('UI Feature Config Tests', () => {
virtualBackground: { enabled: true }
});
await page.goto(MEET_TESTAPP_URL);
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await joinRoomAs('speaker', participantName, page);
await applyVirtualBackground(page, '2');
await waitForVirtualBackgroundToApply(page);
await leaveRoom(page);
await page.reload();
// Now disable virtual backgrounds
await updateRoomConfig(roomId, {
chat: { enabled: true },
@ -277,9 +276,6 @@ test.describe('UI Feature Config Tests', () => {
virtualBackground: { enabled: false }
});
await leaveRoom(page);
await page.reload();
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
await joinRoomAs('speaker', participantName, page);
await page.waitForTimeout(2000);

View File

@ -299,6 +299,7 @@ export const leaveRoom = async (page: Page, role: 'moderator' | 'speaker' = 'spe
}
await page.waitForSelector('.event-left');
await page.waitForSelector('.webhook-meetingEnded', { timeout: 10000 });
};
export const startScreenSharing = async (page: Page) => {