Files
jitsi-meet/tests/pageobjects/PasswordDialog.ts

52 lines
1.3 KiB
TypeScript
Raw Permalink Normal View History

2025-02-12 19:20:21 -06:00
import BaseDialog from './BaseDialog';
const INPUT_KEY_XPATH = '//input[@name="lockKey"]';
/**
* Represents the password dialog in a particular participant.
*/
export default class PasswordDialog extends BaseDialog {
/**
* Waiting for the dialog to appear.
*/
async waitForDialog() {
const input = this.participant.driver.$(INPUT_KEY_XPATH);
await input.waitForExist({
timeout: 5000,
timeoutMsg: 'Password dialog not found'
});
await input.waitForDisplayed();
await input.waitForStable();
2025-02-12 19:20:21 -06:00
}
async isOpen() {
const input = this.participant.driver.$(INPUT_KEY_XPATH);
try {
await input.isExisting();
return await input.isDisplayed();
} catch (e) {
return false;
}
}
2025-02-12 19:20:21 -06:00
/**
* Sets a password and submits the dialog.
* @param password
*/
async submitPassword(password: string) {
const passwordInput = this.participant.driver.$(INPUT_KEY_XPATH);
await passwordInput.waitForExist();
await passwordInput.waitForClickable({ timeout: 2000 });
2025-02-12 19:20:21 -06:00
await passwordInput.click();
await passwordInput.clearValue();
await this.participant.driver.keys(password);
await this.clickOkButton();
}
}