github.com/argoproj/argo-cd/v2@v2.10.9/ui-test/src/applications-sync-panel/applications-sync-panel.ts (about)

     1  import {By, until, WebDriver} from 'selenium-webdriver';
     2  import {Base} from '../base';
     3  import * as Const from '../Constants';
     4  import UiTestUtilities from '../UiTestUtilities';
     5  
     6  export const SYNC_PANEL_SYNCHRONIZE_BUTTON: By = By.xpath('.//button[@qe-id="application-sync-panel-button-synchronize"]');
     7  
     8  export class ApplicationsSyncPanel extends Base {
     9      public constructor(driver: WebDriver) {
    10          super(driver);
    11      }
    12  
    13      /**
    14       * Click the Sync button
    15       */
    16      public async clickSyncButton() {
    17          try {
    18              // Wait until the Synchronize button appears
    19              const synchronizeButton = await this.driver.wait(until.elementLocated(SYNC_PANEL_SYNCHRONIZE_BUTTON), Const.TEST_TIMEOUT);
    20              await this.driver.wait(until.elementIsVisible(synchronizeButton), Const.TEST_TIMEOUT);
    21  
    22              // Check if the sync button is enabled
    23              await this.driver.wait(until.elementIsEnabled(synchronizeButton), Const.TEST_TIMEOUT);
    24              await synchronizeButton.click();
    25  
    26              await this.driver.wait(until.elementIsNotVisible(synchronizeButton), Const.TEST_SLIDING_PANEL_TIMEOUT).catch(e => {
    27                  UiTestUtilities.logError('The Synchronization Sliding Panel did not disappear');
    28                  throw e;
    29              });
    30              UiTestUtilities.log('Synchronize sliding panel disappeared');
    31          } catch (err) {
    32              throw new Error(err);
    33          }
    34      }
    35  }