@Before public void setUp() { String userName = RandomStringUtils.randomAlphanumeric(5); ProfileUserProfilePage profilePage = new ProfileUserProfilePage(userName); getUtil().registerLoginAndGotoPage(profilePage.getUsername(), "password", profilePage.getURL()); this.watchlistPage = profilePage.switchToWatchlist(); this.testSpace = this.watchlistPage.getUsername() + "Test"; }
@Override @Before public void setUp() { super.setUp(); // Set the SMTP port to the default port used by Greenmail (3025) getUtil() .updateObject("XWiki", "XWikiPreferences", "XWiki.XWikiPreferences", 0, "smtp_port", 3025); // Start GreenMail test server this.greenMail = new GreenMail(); this.greenMail.start(); // Create a user for the test String userName = RandomStringUtils.randomAlphanumeric(5); this.profilePage = new ProfileUserProfilePage(userName); getUtil().registerLoginAndGotoPage(profilePage.getUsername(), "password", profilePage.getURL()); // Set the Admin user's email address to use a localhost domain so that the mail is caught by // our // GreenMail Mock mail server. getUtil() .updateObject( "XWiki", this.profilePage.getUsername(), "XWiki.XWikiUsers", 0, "email", "admin@localhost"); this.watchlistPage = this.profilePage.switchToWatchlist(); // Disable auto watch WatchlistPreferencesEditPage watchlistPreferences = this.watchlistPage.editPreferences(); watchlistPreferences.setAutomaticWatchNone(); watchlistPreferences.clickSaveAndContinue(); }