diff --git a/openvidu-components-angular/e2e/stream.test.ts b/openvidu-components-angular/e2e/stream.test.ts index 10d5844c..4fb23bb0 100644 --- a/openvidu-components-angular/e2e/stream.test.ts +++ b/openvidu-components-angular/e2e/stream.test.ts @@ -681,8 +681,8 @@ describe('Stream UI controls and interaction features', () => { await browser.switchTo().window(tabs[0]); + await utils.waitForElement('.OV_stream.remote.speaking'); expect(await utils.getNumberOfElements('.OV_stream.remote.speaking')).toEqual(1); - // Wait for at least one speaking element to appear before asserting expect(await utils.getNumberOfElements('.OV_stream.speaking')).toEqual(1); }); }); diff --git a/openvidu-components-angular/e2e/utils.po.test.ts b/openvidu-components-angular/e2e/utils.po.test.ts index 392d3d4a..9571e3f0 100644 --- a/openvidu-components-angular/e2e/utils.po.test.ts +++ b/openvidu-components-angular/e2e/utils.po.test.ts @@ -15,13 +15,7 @@ export class OpenViduComponentsPO { ); } - async getNumberOfElements(selector: string, timeout: number = this.TIMEOUT): Promise { - try { - await this.waitForElement(selector); - } catch { - // If timeout, return 0 as no elements found - return 0; - } + async getNumberOfElements(selector: string): Promise { return (await this.browser.findElements(By.css(selector))).length; }