private void runMainTitleTestWithTheme(String spaceId, BundledTheme themeKey) { try { Space space = new Space(spaceId, spaceId, spaceId); rpc.createSpace(space); rpc.setThemeForSpace(space, themeKey); rpc.grantPermissions(space, testUser, SpacePermission.VIEW, SpacePermission.PAGE_EDIT); runMainTitleTest(space); } finally { rpc.removeSpace(spaceId); } }
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(); }
@Override protected void setUp() throws Exception { super.setUp(); editor = new Editor(client, suite); rpc.logIn(User.ADMIN); rpc.removeDrafts(testUser); otherSpace = new Space("OtherSpace", "OtherSpace"); rpc.createSpace(otherSpace); rpc.grantPermission(SpacePermission.VIEW, otherSpace, testUser); rpc.grantPermission(SpacePermission.PAGE_EDIT, otherSpace, testUser); pageAttachment = getAttachment(testPage); rpc.createAttachment(pageAttachment); rpc.logOut(); }
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()); }
@Override protected void setUp() throws Exception { super.setUp(); rpc.logIn(adminUser); rpc.setGlobalTheme(BundledTheme.getDocumentationTheme()); disneySpace = new Space("DSNY", "Disney Space"); rpc.createSpace(disneySpace); rpc.grantPermissions(disneySpace, testUser, SpacePermission.VIEW); disneyPage = new Page(disneySpace, "Toy Story", "I like toys"); rpc.createPage(disneyPage); toyPage = new Page(testSpace, "Toy me", "Test the toys"); rpc.createPage(toyPage); rpc.flushIndexQueue(); }
public void testSpacePermission() { userHelper.createUser(limitedUser); Space restrictedSpace = new Space("RES", "Restricted Space"); rpc.createSpace(restrictedSpace); final String newContent = "Page restricted by space"; Page pageToViewInRestrictedSpace = new Page(restrictedSpace, "Page restricted by space", newContent); rpc.createPage(pageToViewInRestrictedSpace); pageWithGadget.setContent(getPageGadgetMacroMarkupForPage(pageToViewInRestrictedSpace)); rpc.savePage(pageWithGadget); // Grant page permission but not space permission to the page to view rpc.grantContentPermission(new ContentPermission(limitedUser, ContentPermissionType.VIEW), pageToViewInRestrictedSpace); rpc.grantContentPermission(new ContentPermission(adminUser, ContentPermissionType.VIEW), pageToViewInRestrictedSpace); rpc.grantPermission(SpacePermission.VIEW, testSpace, limitedUser); rpc.revokePermission(SpacePermission.VIEW, restrictedSpace, limitedUser); suite.logIn(limitedUser, pageWithGadget); assertPageGadgetHasPermissionMessage(); }
@Override protected void setUp() throws Exception { super.setUp(); this.editor = new Editor(client, suite); // set up images on test page rpc.logIn(adminUser); rpc.grantPermission(COMMENT, testSpace, testUser); rpc.createAttachment(testImage); rpc.createAttachment(testImage2); otherSpace = new Space("OTHER", "Other Space"); rpc.createSpace(otherSpace); rpc.grantAllPermissionsExceptAdmin(testUser, otherSpace); otherPage = new Page(otherSpace, "Other Page", "Hello world"); rpc.createPage(otherPage); otherAttachment1 = new Attachment(otherPage, "test night time.png", "image/png", "starryNight.png"); rpc.createAttachment(otherAttachment1); otherAttachment2 = new Attachment(otherPage, "other painting.png", "image/png", "starryNight.png"); rpc.createAttachment(otherAttachment2); rpc.flushIndexQueue(); }
@Override protected void setUp() throws Exception { super.setUp(); this.editor = new Editor(client, suite); this.tinyMce = editor.getTinyMce(); // set up images on test page rpc.logIn(adminUser); //make sure turn off dark feature before test helper = rpc.getDarkFeaturesHelper(); rpc.grantPermission(COMMENT, testSpace, testUser); rpc.createAttachment(testImage); rpc.createAttachment(testImage2); otherSpace = new Space("OTHER", "Other Space"); rpc.createSpace(otherSpace); rpc.grantAllPermissionsExceptAdmin(testUser, otherSpace); otherPage = new Page(otherSpace, "Other Page", "Hello world"); rpc.createPage(otherPage); otherAttachment1 = new Attachment(otherPage, "test night time.png", "image/png", "starryNight.png"); rpc.createAttachment(otherAttachment1); otherAttachment2 = new Attachment(otherPage, "other painting.png", "image/png", "starryNight.png"); rpc.createAttachment(otherAttachment2); otherAttachment3 = new Attachment(otherPage, "test pdf.pdf", "application/pdf", "unprintable.pdf"); rpc.createAttachment(otherAttachment3); rpc.flushIndexQueue(); }
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()); } }
assertThat.textPresent(newContent); Space restrictedSpace = new Space("RTD", "Restricted Space"); Page restrictedPage = new Page(restrictedSpace, "Hidden", "You can't see me"); rpc.createSpace(restrictedSpace);
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 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())); }
TestPlugins.setupTestPluginsForWebDriver(rpc); Space space = new Space("CACHE", "Test space", "for caching JS"); rpc.createSpace(space); rpc.flushIndexQueue();