Revert "ov-components: (test) Enhance element counting method to handle timeouts gracefully"

This reverts commit 61a3589dd7.
master
Carlos Santos 2025-08-14 12:53:31 +02:00
parent 61a3589dd7
commit 3fc0193260
2 changed files with 2 additions and 8 deletions

View File

@ -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);
});
});

View File

@ -15,13 +15,7 @@ export class OpenViduComponentsPO {
);
}
async getNumberOfElements(selector: string, timeout: number = this.TIMEOUT): Promise<number> {
try {
await this.waitForElement(selector);
} catch {
// If timeout, return 0 as no elements found
return 0;
}
async getNumberOfElements(selector: string): Promise<number> {
return (await this.browser.findElements(By.css(selector))).length;
}