webcomponent: Updates dependencies and improves end-to-end tests
Upgrades Playwright dependency to the latest version. Removes unnecessary test cleanup functions and simplifies test structure. Improves test stability by properly handling browser resources.
This commit is contained in:
parent
dbcc9bbb25
commit
659cdcaf73
@ -220,5 +220,8 @@
|
||||
"@schematics/angular:resolver": {
|
||||
"typeSeparator": "."
|
||||
}
|
||||
}
|
||||
},
|
||||
"cli": {
|
||||
"analytics": false
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
"@openvidu-meet/typings": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "1.57.0",
|
||||
"@playwright/test": "1.58.0",
|
||||
"@rollup/plugin-commonjs": "28.0.2",
|
||||
"@rollup/plugin-node-resolve": "16.0.0",
|
||||
"@rollup/plugin-terser": "0.4.4",
|
||||
@ -39,7 +39,7 @@
|
||||
"jest": "29.7.0",
|
||||
"jest-environment-jsdom": "29.7.0",
|
||||
"pixelmatch": "7.1.0",
|
||||
"playwright": "1.57.0",
|
||||
"playwright": "1.58.0",
|
||||
"pngjs": "7.0.0",
|
||||
"rollup": "4.34.9",
|
||||
"rollup-plugin-postcss": "4.0.2",
|
||||
|
||||
@ -6,8 +6,6 @@ import { MEET_TESTAPP_URL } from '../../config.js';
|
||||
import {
|
||||
applyVirtualBackground,
|
||||
createTestRoom,
|
||||
deleteAllRecordings,
|
||||
deleteAllRooms,
|
||||
interactWithElementInIframe,
|
||||
joinRoomAs,
|
||||
leaveRoom,
|
||||
@ -19,8 +17,6 @@ import {
|
||||
waitForElementInIframe
|
||||
} from '../../helpers/function-helpers.js';
|
||||
|
||||
let subscribedToAppErrors = false;
|
||||
|
||||
// Test suite for room functionality in OpenVidu Meet
|
||||
test.describe('Room Functionality Tests', () => {
|
||||
let roomId: string;
|
||||
@ -36,34 +32,17 @@ test.describe('Room Functionality Tests', () => {
|
||||
});
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
if (!subscribedToAppErrors) {
|
||||
page.on('console', (msg) => {
|
||||
const type = msg.type();
|
||||
const tag = type === 'error' ? 'ERROR' : type === 'warning' ? 'WARNING' : 'LOG';
|
||||
console.log('[' + tag + ']', msg.text());
|
||||
});
|
||||
subscribedToAppErrors = true;
|
||||
}
|
||||
// Subscribe to console logs for this page
|
||||
page.on('console', (msg) => {
|
||||
const type = msg.type();
|
||||
const tag = type === 'error' ? 'ERROR' : type === 'warning' ? 'WARNING' : 'LOG';
|
||||
console.log('[' + tag + ']', msg.text());
|
||||
});
|
||||
|
||||
await prepareForJoiningRoom(page, MEET_TESTAPP_URL, roomId);
|
||||
participantName = `P-${Math.random().toString(36).substring(2, 9)}`;
|
||||
});
|
||||
|
||||
test.afterEach(async ({ context }) => {
|
||||
// Save storage state after each test
|
||||
await context.storageState({ path: 'test_localstorage_state.json' });
|
||||
});
|
||||
|
||||
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();
|
||||
});
|
||||
|
||||
// ==========================================
|
||||
// COMPONENT RENDERING TESTS
|
||||
// ==========================================
|
||||
@ -104,25 +83,25 @@ test.describe('Room Functionality Tests', () => {
|
||||
test('should start a videoconference and display video elements', async ({ page, browser }) => {
|
||||
// First participant (speaker) joins
|
||||
await joinRoomAs('speaker', participantName, page);
|
||||
|
||||
// Check local video element
|
||||
const localVideo = await waitForElementInIframe(page, '.OV_stream.local');
|
||||
|
||||
await expect(localVideo).toBeVisible();
|
||||
|
||||
// Second participant (moderator) joins
|
||||
const context = await browser.newContext();
|
||||
const moderatorPage = await context.newPage();
|
||||
// const context = await browser.newContext();
|
||||
const moderatorPage = await browser.newPage();
|
||||
await prepareForJoiningRoom(moderatorPage, MEET_TESTAPP_URL, roomId);
|
||||
|
||||
await joinRoomAs('moderator', 'moderator', moderatorPage);
|
||||
|
||||
// Verify session established and remote video appears
|
||||
await waitForElementInIframe(moderatorPage, '.OV_stream.remote');
|
||||
|
||||
// Cleanup
|
||||
await leaveRoom(page);
|
||||
// Cleanup - order matters to avoid crashes
|
||||
await leaveRoom(moderatorPage, 'moderator');
|
||||
await context.close();
|
||||
await moderatorPage.close();
|
||||
|
||||
// Small delay to ensure browser resources are freed
|
||||
await leaveRoom(page);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -469,7 +469,7 @@ export const openMoreOptionsMenu = async (page: Page) => {
|
||||
await waitForElementInIframe(page, '#toolbar', { state: 'visible' });
|
||||
// Open more options menu
|
||||
await interactWithElementInIframe(page, '#more-options-btn', { action: 'click' });
|
||||
await waitForElementInIframe(page, '#more-options-menu', { state: 'visible' });
|
||||
await waitForElementInIframe(page, '#more-options-menu', { state: 'attached' });
|
||||
await page.waitForTimeout(500); // Wait for menu animation
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user