diff --git a/openvidu-components-angular/e2e/webcomponent.test.ts b/openvidu-components-angular/e2e/webcomponent.test.ts index a9d24213..4c25d829 100644 --- a/openvidu-components-angular/e2e/webcomponent.test.ts +++ b/openvidu-components-angular/e2e/webcomponent.test.ts @@ -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(); diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/session/session.component.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/session/session.component.ts index 1e143bac..be576110 100644 --- a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/session/session.component.ts +++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/session/session.component.ts @@ -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() {