Package org.xwiki.appwithinminutes.test.po

Examples of org.xwiki.appwithinminutes.test.po.ApplicationCreatePage


    @IgnoreBrowser(value = "internet.*", version = "8\\.*", reason="See http://jira.xwiki.org/browse/XE-1146"),
    @IgnoreBrowser(value = "internet.*", version = "9\\.*", reason="See http://jira.xwiki.org/browse/XE-1177")
    })
    public void testSpecialCharactersInAppName()
    {
        ApplicationCreatePage appCreatePage = ApplicationCreatePage.gotoPage();
        Assert.assertFalse(appCreatePage.getContent().contains(INVALID_CLASS_NAME_ERROR_MESSAGE));

        // Set an special character based application name.
        String appPrettyName = "my \\app^";
        String dataSpace = appPrettyName;
        String codeSpace = "myappCode";
        String className = "myappClass";
        appCreatePage.setApplicationName(dataSpace);
        appCreatePage.waitForApplicationNamePreview();
        Assert.assertFalse(appCreatePage.getContent().contains(INVALID_CLASS_NAME_ERROR_MESSAGE));
        // Data space
        Assert.assertTrue(appCreatePage.getContent().contains(dataSpace));
        // Code space
        Assert.assertTrue(appCreatePage.getContent().contains(codeSpace));
        // Class name
        Assert.assertTrue(appCreatePage.getContent().contains(className));

        // Move to the next step (class edit).
        ApplicationClassEditPage classEditPage = appCreatePage.clickNextStep();
        Assert.assertEquals("Class: " + appPrettyName, classEditPage.getDocumentTitle());
        Assert.assertEquals(codeSpace, classEditPage.getMetaDataValue("space"));
        Assert.assertEquals(className, classEditPage.getMetaDataValue("page"));

        // Move to the next step (homepage edit).
View Full Code Here


     *
     * @param appName the name of the application to create
     */
    private void createApplication(String appName)
    {
        ApplicationCreatePage appCreatePage = homePage.clickCreateApplication();
        appCreatePage.setApplicationName(appName);
        appCreatePage.waitForApplicationNamePreview();
        ApplicationClassEditPage classEditPage = appCreatePage.clickNextStep();
        classEditPage.addField("Short Text");
        // Wait for the application home edit page to load before clicking finish to be sure the page layout is stable.
        classEditPage.clickNextStep().waitUntilPageIsLoaded().clickFinish()
            .clickBreadcrumbLink(AppWithinMinutesHomePage.TITLE);
        homePage = new AppWithinMinutesHomePage();
View Full Code Here

    @Test
    public void titleAndContent()
    {
        // Create a new application.
        String appName = RandomStringUtils.randomAlphabetic(6);
        ApplicationCreatePage appCreatePage = ApplicationCreatePage.gotoPage();
        appCreatePage.setApplicationName(appName);
        appCreatePage.waitForApplicationNamePreview();
        ApplicationClassEditPage classEditPage = appCreatePage.clickNextStep();

        // Add a standard field.
        ClassFieldEditPane numberField = classEditPage.addField("Number");

        // Add the Title and Content fields.
View Full Code Here

    @IgnoreBrowser(value = "internet.*", version = "8\\.*", reason="See http://jira.xwiki.org/browse/XE-1146"),
    @IgnoreBrowser(value = "internet.*", version = "9\\.*", reason="See http://jira.xwiki.org/browse/XE-1177")
    })
    public void testEmptyAppNameWithNextStepButton()
    {
        ApplicationCreatePage appCreatePage = ApplicationCreatePage.gotoPage();
        Assert.assertFalse(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));

        // Try to move to the next step without typing the application name.
        appCreatePage.clickNextStep();
        appCreatePage.waitForApplicationNameError();
        Assert.assertTrue(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));

        // Type the application name.
        appCreatePage.setApplicationName("A");
        appCreatePage.waitForApplicationNamePreview();
        Assert.assertFalse(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));

        // Clear the application name using the Backspace key.
        appCreatePage.getApplicationNameInput().sendKeys(Keys.BACK_SPACE);
        appCreatePage.waitForApplicationNameError();
        Assert.assertTrue(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));

        // Try to create the application even if the error message is displayed.
        appCreatePage.clickNextStep();
        Assert.assertTrue(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));

        // Fix the application name and move to the next step.
        appCreatePage.setApplicationName(getTestMethodName());
        appCreatePage.waitForApplicationNamePreview();
        Assert.assertEquals("Class: " + getTestMethodName(), appCreatePage.clickNextStep().getDocumentTitle());
    }
View Full Code Here

    @IgnoreBrowser(value = "internet.*", version = "8\\.*", reason="See http://jira.xwiki.org/browse/XE-1146"),
    @IgnoreBrowser(value = "internet.*", version = "9\\.*", reason="See http://jira.xwiki.org/browse/XE-1177")
    })
    public void testEmptyAppNameWithEnter()
    {
        ApplicationCreatePage appCreatePage = ApplicationCreatePage.gotoPage();
        Assert.assertFalse(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));

        // Press Enter key without typing the application name.
        appCreatePage.getApplicationNameInput().sendKeys(Keys.RETURN);
        appCreatePage.waitForApplicationNameError();
        Assert.assertTrue(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));

        // Type the application name.
        appCreatePage.setApplicationName("B");
        appCreatePage.waitForApplicationNamePreview();
        Assert.assertFalse(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));

        // Clear the application name using the Backspace key.
        appCreatePage.getApplicationNameInput().sendKeys(Keys.BACK_SPACE);
        appCreatePage.waitForApplicationNameError();
        Assert.assertTrue(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));

        // Try to create the application even if the error message is displayed.
        appCreatePage.getApplicationNameInput().sendKeys(Keys.RETURN);
        Assert.assertTrue(appCreatePage.getContent().contains(EMPTY_APP_NAME_ERROR_MESSAGE));

        // Fix the application name and move to the next step using the Enter key.
        appCreatePage.setApplicationName(getTestMethodName());
        appCreatePage.waitForApplicationNamePreview();
        appCreatePage.getApplicationNameInput().sendKeys(Keys.RETURN);
        Assert.assertEquals("Class: " + getTestMethodName(), new ViewPage().getDocumentTitle());
    }
View Full Code Here

    @IgnoreBrowser(value = "internet.*", version = "8\\.*", reason="See http://jira.xwiki.org/browse/XE-1146"),
    @IgnoreBrowser(value = "internet.*", version = "9\\.*", reason="See http://jira.xwiki.org/browse/XE-1177")
    })
    public void testInvalidAppName()
    {
        ApplicationCreatePage appCreatePage = ApplicationCreatePage.gotoPage();
        Assert.assertFalse(appCreatePage.getContent().contains(INVALID_CLASS_NAME_ERROR_MESSAGE));

        // Set an invalid application name.
        appCreatePage.setApplicationName("1");
        appCreatePage.waitForApplicationNameError();
        Assert.assertTrue(appCreatePage.getContent().contains(INVALID_CLASS_NAME_ERROR_MESSAGE));

        // Fix the application name.
        appCreatePage.getApplicationNameInput().sendKeys("Z");
        appCreatePage.waitForApplicationNamePreview();
        Assert.assertFalse(appCreatePage.getContent().contains(INVALID_CLASS_NAME_ERROR_MESSAGE));
        Assert.assertTrue(appCreatePage.getContent().contains("ZClass"));

        // Revert the fix.
        appCreatePage.getApplicationNameInput().sendKeys(Keys.BACK_SPACE);
        appCreatePage.waitForApplicationNameError();
        Assert.assertTrue(appCreatePage.getContent().contains(INVALID_CLASS_NAME_ERROR_MESSAGE));

        // Try to move to the next step even if the application name is invalid.
        appCreatePage.clickNextStep();
        Assert.assertTrue(appCreatePage.getContent().contains(INVALID_CLASS_NAME_ERROR_MESSAGE));

        // Test class name filtering.
        appCreatePage.setApplicationName("7\u0103?\u021B>/t:e-st_@28");
        appCreatePage.waitForApplicationNamePreview();
        Assert.assertTrue(appCreatePage.getContent().contains("\u0103\u021Bte-st_28Class"));
        Assert.assertEquals("Class: 7\u0103?\u021B>/t:e-st_@28", appCreatePage.clickNextStep().getDocumentTitle());
    }
View Full Code Here

    @IgnoreBrowser(value = "internet.*", version = "8\\.*", reason="See http://jira.xwiki.org/browse/XE-1146"),
    @IgnoreBrowser(value = "internet.*", version = "9\\.*", reason="See http://jira.xwiki.org/browse/XE-1177")
    })
    public void testExistingAppName()
    {
        ApplicationCreatePage appCreatePage = ApplicationCreatePage.gotoPage();
        Assert.assertFalse(appCreatePage.getContent().contains(APP_NAME_USED_WARNING_MESSAGE));

        // Type the name of an existing space.
        appCreatePage.setApplicationName("Blog");
        appCreatePage.waitForApplicationNamePreview();
        Assert.assertTrue(appCreatePage.getContent().contains(APP_NAME_USED_WARNING_MESSAGE));

        // Proceed to the next step.
        Assert.assertTrue(appCreatePage.clickNextStep().hasBreadcrumbContent("The Wiki Blog", false));
    }
View Full Code Here

    public void setUp() throws Exception
    {
        super.setUp();

        appName = RandomStringUtils.randomAlphabetic(6);
        ApplicationCreatePage appCreatePage = ApplicationCreatePage.gotoPage();
        appCreatePage.setApplicationName(appName);
        appCreatePage.waitForApplicationNamePreview();
        classEditPage = appCreatePage.clickNextStep();
    }
View Full Code Here

TOP

Related Classes of org.xwiki.appwithinminutes.test.po.ApplicationCreatePage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.