All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.siwenyan.superglue.SearchCriteria Maven / Gradle / Ivy

There is a newer version: 1.25.a
Show newest version
package com.github.siwenyan.superglue;

import com.github.siwenyan.web.ElementProviderOnSearchContext;
import com.github.siwenyan.web.ui.IEditable;
import com.github.siwenyan.web.ui.UIComponentFactory;
import cucumber.api.Scenario;
import org.apache.log4j.Logger;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

import java.util.Map;

public class SearchCriteria extends AbstractStepSet {
    private static Logger log = Logger.getLogger(SearchCriteria.class);

    public SearchCriteria(Scenario scenario, WebDriver webDriver) {
        super(scenario, webDriver);
    }

    //
    //Fill in search criteria.
    //Can be applied to any search page as long as the criteria fields are organized in a table element.
    //
    //@param criteria
    //@param filterTableXpath
    //
    public void setCriteria(Map criteria, String filterTableXpath) {
        IEditable tableEditable = UIComponentFactory.asEditable(new ElementProviderOnSearchContext(driver(), By.xpath(filterTableXpath)));
        tableEditable.edit(criteria);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy