Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

PasswordDialog.ts 975B

12345678910111213141516171819202122232425262728293031323334353637
  1. import BaseDialog from './BaseDialog';
  2. const INPUT_KEY_XPATH = '//input[@name="lockKey"]';
  3. /**
  4. * Represents the password dialog in a particular participant.
  5. */
  6. export default class PasswordDialog extends BaseDialog {
  7. /**
  8. * Waiting for the dialog to appear.
  9. */
  10. async waitForDialog() {
  11. const input = this.participant.driver.$(INPUT_KEY_XPATH);
  12. await input.waitForExist({
  13. timeout: 5000,
  14. timeoutMsg: 'Password dialog not found'
  15. });
  16. await input.waitForDisplayed();
  17. }
  18. /**
  19. * Sets a password and submits the dialog.
  20. * @param password
  21. */
  22. async submitPassword(password: string) {
  23. const passwordInput = this.participant.driver.$(INPUT_KEY_XPATH);
  24. await passwordInput.waitForExist();
  25. await passwordInput.click();
  26. await passwordInput.clearValue();
  27. await this.participant.driver.keys(password);
  28. await this.clickOkButton();
  29. }
  30. }