diff --git a/meet-ce/frontend/webcomponent/tests/e2e/recording-access.test.ts b/meet-ce/frontend/webcomponent/tests/e2e/recording-access.test.ts index c73ff808..82808649 100644 --- a/meet-ce/frontend/webcomponent/tests/e2e/recording-access.test.ts +++ b/meet-ce/frontend/webcomponent/tests/e2e/recording-access.test.ts @@ -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); diff --git a/meet-ce/frontend/webcomponent/tests/e2e/ui-feature-config.test.ts b/meet-ce/frontend/webcomponent/tests/e2e/ui-feature-config.test.ts index 615e805f..544f7490 100644 --- a/meet-ce/frontend/webcomponent/tests/e2e/ui-feature-config.test.ts +++ b/meet-ce/frontend/webcomponent/tests/e2e/ui-feature-config.test.ts @@ -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); diff --git a/meet-ce/frontend/webcomponent/tests/helpers/function-helpers.ts b/meet-ce/frontend/webcomponent/tests/helpers/function-helpers.ts index 512b76a8..0dbd295d 100644 --- a/meet-ce/frontend/webcomponent/tests/helpers/function-helpers.ts +++ b/meet-ce/frontend/webcomponent/tests/helpers/function-helpers.ts @@ -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) => {