Examples of AdministrationSectionPage


Examples of org.xwiki.administration.test.po.AdministrationSectionPage

        if (!initialized) {
            // We have to go to sender page before any config shows up.
            InvitationSenderPage.gotoPage();

            AdministrationSectionPage config = AdministrationSectionPage.gotoPage("Invitation");
            // Set port to 3025
            config.getForm().setFieldValue(By.id("Invitation.InvitationConfig_Invitation.WebHome_0_smtp_port"),
                "3025");
            // Make sure that by default we don't allow non admin to send emails to multiple addresses
            config.getForm().setFieldValue(By.id("Invitation.InvitationConfig_Invitation.WebHome_0_"
                + "usersMaySendToMultiple"), "false");
            config.clickSave();

            // Make sure the users we're registering in testAcceptInvitation and testAcceptInvitationToCloseWiki don't
            // exist.
            // TODO: Fix this whole mess of having try/finally blocks in tests below which is an anti pattern. Instead
            // we need to separate tests by fixture.
View Full Code Here

Examples of org.xwiki.administration.test.po.AdministrationSectionPage

    public void testUnpermittedUserCannotSendToMultipleAddresses() throws Exception
    {
        TestUtils.Session admin = getUtil().getSession();

        // Make sure users don't have the right to send to multiple.
        AdministrationSectionPage config = AdministrationSectionPage.gotoPage("Invitation");
        config.getForm().setFieldValue(By.id("Invitation.InvitationConfig_Invitation.WebHome_0_"
            + "usersMaySendToMultiple"), "false");
        config.clickSave();

        try {
            getUtil().forceGuestUser();
            getUtil().createUserAndLogin("NonMailAdminUser", "WeakPassword");
            setSenderPage(InvitationSenderPage.gotoPage());
            startGreenMail();
            getSenderPage().fillForm("user@localhost.localdomain anotheruser@localhost.localdomain", null, null);
            InvitationSenderPage.InvitationSentPage sent = getSenderPage().send();
            getGreenMail().waitForIncomingEmail(2000, 2);
            MimeMessage[] messages = getGreenMail().getReceivedMessages();
            Assert.assertTrue("Messages were received when they shouldn't have been sent!", messages.length == 0);
            Assert.assertTrue("User was not shown the correct error message.",
                sent.getMessageBoxContent().equals("Your message couldn't be sent because there were no valid email "
                + "addresses to send to."));
            stopGreenMail();

            // Become admin and allow users to send to multiple.
            TestUtils.Session nonAdmin = getUtil().getSession();
            getUtil().setSession(admin);
            config = AdministrationSectionPage.gotoPage("Invitation");
            config.getForm().setFieldValue(By.id("Invitation.InvitationConfig_Invitation.WebHome_0_"
                + "usersMaySendToMultiple"), "true");
            config.clickSave();
            getUtil().setSession(nonAdmin);

            // Prove that the user can now send to multiple recipients.
            startGreenMail();
            setSenderPage(InvitationSenderPage.gotoPage());
View Full Code Here

Examples of org.xwiki.administration.test.po.AdministrationSectionPage

    public void testSendManyToOneAddress() throws Exception
    {
        TestUtils.Session admin = getUtil().getSession();
        try {
            // Allow users to send to multiple.
            AdministrationSectionPage config = AdministrationSectionPage.gotoPage("Invitation");
            config.getForm().setFieldValue(By.id("Invitation.InvitationConfig_Invitation.WebHome_0_"
                + "usersMaySendToMultiple"), "true");
            config.clickSave();

            // Now switch to a wizeguy user
            getUtil().forceGuestUser();
            getUtil().createUserAndLogin("tr0ll", "StrongPassword");
            setSenderPage(InvitationSenderPage.gotoPage());
View Full Code Here

Examples of org.xwiki.administration.test.po.AdministrationSectionPage

        this.registrationPage = this.getRegistrationPage();

        // Switch LiveValidation on or off as needed.
        int x = 0;
        while (this.registrationPage.isLiveValidationEnabled() != useLiveValidation()) {
            AdministrationSectionPage sectionPage = new AdministrationSectionPage("Registration");
            getDriver().get(getUtil().getURLToLoginAsAdminAndGotoPage(sectionPage.getURL()));
            getUtil().recacheSecretToken();
            getUtil().assertOnPage(sectionPage.getURL());
            sectionPage.getForm().setFieldValue(By.name("XWiki.Registration_0_liveValidation_enabled"),
                Boolean.valueOf(useLiveValidation()).toString());
            sectionPage.clickSave();
            if (x > 2) {
                throw new WebDriverException("Unable to set useLiveValidation to " + useLiveValidation());
            }
            x++;
            this.registrationPage = this.getRegistrationPage();
View Full Code Here

Examples of org.xwiki.test.ui.administration.elements.AdministrationSectionPage

        registerPage.gotoPage();

        // Switch LiveValidation on or off as needed.
        int x = 0;
        while (registerPage.liveValidationEnabled() != useLiveValidation()) {
            AdministrationSectionPage sectionPage = new AdministrationSectionPage("Registration");
            getDriver().get(getUtil().getURLToLoginAsAdminAndGotoPage(sectionPage.getURL()));
            getUtil().recacheSecretToken();
            getUtil().assertOnPage(sectionPage.getURL());
            sectionPage.getForm().setFieldValue(By.name("XWiki.Registration_0_liveValidation_enabled"),
                Boolean.valueOf(useLiveValidation()).toString());
            sectionPage.clickSave();
            if (x > 2) {
                throw new WebDriverException("Unable to set useLiveValidation to " + useLiveValidation());
            }
            x++;
            registerPage.gotoPage();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.