Skip to content

Commit

Permalink
ov-components: Used jasmine instead of mocha
Browse files Browse the repository at this point in the history
  • Loading branch information
CSantosM committed Oct 10, 2024
1 parent 5a40ce9 commit a664b50
Show file tree
Hide file tree
Showing 14 changed files with 574 additions and 587 deletions.
249 changes: 124 additions & 125 deletions openvidu-components-angular/e2e/nested-components/directives.test.ts

Large diffs are not rendered by default.

21 changes: 10 additions & 11 deletions openvidu-components-angular/e2e/nested-components/events.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { expect } from 'chai';
import { Builder, By, WebDriver } from 'selenium-webdriver';

import { NestedConfig } from '../selenium.conf';
Expand Down Expand Up @@ -42,7 +41,7 @@ describe('Testing EVENTS', () => {

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

it('should receive the onVideoEnabledChanged event', async () => {
Expand All @@ -57,7 +56,7 @@ describe('Testing EVENTS', () => {
await utils.clickOn('#camera-btn');

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

it('should receive the onAudioEnabledChanged event', async () => {
Expand All @@ -72,7 +71,7 @@ describe('Testing EVENTS', () => {
await utils.clickOn('#mic-btn');

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

it('should receive the onScreenShareEnabledChanged event', async () => {
Expand All @@ -87,7 +86,7 @@ describe('Testing EVENTS', () => {
await utils.clickOn('#screenshare-btn');

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

it('should receive the onFullscreenEnabledChanged event', async () => {
Expand All @@ -104,7 +103,7 @@ describe('Testing EVENTS', () => {
await browser.sleep(1000);

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

it('should receive the onRecordingStartRequested event', async () => {
Expand All @@ -119,7 +118,7 @@ describe('Testing EVENTS', () => {
await utils.toggleRecordingFromToolbar();

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

it('should receive the onParticipantsPanelStatusChanged event', async () => {
Expand All @@ -134,7 +133,7 @@ describe('Testing EVENTS', () => {
await utils.togglePanel('participants');

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

it('should receive the onChatPanelStatusChanged event', async () => {
Expand All @@ -149,7 +148,7 @@ describe('Testing EVENTS', () => {
await utils.togglePanel('chat');

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

it('should receive the onActivitiesPanelStatusChanged event', async () => {
Expand All @@ -164,7 +163,7 @@ describe('Testing EVENTS', () => {
await utils.togglePanel('activities');

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

it('should receive the onSettingsPanelStatusChanged event', async () => {
Expand All @@ -179,6 +178,6 @@ describe('Testing EVENTS', () => {
await utils.togglePanel('settings');

await utils.waitForElement('#onSettingsPanelStatusChanged');
expect(await utils.isPresent('#onSettingsPanelStatusChanged')).to.be.true;
expect(await utils.isPresent('#onSettingsPanelStatusChanged')).toBeTrue();
});
});
2 changes: 1 addition & 1 deletion openvidu-components-angular/e2e/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"strict": true,
"outDir": "./dist",
"lib": ["es6"],
"types": [ "mocha", "node" ],
"types": [ "jasmine", "node" ],
"experimentalDecorators": true,
"emitDecoratorMetadata": true
},
Expand Down
29 changes: 14 additions & 15 deletions openvidu-components-angular/e2e/utils.po.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { expect } from 'chai';
import { By, Origin, until, WebDriver, WebElement } from 'selenium-webdriver';
import { By, until, WebDriver, WebElement } from 'selenium-webdriver';

export class OpenViduComponentsPO {
private TIMEOUT = 10 * 1000;
Expand Down Expand Up @@ -31,44 +30,44 @@ export class OpenViduComponentsPO {

async checkPrejoinIsPresent(): Promise<void> {
await this.waitForElement('#prejoin-container');
expect(await this.isPresent('#prejoin-container')).to.be.true;
expect(await this.isPresent('#prejoin-container')).toBe(true);
}

async checkSessionIsPresent() {
await this.waitForElement('#call-container');
expect(await this.isPresent('#call-container')).to.be.true;
expect(await this.isPresent('#call-container')).toBe(true);

await this.waitForElement('#session-container');
expect(await this.isPresent('#session-container')).to.be.true;
expect(await this.isPresent('#session-container')).toBe(true);
}

async checkLayoutPresent(): Promise<void> {
await this.waitForElement('#layout-container');
expect(await this.isPresent('#layout-container')).to.be.true;
expect(await this.isPresent('#layout-container')).toBe(true);

await this.waitForElement('#layout');
expect(await this.isPresent('#layout')).to.be.true;
expect(await this.isPresent('#layout')).toBe(true);
}

async checkStreamIsPresent(): Promise<void> {
await this.waitForElement('.OV_stream');
expect(await this.isPresent('.OV_stream')).to.be.true;
expect(await this.isPresent('.OV_stream')).toBe(true);
}

async checkVideoElementIsPresent(): Promise<void> {
await this.waitForElement('video');
expect(await this.isPresent('video')).to.be.true;
expect(await this.isPresent('video')).toBe(true);
}

async checkToolbarIsPresent(): Promise<void> {
await this.waitForElement('#toolbar');
await this.waitForElement('#media-buttons-container');
expect(await this.isPresent('#media-buttons-container')).to.be.true;
expect(await this.isPresent('#media-buttons-container')).toBe(true);
}

async chceckProFeatureAlertIsPresent(): Promise<void> {
await this.waitForElement('ov-pro-feature-template');
expect(await this.isPresent('ov-pro-feature-template')).to.be.true;
expect(await this.isPresent('ov-pro-feature-template')).toBe(true);
}

async clickOn(selector: string): Promise<void> {
Expand Down Expand Up @@ -104,7 +103,7 @@ export class OpenViduComponentsPO {

async toggleToolbarMoreOptions(): Promise<void> {
await this.waitForElement('#more-options-btn');
expect(await this.isPresent('#more-options-btn')).to.be.true;
expect(await this.isPresent('#more-options-btn')).toBe(true);
await this.clickOn('#more-options-btn');
await this.browser.sleep(500);
await this.waitForElement('#more-options-menu');
Expand All @@ -124,7 +123,7 @@ export class OpenViduComponentsPO {
await this.toggleToolbarMoreOptions();

await this.waitForElement('#recording-btn');
expect(await this.isPresent('#recording-btn')).to.be.true;
expect(await this.isPresent('#recording-btn')).toBe(true);
await this.clickOn('#recording-btn');
}

Expand All @@ -133,15 +132,15 @@ export class OpenViduComponentsPO {
await this.toggleToolbarMoreOptions();

await this.waitForElement('#fullscreen-btn');
expect(await this.isPresent('#fullscreen-btn')).to.be.true;
expect(await this.isPresent('#fullscreen-btn')).toBe(true);
await this.clickOn('#fullscreen-btn');
}

async togglePanel(panelName: string) {
switch (panelName) {
case 'activities':
await this.waitForElement('#activities-panel-btn');
expect(await this.isPresent('#activities-panel-btn')).to.be.true;
expect(await this.isPresent('#activities-panel-btn')).toBe(true);
await this.clickOn('#activities-panel-btn');
break;

Expand Down
Loading

0 comments on commit a664b50

Please sign in to comment.