com.frameworkium.core.ui.pages.PageFactory Java Examples

The following examples show how to use com.frameworkium.core.ui.pages.PageFactory. 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: WelcomePage.java    From frameworkium-core with Apache License 2.0 5 votes vote down vote up
/**
 * Static factory method for this page object with specified timeout.
 *
 * @param timeout timeout in seconds
 * @return An instance of this page object with specified wait timeout
 */
@Step("Navigate to 'The Internet'")
public static WelcomePage open(long timeout) {
    return PageFactory.newInstance(
            WelcomePage.class,
            "https://the-internet.herokuapp.com",
            Duration.of(timeout, SECONDS));
}
 
Example #2
Source File: WelcomePage.java    From frameworkium-examples with Apache License 2.0 5 votes vote down vote up
@Step("Click the Dynamic Loading link - user: {0}, password {1}")
public BasicAuthSuccessPage navigateToBasicAuth(String username, String password) {
    // For this sort of authentication, Selenium cannot handle the dialog
    // box that appears if you click the link.
    // Instead, we can provide the username and password in the URL:
    String url = formatBasicAuthURL(username, password, basicAuthLink.getReference());
    return PageFactory.newInstance(BasicAuthSuccessPage.class, url);
}
 
Example #3
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 #4
Source File: CalculatorAppTest.java    From frameworkium-examples with Apache License 2.0 5 votes vote down vote up
/**
 * Example test for https://appium.s3.amazonaws.com/TestApp7.1.app.zip
 */
@Test(description = "Test sum computation", enabled = false)
@TmsLink("CALC-1")
public void testIOSApp() {

    String result = PageFactory
            .newInstance(CalculatorPage.class)
            .computeSum(1, 2).then()
            .getResult();

    assertThat(result).isEqualTo("3");
}
 
Example #5
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 #6
Source File: WelcomePage.java    From frameworkium-examples with Apache License 2.0 4 votes vote down vote up
@Step("Click the Frames link")
public FramesPage clickFramesLink() {
    framesLink.click();
    return PageFactory.newInstance(FramesPage.class);
}
 
Example #7
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 #8
Source File: WelcomePage.java    From frameworkium-examples 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 #9
Source File: WelcomePage.java    From frameworkium-examples with Apache License 2.0 4 votes vote down vote up
@Step("Click the JavaScript Alerts link")
public JavaScriptAlertsPage clickJavascriptAlertsLink() {
    javascriptAlertsLink.click();
    return PageFactory.newInstance(JavaScriptAlertsPage.class);
}
 
Example #10
Source File: WelcomePage.java    From frameworkium-examples with Apache License 2.0 4 votes vote down vote up
@Step("Click the Key Presses link")
public KeyPressesPage clickKeyPressesLink() {
    keyPressesLink.click();
    return PageFactory.newInstance(KeyPressesPage.class);
}
 
Example #11
Source File: WelcomePage.java    From frameworkium-examples with Apache License 2.0 4 votes vote down vote up
@Step("Click the Sortable Data Table link")
public SortableDataTablesPage clickSortableDataTablesLink() {
    sortableDataTablesLink.click();
    return PageFactory.newInstance(SortableDataTablesPage.class);
}
 
Example #12
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 #13
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 #14
Source File: JQueryDemoPage.java    From frameworkium-core with Apache License 2.0 4 votes vote down vote up
public static JQueryDemoPage open() {
    return PageFactory.newInstance(
            JQueryDemoPage.class,
            "https://jqueryui.com/demos/");
}
 
Example #15
Source File: HomePage.java    From frameworkium-core with Apache License 2.0 4 votes vote down vote up
public static HomePage open() {
    return PageFactory.newInstance(
            HomePage.class,
            "https://selenium.dev/");
}
 
Example #16
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 #17
Source File: HeaderComponent.java    From frameworkium-core with Apache License 2.0 4 votes vote down vote up
public SeleniumDownloadPage clickDownloadLink() {
    downloadLink.click();
    return PageFactory.newInstance(SeleniumDownloadPage.class);
}
 
Example #18
Source File: DeveloperGuidePage.java    From frameworkium-core with Apache License 2.0 4 votes vote down vote up
public static DeveloperGuidePage open() {
    return PageFactory.newInstance(
            DeveloperGuidePage.class, "https://docs.angularjs.org/guide");
}
 
Example #19
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 #20
Source File: EnglishCountiesPage.java    From frameworkium-core 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 #21
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 #22
Source File: DynamicLoadingExamplePage.java    From frameworkium-core with Apache License 2.0 4 votes vote down vote up
public static DynamicLoadingExamplePage openExampleTwo() {
    return PageFactory.newInstance(
            DynamicLoadingExamplePage.class,
            "https://the-internet.herokuapp.com/dynamic_loading/2");
}
 
Example #23
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 #24
Source File: WelcomePage.java    From frameworkium-core with Apache License 2.0 4 votes vote down vote up
@Step("Click the Checkboxes link")
public CheckboxesPage clickCheckboxesLink() {
    checkboxesLink.click();
    return PageFactory.newInstance(
            CheckboxesPage.class, Duration.of(15, SECONDS));
}
 
Example #25
Source File: WelcomePage.java    From frameworkium-core with Apache License 2.0 4 votes vote down vote up
@Step("Click the Drag And Drop link")
public DragAndDropPage clickDragAndDropLink() {
    dragAndDropLink.click();
    return PageFactory.newInstance(DragAndDropPage.class);
}
 
Example #26
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 #27
Source File: WelcomePage.java    From frameworkium-core with Apache License 2.0 4 votes vote down vote up
@Step("Click the JavaScript Alerts link")
public JavaScriptAlertsPage clickJavascriptAlertsLink() {
    javascriptAlertsLink.click();
    return PageFactory.newInstance(JavaScriptAlertsPage.class);
}
 
Example #28
Source File: WelcomePage.java    From frameworkium-core with Apache License 2.0 4 votes vote down vote up
@Step("Click the Key Presses link")
public KeyPressesPage clickKeyPressesLink() {
    keyPressesLink.click();
    return PageFactory.newInstance(KeyPressesPage.class);
}
 
Example #29
Source File: HomePage.java    From frameworkium-examples with Apache License 2.0 4 votes vote down vote up
@Step("Click developer guide link")
public DeveloperGuidePage clickDeveloperGuideLink() {
    developerGuideMenuItem.click();
    return PageFactory.newInstance(DeveloperGuidePage.class);
}
 
Example #30
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/");
}