Created
July 6, 2020 06:08
-
-
Save KrishnB/1d1c9332bb338fd0f597dd60cf7292db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PageInitiator { | |
public static <T extends BasePage> T getPage(Class<T> tClass) { | |
Injector pageInjector = (Injector) Reporter.getCurrentTestResult() | |
.getAttribute(Constants.PAGE_INJECTOR); | |
T page = pageInjector.getInstance(tClass); | |
return (T) page.init(page); | |
} | |
public static <T extends BaseComponent> T getComponent(Class<T> tClass) { | |
Injector pageInjector = (Injector) Reporter.getCurrentTestResult() | |
.getAttribute(Constants.PAGE_INJECTOR); | |
T page = pageInjector.getInstance(tClass); | |
return (T) page.init(page); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment