github.com/argoproj/argo-cd/v2@v2.10.9/ui-test/src/popup/popup-manager.ts (about) 1 import {By, WebDriver} from 'selenium-webdriver'; 2 import {Base} from '../base'; 3 import UiTestUtilities from '../UiTestUtilities'; 4 5 // Popup Confirmation dialog 6 // Uncomment to use 7 // const POPUP_OK_BUTTON_CSS: By = By.css('#app .popup-container .qe-argo-popup-ok-button'); 8 // const POPUP_OK_BUTTON: By = By.xpath('.//button[@qe-id="argo-popup-ok-button"]'); 9 // const POPUP_CANCEL_BUTTON: By = By.xpath('.//button[@qe-id="argo-popup-cancel-button"]'); 10 11 // Popup Prompt dialog 12 const DELETE_APP_POPUP_FIELD_CONFIRMATION: By = By.xpath('.//input[@qeid="name-field-delete-confirmation"]'); 13 const DELETE_APP_PROMPT_POPUP_OK_BUTTON: By = By.xpath('.//button[@qe-id="prompt-popup-ok-button"]'); 14 const DELETE_APP_PROMPT_POPUP_CANCEL_BUTTON: By = By.xpath('.//button[@qe-id="prompt-popup-cancel-button"]'); 15 16 export class PopupManager extends Base { 17 public constructor(driver: WebDriver) { 18 super(driver); 19 } 20 21 public async setPromptFieldName(appName: string): Promise<void> { 22 const confirmationField = await UiTestUtilities.findUiElement(this.driver, DELETE_APP_POPUP_FIELD_CONFIRMATION); 23 await confirmationField.sendKeys(appName); 24 } 25 26 public async clickPromptOk(): Promise<void> { 27 const okButton = await UiTestUtilities.findUiElement(this.driver, DELETE_APP_PROMPT_POPUP_OK_BUTTON); 28 await okButton.click(); 29 } 30 31 public async clickPromptCancel(): Promise<void> { 32 const cancelButton = await UiTestUtilities.findUiElement(this.driver, DELETE_APP_PROMPT_POPUP_CANCEL_BUTTON); 33 await cancelButton.click(); 34 } 35 }