Package org.xwiki.appwithinminutes.test.po

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


        getUtil().deletePage(getTestClassName(), getTestMethodName());
        editQueryStringParameters.put("editor", "inline");
        editQueryStringParameters.put("template", "AppWithinMinutes.LiveTableTemplate");
        editQueryStringParameters.put("AppWithinMinutes.LiveTableClass_0_class", "XWiki.XWikiUsers");
        getUtil().gotoPage(getTestClassName(), getTestMethodName(), "edit", editQueryStringParameters);
        editPage = new ApplicationHomeEditPage().waitUntilPageIsLoaded();
    }
View Full Code Here


        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).
        ApplicationHomeEditPage homeEditPage = classEditPage.clickNextStep();
        Assert.assertEquals(appPrettyName + " Home", homeEditPage.getDocumentTitle());
        Assert.assertEquals(dataSpace, homeEditPage.getMetaDataValue("space"));

        // Move to the next step (homepage).
        ApplicationHomePage homePage = homeEditPage.clickFinish();
        Assert.assertEquals(appPrettyName + " Home", homePage.getDocumentTitle());
        Assert.assertEquals(dataSpace, homePage.getMetaDataValue("space"));

        // Edit the application's class.
        classEditPage = homePage.clickEditApplication();
        Assert.assertEquals(codeSpace, classEditPage.getMetaDataValue("space"));

        // Move to the next step and check if we landed in the correct data space.
        homeEditPage = classEditPage.clickNextStep();
        Assert.assertEquals(dataSpace, homeEditPage.getMetaDataValue("space"));

        // Go to the App Within Minutes home page.
        homeEditPage.clickBreadcrumbLink(AppWithinMinutesHomePage.TITLE);
        AppWithinMinutesHomePage appWithinMinutesHomePage = new AppWithinMinutesHomePage();

        // Assert that the created application is listed in the live table.
        ApplicationsLiveTableElement appsLiveTable = appWithinMinutesHomePage.getAppsLiveTable();
        appsLiveTable.waitUntilReady();
View Full Code Here

        getUtil().deletePage(getTestClassName(), getTestMethodName());
        editQueryStringParameters.put("editor", "inline");
        editQueryStringParameters.put("template", "AppWithinMinutes.LiveTableTemplate");
        editQueryStringParameters.put("AppWithinMinutes.LiveTableClass_0_class", "XWiki.XWikiUsers");
        getUtil().gotoPage(getTestClassName(), getTestMethodName(), "edit", editQueryStringParameters);
        editPage = new ApplicationHomeEditPage().waitUntilPageIsLoaded();
    }
View Full Code Here

    public void testDeprecatedColumns()
    {
        // Fake a deprecated column by using a column that doesn't exist.
        editQueryStringParameters.put("AppWithinMinutes.LiveTableClass_0_columns", "doc.name foo");
        getUtil().gotoPage(getTestClassName(), getTestMethodName(), "edit", editQueryStringParameters);
        editPage = new ApplicationHomeEditPage().waitUntilPageIsLoaded();

        Assert.assertTrue(editPage.isDeprecatedLiveTableColumnsWarningDisplayed());
        Assert.assertFalse(editPage.isLiveTableColumnDeprecated("Page name"));
        Assert.assertTrue(editPage.isLiveTableColumnDeprecated("foo"));

        // Keep deprecated columns.
        editPage.removeAllDeprecatedLiveTableColumns(false);
        Assert.assertFalse(editPage.isDeprecatedLiveTableColumnsWarningDisplayed());
        Assert.assertTrue(editPage.isLiveTableColumnDeprecated("foo"));
        ApplicationHomePage viewPage = editPage.clickSaveAndView();
        LiveTableElement liveTable = viewPage.getEntriesLiveTable();
        liveTable.waitUntilReady();
        // The column title isn't translated because we haven't generated the document translation bundle.
        Assert.assertTrue(liveTable.hasColumn("xwikiusers.livetable.foo"));

        // Edit again and remove the deprecated column.
        editPage = viewPage.editInline();
        Assert.assertTrue(editPage.isDeprecatedLiveTableColumnsWarningDisplayed());
        editPage.removeLiveTableColumn("foo");
        Assert.assertFalse(editPage.hasLiveTableColumn("foo"));
        // The warning must disappear if we remove the deprecated column.
        Assert.assertFalse(editPage.isDeprecatedLiveTableColumnsWarningDisplayed());

        // Reload and remove all deprecated columns.
        getDriver().navigate().refresh();
        editPage = new ApplicationHomeEditPage().waitUntilPageIsLoaded();
        editPage.removeAllDeprecatedLiveTableColumns(true);
        Assert.assertFalse(editPage.isDeprecatedLiveTableColumnsWarningDisplayed());
        Assert.assertTrue(editPage.hasLiveTableColumn("Page name"));
        Assert.assertFalse(editPage.hasLiveTableColumn("foo"));
    }
View Full Code Here

    {
        // Make sure the list of columns is empty.
        editQueryStringParameters.put("AppWithinMinutes.LiveTableClass_0_columns", "");
        getUtil().gotoPage(getTestClassName(), getTestMethodName(), "edit", editQueryStringParameters);
        // Wait for the page to load before clicking on the save button to be sure the page layout is stable.
        ApplicationHomePage viewPage = new ApplicationHomeEditPage().waitUntilPageIsLoaded().clickSaveAndView();
        Assert.assertFalse(viewPage.hasEntriesLiveTable());
        Assert.assertEquals("", viewPage.editWiki().getContent());
    }
View Full Code Here

        // Set the field pretty name and default value
        fieldEditPane.setPrettyName("City Name");
        fieldEditPane.setDefaultValue("Paris");

        // Move to the next step.
        ApplicationHomeEditPage homeEditPage = classEditPage.clickNextStep().waitUntilPageIsLoaded();

        // Move back to the second step.
        classEditPage = homeEditPage.clickPreviousStep();

        // Open the configuration panel and set the field name
        fieldEditPane = new ClassFieldEditPane("shortText1");
        fieldEditPane.openConfigPanel();
        fieldEditPane.setName("cityName");

        // Move to the next step.
        homeEditPage = classEditPage.clickNextStep();

        // Step 3
        // Enter the application description.
        String appDescription = "Simple application to manage data about various cities";
        homeEditPage.setDescription(appDescription);

        // Add the Short Text field from the previous step to the list of columns.
        homeEditPage.addLiveTableColumn("City Name");

        // Click the finish button which should lead us to the application home page.
        ApplicationHomePage homePage = homeEditPage.clickFinish();

        // Assert the application description is present.
        Assert.assertTrue(homePage.getContent().contains(appDescription));

        // Add a new entry.
        String firstEntryName = RandomStringUtils.randomAlphanumeric(6);
        EntryNamePane entryNamePane = homePage.clickAddNewEntry();
        entryNamePane.setName(firstEntryName);
        EntryEditPage entryEditPage = entryNamePane.clickAdd();

        // Assert the pretty name and the default value of the Short Text field.
        // Apparently WebElement#getText() takes into account the text-transform CSS property.
        Assert.assertEquals("CITY NAME", entryEditPage.getLabel("cityName"));
        Assert.assertEquals("Paris", entryEditPage.getValue("cityName"));

        // Change the field value.
        entryEditPage.setValue("cityName", "London");

        // Save and go back to the application home page.
        String appHomePageTitle = appName + " Home";
        entryEditPage.clickSaveAndView().clickBreadcrumbLink(appHomePageTitle);
        homePage = new ApplicationHomePage();

        // Assert the entry we have just created is listed in the live table.
        LiveTableElement entriesLiveTable = homePage.getEntriesLiveTable();
        entriesLiveTable.waitUntilReady();
        Assert.assertTrue(entriesLiveTable.hasRow("City Name", "London"));

        // Assert that the application space index lists only the home page and the entry we have just created. The rest
        // of the documents (class, template, sheet, preferences) should be marked as hidden.
        LiveTableElement appSpaceIndexLiveTable = SpaceIndexPage.gotoPage(appName).getLiveTable();
        appSpaceIndexLiveTable.waitUntilReady();
        Assert.assertEquals(2, appSpaceIndexLiveTable.getRowCount());
        Assert.assertTrue(appSpaceIndexLiveTable.hasRow("Page", "WebHome"));
        Assert.assertTrue(appSpaceIndexLiveTable.hasRow("Page", firstEntryName));

        // Go back to the application home page.
        getDriver().navigate().back();

        // Click the edit button.
        homePage.edit();
        homeEditPage = new ApplicationHomeEditPage();

        // Change the application description.
        appDescription = "The best app!";
        homeEditPage.setDescription(appDescription);

        // Remove one of the live table columns.
        homeEditPage.removeLiveTableColumn("Actions");

        // Save
        homePage = homeEditPage.clickSaveAndView();

        // Assert that the application description has changed and that the column has been removed.
        Assert.assertTrue(homePage.getContent().contains(appDescription));
        entriesLiveTable = homePage.getEntriesLiveTable();
        entriesLiveTable.waitUntilReady();
        Assert.assertFalse(entriesLiveTable.hasColumn("Actions"));

        // Click the link to edit the application.
        classEditPage = homePage.clickEditApplication();

        // Drag a Number field.
        fieldEditPane = classEditPage.addField("Number");

        // Set the field pretty name.
        fieldEditPane.setPrettyName("Population Size");

        // Fast forward.
        homeEditPage = classEditPage.clickNextStep();
        // Just wait for the WYSIWYG editor (which is used for setting the application description) to load so that the
        // page layout is stable before we click on the Finish button.
        homeEditPage.setDescription(appDescription);
        homePage = homeEditPage.clickFinish();

        // Add a new entry.
        String secondEntryName = RandomStringUtils.randomAlphanumeric(6);
        entryNamePane = homePage.clickAddNewEntry();
        entryNamePane.setName(secondEntryName);
View Full Code Here

        fieldEditPane.setPrettyName("City Name");
        fieldEditPane.openConfigPanel();
        fieldEditPane.setName("cityName");

        // Move to the next step.
        ApplicationHomeEditPage homeEditPage = classEditor.clickNextStep();
        homeEditPage.setDescription("demo");

        // Finish editing.
        ApplicationHomePage homePage = homeEditPage.clickFinish();
        Assert.assertTrue(homePage.getContent().contains("demo"));
    }
View Full Code Here

        titleField.setDefaultValue(defaultTitle);
        String defaultContent = "Enter content here";
        contentField.setDefaultValue(defaultContent);

        // Add live table columns for Title and Content.
        ApplicationHomeEditPage homeEditPage = classEditPage.clickNextStep().waitUntilPageIsLoaded();
        homeEditPage.addLiveTableColumn("My Title");
        homeEditPage.addLiveTableColumn("My Content");

        // Add an application entry.
        EntryNamePane entryNamePane = homeEditPage.clickFinish().clickAddNewEntry();
        entryNamePane.setName("Test");
        EntryEditPage entryEditPage = entryNamePane.clickAdd();
        RichTextAreaElement contentTextArea = entryEditPage.getContentEditor().waitToLoad().getRichTextArea();
        Assert.assertEquals("13", entryEditPage.getValue("number1"));
        Assert.assertEquals(defaultTitle, entryEditPage.getDocumentTitle());
View Full Code Here

        editQueryStringParameters.put("editor", "inline");
        editQueryStringParameters.put("template", "AppWithinMinutes.LiveTableTemplate");
        editQueryStringParameters.put("AppWithinMinutes.LiveTableClass_0_class", "Panels.PanelClass");
        getUtil().gotoPage(getTestClassName(), getTestMethodName(), "edit", editQueryStringParameters);
        // Wait for the page to load before clicking on the save button to make sure the page layout is stable.
        homePage = new ApplicationHomeEditPage().waitUntilPageIsLoaded().clickSaveAndView();
    }
View Full Code Here

    @Test
    public void filterStaticList()
    {
        // Create an application that has a Static List field and add a corresponding column to the live table.
        classEditPage.addField("Static List");
        ApplicationHomeEditPage homeEditPage = classEditPage.clickNextStep().waitUntilPageIsLoaded();
        homeEditPage.addLiveTableColumn("Static List");

        // Add first entry.
        EntryNamePane entryNamePane = homeEditPage.clickFinish().clickAddNewEntry();
        entryNamePane.setName("Foo");
        EntryEditPage entryEditPage = entryNamePane.clickAdd();
        entryEditPage.setValue("staticList1", "value1");
        entryEditPage.clickSaveAndView().clickBreadcrumbLink(appName + " Home");
View Full Code Here

TOP

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

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.