diff --git a/openvidu-components-angular/e2e/api-directives.test.ts b/openvidu-components-angular/e2e/api-directives.test.ts index b21981a3..035bbbc0 100644 --- a/openvidu-components-angular/e2e/api-directives.test.ts +++ b/openvidu-components-angular/e2e/api-directives.test.ts @@ -2,7 +2,7 @@ import { Builder, WebDriver } from 'selenium-webdriver'; import { TestAppConfig } from './selenium.conf'; import { OpenViduComponentsPO } from './utils.po.test'; -const url = TestAppConfig.appUrl; +let url = ''; describe('Testing API Directives', () => { let browser: WebDriver; @@ -19,6 +19,7 @@ describe('Testing API Directives', () => { beforeEach(async () => { browser = await createChromeBrowser(); utils = new OpenViduComponentsPO(browser); + url = `${TestAppConfig.appUrl}&roomName=API_DIRECTIVES_${Math.floor(Math.random() * 1000)}`; }); afterEach(async () => { @@ -173,7 +174,7 @@ describe('Testing API Directives', () => { }); it('should show the token error WITH prejoin page', async () => { - const fixedUrl = `${url}&roomName=TEST_TOKEN&participantName=PNAME`; + const fixedUrl = `${TestAppConfig.appUrl}&roomName=TEST_TOKEN&participantName=PNAME`; await browser.get(`${fixedUrl}`); // Checking if prejoin page exist @@ -203,7 +204,7 @@ describe('Testing API Directives', () => { }); it('should show the token error WITHOUT prejoin page', async () => { - const fixedUrl = `${url}&roomName=TOKEN_ERROR&prejoin=false&participantName=PNAME`; + const fixedUrl = `${TestAppConfig.appUrl}&roomName=TOKEN_ERROR&prejoin=false&participantName=PNAME`; await browser.get(`${fixedUrl}`); // Checking if session container is present @@ -541,7 +542,7 @@ describe('Testing API Directives', () => { it('should HIDE the MUTE button in participants panel', async () => { const roomName = 'e2etest'; - const fixedUrl = `${url}&prejoin=false&participantMuteBtn=false&roomName=${roomName}`; + const fixedUrl = `${TestAppConfig.appUrl}&prejoin=false&participantMuteBtn=false&roomName=${roomName}`; await browser.get(fixedUrl); await utils.checkSessionIsPresent(); diff --git a/openvidu-components-angular/e2e/utils.po.test.ts b/openvidu-components-angular/e2e/utils.po.test.ts index d88bc97d..aa45d38b 100644 --- a/openvidu-components-angular/e2e/utils.po.test.ts +++ b/openvidu-components-angular/e2e/utils.po.test.ts @@ -1,5 +1,4 @@ import { By, until, WebDriver, WebElement } from 'selenium-webdriver'; -import { TestAppConfig } from './selenium.conf'; export class OpenViduComponentsPO { private TIMEOUT = 10 * 1000; @@ -167,7 +166,9 @@ export class OpenViduComponentsPO { console.warn(`Warning: ${videoCount} video elements still present after leaving room`); } } catch (error) { - this.browser.get(TestAppConfig.appUrl); + console.error('Error during leaveRoom:', error); + + throw error; } }