public boolean recentUpdatesContainsUpdateByUser(User user) { final String expectedText = user == null || user.isAnonymous()? "Anonymous" : user.getFullName(); return client.getText(UPDATES_MACRO_CONTENT_LOCATOR + " li.grouping .update-items h3").equals(expectedText); }
public void testUserBreadcrumb() { //TODO seems to fail in OnDemand mode if (TestProperties.isOnDemandAlaCarte()) return; String fullName = testUser.getFullName(); doBreadcrumbTest(fullName); }
public void testPersonalSpace() { rpc.createPersonalSpace(testUser); rpc.flushIndexQueue(); spacePicker.type(testUser.getFullName()); spacePicker.waitForResultsToContainExactEntry(testUser.getFullName()); }
public void selectUser(User user) { selectItem(user.getFullName() + " (" + user.getUsername() + ")"); }
public void waitForResultsToContainUser(User user) { waitForItem(user.getFullName() + " (" + user.getUsername() + ")"); }
public void testUsernameField() throws Exception { //TODO fails in OnDemand if (TestProperties.isOnDemandAlaCarte()) return; fieldTest("content-by-user", "", testUser.getFullName(), testUser.getUsername()); }
public void testUserLink() { if (Browser.IE.equals(client.getBrowser())) { return; } editor.createPage(testSpace); testContent = testUserWithApostrophe; searchText = "Pad"; link = new EditorLink("userinfo", testUserWithApostrophe.getFullName(), "/display/~" + testUserWithApostrophe.getUsername()); runAutocomplete(); }
public void testBasicHeartbeat() { editor.logInAndEdit(testUser, testPage); suite.logOut(); editor.logInAndEdit(testUser2, testPage); editor.waitForHeartbeatMessage(); assertThat.textPresent("This page is also being edited by"); assertThat.textPresent(testUser.getFullName()); suite.logOut(); editor.logInAndEdit(testUser, testPage); editor.waitForHeartbeatMessage(); assertThat.textPresent("This page is also being edited by"); assertThat.textPresent(testUser2.getFullName()); }
public void testImageLinkedToUser() { linkBrowser.typeInSearch(testUser.getFullName()); linkBrowser.clickSearchButton(); linkBrowser.waitForDataTable(1); linkBrowser.selectFromDataTable(testUser.getFullName()); linkBrowser.clickInsert(); assertTrue(tinyMce.isImagePresent(testImage)); assertTrue(tinyMce.isSelectorPresent("a img")); PageView view = editor.save(); view.clickOnEmbeddedImageLink(); assertTrue(view.isViewing(testUser)); } }
public void testStatusMenuItem() { suite.logIn(testUser); new DashboardSeleniumHelper(client, UpdatesTab.ALL); assertThat.elementNotVisible(adminUserHover.getId()); adminUserHover.mouseOver(); adminUserHover.openMenu(); adminUserHover.clickLinkWithClass("user-status-link"); assertThat.textPresent("Status Updates for " + adminUser.getFullName()); }
public void testProfileMenuItem() { suite.logIn(adminUser); new DashboardSeleniumHelper(client, UpdatesTab.ALL); assertThat.elementNotVisible(adminUserHover.getId()); adminUserHover.mouseOver(); adminUserHover.openMenu(); adminUserHover.clickLinkWithClass("user-profile-link"); assertThat.pageTitleEquals(adminUser.getFullName()); }
public void todoTestFollowUser() { // can't make this stupid test pass - I'm at my wits end! writing a test shouldn't take half a day! // This is because when the selenium client clicks on the dropdown item, // the hidden username parameter is not populated suite.logIn(adminUser, "/users/viewfollow.action?username=admin"); AuthorAutocompleteTextField followUserBox = new AuthorAutocompleteTextField("name=follow-autocomplete", client); followUserBox.typeUserName(adminUser.getUsername()); followUserBox.waitForResultsToContainUser(adminUser); followUserBox.selectUser(adminUser); client.clickButtonWithName("follow", false); assertThat.textPresent("Now following " + adminUser.getFullName()); followUserBox.typeUserName("admin"); followUserBox.waitForResultsToContainUser(adminUser); followUserBox.selectUser(adminUser); client.clickButtonWithName("follow", false); assertThat.textPresent("Already following " + adminUser.getFullName()); }
public void testUserPickerInGlobalPerms() { suite.logIn(adminUser, "/admin/permissions/editglobalpermissions.action"); client.click("userpicker-popup-link"); popup = new UserPickerPopup(client); popup.switchToUserTab(); popup.searchForUsers(sampleUser.getUsername().substring(0, 4)); assertThat.textPresent(sampleUser.getFullName()); popup.select(sampleUser); popup.addUsers(); String destination = client.getEval("$('#usersToAdd').val()"); assertEquals(sampleUser.getUsername(), destination); }
public void setUserDetails(User user) { client.typeInElementWithId("username", user.getName()); client.typeInElementWithId("fullname", user.getFullName()); client.typeInElementWithId("email", user.getEmail()); client.typeInElementWithId("password", user.getPassword()); client.typeInElementWithId("confirmpassword", user.getPassword()); }
public void testUserPickerInSpacePerms() { suite.logIn(adminUser, "/spaces/editspacepermissions.action?key=" + testSpace.getKey()); client.click("userpicker-popup-link"); popup = new UserPickerPopup(client); popup.switchToUserTab(); popup.searchForUsers(sampleUser.getUsername().substring(0, 4)); assertThat.textPresent(sampleUser.getFullName()); popup.select(sampleUser); popup.addUsers(); String destination = client.getEval("$('#users-to-add-autocomplete').val()"); assertEquals(sampleUser.getUsername(), destination); }
public void disabled_testSearchUsingApostrophes() { searchText = "O'Brien"; Page apostrophePage = new Page(testSpace, "O'Brien's rules for World Domination", "There are no rules"); rpc.createPage(apostrophePage); rpc.flushIndexQueue(); editor.edit(testPage); tinyMce.selectEmptyFirstParagraph(); // Check should be case-insensitive setAndSelectText(searchText.toLowerCase()); editorAutocomplete = triggerWithShortcut(); editorAutocomplete.waitForNthResultToContain(0, getPageResultTitle(apostrophePage)); editorAutocomplete.waitForNthResultToContain(1, testUserWithApostrophe.getFullName()); assertEquals(2, editorAutocomplete.getNumberOfResults()); }
public void testUserPickerPopupInManageGroups() { suite.logIn(adminUser, "/admin/users/domembersofgroupsearch.action?membersOfGroupTerm=confluence-administrators"); client.click("css=.add-user"); client.click("popup-link"); popup = new UserPickerPopup(client); popup.searchForUsers(sampleUser.getUsername()); assertThat.textPresent(sampleUser.getFullName()); popup.select(sampleUser); popup.addUsers(); String destination = client.getEval("$('#usersToAdd').val()"); assertEquals(sampleUser.getUsername(), destination); } }
public void testPageAuthorWithAttachmentOnCreate() throws InterruptedException { editor.logInAndCreatePage(testUser, testSpace); // trigger a draft String title = "Drafts and Attachments"; editor.setTitle(title); editor.setContent("Together in eternal harmony"); rpc.logIn(adminUser); rpc.grantPermission(SpacePermission.ATTACHMENT_CREATE, testSpace, testUser); AttachTo attachTo = new AttachTo(client, rpc); Attachment attachment = attachTo.draftFromEditor(TEST_ATTACHMENT, Attachment.PNG_TYPE, testUser, testSpace); editor.insertImage(attachment); assertTrue(tinyMce.isImagePresent(attachment)); editor.triggerDraftAutoSave(); // save the draft editor.save(); assertThat.textPresent(title); assertThat.textPresent("Created by " + testUser.getFullName()); assertThat.textNotPresent("Anonymous"); assertThat.imagePresent(TEST_ATTACHMENT); client.click("view-attachments-link", true); assertThat.elementContainsText("css=a.filename", TEST_ATTACHMENT); assertThat.elementWithXpathContainsText( "//table[contains(@class, 'attachments')]//a[contains(@class, 'confluence-userlink')]", testUser.getFullName()); }
public void testMerge() throws IOException, SAXException { editor.logInAndEdit(testUser, testPage); editor.setContent("a"); //we must make a change using the "setContent" or we can not save a draft. The setHtmlContent does not constitute a change and thus no draft will be saved. editor.setHtmlContent("<p>" + testPage.getContent() + "</p>\\n<p>With an addition</p>"); editor.triggerDraftAndCheckUserDrafts(testPage); suite.logOut(); editor.logInAndEdit(User.TEST2, testPage); editor.setHtmlContent("<p>A prefix</p>\\n<p>" + testPage.getContent() + "</p>"); assertThat.infoVisibleWithText("This page is also being edited by " + testUser.getFullName()); editor.save(); suite.logOut(); editor.logInAndEdit(testUser, testPage); assertThat.infoVisibleWithText("The page has since been updated. Your changes will be merged with the latest version."); editor.merge(); assertThat.infoNotVisible(); final PageView view = editor.save(); final String expected = ("<p>A prefix</p><p>" + testPage.getContent() + "</p><p>With an addition</p>").toLowerCase(); assertEquals(expected, view.getNormalisedContent()); }
client.typeInElementWithName("password", adminUser.getPassword()); client.typeInElementWithName("confirm", adminUser.getPassword()); client.typeInElementWithName("fullName", adminUser.getFullName()); client.typeInElementWithName("email", adminUser.getEmail());