@Override protected void setUp() throws Exception { super.setUp(); // set up test page rpc.logIn(adminUser); testPage.setContent( "h2. Heading\n" + "[(<Funky *Monkey* Text>)|" + testSpace.getDefaultHomePageTitle() + "]\n" + "Ch{_}e{_}ese\n" + "h3. Wat\n" + "[Wat Heading|#Wat]\n" + "[Cool Koala|New Page]\n" + EXTERNAL_LINK); rpc.savePage(testPage); defaultUser = testUserWithApostrophe; editor.logInAndEdit(defaultUser, testPage); }
/** * Tests that breadcrumbs don't appear as "..." even if there is plenty of room. This is a timing issue and will only * fail intermittently if there is a problem (It will never fail if everything is working properly). */ public void testNoEllipsis() { testPage.setContent("ABC, it's [e{*}as{*}y|" + testSpace.getDefaultHomePageTitle() + "] as 123"); rpc.logIn(testUser); rpc.savePage(testPage); editor.logInAndEdit(testUser, testPage); assertThat.linkPresentWithText("easy"); // Place the cursor somewhere inside the link. The only way I could find to do this was to make an element // inside the link and collapse at the start of it, hence the bold "as". editor.getTinyMce().putCursorAtStartOfFirstElementWithSelector("a strong"); LinkBrowser dialog = editor.openLinkBrowser(); String breadcrumbsText = dialog.getBreadcrumbsText(); assertTrue(breadcrumbsText.indexOf("...") == -1); }
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()); } }