// Path: src/e2e-test/java/io/cdap/plugin/salesforcemultiobjectsbatchsource/actions/SalesforceMultiObjectsPropertiesPageActions.java
// public class SalesforceMultiObjectsPropertiesPageActions {
//   private static final Logger logger = LoggerFactory.getLogger(SalesforceMultiObjectsPropertiesPageActions.class);
// 
//   static {
//     SeleniumHelper.getPropertiesLocators(SalesforceMultiObjectsPropertiesPage.class);
//   }
// 
//   public static void fillWhiteListWithSObjectNames(List<SObjects> sObjectNames) {
//     int totalSObjects = sObjectNames.size();
// 
//     for (int i = 0; i < totalSObjects - 1; i++) {
//       SalesforceMultiObjectsPropertiesPage.sObjectNameAddRowButtonsInWhiteList.get(i).click();
//     }
// 
//     for (int i = 0; i < totalSObjects; i++) {
//       SalesforceMultiObjectsPropertiesPage.sObjectNameInputsInWhiteList.get(i).sendKeys(sObjectNames.get(i).value);
//     }
//   }
// 
//   public static void fillBlackListWithSObjectNames(List<SObjects> sObjectNames) {
//     int totalSObjects = sObjectNames.size();
// 
//     for (int i = 0; i < totalSObjects - 1; i++) {
//       SalesforceMultiObjectsPropertiesPage.sObjectNameAddRowButtonsInBlackList.get(i).click();
//     }
// 
//     for (int i = 0; i < totalSObjects; i++) {
//       SalesforceMultiObjectsPropertiesPage.sObjectNameInputsInBlackList.get(i).sendKeys(sObjectNames.get(i).value);
//     }
//   }
// 
//   public static void verifyInvalidSObjectNameValidationMessageForWhiteList(List<SObjects> whiteListedSObjects) {
//     String invalidSObjectNameValidationMessage = PluginPropertyUtils.errorProp("invalid.sobjectnames");
// 
//     if (whiteListedSObjects.size() > 0) {
//       AssertionHelper.verifyElementContainsText(SalesforceMultiObjectsPropertiesPage.propertyErrorInWhiteList,
//         invalidSObjectNameValidationMessage);
// 
//       for (SObjects whiteListedSObject : whiteListedSObjects) {
//         AssertionHelper.verifyElementContainsText(SalesforceMultiObjectsPropertiesPage.propertyErrorInWhiteList,
//           whiteListedSObject.value);
//       }
//     }
//   }
// 
//   public static void verifyInvalidSObjectNameValidationMessageForBlackList(List<SObjects> blackListedSObjects) {
//     String invalidSObjectNameValidationMessage = PluginPropertyUtils.errorProp("invalid.sobjectnames");
// 
//     if (blackListedSObjects.size() > 0) {
//       AssertionHelper.verifyElementContainsText(SalesforceMultiObjectsPropertiesPage.propertyErrorInBlackList,
//         invalidSObjectNameValidationMessage);
// 
//       for (SObjects blackListedSObject : blackListedSObjects) {
//         AssertionHelper.verifyElementContainsText(SalesforceMultiObjectsPropertiesPage.propertyErrorInBlackList,
//           blackListedSObject.value);
//       }
//     }
//   }
// }
// 
// Path: src/e2e-test/java/io/cdap/plugin/utils/enums/SObjects.java
// public enum SObjects {
//   ACCOUNT("Account"),
//   CONTACT("Contact"),
//   LEAD("Lead"),
//   OPPORTUNITY("Opportunity"),
//   BLAHBLAH("blahblah"),
//   ACCOUNTZZ("Accountzz"),
//   LEADSS("Leadss");
// 
//   public final String value;
// 
//   SObjects(String value) {
//     this.value = value;
//   }
// }


import io.cdap.plugin.salesforcemultiobjectsbatchsource.actions.SalesforceMultiObjectsPropertiesPageActions;
import io.cdap.plugin.utils.enums.SObjects;
import io.cucumber.datatable.DataTable;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import java.util.ArrayList;
import java.util.List;
/*
 * Copyright © 2022 Cask Data, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package io.cdap.plugin.salesforcemultiobjectsbatchsource.stepsdesign;



/**
 * Design-time steps of Salesforce MultiObjects Batch Source plugin.
 */
public class DesignTimeSteps {
  List<SObjects> whiteListedSObjects = new ArrayList<>();
  List<SObjects> blackListedSObjects = new ArrayList<>();

  @When("fill White List with below listed SObjects:")
  public void fillWhiteList(DataTable table) {
    List<String> list = table.asList();

    for (String sObject : list) {
      whiteListedSObjects.add(SObjects.valueOf(sObject));
    }

// Path: src/e2e-test/java/io/cdap/plugin/salesforcemultiobjectsbatchsource/actions/SalesforceMultiObjectsPropertiesPageActions.java
// public class SalesforceMultiObjectsPropertiesPageActions {
//   private static final Logger logger = LoggerFactory.getLogger(SalesforceMultiObjectsPropertiesPageActions.class);
// 
//   static {
//     SeleniumHelper.getPropertiesLocators(SalesforceMultiObjectsPropertiesPage.class);
//   }
// 
//   public static void fillWhiteListWithSObjectNames(List<SObjects> sObjectNames) {
//     int totalSObjects = sObjectNames.size();
// 
//     for (int i = 0; i < totalSObjects - 1; i++) {
//       SalesforceMultiObjectsPropertiesPage.sObjectNameAddRowButtonsInWhiteList.get(i).click();
//     }
// 
//     for (int i = 0; i < totalSObjects; i++) {
//       SalesforceMultiObjectsPropertiesPage.sObjectNameInputsInWhiteList.get(i).sendKeys(sObjectNames.get(i).value);
//     }
//   }
// 
//   public static void fillBlackListWithSObjectNames(List<SObjects> sObjectNames) {
//     int totalSObjects = sObjectNames.size();
// 
//     for (int i = 0; i < totalSObjects - 1; i++) {
//       SalesforceMultiObjectsPropertiesPage.sObjectNameAddRowButtonsInBlackList.get(i).click();
//     }
// 
//     for (int i = 0; i < totalSObjects; i++) {
//       SalesforceMultiObjectsPropertiesPage.sObjectNameInputsInBlackList.get(i).sendKeys(sObjectNames.get(i).value);
//     }
//   }
// 
//   public static void verifyInvalidSObjectNameValidationMessageForWhiteList(List<SObjects> whiteListedSObjects) {
//     String invalidSObjectNameValidationMessage = PluginPropertyUtils.errorProp("invalid.sobjectnames");
// 
//     if (whiteListedSObjects.size() > 0) {
//       AssertionHelper.verifyElementContainsText(SalesforceMultiObjectsPropertiesPage.propertyErrorInWhiteList,
//         invalidSObjectNameValidationMessage);
// 
//       for (SObjects whiteListedSObject : whiteListedSObjects) {
//         AssertionHelper.verifyElementContainsText(SalesforceMultiObjectsPropertiesPage.propertyErrorInWhiteList,
//           whiteListedSObject.value);
//       }
//     }
//   }
// 
//   public static void verifyInvalidSObjectNameValidationMessageForBlackList(List<SObjects> blackListedSObjects) {
//     String invalidSObjectNameValidationMessage = PluginPropertyUtils.errorProp("invalid.sobjectnames");
// 
//     if (blackListedSObjects.size() > 0) {
//       AssertionHelper.verifyElementContainsText(SalesforceMultiObjectsPropertiesPage.propertyErrorInBlackList,
//         invalidSObjectNameValidationMessage);
// 
//       for (SObjects blackListedSObject : blackListedSObjects) {
//         AssertionHelper.verifyElementContainsText(SalesforceMultiObjectsPropertiesPage.propertyErrorInBlackList,
//           blackListedSObject.value);
//       }
//     }
//   }
// }
// 
// Path: src/e2e-test/java/io/cdap/plugin/utils/enums/SObjects.java
// public enum SObjects {
//   ACCOUNT("Account"),
//   CONTACT("Contact"),
//   LEAD("Lead"),
//   OPPORTUNITY("Opportunity"),
//   BLAHBLAH("blahblah"),
//   ACCOUNTZZ("Accountzz"),
//   LEADSS("Leadss");
// 
//   public final String value;
// 
//   SObjects(String value) {
//     this.value = value;
//   }
// }


// Path: src/e2e-test/java/io/cdap/plugin/salesforcemultiobjectsbatchsource/stepsdesign/DesignTimeSteps.java
import io.cdap.plugin.salesforcemultiobjectsbatchsource.actions.SalesforceMultiObjectsPropertiesPageActions;
import io.cdap.plugin.utils.enums.SObjects;
import io.cucumber.datatable.DataTable;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import java.util.ArrayList;
import java.util.List;

/*
 * Copyright © 2022 Cask Data, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package io.cdap.plugin.salesforcemultiobjectsbatchsource.stepsdesign;



/**
 * Design-time steps of Salesforce MultiObjects Batch Source plugin.
 */
public class DesignTimeSteps {
  List<SObjects> whiteListedSObjects = new ArrayList<>();
  List<SObjects> blackListedSObjects = new ArrayList<>();

  @When("fill White List with below listed SObjects:")
  public void fillWhiteList(DataTable table) {
    List<String> list = table.asList();

    for (String sObject : list) {
      whiteListedSObjects.add(SObjects.valueOf(sObject));
    }

    SalesforceMultiObjectsPropertiesPageActions.fillWhiteListWithSObjectNames(whiteListedSObjects);