com.onevizion.uitest.api.helper.entity.EntityReportGroup Maven / Gradle / Ivy
package com.onevizion.uitest.api.helper.entity;
import java.util.HashMap;
import java.util.Map;
import org.openqa.selenium.By;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.onevizion.uitest.api.AbstractSeleniumCore;
import com.onevizion.uitest.api.SeleniumSettings;
import com.onevizion.uitest.api.helper.AssertElement;
import com.onevizion.uitest.api.helper.Grid;
import com.onevizion.uitest.api.helper.Js;
import com.onevizion.uitest.api.helper.Window;
import com.onevizion.uitest.api.helper.form.Form;
import com.onevizion.uitest.api.helper.grid.Grid2;
import com.onevizion.uitest.api.vo.entity.ReportGroup;
@Component
public class EntityReportGroup {
private static final String NAME = "reportGroup";
@Autowired
private Window window;
@Autowired
private SeleniumSettings seleniumSettings;
@Autowired
private AssertElement assertElement;
@Autowired
private Js js;
@Autowired
private Form form;
@Autowired
private Grid grid;
@Autowired
private Grid2 grid2;
public void add(ReportGroup reportGroup) {
form.openAddWithoutTabs();
seleniumSettings.getWebDriver().findElement(By.name(NAME)).clear();
seleniumSettings.getWebDriver().findElement(By.name(NAME)).sendKeys(reportGroup.getName());
window.closeModal(By.id(AbstractSeleniumCore.BUTTON_OK_ID_BASE));
grid2.waitLoad();
}
public void edit(ReportGroup reportGroup) {
form.openEditWithoutTabs();
seleniumSettings.getWebDriver().findElement(By.name(NAME)).clear();
seleniumSettings.getWebDriver().findElement(By.name(NAME)).sendKeys(reportGroup.getName());
window.closeModal(By.id(AbstractSeleniumCore.BUTTON_OK_ID_BASE));
grid2.waitLoad();
}
public void testOnForm(ReportGroup reportGroup) {
form.openEditWithoutTabs();
assertElement.assertText(NAME, reportGroup.getName());
window.closeModal(By.id(AbstractSeleniumCore.BUTTON_CANCEL_ID_BASE));
}
public void testInGrid(Long gridId, int rowIndex, ReportGroup reportGroup) {
Map gridVals = new HashMap<>();
gridVals.put(js.getColumnIndexByLabel(gridId, "Report Group Name"), reportGroup.getName());
grid.checkGridRowByRowIndexAndColIndex(gridId, rowIndex, gridVals);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy