
com.github.invictum.panels.builder.RegularPanelBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of invictum-test-core Show documentation
Show all versions of invictum-test-core Show documentation
Used as a base for automation. Based on Serenity BDD project.
The newest version!
package com.github.invictum.panels.builder;
import com.github.invictum.panels.AbstractPanel;
import com.github.invictum.panels.init.PanelInitUtil;
import com.github.invictum.panels.proxy.LazyPanelElementFactory;
import net.serenitybdd.core.pages.WebElementFacade;
import java.util.ArrayList;
import java.util.List;
public class RegularPanelBuilder extends PanelBuilder {
public RegularPanelBuilder(Class panelClass) {
super(panelClass);
}
@Override
public T build() {
getPage().activateIfJQueryRelated(locator());
PanelInitUtil.applyGlobalInitStrategy(panelClass(), getPage());
T panelInstance = assemblePanelWithReflection();
panelInstance.initWith(getPage(), LazyPanelElementFactory.produce(getPage(), locator()));
PanelInitUtil.invokeWhenInitializedMethods(panelInstance);
return panelInstance;
}
@Override
public List buildAll() {
getPage().activateIfJQueryRelated(locator());
List panels = getPage().findAll(locator());
PanelInitUtil.applyGlobalInitStrategy(panelClass(), getPage());
List panelList = new ArrayList<>();
for (WebElementFacade element : panels) {
T panel = assemblePanelWithReflection();
panel.initWith(getPage(), element);
PanelInitUtil.invokeWhenInitializedMethods(panel);
panelList.add(panel);
}
return panelList;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy