Ejemplo n.º 1
0
 /**
  * This method create a trigger
  *
  * @param triggersPage Trigger PO
  * @param triggerName Trigger name
  */
 public static void createTrigger(TriggersPage triggersPage, String triggerName) {
   triggersPage.clickOnAddTrigger();
   Assert.assertTrue(
       triggersPage.isTriggerPopUPDisplayed(POPUP_ADD_TRIGGER),
       "Adding trigger popup is not displayed");
   triggersPage.addTrigger(triggerName);
   triggersPage.submit();
   Utilities.waitTime(ConstantsClass.TIMEOUT_2_SECONDS);
   Assert.assertTrue(
       triggersPage.existTrigger(triggerName),
       String.format("Trigger '%s' was not added correctly", triggerName));
 }
Ejemplo n.º 2
0
  /**
   * This method removes a trigger if exists in the list
   *
   * @param triggersPage Trigger PO
   * @param triggerName Trigger name
   */
  public static void deleteTriggerIfExist(TriggersPage triggersPage, String triggerName) {

    if (triggersPage.existTrigger(triggerName)) {

      triggersPage.selectTriggerIntoTheTable(triggerName);
      triggersPage.clickOnRemove();
      Assert.assertTrue(
          triggersPage.isTriggerPopUPDisplayed(POPUP_DELETE_TRIGGER),
          "The remove trigger dialog was not displayed");

      triggersPage.clickOnOK();
      Assert.assertTrue(
          EventsCommon.checkFlareMessageAppearsAndClickToDisappear(FLARE_MESSAGE_TRIGGER_REMOVED));
      WebDriverCommands.refreshPage();

      Assert.assertFalse(
          triggersPage.existTrigger(triggerName),
          String.format("The trigger %s is still in the list", triggerName));
    }
  }