Package org.xwiki.appwithinminutes.test.po

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


        // 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);
        entryEditPage = entryNamePane.clickAdd();

        // Assert the new field is displayed in the edit sheet (field name was auto-generated).
        // Apparently WebElement#getText() takes into account the text-transform CSS property.
        Assert.assertEquals("POPULATION SIZE", entryEditPage.getLabel("number1"));
View Full Code Here


        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());
        Assert.assertEquals(defaultTitle, entryEditPage.getTitle());
        entryEditPage.setTitle("Foo");
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 testEntryNameWithURLSpecialCharacters()
    {
        EntryNamePane entryNamePane = homePage.clickAddNewEntry();
        String entryName = "A?b=c&d#" + RandomStringUtils.randomAlphanumeric(3);
        entryNamePane.setName(entryName);
        EntryEditPage entryEditPage = entryNamePane.clickAdd();
        entryEditPage.setValue("description", "This is a test panel.");
        entryEditPage.clickSaveAndView();

        getUtil().gotoPage(getTestClassName(), getTestMethodName());
        homePage = new ApplicationHomePage();
View Full Code Here

        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");

        // Add second entry.
        entryNamePane = new ApplicationHomePage().clickAddNewEntry();
        entryNamePane.setName("Bar");
        entryEditPage = entryNamePane.clickAdd();
        entryEditPage.setValue("staticList1", "value2");
        entryEditPage.clickSaveAndView().clickBreadcrumbLink(appName + " Home");

        // Filter the Static List column of the live table.
        LiveTableElement liveTable = new ApplicationHomePage().getEntriesLiveTable();
View Full Code Here

        ApplicationHomeEditPage homeEditPage = classEditPage.clickNextStep().waitUntilPageIsLoaded();
        homeEditPage.addLiveTableColumn("Title");
        homeEditPage.moveLiveTableColumnBefore("Title", "Page name");

        // Add first entry.
        EntryNamePane entryNamePane = homeEditPage.clickFinish().clickAddNewEntry();
        entryNamePane.setName("Foo");
        EntryEditPage entryEditPage = entryNamePane.clickAdd();
        entryEditPage.setTitle("The Mighty Foo");
        entryEditPage.clickSaveAndView().clickBreadcrumbLink(appName + " Home");

        // Add second entry.
        entryNamePane = new ApplicationHomePage().clickAddNewEntry();
        entryNamePane.setName("Bar");
        entryEditPage = entryNamePane.clickAdd();
        entryEditPage.setTitle("The Empty Bar");
        entryEditPage.clickSaveAndView().clickBreadcrumbLink(appName + " Home");

        // Filter the Title column of the live table.
        LiveTableElement liveTable = new ApplicationHomePage().getEntriesLiveTable();
View Full Code Here

TOP

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

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.