Skip to content

Commit

Permalink
ov-components: Fixed e2e tests events
Browse files Browse the repository at this point in the history
  • Loading branch information
CSantosM committed Jul 29, 2024
1 parent 27644e8 commit c61bed5
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 53 deletions.
101 changes: 59 additions & 42 deletions openvidu-components-angular/e2e/angular.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ describe('Testing EVENTS', () => {
await browser.quit();
});

it('should receive the onLeaveButtonClicked event', async () => {
it('should receive the onRoomDisconnected event', async () => {
await browser.get(`${url}`);

await utils.clickOn('#ovToolbar-checkbox');
Expand All @@ -1113,11 +1113,11 @@ describe('Testing EVENTS', () => {
await utils.clickOn('#leave-btn');

// Checking if onLeaveButtonClicked has been received
await utils.waitForElement('#onLeaveButtonClicked');
expect(await utils.isPresent('#onLeaveButtonClicked')).to.be.true;
await utils.waitForElement('#onRoomDisconnected');
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 utils.clickOn('#ovToolbar-checkbox');
Expand All @@ -1126,15 +1126,13 @@ describe('Testing EVENTS', () => {

await utils.checkToolbarIsPresent();

// Clicking to leave button
await utils.clickOn('#camera-btn');

// Checking if onLeaveButtonClicked has been received
await utils.waitForElement('#onCameraButtonClicked');
expect(await utils.isPresent('#onCameraButtonClicked')).to.be.true;
await utils.waitForElement('#onVideoEnabledChanged');
expect(await utils.isPresent('#onVideoEnabledChanged')).to.be.true;
});

it('should receive the onMicrophoneButtonClicked event', async () => {
it('should receive the onAudioEnabledChanged event', async () => {
await browser.get(`${url}`);

await utils.clickOn('#ovToolbar-checkbox');
Expand All @@ -1143,15 +1141,13 @@ describe('Testing EVENTS', () => {

await utils.checkToolbarIsPresent();

// Clicking to leave button
await utils.clickOn('#mic-btn');

// Checking if onMicrophoneButtonClicked has been received
await utils.waitForElement('#onMicrophoneButtonClicked');
expect(await utils.isPresent('#onMicrophoneButtonClicked')).to.be.true;
await utils.waitForElement('#onAudioEnabledChanged');
expect(await utils.isPresent('#onAudioEnabledChanged')).to.be.true;
});

it('should receive the onScreenshareButtonClicked event', async () => {
it('should receive the onScreenShareEnabledChanged event', async () => {
await browser.get(`${url}`);

await utils.clickOn('#ovToolbar-checkbox');
Expand All @@ -1160,78 +1156,99 @@ describe('Testing EVENTS', () => {

await utils.checkToolbarIsPresent();

// Clicking to leave button
await utils.clickOn('#screenshare-btn');

// Checking if onScreenshareButtonClicked has been received
await utils.waitForElement('#onScreenshareButtonClicked');
expect(await utils.isPresent('#onScreenshareButtonClicked')).to.be.true;
await utils.waitForElement('#onScreenShareEnabledChanged');
expect(await utils.isPresent('#onScreenShareEnabledChanged')).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.toggleFullscreenFromToolbar();

await utils.waitForElement('#more-options-menu');
await utils.waitForElement('#onFullscreenEnabledChanged');
expect(await utils.isPresent('#onFullscreenEnabledChanged')).to.be.true;
});

await utils.clickOn('#fullscreen-btn');
it('should receive the onRecordingStartRequested event', async () => {
await browser.get(`${url}`);

// Checking if onFullscreenButtonClicked has been received
await utils.waitForElement('#onFullscreenButtonClicked');
expect(await utils.isPresent('#onFullscreenButtonClicked')).to.be.true;
await utils.clickOn('#ovToolbar-checkbox');

await utils.clickOn('#apply-btn');

await utils.checkToolbarIsPresent();

await utils.toggleRecordingFromToolbar();

await utils.waitForElement('#onRecordingStartRequested');
expect(await utils.isPresent('#onRecordingStartRequested')).to.be.true;
});

it('should receive the onParticipantsPanelButtonClicked event', async () => {
it('should receive the onParticipantsPanelStatusChanged event', async () => {
await browser.get(`${url}`);

await utils.clickOn('#ovToolbar-checkbox');
await utils.clickOn('#ovPanel-checkbox');

await utils.clickOn('#apply-btn');

await utils.checkToolbarIsPresent();

await utils.clickOn('#participants-panel-btn');
await utils.togglePanel('participants');

await utils.waitForElement('#onParticipantsPanelButtonClicked');
expect(await utils.isPresent('#onParticipantsPanelButtonClicked')).to.be.true;
await utils.waitForElement('#onParticipantsPanelStatusChanged');
expect(await utils.isPresent('#onParticipantsPanelStatusChanged')).to.be.true;
});

it('should receive the onChatPanelButtonClicked event', async () => {
it('should receive the onChatPanelStatusChanged event', async () => {
await browser.get(`${url}`);

await utils.clickOn('#ovToolbar-checkbox');
await utils.clickOn('#ovPanel-checkbox');

await utils.clickOn('#apply-btn');

await utils.checkToolbarIsPresent();

await utils.clickOn('#chat-panel-btn');
await utils.togglePanel('chat');

await utils.waitForElement('#onChatPanelButtonClicked');
expect(await utils.isPresent('#onChatPanelButtonClicked')).to.be.true;
await utils.waitForElement('#onChatPanelStatusChanged');
expect(await utils.isPresent('#onChatPanelStatusChanged')).to.be.true;
});

it('should receive the onActivitiesPanelButtonClicked event', async () => {
it('should receive the onActivitiesPanelStatusChanged event', async () => {
await browser.get(`${url}`);

await utils.clickOn('#ovToolbar-checkbox');
await utils.clickOn('#ovPanel-checkbox');

await utils.clickOn('#apply-btn');

await utils.checkToolbarIsPresent();

await utils.clickOn('#activities-panel-btn');
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('#onActivitiesPanelButtonClicked');
expect(await utils.isPresent('#onActivitiesPanelButtonClicked')).to.be.true;
await utils.waitForElement('#onSettingsPanelStatusChanged');
expect(await utils.isPresent('#onSettingsPanelStatusChanged')).to.be.true;
});
});
2 changes: 1 addition & 1 deletion openvidu-components-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"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-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"
},
"version": "3.0.0-beta3-dev"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,23 @@ <h3 style="background-color: rgb(172, 201, 255); font-weight: bold">
id="custom-toolbar"
[screenshareButton]="screenshareBtn"
[fullscreenButton]="fullscreenBtn"
[backgroundEffectsButton]="backgroundEffectsBtn"
[settingsButton]="settingsBtn"
[leaveButton]="leaveBtn"
[participantsPanelButton]="participantsPanelBtn"
[activitiesPanelButton]="activitiesPanelBtn"
[chatPanelButton]="chatPanelBtn"
[displayRoomName]="displaySessionId"
[displayLogo]="displayLogo"
[broadcastingButton]="broadcastingBtn"
(onLeaveButtonClicked)="appendElement('onLeaveButtonClicked')"
(onCameraButtonClicked)="appendElement('onCameraButtonClicked')"
(onMicrophoneButtonClicked)="appendElement('onMicrophoneButtonClicked')"
(onAudioEnabledChanged)="appendElement('onAudioEnabledChanged')"
(onVideoEnabledChanged)="appendElement('onVideoEnabledChanged')"
(onBroadcastingStopRequested)="appendElement('onBroadcastingStopRequested')"
(onFullscreenEnabledChanged)="appendElement('onFullscreenEnabledChanged')"
(onRecordingStartRequested)="appendElement('onRecordingStartRequested')"
(onRecordingStopRequested)="appendElement('onRecordingStopRequested')"
(onRoomDisconnected)="appendElement('onRoomDisconnected')"
(onScreenShareEnabledChanged)="appendElement('onScreenShareEnabledChanged')"
(onFullscreenButtonClicked)="appendElement('onFullscreenButtonClicked')"
(onParticipantsPanelButtonClicked)="appendElement('onParticipantsPanelButtonClicked')"
(onChatPanelButtonClicked)="appendElement('onChatPanelButtonClicked')"
(onActivitiesPanelButtonClicked)="appendElement('onActivitiesPanelButtonClicked')"
>
<ng-template [ngIf]="ovToolbarAdditionalButtonsSelected">
<div *ovToolbarAdditionalButtons id="custom-toolbar-additional-buttons">
Expand Down Expand Up @@ -144,7 +146,14 @@ <h3 style="background-color: rgb(172, 201, 255); font-weight: bold">

<!-- PANELS -->
<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">
<div *ovAdditionalPanels id="custom-additional-panel">
<h1 id="additional-panel-title">NEW PANEL</h1>
Expand Down Expand Up @@ -206,6 +215,13 @@ <h1 id="additional-panel-title">NEW PANEL</h1>
*ovActivitiesPanel
[recordingActivity]="recordingActivity"
[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"
>
<ov-recording-activity *ngIf="recordingActivity"></ov-recording-activity>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
section {
display: flex;
justify-content: center;
max-height: 300px;
}

ul {
Expand All @@ -17,8 +18,9 @@ ul {
.directive-container {
border: 1px solid;
border-top: 0px;
margin: 10px;
padding: 5px;
// margin: 10px;
// padding: 5px;
height: fit-content;
}

h4 {
Expand Down

0 comments on commit c61bed5

Please sign in to comment.