@Override protected String getTitle() { return page.getTitle(); }
public void testConfluenceContentField() throws Exception { fieldTest("contributors", "page", testPage.getTitle(), testPage.getTitle()); // Test the ConfluenceContent field for content in a different space Space monkeySpace = new Space("MKY", "Monkey Trousers"); rpc.createSpace(monkeySpace); rpc.grantPermission(SpacePermission.VIEW, monkeySpace, testUser); Page monkeyPage = new Page(monkeySpace, "tweet", "munky trousers!"); rpc.createPage(monkeyPage); rpc.flushIndexQueue(); fieldTest("contributors", "page", monkeyPage.getTitle(), monkeySpace.getKey() + ":" + monkeyPage.getTitle()); }
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); }
private Comment setupRpcComment() { String content = "I can't believe it's not butter"; Comment comment = new Comment(testPage, content); //add comment as test user rpc.logIn(defaultUser); rpc.createComment(comment); rpc.logOut(); return comment; }
public void testUsernameField() throws Exception { //TODO fails in OnDemand if (TestProperties.isOnDemandAlaCarte()) return; fieldTest("content-by-user", "", testUser.getFullName(), testUser.getUsername()); }
private String getPermissionRowSelectorJS(ContentPermission contentPermission, String tableSelector) { String rowSelector = "." + contentPermission.getPermissionType().lowerValue() + "-permission-row"; String username = GeneralUtil.escapeForJavascript(contentPermission.getEntity().getName()); return "$('" + tableSelector + " " + rowSelector + "')" + ".filter(function(){return $('.permission-entity-name',this).text() == '" + username + "'})" + ".closest('tr')"; }
/** * Located at the root of a space (i.e. no parent page). */ public Location(Space space) { this(space.getKey(), ""); }
/** * Returns the sort alphabetical link locator for the given page. */ public String getSortAlphabeticallyLocator(Page page) { return "css=li#node-" + page.getId() + " a.abc"; }
public UserHoverPopup(ConfluenceSeleniumClient client, User user) { this.client = client; this.username = user.getUsername(); }
public void testUserBreadcrumb() { //TODO seems to fail in OnDemand mode if (TestProperties.isOnDemandAlaCarte()) return; String fullName = testUser.getFullName(); doBreadcrumbTest(fullName); }
public void testSearchForInQuickSearch() { String searchTerm = testSpace.getHomePage().getTitle(); editor.logInAndEdit(testUser, testPage); LinkBrowser dialog = editor.openLinkBrowser(); dialog.selectTab(LinkBrowser.Tab.SEARCH); dialog.quickSearch(searchTerm); dialog.selectFromQuickSearch("Search for"); dialog.waitForDataTable(1); }
public void deleteAllContentBlueprints(User user) throws JSONException { RestHelper.doDeleteJson(baseUrl + CONTENT_BLUEPRINTS_REST_PATH + "/deleteAll", user); // TODO - return number of records deleted? }
@Override protected String getEntityId() { return page.getIdAsString(); }
public String getEditSpaceStylesheetUrl(Space space) { return "/spaces/editstylesheet.action?key=" + space.getKey(); } }
private String getPageGadgetMacroMarkupForPage(Page page) { return GADGET_MARKUP_MACRO_START + GADGET_MARKUP_MACRO_BODY + page.getId() + GADGET_MARKUP_MACRO_END; }
public void deleteAll(User user) throws JSONException { RestHelper.doDeleteJson(baseUrl + CONTENT_BLUEPRINTS_REST_PATH + "/deleteAll", user); // TODO - return number of records deleted? }
public Location(Space space, String parentPageTitle) { this(space.getKey(), parentPageTitle); }
public void deleteAllSpaceBlueprints(User user) throws JSONException { RestHelper.doDeleteJson(baseUrl + SPACE_BLUEPRINTS_REST_PATH + "/deleteAll", user); // TODO - return number of records deleted? }