openvidu-components: fixed e2e tests

pull/809/head
Carlos Santos 2023-02-28 11:30:35 +01:00
parent b013d851da
commit d83604b92a
2 changed files with 18 additions and 8 deletions

View File

@ -123,7 +123,8 @@ describe('Testing API Directives', () => {
});
it('should run the app with VIDEO MUTED in prejoin page', async () => {
let idVideoEnabled;
try {
let idVideoEnabled;
const script = 'return document.getElementsByTagName("video")[0].srcObject.getVideoTracks()[0].enabled;';
await browser.get(`${url}&prejoin=true&videoMuted=true`);
@ -152,6 +153,11 @@ describe('Testing API Directives', () => {
await utils.waitForElement('#videocam_off');
expect(await utils.isPresent('#videocam_off')).to.be.true;
} catch (error) {
console.log(error);
console.log(await browser.takeScreenshot());
}
});
it('should run the app with VIDEO MUTED and WITHOUT PREJOIN page', async () => {
@ -160,6 +166,8 @@ describe('Testing API Directives', () => {
await browser.get(`${url}&prejoin=false&videoMuted=true`);
await browser.sleep(2000);
await utils.checkSessionIsPresent();
await utils.checkLayoutPresent();

View File

@ -197,13 +197,15 @@ export class SessionComponent implements OnInit, OnDestroy {
async ngOnDestroy() {
// Reconnecting session is received in Firefox
// To avoid 'Connection lost' message uses session.off()
this.session?.off('reconnecting');
await this.participantService.clear();
this.session = null;
this.sessionScreen = null;
if (this.menuSubscription) this.menuSubscription.unsubscribe();
if (this.layoutWidthSubscription) this.layoutWidthSubscription.unsubscribe();
if (this.captionLanguageSubscription) this.captionLanguageSubscription.unsubscribe();
if (!this.usedInPrejoinPage) {
this.session?.off('reconnecting');
await this.participantService.clear();
this.session = null;
this.sessionScreen = null;
if (this.menuSubscription) this.menuSubscription.unsubscribe();
if (this.layoutWidthSubscription) this.layoutWidthSubscription.unsubscribe();
if (this.captionLanguageSubscription) this.captionLanguageSubscription.unsubscribe();
}
}
leaveSession() {