@Test
 public void deleteBonusTest() {
   expectedImsBonusEntity.setSearchFieldText(existingTemplate);
   expectedImsBonusEntity.setSelectedTemplateName(existingTemplate);
   expectedImsBonusEntity.setAvailableTemplates(Arrays.asList(existingTemplate));
   expectedImsBonusEntity.setSourceForBonusCalcAmount("No amount required");
   // WHEN
   imsBonusPage =
       (ImsBonusPage)
           testGroupsPage.addAction(testGroupToTest, expectedImsBonusEntity.getAction());
   imsBonusPage.setAllFields(expectedImsBonusEntity);
   testGroupsPage = (TestGroupsPage) imsBonusPage.clickOk(true);
   campaignDetailsPage = testGroupsPage.clickSave();
   activityTab = campaignDetailsPage.openActivityTab();
   testGroupsPage = activityTab.clickActionsWithTestGroups();
   testGroupsPage.clickDelete(testGroupToTest);
   // THEN
   assertTrue(
       testGroupsPage.getAction(testGroupToTest).equals("Add Action"),
       "IMS Bonus is not disappeared from test group after deleting.");
   campaignDetailsPage = testGroupsPage.clickSave();
   activityTab = campaignDetailsPage.openActivityTab();
   testGroupsPage = activityTab.clickActionsWithTestGroups();
   assertTrue(
       testGroupsPage.getAction(testGroupToTest).equals("Add Action"),
       "IMS Bonus is not disappeared from test group after deleting.");
 }
 @Test
 public void saveBonusTest() {
   expectedImsBonusEntity.setSearchFieldText(existingTemplate);
   expectedImsBonusEntity.setSelectedTemplateName(existingTemplate);
   expectedImsBonusEntity.setAvailableTemplates(Arrays.asList(existingTemplate));
   expectedImsBonusEntity.setSourceForBonusCalcAmount("No amount required");
   // WHEN
   imsBonusPage =
       (ImsBonusPage)
           testGroupsPage.addAction(testGroupToTest, expectedImsBonusEntity.getAction());
   imsBonusPage.setAllFields(expectedImsBonusEntity);
   testGroupsPage = (TestGroupsPage) imsBonusPage.clickOk(true);
   campaignDetailsPage = testGroupsPage.clickSave();
   activityTab = campaignDetailsPage.openActivityTab();
   testGroupsPage = activityTab.clickActionsWithTestGroups();
   // THEN
   assertEquals(expectedImsBonusEntity.getAction(), testGroupsPage.getAction(testGroupToTest));
   assertEquals(
       expectedImsBonusEntity.getSelectedTemplateName()
           + " - Amount Source: "
           + expectedImsBonusEntity.getSourceForBonusCalcAmount(),
       testGroupsPage.getSummary(testGroupToTest));
   activityTab = campaignTabs.openActivityTab();
   testGroupsPage = activityTab.clickActionsWithTestGroups();
   imsBonusPage = (ImsBonusPage) testGroupsPage.clickEdit(testGroupToTest);
   actualImsBonusEntity = imsBonusPage.getAllFields();
   assertObjectsEquals(expectedImsBonusEntity, actualImsBonusEntity);
 }
 @BeforeMethod
 public void createNewCampaign() {
   // GIVEN
   DbUnitUtil.clean("demodb-jdbc.properties");
   campaignData = new CampaignData();
   cmDashboardPage = goToCMDashboardDirectly();
   campaignDetailsPage = cmDashboardPage.createCampaign(campaignData);
   campaignTabs = campaignDetailsPage.clickSave();
   activityTab = campaignTabs.openActivityTab();
   activityName = activityTab.getOpenedDetails().getActivityName();
   activityID = activityTab.getOpenedDetails().getActivityID();
   actionsPage = activityTab.clickActions();
   testGroupsPage = actionsPage.clickTestYes();
   expectedImsBonusEntity = new ImsBonusEntity();
   actualImsBonusEntity = new ImsBonusEntity();
 }