// Path: src/e2e-test/java/io/cdap/plugin/utils/SchemaFieldTypeMapping.java
// public class SchemaFieldTypeMapping {
//   private final String field;
//   private final String type;
// 
//   public SchemaFieldTypeMapping(String field, String type) {
//     this.field = field;
//     this.type = type;
//   }
// 
//   public String getField() {
//     return field;
//   }
// 
//   public String getType() {
//     return type;
//   }
// }
// 
// Path: src/e2e-test/java/io/cdap/plugin/utils/enums/SalesforceBatchSourceProperty.java
// public enum SalesforceBatchSourceProperty {
//   REFERENCE_NAME("referenceName", PluginPropertyUtils.errorProp("required.property.referencename")),
//   SOQL_QUERY("query", PluginPropertyUtils.errorProp("required.property.soqlorsobjectname"));
// 
//   public final String dataCyAttributeValue;
//   public String propertyMissingValidationMessage;
// 
//   SalesforceBatchSourceProperty(String value) {
//     this.dataCyAttributeValue = value;
//   }
// 
//   SalesforceBatchSourceProperty(String value, String propertyMissingValidationMessage) {
//     this.dataCyAttributeValue = value;
//     this.propertyMissingValidationMessage = propertyMissingValidationMessage;
//   }
// }


import io.cdap.e2e.utils.SeleniumDriver;
import io.cdap.plugin.utils.SchemaFieldTypeMapping;
import io.cdap.plugin.utils.enums.SalesforceBatchSourceProperty;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.How;
  @FindBy(how = How.XPATH, using = "//div[@data-cy='duration']//div[@data-cy='value']//div")
  public static WebElement durationUnitSelector;

  @FindBy(how = How.XPATH, using = "//div[@data-cy='offset']//div[@data-cy='key']//input")
  public static WebElement offsetInput;

  @FindBy(how = How.XPATH, using = "//div[@data-cy='offset']//div[@data-cy='value']//div")
  public static WebElement offsetUnitSelector;

  // Salesforce Batch Source - Properties page - Advanced section
  @FindBy(how = How.XPATH, using = "//div[@data-cy='switch-enablePKChunk']")
  public static WebElement enablePkChunkingToggle;

  @FindBy(how = How.XPATH, using = "//input[@data-cy='chunkSize']")
  public static WebElement chunkSizeInput;

  @FindBy(how = How.XPATH, using = "//input[@data-cy='parent']")
  public static WebElement sObjectParentNameInput;

  @FindBy(how = How.XPATH, using = "//span[contains(@class, 'text-success')]" +
    "[normalize-space(text())= 'No errors found.']")
  public static WebElement noErrorsFoundSuccessMessage;

  @FindBy(how = How.XPATH, using = "//a[./span[contains(@class, 'fa-remove')]]")
  public static WebElement closePropertiesPageButton;

  @FindBy(how = How.XPATH, using = "//h2[contains(text(), 'Errors')]" +
    "/following-sibling::div[contains(@class, 'text-danger')]//li")
  public static WebElement errorMessageOnHeader;

// Path: src/e2e-test/java/io/cdap/plugin/utils/SchemaFieldTypeMapping.java
// public class SchemaFieldTypeMapping {
//   private final String field;
//   private final String type;
// 
//   public SchemaFieldTypeMapping(String field, String type) {
//     this.field = field;
//     this.type = type;
//   }
// 
//   public String getField() {
//     return field;
//   }
// 
//   public String getType() {
//     return type;
//   }
// }
// 
// Path: src/e2e-test/java/io/cdap/plugin/utils/enums/SalesforceBatchSourceProperty.java
// public enum SalesforceBatchSourceProperty {
//   REFERENCE_NAME("referenceName", PluginPropertyUtils.errorProp("required.property.referencename")),
//   SOQL_QUERY("query", PluginPropertyUtils.errorProp("required.property.soqlorsobjectname"));
// 
//   public final String dataCyAttributeValue;
//   public String propertyMissingValidationMessage;
// 
//   SalesforceBatchSourceProperty(String value) {
//     this.dataCyAttributeValue = value;
//   }
// 
//   SalesforceBatchSourceProperty(String value, String propertyMissingValidationMessage) {
//     this.dataCyAttributeValue = value;
//     this.propertyMissingValidationMessage = propertyMissingValidationMessage;
//   }
// }


// Path: src/e2e-test/java/io/cdap/plugin/salesforcebatchsource/locators/SalesforcePropertiesPage.java
import io.cdap.e2e.utils.SeleniumDriver;
import io.cdap.plugin.utils.SchemaFieldTypeMapping;
import io.cdap.plugin.utils.enums.SalesforceBatchSourceProperty;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.How;

  @FindBy(how = How.XPATH, using = "//div[@data-cy='duration']//div[@data-cy='value']//div")
  public static WebElement durationUnitSelector;

  @FindBy(how = How.XPATH, using = "//div[@data-cy='offset']//div[@data-cy='key']//input")
  public static WebElement offsetInput;

  @FindBy(how = How.XPATH, using = "//div[@data-cy='offset']//div[@data-cy='value']//div")
  public static WebElement offsetUnitSelector;

  // Salesforce Batch Source - Properties page - Advanced section
  @FindBy(how = How.XPATH, using = "//div[@data-cy='switch-enablePKChunk']")
  public static WebElement enablePkChunkingToggle;

  @FindBy(how = How.XPATH, using = "//input[@data-cy='chunkSize']")
  public static WebElement chunkSizeInput;

  @FindBy(how = How.XPATH, using = "//input[@data-cy='parent']")
  public static WebElement sObjectParentNameInput;

  @FindBy(how = How.XPATH, using = "//span[contains(@class, 'text-success')]" +
    "[normalize-space(text())= 'No errors found.']")
  public static WebElement noErrorsFoundSuccessMessage;

  @FindBy(how = How.XPATH, using = "//a[./span[contains(@class, 'fa-remove')]]")
  public static WebElement closePropertiesPageButton;

  @FindBy(how = How.XPATH, using = "//h2[contains(text(), 'Errors')]" +
    "/following-sibling::div[contains(@class, 'text-danger')]//li")
  public static WebElement errorMessageOnHeader;

  public static WebElement getSchemaFieldTypeMappingElement(SchemaFieldTypeMapping schemaFieldTypeMapping) {