Java Code Examples for com.frameworkium.core.ui.pages.PageFactory#newInstance()

The following examples show how to use com.frameworkium.core.ui.pages.PageFactory#newInstance() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FormAuthenticationPage.java    From frameworkium-examples with Apache License 2.0 5 votes vote down vote up
@Step("Log in - {0}/{1}")
public <T extends BasePage<T>> T login(
        String username, String password, Class<T> classOfExpectedPageObject) {

    usernameField.clear();
    usernameField.sendKeys(username);

    passwordField.clear();
    passwordField.sendKeys(password);

    loginButton.click();
    return PageFactory.newInstance(classOfExpectedPageObject);
}
 
Example 2
Source File: PlanJourneyPage.java    From frameworkium-examples with Apache License 2.0 5 votes vote down vote up
@Step("Plan journey from {0} to {1}")
public JourneyPlannerResultsPage planJourney(String from, String to) {

    fromField.sendKeys(from);
    clickFirstSuggestion(fromSuggestions);
    toField.sendKeys(to);
    clickFirstSuggestion(toSuggestions);
    planJourneyButton.click();
    return PageFactory.newInstance(JourneyPlannerResultsPage.class);
}
 
Example 3
Source File: WelcomePage.java    From frameworkium-examples with Apache License 2.0 4 votes vote down vote up
@Step("Navigate to https://the-internet.herokuapp.com")
public static WelcomePage open() {
    return PageFactory.newInstance(
            WelcomePage.class, "https://the-internet.herokuapp.com");
}
 
Example 4
Source File: SeleniumHomePage.java    From frameworkium-bdd with Apache License 2.0 4 votes vote down vote up
public static void open() {
    PageFactory.newInstance(
            SeleniumHomePage.class,
            "https://www.seleniumhq.org");
}
 
Example 5
Source File: WelcomePage.java    From frameworkium-core with Apache License 2.0 4 votes vote down vote up
@Step("Navigate to https://the-internet.herokuapp.com")
public static WelcomePage open() {
    return PageFactory.newInstance(
            WelcomePage.class, "https://the-internet.herokuapp.com");
}
 
Example 6
Source File: EnglishCountiesUsingListsPage.java    From frameworkium-core with Apache License 2.0 4 votes vote down vote up
public static EnglishCountiesUsingListsPage open() {
    return PageFactory.newInstance(EnglishCountiesUsingListsPage.class,
            "https://en.wikipedia.org/wiki/List_of_ceremonial_counties_of_England");
}
 
Example 7
Source File: FramesPage.java    From frameworkium-examples with Apache License 2.0 4 votes vote down vote up
@Step("Click iFrame link")
public IFramePage clickIFrameLink() {
    iFrameLink.click();
    return PageFactory.newInstance(IFramePage.class);
}
 
Example 8
Source File: WelcomePage.java    From frameworkium-examples with Apache License 2.0 4 votes vote down vote up
@Step("Click the Dynamic Loading link")
public DynamicLoadingPage clickDynamicLoading() {
    dynamicLoadingLink.click();
    return PageFactory.newInstance(DynamicLoadingPage.class);
}
 
Example 9
Source File: SortableDataTablesPage.java    From frameworkium-core with Apache License 2.0 4 votes vote down vote up
public static SortableDataTablesPage open() {
    return PageFactory.newInstance(
            SortableDataTablesPage.class,
            "https://the-internet.herokuapp.com/tables");
}
 
Example 10
Source File: HomePage.java    From frameworkium-examples with Apache License 2.0 4 votes vote down vote up
@Step("Open home page")
public static HomePage open() {
    UITestLifecycle.get().getWebDriver().manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
    return PageFactory.newInstance(HomePage.class, "https://angularjs.org/");
}
 
Example 11
Source File: HomePage.java    From frameworkium-examples with Apache License 2.0 4 votes vote down vote up
@Step("Go to the plan journey page")
public PlanJourneyPage clickPlanJourneyLink() {
    planJourneyLink.click();
    return PageFactory.newInstance(PlanJourneyPage.class);
}
 
Example 12
Source File: EnglishCountiesPage.java    From frameworkium-examples with Apache License 2.0 4 votes vote down vote up
public static EnglishCountiesPage open() {
    return PageFactory.newInstance(EnglishCountiesPage.class,
            "https://en.wikipedia.org/wiki/List_of_ceremonial_counties_of_England");
}
 
Example 13
Source File: WelcomePage.java    From frameworkium-examples with Apache License 2.0 4 votes vote down vote up
@Step("Click the File Download link")
public FileDownloadPage clickFileDownloadLink() {
    fileDownloadLink.click();
    return PageFactory.newInstance(FileDownloadPage.class);
}
 
Example 14
Source File: WelcomePage.java    From frameworkium-examples with Apache License 2.0 4 votes vote down vote up
@Step("Click the File Upload link")
public FileUploadPage clickFileUploadLink() {
    fileUploadLink.click();
    return PageFactory.newInstance(FileUploadPage.class);
}
 
Example 15
Source File: HighestMountainPage.java    From frameworkium-examples with Apache License 2.0 4 votes vote down vote up
public static HighestMountainPage open() {
    return PageFactory.newInstance(HighestMountainPage.class,
            "https://en.wikipedia.org/wiki/List_of_highest_mountains_on_Earth");
}
 
Example 16
Source File: HomePage.java    From frameworkium-examples with Apache License 2.0 4 votes vote down vote up
@Step("Navigate to the Github homepage")
public static HomePage open() {
    return PageFactory.newInstance(HomePage.class, "https://github.com");
}
 
Example 17
Source File: SeleniumDownloadPage.java    From frameworkium-core with Apache License 2.0 4 votes vote down vote up
public static SeleniumDownloadPage open() {
    return PageFactory.newInstance(
            SeleniumDownloadPage.class,
            "https://selenium.dev/downloads/");
}
 
Example 18
Source File: WelcomePage.java    From frameworkium-core with Apache License 2.0 4 votes vote down vote up
@Step("Click the Hovers link")
public HoversPage clickHoversLink() {
    hoversLink.click();
    return PageFactory.newInstance(HoversPage.class);
}
 
Example 19
Source File: WelcomePage.java    From frameworkium-examples with Apache License 2.0 4 votes vote down vote up
@Step("Click the Dropdown link")
public DropdownPage clickDropdownLink() {
    dropdownLink.click();
    return PageFactory.newInstance(DropdownPage.class);
}
 
Example 20
Source File: HomePage.java    From frameworkium-examples with Apache License 2.0 4 votes vote down vote up
public static HomePage open() {
    return PageFactory.newInstance(
            HomePage.class,
            "https://www.seleniumhq.org/");
}