Examples of InvitationGuestActionsPage


Examples of org.xwiki.invitation.test.po.InvitationGuestActionsPage

        try {
            getUtil().forceGuestUser();

            // Try to accept nonexistent message.
            getUtil().gotoPage("Invitation", "InvitationGuestActions", "view", "doAction_accept&messageID=12345");
            InvitationGuestActionsPage guestPage = new InvitationGuestActionsPage();
            Assert.assertNotNull("Guests able to accept nonexistent invitation", guestPage.getMessage());
            Assert.assertEquals("No message was found by the given ID. It might have been deleted "
                + "or maybe the system is experiencing difficulties.", guestPage.getMessage());

            // Try to decline nonexistent message.
            getUtil().gotoPage("Invitation", "InvitationGuestActions", "view", "doAction_decline&messageID=12345");
            Assert.assertNotNull("Guests able to decline nonexistent invitation", guestPage.getMessage());
            Assert.assertEquals("No invitation was found by the given ID. It might have been deleted or "
                + "maybe the system is experiencing difficulties.", guestPage.getMessage());

            // Try to report nonexistent message.
            getUtil().gotoPage("Invitation", "InvitationGuestActions", "view", "doAction_report&messageID=12345");
            Assert.assertNotNull("Guests able to report nonexistent invitation as spam", guestPage.getMessage());
            Assert.assertEquals("There was no message found by the given ID. Maybe an administrator "
                + "deleted the message from our system.", guestPage.getMessage());
        } finally {
            getUtil().setSession(s);
        }
    }
View Full Code Here

Examples of org.xwiki.invitation.test.po.InvitationGuestActionsPage

            // Now switch to guest.
            TestUtils.Session spammer = getUtil().getSession();
            getUtil().forceGuestUser();

            InvitationGuestActionsPage guestPage =
                InvitationGuestActionsPage.gotoPage(htmlMessage, InvitationGuestActionsPage.Action.REPORT);
            guestPage.setMemo("It's the email lottery, they have taken over your server!");
            guestPage.confirm();
            Assert.assertTrue("Failed to report spam",
                guestPage.getMessage().contains("Your report has been logged and the situation"));

            // Prove that a reported message cannot be accepted (which would clear the "reported" status)
            guestPage = InvitationGuestActionsPage.gotoPage(htmlMessage, InvitationGuestActionsPage.Action.ACCEPT);
            Assert.assertTrue("After a message is reported a user can accept it, clearing the spam report",
                guestPage.getMessage().equals("This invitation has been reported as spam and is no longer valid."));
            // Prove that a reported message cannot be declined
            guestPage = InvitationGuestActionsPage.gotoPage(htmlMessage, InvitationGuestActionsPage.Action.DECLINE);
            Assert.assertTrue("After a message is reported a user can decline it, clearing the spam report",
                guestPage.getMessage().equals("This invitation has already been reported as "
                + "spam and thus cannot be declined."));
            // Switch to admin
            getUtil().setSession(admin);
            // Go to invitation sender.
            setSenderPage(InvitationSenderPage.gotoPage());
View Full Code Here

Examples of org.xwiki.invitation.test.po.InvitationGuestActionsPage

            Assert.assertTrue("New invitation is not listed as pending in the footer.",
                getSenderPage().getFooter().myPendingInvitations() == 1);
            // Now switch to guest.
            getUtil().forceGuestUser();

            InvitationGuestActionsPage guestPage =
                InvitationGuestActionsPage.gotoPage(htmlMessage, InvitationGuestActionsPage.Action.DECLINE);
            guestPage.setMemo("I'm not interested thank you.");
            guestPage.confirm();
            Assert.assertTrue("Failed to decline invitation",
                getDriver().getPageSource().contains("This invitation has successfully been declined."));
            // Switch to admin
            getUtil().setSession(admin);
            // Go to invitation sender.
            setSenderPage(InvitationSenderPage.gotoPage());
            Assert.assertTrue("Declined invitation is still listed as pending in the footer.",
                getSenderPage().getFooter().spamReports() == 0);

            // View declined invitation.
            InspectInvitationsPage inspectPage = getSenderPage().getFooter().inspectMyInvitations();
            InspectInvitationsPage.OneMessage inspect = inspectPage.getMessageWhere("Status", "Declined");

            Assert.assertTrue("Not showing message box to say the invitation has been declined",
                inspect.getStatusAndMemo().equals("Declined with message: I'm not interested thank you."));

            // Insure the message history table is correct.
            TableElement messageHistoryTable = inspect.clickMessageHistory();
            List<WebElement> row2 = messageHistoryTable.getRow(2);
            Assert.assertTrue("Message history table not showing correctly.",
                row2.get(0).getText().equals("Declined"));
            Assert.assertTrue("Message history table not showing correctly.",
                row2.get(2).getText().equals("I'm not interested thank you."));

            // Make sure a guest can't accept the invitation now.
            getUtil().forceGuestUser();
            guestPage = InvitationGuestActionsPage.gotoPage(htmlMessage, InvitationGuestActionsPage.Action.ACCEPT);
            Assert.assertTrue("After a message is declined a user can still accept it!",
                guestPage.getMessage().equals("This invitation has been declined and cannot be accepted now."));
            // Try to decline the invitation.
            guestPage = InvitationGuestActionsPage.gotoPage(htmlMessage, InvitationGuestActionsPage.Action.DECLINE);
            Assert.assertTrue("User was allowed to decline an invitation twice.",
                guestPage.getMessage().equals("This invitation has already been declined and "
                + "cannot be declined again."));
            // Prove that the message can still be reported as spam
            guestPage = InvitationGuestActionsPage.gotoPage(htmlMessage, InvitationGuestActionsPage.Action.REPORT);
            Assert.assertTrue("After the invitation was declined it now cannot be reported as spam.",
                guestPage.getMessage().equals(""));
        } finally {
            stopGreenMail();
            getUtil().setSession(admin);
        }
    }
View Full Code Here

Examples of org.xwiki.invitation.test.po.InvitationGuestActionsPage

            Assert.assertTrue("New invitation is not listed as pending in the footer.",
                getSenderPage().getFooter().myPendingInvitations() == 1);
            // Now switch to guest.
            getUtil().forceGuestUser();

            InvitationGuestActionsPage guestPage =
                InvitationGuestActionsPage.gotoPage(htmlMessage, InvitationGuestActionsPage.Action.ACCEPT);
            Assert.assertTrue("There was an error message when accepting the invitation message:\n"
                + guestPage.getMessage(),
                guestPage.getMessage().equals(""));
            // Register a new user.
            RegistrationPage rp = new RegistrationPage();
            rp.fillRegisterForm(null, null, "InvitedMember", "WeakPassword", "WeakPassword", null);
            rp.clickRegister();
            Assert.assertTrue("There were failure messages when registering.",
                rp.getValidationFailureMessages().isEmpty());
            getDriver().get(getUtil().getURLToLoginAs("InvitedMember", "WeakPassword"));

            Assert.assertTrue("Failed to log user in after registering from invitation.", rp.isAuthenticated());

            // Now switch to guest again and try to accept the invitation again.
            getUtil().forceGuestUser();
            guestPage = InvitationGuestActionsPage.gotoPage(htmlMessage, InvitationGuestActionsPage.Action.ACCEPT);
            Assert.assertTrue("After the invitation was accepted a user was allowed to accept it again.",
                guestPage.getMessage().equals("This invitation has already been accepted and the "
                + "offer is no longer valid."));
            // Try to decline the invitation.
            guestPage = InvitationGuestActionsPage.gotoPage(htmlMessage, InvitationGuestActionsPage.Action.DECLINE);
            Assert.assertTrue("After the invitation was accepted a user was allowed to decline it.",
                guestPage.getMessage().equals("This invitation has already been accepted and "
                + "now cannot be declined."));
            // Prove that the message can still be reported as spam
            guestPage = InvitationGuestActionsPage.gotoPage(htmlMessage, InvitationGuestActionsPage.Action.REPORT);
            Assert.assertTrue("After the invitation was accepted it now cannot be reported as spam.",
                guestPage.getMessage().equals(""));
        } finally {
            stopGreenMail();
            getUtil().setSession(admin);
        }
    }
View Full Code Here

Examples of org.xwiki.invitation.test.po.InvitationGuestActionsPage

            Assert.assertTrue("New invitation is not listed as pending in the footer.",
                getSenderPage().getFooter().myPendingInvitations() == 1);
            // Now switch to guest.
            getUtil().forceGuestUser();

            InvitationGuestActionsPage guestPage =
                InvitationGuestActionsPage.gotoPage(htmlMessage, InvitationGuestActionsPage.Action.ACCEPT);
            Assert.assertTrue("There was an error message when accepting the invitation message:\n"
                + guestPage.getMessage(),
                guestPage.getMessage().equals(""));
            // Register a new user.
            RegistrationPage rp = new RegistrationPage();
            rp.fillRegisterForm(null, null, "AnotherInvitedMember", "WeakPassword", "WeakPassword", null);
            rp.clickRegister();
            Assert.assertTrue("There were failure messages when registering.",
View Full Code Here

Examples of org.xwiki.invitation.test.po.InvitationGuestActionsPage

            String commonPart = "\nAdministrator left you this message when rescinding the invitation.\n"
                + "Sorry, wrong email address.";

            // Prove that invitation cannot be accepted
            InvitationGuestActionsPage guestPage =
                InvitationGuestActionsPage.gotoPage(htmlMessage, InvitationGuestActionsPage.Action.ACCEPT);
            Assert.assertFalse("Guest was able to accept a message which had been canceled.",
                guestPage.getMessage().equals(""));
            Assert.assertEquals("We're sorry but this invitation has been rescinded." + commonPart,
                guestPage.getMessage());

            // Prove that invitation cannot be declined
            guestPage = InvitationGuestActionsPage.gotoPage(htmlMessage, InvitationGuestActionsPage.Action.DECLINE);
            Assert.assertFalse("Guest was able to decline a message which had been canceled.",
                guestPage.getMessage().equals(""));
            Assert.assertEquals("This invitation has been rescinded and thus cannot be declined." + commonPart,
                guestPage.getMessage());

            // Prove that the message report spam page still shows up.
            guestPage = InvitationGuestActionsPage.gotoPage(htmlMessage, InvitationGuestActionsPage.Action.REPORT);
            Assert.assertTrue("Guest was not able to report canceled invitation as spam",
                guestPage.getMessage().equals(""));
            guestPage.setMemo("Canceled message is spam.");
            Assert.assertEquals("Your report has been logged and the situation will "
                + "be investigated as soon as possible, we apologize for the inconvenience.", guestPage.confirm());
        } finally {
            stopGreenMail();
            getUtil().setSession(admin);
        }
    }
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.