ov-components: Fixed e2e tests events

pull/839/head
Carlos Santos 2024-07-29 11:33:18 +02:00 committed by Unknown
parent 27644e8fa5
commit c61bed5a75
4 changed files with 99 additions and 64 deletions

View File

@ -1100,7 +1100,7 @@ describe('Testing EVENTS', () => {
await browser.quit(); await browser.quit();
}); });
it('should receive the onLeaveButtonClicked event', async () => { it('should receive the onRoomDisconnected event', async () => {
await browser.get(`${url}`); await browser.get(`${url}`);
await utils.clickOn('#ovToolbar-checkbox'); await utils.clickOn('#ovToolbar-checkbox');
@ -1113,11 +1113,11 @@ describe('Testing EVENTS', () => {
await utils.clickOn('#leave-btn'); await utils.clickOn('#leave-btn');
// Checking if onLeaveButtonClicked has been received // Checking if onLeaveButtonClicked has been received
await utils.waitForElement('#onLeaveButtonClicked'); await utils.waitForElement('#onRoomDisconnected');
expect(await utils.isPresent('#onLeaveButtonClicked')).to.be.true; expect(await utils.isPresent('#onRoomDisconnected')).to.be.true;
}); });
it('should receive the onCameraButtonClicked event', async () => { it('should receive the onVideoEnabledChanged event', async () => {
await browser.get(`${url}`); await browser.get(`${url}`);
await utils.clickOn('#ovToolbar-checkbox'); await utils.clickOn('#ovToolbar-checkbox');
@ -1126,15 +1126,13 @@ describe('Testing EVENTS', () => {
await utils.checkToolbarIsPresent(); await utils.checkToolbarIsPresent();
// Clicking to leave button
await utils.clickOn('#camera-btn'); await utils.clickOn('#camera-btn');
// Checking if onLeaveButtonClicked has been received await utils.waitForElement('#onVideoEnabledChanged');
await utils.waitForElement('#onCameraButtonClicked'); expect(await utils.isPresent('#onVideoEnabledChanged')).to.be.true;
expect(await utils.isPresent('#onCameraButtonClicked')).to.be.true;
}); });
it('should receive the onMicrophoneButtonClicked event', async () => { it('should receive the onAudioEnabledChanged event', async () => {
await browser.get(`${url}`); await browser.get(`${url}`);
await utils.clickOn('#ovToolbar-checkbox'); await utils.clickOn('#ovToolbar-checkbox');
@ -1143,15 +1141,13 @@ describe('Testing EVENTS', () => {
await utils.checkToolbarIsPresent(); await utils.checkToolbarIsPresent();
// Clicking to leave button
await utils.clickOn('#mic-btn'); await utils.clickOn('#mic-btn');
// Checking if onMicrophoneButtonClicked has been received await utils.waitForElement('#onAudioEnabledChanged');
await utils.waitForElement('#onMicrophoneButtonClicked'); expect(await utils.isPresent('#onAudioEnabledChanged')).to.be.true;
expect(await utils.isPresent('#onMicrophoneButtonClicked')).to.be.true;
}); });
it('should receive the onScreenshareButtonClicked event', async () => { it('should receive the onScreenShareEnabledChanged event', async () => {
await browser.get(`${url}`); await browser.get(`${url}`);
await utils.clickOn('#ovToolbar-checkbox'); await utils.clickOn('#ovToolbar-checkbox');
@ -1160,37 +1156,13 @@ describe('Testing EVENTS', () => {
await utils.checkToolbarIsPresent(); await utils.checkToolbarIsPresent();
// Clicking to leave button
await utils.clickOn('#screenshare-btn'); await utils.clickOn('#screenshare-btn');
// Checking if onScreenshareButtonClicked has been received await utils.waitForElement('#onScreenShareEnabledChanged');
await utils.waitForElement('#onScreenshareButtonClicked'); expect(await utils.isPresent('#onScreenShareEnabledChanged')).to.be.true;
expect(await utils.isPresent('#onScreenshareButtonClicked')).to.be.true;
}); });
it('should receive the onFullscreenButtonClicked event', async () => { it('should receive the onFullscreenEnabledChanged event', async () => {
await browser.get(`${url}`);
await utils.clickOn('#ovToolbar-checkbox');
await utils.clickOn('#apply-btn');
await utils.checkToolbarIsPresent();
// Open more options menu
await utils.clickOn('#more-options-btn');
await browser.sleep(500);
await utils.waitForElement('#more-options-menu');
await utils.clickOn('#fullscreen-btn');
// Checking if onFullscreenButtonClicked has been received
await utils.waitForElement('#onFullscreenButtonClicked');
expect(await utils.isPresent('#onFullscreenButtonClicked')).to.be.true;
});
it('should receive the onParticipantsPanelButtonClicked event', async () => {
await browser.get(`${url}`); await browser.get(`${url}`);
await utils.clickOn('#ovToolbar-checkbox'); await utils.clickOn('#ovToolbar-checkbox');
@ -1199,13 +1171,13 @@ describe('Testing EVENTS', () => {
await utils.checkToolbarIsPresent(); await utils.checkToolbarIsPresent();
await utils.clickOn('#participants-panel-btn'); await utils.toggleFullscreenFromToolbar();
await utils.waitForElement('#onParticipantsPanelButtonClicked'); await utils.waitForElement('#onFullscreenEnabledChanged');
expect(await utils.isPresent('#onParticipantsPanelButtonClicked')).to.be.true; expect(await utils.isPresent('#onFullscreenEnabledChanged')).to.be.true;
}); });
it('should receive the onChatPanelButtonClicked event', async () => { it('should receive the onRecordingStartRequested event', async () => {
await browser.get(`${url}`); await browser.get(`${url}`);
await utils.clickOn('#ovToolbar-checkbox'); await utils.clickOn('#ovToolbar-checkbox');
@ -1214,24 +1186,69 @@ describe('Testing EVENTS', () => {
await utils.checkToolbarIsPresent(); await utils.checkToolbarIsPresent();
await utils.clickOn('#chat-panel-btn'); await utils.toggleRecordingFromToolbar();
await utils.waitForElement('#onChatPanelButtonClicked'); await utils.waitForElement('#onRecordingStartRequested');
expect(await utils.isPresent('#onChatPanelButtonClicked')).to.be.true; expect(await utils.isPresent('#onRecordingStartRequested')).to.be.true;
}); });
it('should receive the onActivitiesPanelButtonClicked event', async () => { it('should receive the onParticipantsPanelStatusChanged event', async () => {
await browser.get(`${url}`); await browser.get(`${url}`);
await utils.clickOn('#ovToolbar-checkbox'); await utils.clickOn('#ovPanel-checkbox');
await utils.clickOn('#apply-btn'); await utils.clickOn('#apply-btn');
await utils.checkToolbarIsPresent(); await utils.checkToolbarIsPresent();
await utils.clickOn('#activities-panel-btn'); await utils.togglePanel('participants');
await utils.waitForElement('#onActivitiesPanelButtonClicked'); await utils.waitForElement('#onParticipantsPanelStatusChanged');
expect(await utils.isPresent('#onActivitiesPanelButtonClicked')).to.be.true; expect(await utils.isPresent('#onParticipantsPanelStatusChanged')).to.be.true;
});
it('should receive the onChatPanelStatusChanged event', async () => {
await browser.get(`${url}`);
await utils.clickOn('#ovPanel-checkbox');
await utils.clickOn('#apply-btn');
await utils.checkToolbarIsPresent();
await utils.togglePanel('chat');
await utils.waitForElement('#onChatPanelStatusChanged');
expect(await utils.isPresent('#onChatPanelStatusChanged')).to.be.true;
});
it('should receive the onActivitiesPanelStatusChanged event', async () => {
await browser.get(`${url}`);
await utils.clickOn('#ovPanel-checkbox');
await utils.clickOn('#apply-btn');
await utils.checkToolbarIsPresent();
await utils.togglePanel('activities');
await utils.waitForElement('#onActivitiesPanelStatusChanged');
expect(await utils.isPresent('#onActivitiesPanelStatusChanged')).to.be.true;
});
it('should receive the onSettingsPanelStatusChanged event', async () => {
await browser.get(`${url}`);
await utils.clickOn('#ovPanel-checkbox');
await utils.clickOn('#apply-btn');
await utils.checkToolbarIsPresent();
await utils.togglePanel('settings');
await utils.waitForElement('#onSettingsPanelStatusChanged');
expect(await utils.isPresent('#onSettingsPanelStatusChanged')).to.be.true;
}); });
}); });

View File

@ -98,7 +98,7 @@
"webcomponent:build": "./node_modules/@angular/cli/bin/ng.js build openvidu-webcomponent --configuration production && node ./openvidu-webcomponent-build.js", "webcomponent:build": "./node_modules/@angular/cli/bin/ng.js build openvidu-webcomponent --configuration production && node ./openvidu-webcomponent-build.js",
"webcomponent:e2e": "tsc --project ./e2e && npx mocha --recursive --timeout 30000 ./e2e/dist/webcomponent-e2e/**/*.test.js", "webcomponent:e2e": "tsc --project ./e2e && npx mocha --recursive --timeout 30000 ./e2e/dist/webcomponent-e2e/**/*.test.js",
"webcomponent:e2e-ci": "cross-env LAUNCH_MODE=CI npm run webcomponent:e2e", "webcomponent:e2e-ci": "cross-env LAUNCH_MODE=CI npm run webcomponent:e2e",
"webcomponent:serve-testapp": "npx http-server ./e2e/webcomponent-app/ && echo http://localhost:8080/?OV_URL=https://localhost:4443&OV_SECRET=MY_SECRET&prejoin=false", "webcomponent:serve-testapp": "npx http-server ./e2e/webcomponent-app/",
"simulate:multiparty": "livekit-cli load-test --url ws://localhost:7880 --api-key devkey --api-secret secret --room daily-call --publishers 8 --audio-publishers 8 --identity-prefix Participant --identity publisher" "simulate:multiparty": "livekit-cli load-test --url ws://localhost:7880 --api-key devkey --api-secret secret --room daily-call --publishers 8 --audio-publishers 8 --identity-prefix Participant --identity publisher"
}, },
"version": "3.0.0-beta3-dev" "version": "3.0.0-beta3-dev"

View File

@ -78,6 +78,8 @@
id="custom-toolbar" id="custom-toolbar"
[screenshareButton]="screenshareBtn" [screenshareButton]="screenshareBtn"
[fullscreenButton]="fullscreenBtn" [fullscreenButton]="fullscreenBtn"
[backgroundEffectsButton]="backgroundEffectsBtn"
[settingsButton]="settingsBtn"
[leaveButton]="leaveBtn" [leaveButton]="leaveBtn"
[participantsPanelButton]="participantsPanelBtn" [participantsPanelButton]="participantsPanelBtn"
[activitiesPanelButton]="activitiesPanelBtn" [activitiesPanelButton]="activitiesPanelBtn"
@ -85,14 +87,14 @@
[displayRoomName]="displaySessionId" [displayRoomName]="displaySessionId"
[displayLogo]="displayLogo" [displayLogo]="displayLogo"
[broadcastingButton]="broadcastingBtn" [broadcastingButton]="broadcastingBtn"
(onLeaveButtonClicked)="appendElement('onLeaveButtonClicked')" (onAudioEnabledChanged)="appendElement('onAudioEnabledChanged')"
(onCameraButtonClicked)="appendElement('onCameraButtonClicked')" (onVideoEnabledChanged)="appendElement('onVideoEnabledChanged')"
(onMicrophoneButtonClicked)="appendElement('onMicrophoneButtonClicked')" (onBroadcastingStopRequested)="appendElement('onBroadcastingStopRequested')"
(onFullscreenEnabledChanged)="appendElement('onFullscreenEnabledChanged')"
(onRecordingStartRequested)="appendElement('onRecordingStartRequested')"
(onRecordingStopRequested)="appendElement('onRecordingStopRequested')"
(onRoomDisconnected)="appendElement('onRoomDisconnected')"
(onScreenShareEnabledChanged)="appendElement('onScreenShareEnabledChanged')" (onScreenShareEnabledChanged)="appendElement('onScreenShareEnabledChanged')"
(onFullscreenButtonClicked)="appendElement('onFullscreenButtonClicked')"
(onParticipantsPanelButtonClicked)="appendElement('onParticipantsPanelButtonClicked')"
(onChatPanelButtonClicked)="appendElement('onChatPanelButtonClicked')"
(onActivitiesPanelButtonClicked)="appendElement('onActivitiesPanelButtonClicked')"
> >
<ng-template [ngIf]="ovToolbarAdditionalButtonsSelected"> <ng-template [ngIf]="ovToolbarAdditionalButtonsSelected">
<div *ovToolbarAdditionalButtons id="custom-toolbar-additional-buttons"> <div *ovToolbarAdditionalButtons id="custom-toolbar-additional-buttons">
@ -144,7 +146,14 @@
<!-- PANELS --> <!-- PANELS -->
<ng-template [ngIf]="ovPanelSelected"> <ng-template [ngIf]="ovPanelSelected">
<ov-panel *ovPanel id="custom-panels"> <ov-panel
*ovPanel
id="custom-panels"
(onActivitiesPanelStatusChanged)="appendElement('onActivitiesPanelStatusChanged')"
(onChatPanelStatusChanged)="appendElement('onChatPanelStatusChanged')"
(onParticipantsPanelStatusChanged)="appendElement('onParticipantsPanelStatusChanged')"
(onSettingsPanelStatusChanged)="appendElement('onSettingsPanelStatusChanged')"
>
<ng-template [ngIf]="ovAdditionalPanelsSelected"> <ng-template [ngIf]="ovAdditionalPanelsSelected">
<div *ovAdditionalPanels id="custom-additional-panel"> <div *ovAdditionalPanels id="custom-additional-panel">
<h1 id="additional-panel-title">NEW PANEL</h1> <h1 id="additional-panel-title">NEW PANEL</h1>
@ -206,6 +215,13 @@
*ovActivitiesPanel *ovActivitiesPanel
[recordingActivity]="recordingActivity" [recordingActivity]="recordingActivity"
[broadcastingActivity]="broadcastingActivity" [broadcastingActivity]="broadcastingActivity"
(onBroadcastingStartRequested)="appendElement('onBroadcastingStartRequested')"
(onBroadcastingStopRequested)="appendElement('onBroadcastingStopRequested')"
(onRecordingDeleteRequested)="appendElement('onRecordingDeleteRequested')"
(onRecordingDownloadClicked)="appendElement('onRecordingDownloadClicked')"
(onRecordingPlayClicked)="appendElement('onRecordingPlayClicked')"
(onRecordingStartRequested)="appendElement('onRecordingStartRequested')"
(onRecordingStopRequested)="appendElement('onRecordingStopRequested')"
id="custom-activities-panel" id="custom-activities-panel"
> >
<ov-recording-activity *ngIf="recordingActivity"></ov-recording-activity> <ov-recording-activity *ngIf="recordingActivity"></ov-recording-activity>

View File

@ -1,6 +1,7 @@
section { section {
display: flex; display: flex;
justify-content: center; justify-content: center;
max-height: 300px;
} }
ul { ul {
@ -17,8 +18,9 @@ ul {
.directive-container { .directive-container {
border: 1px solid; border: 1px solid;
border-top: 0px; border-top: 0px;
margin: 10px; // margin: 10px;
padding: 5px; // padding: 5px;
height: fit-content;
} }
h4 { h4 {