public void setSearchSpace(Space space) { String label = "All Spaces"; if(space != null) label = space.getName(); client.selectOption("search-image-space-select", label); }
public void testSpaceBreadcrumb() { String spaceName = space.getName(); doBreadcrumbTest(spaceName, true); }
public void testSpaceKeyField() throws Exception { // Depending on the parameter field width, long space names might be truncated and not match correctly. String shortSpaceName = testSpace.getName().substring(0, 10); fieldTest("popular-labels", "spaceKey", shortSpaceName, testSpace.getKey()); }
/** * On the Browse panel, waits until the root node shows the required Space name. */ public void waitForSpaceAtBrowseTreeRoot(Space space) { String spaceName = GeneralUtil.escapeForJavascript(space.getName()); client.waitForJQueryElementSelector("#tree-root-node-item a:contains(\"" + spaceName + "\")"); }
private String getPageResultTitle(Page page) { return page.getTitle() + " \\(" + page.getSpace().getName() + "\\)"; }
public void testSpaceLink() { Space space = new Space("BLAH", "<em>B</em>lah"); rpc.createSpace(space); rpc.grantAllPermissionsExceptAdmin(defaultUser, space); rpc.flushIndexQueue(); editor.createPage(space); testContent = space; searchText = space.getName().substring(0, 3); //3 characters is enough link = new EditorLink("space", space.getName(), "/display/" + space.getKey()); runAutocomplete(); }
/** * Waits until the location breadcrumbs match the passed Space and parent Page. * @param space the Space for the location - required * @param parentPage the parent Page for the location. If null the location will be at the top level of the Space */ public void waitForBreadcrumbs(Space space, Page parentPage) { client.waitForJQueryElementSelector("#new-parent-breadcrumbs li:first a[title=\"" + space.getName() + "\"]"); if (parentPage != null) { client.waitForJQueryElementSelector("#new-parent-breadcrumbs li:last a[title=\"" + parentPage.getTitle() + "\"]"); } else { // Check that the space breadcrumb is the only one client.waitForCondition("$('#new-parent-breadcrumbs li').length == 1"); } }
public void clickResult(TitledContent contentEntity) { String title = contentEntity.getTitle(); if (contentEntity instanceof AbstractContentEntity) { AbstractContentEntity entity = (AbstractContentEntity) contentEntity; title = title + " (" + entity.getSpace().getName() + ")"; } else if(contentEntity instanceof Attachment) { Attachment attachment = (Attachment) contentEntity; ContentEntity ownerContent = attachment.getPage(); // not sure why drafts don't have space names in the title if (ownerContent != null && !(ownerContent instanceof Draft) && attachment.getPage().getSpace() != null) { title = title + " (" + attachment.getPage().getSpace().getName() + ")"; } } clickItem(title); }
public void testSearchRespectsSpaceSelected() { Space testSpace2 = new Space("AAA", "Another Test Space"); rpc.logIn(adminUser); rpc.createSpace(testSpace2); rpc.grantPermission(SpacePermission.VIEW, testSpace2, testUser); rpc.flushIndexQueue(); editor.logInAndEdit(testUser, testPage); LinkBrowser dialog = editor.openLinkBrowser(); dialog.selectTab(LinkBrowser.Tab.SEARCH); assertEquals("", dialog.getSpaceSelected()); dialog.typeInSearch("test"); dialog.clickSearchButton(); dialog.waitForDataTable(2); assertTrue(dialog.isPresentInSearchResults("space", testSpace.getName())); assertTrue(dialog.isPresentInSearchResults("space", testSpace2.getName())); dialog.selectSearchSpace(testSpace.getName()); dialog.clickSearchButton(); dialog.waitForDataTable(2); assertTrue(dialog.isPresentInSearchResults("space", testSpace.getName())); assertFalse(dialog.isPresentInSearchResults("space", testSpace2.getName())); }
/** * Change the selected space on the browse panel. */ public void selectSpaceOnBrowsePanel(Space space) { client.selectOption(NEW_SPACE_KEY_SELECT_ID, space.getName()); // CONF-19449 if (Browser.IE.equals(client.getBrowser())) { client.getEval("$('#" + NEW_SPACE_KEY_SELECT_ID + "').change()"); } waitForBrowsePanel(); waitForSpaceAtBrowseTreeRoot(space); }
public void testImageLinkedToSpace() { linkBrowser.typeInSearch(testSpace.getName()); linkBrowser.clickSearchButton(); linkBrowser.waitForDataTable(2); linkBrowser.selectFromDataTable(testSpace.getName()); linkBrowser.clickInsert(); assertTrue(tinyMce.isImagePresent(testImage)); assertTrue(tinyMce.isSelectorPresent("a img")); PageView view = editor.save(); view.clickOnEmbeddedImageLink(); assertTrue(view.isViewing(testSpace.getHomePage())); }
public void testConfluenceContentDropdownHasTooltips() throws Exception { MacroBrowser mb = editor.openMacroBrowser(); mb.selectMacro("include", false); String paramName = ""; mb.typeStringParam(paramName, testPage.getTitle()); mb.waitForDropDownForParameter(paramName); String toolip = testPage.getTitle() + " (" + testPage.getSpace().getName() + ")"; assertEquals(toolip, mb.getDropDownOptionTooltip(testPage.getTitle())); }
public void testToolTips() { // This tests the links in the browse menu, which isn't shown in the default theme anymore rpc.logIn(adminUser); rpc.setThemeForSpace(testUserPage.getSpace(), BundledTheme.DOCUMENTATION); rpc.logOut(); suite.viewPage(testUserPage); testForToolTip("#space-pages-link", "Browse pages in the " + testSpace.getName() + " space (g , s)"); testForToolTip(".view .show-labels-editor", "Edit Labels (l)"); testForToolTip("#view-attachments-link", "View Attachments (t)"); testForToolTip("#link-to-page-link", "Link to this Page (k)"); testForToolTip("#editPageLink", "Edit (e)"); }
public void testCurrentSpaceAppearsInOptionsWhenEditingBlog() { rpc.logIn(adminUser); rpc.grantPermission(SpacePermission.BLOG_EDIT, testSpace, testUser); editor.logInAndEdit(testUser, testBlogPost); LinkBrowser dialog = editor.openLinkBrowser(); dialog.selectTab(LinkBrowser.Tab.SEARCH); assertEquals("", dialog.getSpaceSelected()); dialog.selectSearchSpace(testSpace.getName()); assertEquals(testSpace.getKey(), dialog.getSpaceSelected()); }
public void testMoveSpace() throws Exception { Space monkeySpace = new Space("MKY", "Monkey Trousers", "A space about monkey trousers...or is it?"); rpc.createSpace(monkeySpace); Page monkeyHome = rpc.getExistingPage(monkeySpace, monkeySpace.getDefaultHomePageTitle()); rpc.grantPermission(SpacePermission.VIEW, monkeySpace, testUser); rpc.grantPermission(SpacePermission.PAGE_EDIT, monkeySpace, testUser); editor.logInAndCreatePage(testUser, testSpace); editor.setTitle("Page Title"); MovePageDialog dialog = editor.saveWithLocation(); dialog.selectBrowsePanel(); PageOrderingTree tree = dialog.getBrowseTree(); assertTrue(tree.isShowingPageWithName(testSpace.getName())); // top-level page initially dialog.selectSpaceOnBrowsePanel(monkeySpace); tree.clickPage(monkeyHome); dialog.waitForBreadcrumbs(monkeySpace, monkeyHome); dialog.clickOKButton(); assertThat.linkPresentWithText(monkeyHome.getTitle()); assertThat.linkPresentWithText(monkeySpace.getName()); } }
public void testBasic() { rpc.logIn(testUser); final String pageTitle = "flintstone bowling team"; final String pageTitle2 = "flintstone bowling meeting minutes"; rpc.createPage(new Page(testSpace, pageTitle, "")); rpc.createPage(new Page(testSpace, pageTitle2, "")); rpc.logIn(adminUser); rpc.flushIndexQueue(); suite.logIn(testUser, "/dashboard.action"); quickNavBox.type("fli"); quickNavBox.waitUntilVisible(); quickNavBox.waitForNumberOfResults(2); quickNavBox.waitForResultsToContainExactEntry(pageTitle); quickNavBox.waitForResultsToContainExactEntry(pageTitle2); quickNavBox.type("flintstone mee"); quickNavBox.waitForNumberOfResults(1); quickNavBox.waitForResultsToContainExactEntry(pageTitle2); assertEquals(pageTitle2 + " (" + testSpace.getName() + ")", quickNavBox.getResultTitle(pageTitle2)); quickNavBox.type("flintstone tea"); quickNavBox.waitForNumberOfResults(1); quickNavBox.waitForResultsToContainExactEntry(pageTitle); assertEquals(pageTitle + " (" + testSpace.getName() + ")", quickNavBox.getResultTitle(pageTitle)); }
public void testChangeParentOnTree() throws Exception { Page monkeyPage = new Page(testSpace, "Monkey Trousers", "For or from?"); rpc.createPage(monkeyPage); editor.logInAndCreatePage(testUser, testSpace); editor.setTitle("Gorilla Vest"); MovePageDialog dialog = editor.saveWithLocation(); dialog.selectBrowsePanel(); PageOrderingTree tree = dialog.getBrowseTree(); assertTrue(tree.isShowingPageWithName(testSpace.getName())); // top-level page tree.clickPage(monkeyPage); dialog.waitForBreadcrumbs(testSpace, monkeyPage); dialog.clickOKButton(); assertThat.linkPresentWithText(monkeyPage.getTitle()); }
public void testQuickSearchRespectsSpaceSelected() { // For some reason selecting the space *and* firing the event isn't triggering the change bind in IE. // It works for the old LB and works manually, but won't play nice here. dT if (Browser.IE.equals(client.getBrowser())) return; Space testSpace2 = new Space("AAA", "Another Test Space"); rpc.logIn(adminUser); rpc.createSpace(testSpace2); rpc.grantPermission(SpacePermission.VIEW, testSpace2, testUser); rpc.flushIndexQueue(); editor.logInAndEdit(testUser, testPage); LinkBrowser dialog = editor.openLinkBrowser(); dialog.selectTab(LinkBrowser.Tab.SEARCH); assertEquals("", dialog.getSpaceSelected()); dialog.quickSearch("tes"); assertTrue(dialog.isPresentInQuickSearch(testPage.getTitle())); assertTrue(dialog.isPresentInQuickSearch(testSpace2.getName())); dialog.escapeFromQuickSearch(); dialog.selectSearchSpace(testSpace.getName()); dialog.quickSearch("test"); assertTrue(dialog.isPresentInQuickSearch(testPage.getTitle())); assertFalse(dialog.isPresentInQuickSearch("Another")); }
public void testChangeLocation() throws Exception { editor.logInAndCreatePage(testUser, testSpace); editor.setTitle("Child page"); assertEquals(new Location(testSpace), editor.getLocation()); MovePageDialog dialog = editor.saveWithLocation(); dialog.selectLocationPanel(); dialog.parentPageAutocomplete("Another"); dialog.clickParentPageAutocomplete("Another page"); Location destination = new Location(testSpace, "Another page"); dialog.clickOKButton(); Breadcrumbs breadcrumbs = suite.getBreadcrumbs(rpc); assertEquals(destination.getParentPageTitle(), breadcrumbs.getParentCrumb().getTitle()); assertEquals(testSpace.getName(), breadcrumbs.getSpaceCrumb().getTitle()); }
public void testInsertLinkInPersonalSpace() { rpc.logIn(testUser); Space personalSpace = rpc.createPersonalSpace(testUser); rpc.logIn(adminUser); rpc.flushIndexQueue(); editor.logInAndCreatePage(testUser, personalSpace); editor.getTinyMce().editorContentFocus(); LinkBrowser dialog = editor.openLinkBrowser(); dialog.selectTab(LinkBrowser.Tab.SEARCH); Page homePage = personalSpace.getHomePage(); dialog.typeInSearch(homePage.getTitle()); dialog.selectSearchSpace(personalSpace.getName()); dialog.clickSearchButton(); dialog.waitForDataTable(1); dialog.selectFromDataTable(homePage.getTitle()); dialog.clickInsert(); assertThat.assertLinkInserted(homePage.getTitle(), homePage); }