Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(tests): wait for aria-checked after VB thumbnail clicks

Jaya Allamsetty279638111a49
diff --git a/tests/pageobjects/VirtualBackgroundDialog.ts b/tests/pageobjects/VirtualBackgroundDialog.ts
index fe677ae64d..804c93d397 100644
--- a/tests/pageobjects/VirtualBackgroundDialog.ts
+++ b/tests/pageobjects/VirtualBackgroundDialog.ts
@@ -27,36 +27,44 @@ export default class VirtualBackgroundDialog extends BaseDialog {
}
/**
- * Clicks the "Remove background" (None) thumbnail.
+ * Clicks a thumbnail and waits for it to become aria-checked.
+ * Ensures React has finished re-rendering before the next click, preventing
+ * rapid clicks from being swallowed during reconciliation.
+ *
+ * @param {string} selector - CSS selector for the thumbnail.
+ * @param {string} label - Human-readable label for logging.
*/
- async clickNone(): Promise<void> {
- await this.participant.log('VirtualBackgroundDialog: clicking None thumbnail');
- const el = this.participant.driver.$(NONE_THUMBNAIL);
+ private async clickAndWaitChecked(selector: string, label: string): Promise<void> {
+ await this.participant.log(`VirtualBackgroundDialog: clicking ${label} thumbnail`);
+ const el = this.participant.driver.$(selector);
- await el.waitForClickable({ timeout: 3000, timeoutMsg: 'None thumbnail not clickable' });
+ await el.waitForClickable({ timeout: 3000, timeoutMsg: `${label} thumbnail not clickable` });
await el.click();
+ await this.participant.driver.waitUntil(
+ async () => (await el.getAttribute('aria-checked')) === 'true',
+ { timeout: 2000, timeoutMsg: `${label} thumbnail did not become checked after click` }
+ );
}
/**
- * Clicks the "Half Blur" (slight blur) thumbnail.
+ * Clicks the "Remove background" (None) thumbnail.
*/
- async clickSlightBlur(): Promise<void> {
- await this.participant.log('VirtualBackgroundDialog: clicking Slight Blur thumbnail');
- const el = this.participant.driver.$(SLIGHT_BLUR_THUMBNAIL);
+ clickNone(): Promise<void> {
+ return this.clickAndWaitChecked(NONE_THUMBNAIL, 'None');
+ }
- await el.waitForClickable({ timeout: 3000, timeoutMsg: 'Slight Blur thumbnail not clickable' });
- await el.click();
+ /**
+ * Clicks the "Half Blur" (slight blur) thumbnail.
+ */
+ clickSlightBlur(): Promise<void> {
+ return this.clickAndWaitChecked(SLIGHT_BLUR_THUMBNAIL, 'Slight Blur');
}
/**
* Clicks the "Blur" (full blur) thumbnail.
*/
- async clickBlur(): Promise<void> {
- await this.participant.log('VirtualBackgroundDialog: clicking Blur thumbnail');
- const el = this.participant.driver.$(BLUR_THUMBNAIL);
-
- await el.waitForClickable({ timeout: 3000, timeoutMsg: 'Blur thumbnail not clickable' });
- await el.click();
+ clickBlur(): Promise<void> {
+ return this.clickAndWaitChecked(BLUR_THUMBNAIL, 'Blur');
}
/**