r3639 - in trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it: . anonymousPoll creatorOnly everybody voterOnly
Author: tchemit Date: 2012-08-27 01:15:33 +0200 (Mon, 27 Aug 2012) New Revision: 3639 Url: http://chorem.org/repositories/revision/pollen/3639 Log: refs #742: Option to allow all users to show voting of others users (tests are ok for free polls) Added: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/AbstractIT.java trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/anonymousPoll/ trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/anonymousPoll/AnonymousFreePollByAdminIT.java trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/anonymousPoll/AnonymousFreePollByConnectedIT.java trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/anonymousPoll/AnonymousFreePollByNotConnectedIT.java trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/creatorOnly/ trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/creatorOnly/CreatorOnlyFreePollByAdminIT.java trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/creatorOnly/CreatorOnlyFreePollByConnectedIT.java trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/creatorOnly/CreatorOnlyFreePollByNotConnectedIT.java trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/everybody/ trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/everybody/EverybodyFreePollByAdminIT.java trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/everybody/EverybodyFreePollByConnectedIT.java trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/everybody/EverybodyFreePollByNotConnectedIT.java trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/voterOnly/ trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/voterOnly/VoterOnlyFreePollByAdminIT.java trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/voterOnly/VoterOnlyFreePollByConnectedIT.java trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/voterOnly/VoterOnlyFreePollByNotConnectedIT.java Removed: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/AnonymousFreePollByAnonymousIT.java Added: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/AbstractIT.java =================================================================== --- trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/AbstractIT.java (rev 0) +++ trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/AbstractIT.java 2012-08-26 23:15:33 UTC (rev 3639) @@ -0,0 +1,162 @@ +package org.chorem.pollen.ui.it; + +import org.chorem.pollen.bean.PollUri; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; + +/** + * Abstrac it for this it. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.4.5 + */ +public abstract class AbstractIT extends AbstractPollIT { + + /** Not connected vote uri. */ + protected final PollUri notConnectedVotePollUri; + + /** Connected user voter uri. */ + protected final PollUri connectedVotePollUri; + + /** Admin user voter uri. */ + protected final PollUri adminVotePollUri; + + protected AbstractIT(Class<? extends WebDriver> driverType, + String pollId, + String creatorId, + String notConnectedVoteId, + String userVoteId, + String adminVoteId) { + super(driverType, pollId, creatorId); + + notConnectedVotePollUri = newPollUri(notConnectedVoteId); + connectedVotePollUri = newPollUri(userVoteId); + adminVotePollUri = newPollUri(adminVoteId); + } + + protected final void canNotModifyAnyVote() { + checkCanNotModifiyVote(notConnectedVotePollUri); + checkCanNotModifiyVote(connectedVotePollUri); + checkCanNotModifiyVote(adminVotePollUri); + } + + protected final void canNotDeleteAnyVote() { + checkCanNotDeleteVote(notConnectedVotePollUri); + checkCanNotDeleteVote(connectedVotePollUri); + checkCanNotDeleteVote(adminVotePollUri); + } + + protected final void canSeeOnlyAdminVote() { + checkCanSeeVote(adminVotePollUri); + checkCanNotSeeVote(notConnectedVotePollUri); + checkCanNotSeeVote(connectedVotePollUri); + } + + protected final void canSeeOnlyConnectedVote() { + checkCanSeeVote(connectedVotePollUri); + checkCanNotSeeVote(notConnectedVotePollUri); + checkCanNotSeeVote(adminVotePollUri); + } + + protected final void canSeeOnlyNotConnectedVote() { + checkCanSeeVote(notConnectedVotePollUri); + checkCanNotSeeVote(connectedVotePollUri); + checkCanNotSeeVote(adminVotePollUri); + } + + protected final void canDeleteAdminVote() { + checkCanDeleteVote(adminVotePollUri); + checkCanNotDeleteVote(notConnectedVotePollUri); + checkCanNotDeleteVote(connectedVotePollUri); + } + + protected final void canDeleteConnectedVote() { + checkCanDeleteVote(connectedVotePollUri); + checkCanNotDeleteVote(notConnectedVotePollUri); + checkCanNotDeleteVote(adminVotePollUri); + } + + protected final void canDeleteNotConnectedVote() { + checkCanDeleteVote(notConnectedVotePollUri); + checkCanNotDeleteVote(connectedVotePollUri); + checkCanNotDeleteVote(adminVotePollUri); + } + + protected final void canModifyNotConnectedVote() { + checkCanModifiyVote(notConnectedVotePollUri); + checkCanNotModifiyVote(connectedVotePollUri); + checkCanNotModifiyVote(adminVotePollUri); + } + + protected final void canModifyUserVote() { + checkCanModifiyVote(connectedVotePollUri); + checkCanNotModifiyVote(notConnectedVotePollUri); + checkCanNotModifiyVote(adminVotePollUri); + } + + protected final void canModifyAdminVote() { + checkCanModifiyVote(adminVotePollUri); + checkCanNotModifiyVote(notConnectedVotePollUri); + checkCanNotModifiyVote(connectedVotePollUri); + } + + protected final void canNotSeeAnyVote() { + checkCanNotSeeVote(notConnectedVotePollUri); + checkCanNotSeeVote(connectedVotePollUri); + checkCanNotSeeVote(adminVotePollUri); + } + + protected final void canSeeAllVotes() { + checkCanSeeVote(notConnectedVotePollUri); + checkCanSeeVote(connectedVotePollUri); + checkCanSeeVote(adminVotePollUri); + } + + protected final void canDeleteAllVotes() { + checkCanDeleteVote(notConnectedVotePollUri); + checkCanDeleteVote(connectedVotePollUri); + checkCanDeleteVote(adminVotePollUri); + } + + protected void checkPollNotFoundInGrid(String pollId) { + checkNoElement(By.xpath("//td[@title=\"" + pollId + "\"]")); + } + + protected void checkPollFoundInGrid(String pollId) { + findElement(By.xpath("//td[@title=\"" + pollId + "\"]")); + } + + protected void checkCanNotSeeVote(PollUri uri) { + checkNoElement(By.id("vote_" + uri.getAccountId())); + } + + protected void checkCanSeeVote(PollUri uri) { + findElement(By.id("vote_" + uri.getAccountId())); + } + + protected void checkCanModifiyVote(PollUri uri) { + findElement(By.id("modifyVote_" + uri.getAccountId())); + } + + protected void checkCanNotModifiyVote(PollUri uri) { + checkNoElement(By.id("modifyVote_" + uri.getAccountId())); + } + + protected void checkCanDeleteVote(PollUri uri) { + findElement(By.id("deleteVote_" + uri.getAccountId())); + } + + protected void checkCanNotDeleteVote(PollUri uri) { + checkNoElement(By.id("deleteVote_" + uri.getAccountId())); + } + + protected void checkCanNotVote(PollUri uri) { + checkNoElement(By.id("voteForm_pollen_action_pollVote")); + checkNoElement(By.name("vote.choiceVoteToChoice[0].voteValue")); + } + + protected void checkCanVote(PollUri uri) { + findElement(By.id("voteForm_pollen_action_pollVote")); + findElement(By.name("vote.choiceVoteToChoice[0].voteValue")); + } +} Property changes on: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/AbstractIT.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Deleted: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/AnonymousFreePollByAnonymousIT.java =================================================================== --- trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/AnonymousFreePollByAnonymousIT.java 2012-08-26 23:14:26 UTC (rev 3638) +++ trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/AnonymousFreePollByAnonymousIT.java 2012-08-26 23:15:33 UTC (rev 3639) @@ -1,103 +0,0 @@ -package org.chorem.pollen.ui.it; - -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; - -/** - * Test a anonymous free poll created by a anonymous user. - * <p/> - * For that poll nobody can see votes. - * - * @author tchemit <chemit@codelutin.com> - * @since 1.4.5 - */ -public class AnonymousFreePollByAnonymousIT extends AbstractPollIT { - - public AnonymousFreePollByAnonymousIT(Class<? extends WebDriver> driverType) { - super(driverType, - "cacb52f4d49047b7a7aa24ec528fcc87", - "e814ba6e25174d5983ad796c400520f5"); - } - - @Test - public void checkSummaryPollPage() { - - // can not access to summary page with no pollId - gotoUrl(urlFixtures.summaryPoll(), urlFixtures.poll_required(), false); - - // can not access to summary page with no creatorId - gotoUrl(urlFixtures.summaryPoll(pollUri), urlFixtures.poll_creator_required(), false); - - // access to summary page - gotoUrl(urlFixtures.summaryPoll(adminPollUri), true); - - // user can vote (#voteUrl) - findElement(By.id("voteUrl")); - } - - @Test - public void checkModeratePollPage() { - - // can not access to moderate page with no pollId - gotoUrl(urlFixtures.moderatePoll(), urlFixtures.poll_required(), false); - - // can not access to moderate page with no creatorId - gotoUrl(urlFixtures.moderatePoll(pollUri), urlFixtures.poll_creator_required(), false); - - // access to moderate page - gotoUrl(urlFixtures.moderatePoll(adminPollUri), true); - - // can not vote - checkCanNotVote(); - - // can not see votes - checkCanNotSeeVote(); - } - - @Test - public void checkVoteForPage() { - - // access to votefor page with no accountId - gotoUrl(urlFixtures.voteforPoll(pollUri), true); - - // can vote - checkCanVote(); - - // can not see votes - checkCanNotSeeVote(); - } - - @Test - public void checkVoteForPageWithCreatorId() { - - // access to votefor page with creatorId - gotoUrl(urlFixtures.voteforPoll(adminPollUri), true); - - // can not vote - checkCanNotVote(); - - // can not see votes - checkCanNotSeeVote(); - } - - protected void checkCanNotSeeVote() { - checkNoElement(By.className("voted")); - checkNoElement(By.className("notVoted")); - } - - protected void checkCanSeeVote() { - findElement(By.className("voted")); - findElement(By.className("notVoted")); - } - - protected void checkCanNotVote() { - checkNoElement(By.id("voteForm_pollen_action_pollVote")); - checkNoElement(By.name("vote.choiceVoteToChoice[0].voteValue")); - } - - protected void checkCanVote() { - findElement(By.id("voteForm_pollen_action_pollVote")); - findElement(By.name("vote.choiceVoteToChoice[0].voteValue")); - } -} Added: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/anonymousPoll/AnonymousFreePollByAdminIT.java =================================================================== --- trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/anonymousPoll/AnonymousFreePollByAdminIT.java (rev 0) +++ trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/anonymousPoll/AnonymousFreePollByAdminIT.java 2012-08-26 23:15:33 UTC (rev 3639) @@ -0,0 +1,197 @@ +package org.chorem.pollen.ui.it.anonymousPoll; + +import org.chorem.pollen.ui.it.AbstractIT; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; + +/** + * Test a anonymous free poll created by an administrator. + * <p/> + * For that poll nobody can see votes. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.4.5 + */ +public class AnonymousFreePollByAdminIT extends AbstractIT { + + public AnonymousFreePollByAdminIT(Class<? extends WebDriver> driverType) { + super(driverType, + "87cb5b1529374ac0b8c6b7f0b98e169c", + "65a3caf0bf204226bfcd259c69e56ca8", + "a0ff6892a28b4a65809b16cd8903245e", + "fd47e01378354fcaa220a4ffd0974417", + "010f05042ff3485c834d1ecdc4d17f1e"); + } + + @Test + public void checkSummaryPollPage() { + + // can not access to summary page with no pollId + gotoUrl(urlFixtures.summaryPoll(), urlFixtures.poll_required(), false); + + // can not access to summary page with no creatorId + gotoUrl(urlFixtures.summaryPoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to summary page + gotoUrl(urlFixtures.summaryPoll(creatorUri), true); + + // user can vote (#voteUrl) + findElement(By.id("voteUrl")); + } + + @Test + public void checkModeratePollPage() { + + // can not access to moderate page with no pollId + gotoUrl(urlFixtures.moderatePoll(), urlFixtures.poll_required(), false); + + // can not access to moderate page with no creatorId + gotoUrl(urlFixtures.moderatePoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to moderate page + gotoUrl(urlFixtures.moderatePoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can not see votes + canNotSeeAnyVote(); + + // connect as user + adminLogin(); + + // can not access to moderate page with no creatorId + gotoUrl(urlFixtures.moderatePoll(pollUri), false); + } + + @Test + public void checkVoteForPageWithCreatorId() { + + // access to votefor page with creatorId + gotoUrl(urlFixtures.voteforPoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can not see votes + canNotSeeAnyVote(); + } + + @Test + public void checkVoteForPageWithNoAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can vote + checkCanVote(pollUri); + + // can not see votes + canNotSeeAnyVote(); + } + + @Test + public void checkVoteWithNotConnectedVoteAccountId() { + + // access to votefor page with notConnected voter + gotoUrl(urlFixtures.voteforPoll(notConnectedVotePollUri), true); + + // can not see votes + canNotSeeAnyVote(); + + // can vote + checkCanVote(notConnectedVotePollUri); + + //TODO Fix this with http://chorem.org/issues/795 + // can modifiy his vote +// checkCanModifiyVote(notConnectedVotePollUri); + } + + @Test + public void checkVoteWithConnectedVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(connectedVotePollUri), true); + + // can not see votes + canNotSeeAnyVote(); + + // can vote + checkCanVote(connectedVotePollUri); + + //TODO Fix this with http://chorem.org/issues/795 + // can modifiy his vote +// checkCanModifiyVote(connectedVotePollUri); + + //TODO Fix this with http://chorem.org/issues/795 +// // can delete his vote +// checkCanDeleteVote(connectedVotePollUri); + // connect as user + userLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can not see votes + canNotSeeAnyVote(); + + // can vote + checkCanVote(connectedVotePollUri); + + // can not modifiy his vote (with no accountId, anonymous poll can not find the vote) + canNotModifyAnyVote(); + + // can not his vote (with no accountId, anonymous poll can not find the vote) + canNotDeleteAnyVote(); + + // poll not present in participant poll (anonymous poll) + gotoUrl(urlFixtures.participatedList(), true); + + checkPollNotFoundInGrid(pollId); + } + + @Test + public void checkVoteWithAdminVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(adminVotePollUri), true); + + // can not see votes + canNotSeeAnyVote(); + + // can vote + checkCanVote(adminVotePollUri); + + //TODO Fix this with http://chorem.org/issues/795 +// // can modifiy his vote +// checkCanModifiyVote(adminVotePollUri); + + //TODO Fix this with http://chorem.org/issues/795 +// // can delete his vote +// checkCanDeleteVote(adminVotePollUri); + + // connect as admin + adminLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can not see votes + canNotSeeAnyVote(); + + // can vote + checkCanVote(adminVotePollUri); + + // can not modifiy his vote (with no accountId, anonymous poll can not find the vote) + canNotModifyAnyVote(); + + // can not delete his vote (with no accountId, anonymous poll can not find the vote) + canNotDeleteAnyVote(); + + // poll not present in participant poll (anonymous poll) + gotoUrl(urlFixtures.participatedList(), true); + + checkPollNotFoundInGrid(pollId); + } +} Property changes on: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/anonymousPoll/AnonymousFreePollByAdminIT.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/anonymousPoll/AnonymousFreePollByConnectedIT.java =================================================================== --- trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/anonymousPoll/AnonymousFreePollByConnectedIT.java (rev 0) +++ trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/anonymousPoll/AnonymousFreePollByConnectedIT.java 2012-08-26 23:15:33 UTC (rev 3639) @@ -0,0 +1,197 @@ +package org.chorem.pollen.ui.it.anonymousPoll; + +import org.chorem.pollen.ui.it.AbstractIT; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; + +/** + * Test a anonymous free poll created by a connected user. + * <p/> + * For that poll nobody can see votes. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.4.5 + */ +public class AnonymousFreePollByConnectedIT extends AbstractIT { + + public AnonymousFreePollByConnectedIT(Class<? extends WebDriver> driverType) { + super(driverType, + "fdd43f4c8d614a9aa48047804583508a", + "9a8e8523f1ba404f8fde45d1844c59ac", + "07dc154dce514d368441eaa9f27d21e0", + "e67a14d729c7440ebe4a55d589cba515", + "29993520034a41168def96f908d2696b"); + } + + @Test + public void checkSummaryPollPage() { + + // can not access to summary page with no pollId + gotoUrl(urlFixtures.summaryPoll(), urlFixtures.poll_required(), false); + + // can not access to summary page with no creatorId + gotoUrl(urlFixtures.summaryPoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to summary page + gotoUrl(urlFixtures.summaryPoll(creatorUri), true); + + // user can vote (#voteUrl) + findElement(By.id("voteUrl")); + } + + @Test + public void checkModeratePollPage() { + + // can not access to moderate page with no pollId + gotoUrl(urlFixtures.moderatePoll(), urlFixtures.poll_required(), false); + + // can not access to moderate page with no creatorId + gotoUrl(urlFixtures.moderatePoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to moderate page + gotoUrl(urlFixtures.moderatePoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can not see votes + canNotSeeAnyVote(); + + // connect as user + userLogin(); + + // can access to moderate page with no creatorId + gotoUrl(urlFixtures.moderatePoll(pollUri), false); + } + + @Test + public void checkVoteForPageWithCreatorId() { + + // access to votefor page with creatorId + gotoUrl(urlFixtures.voteforPoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can not see votes + canNotSeeAnyVote(); + } + + @Test + public void checkVoteForPageWithNoAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can vote + checkCanVote(pollUri); + + // can not see votes + canNotSeeAnyVote(); + } + + @Test + public void checkVoteWithNotConnectedVoteAccountId() { + + // access to votefor page with notConnected voter + gotoUrl(urlFixtures.voteforPoll(notConnectedVotePollUri), true); + + // can not see votes + canNotSeeAnyVote(); + + // can vote + checkCanVote(notConnectedVotePollUri); + + //TODO Fix this with http://chorem.org/issues/795 + // can modifiy his vote +// checkCanModifiyVote(notConnectedVotePollUri); + } + + @Test + public void checkVoteWithConnectedVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(connectedVotePollUri), true); + + // can not see votes + canNotSeeAnyVote(); + + // can vote + checkCanVote(connectedVotePollUri); + + //TODO Fix this with http://chorem.org/issues/795 + // can modifiy his vote +// checkCanModifiyVote(connectedVotePollUri); + + //TODO Fix this with http://chorem.org/issues/795 +// // can delete his vote +// checkCanDeleteVote(connectedVotePollUri); + // connect as user + userLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can not see votes + canNotSeeAnyVote(); + + // can vote + checkCanVote(pollUri); + + // can not modifiy his vote (with no accountId, anonymous poll can not find the vote) + canNotModifyAnyVote(); + + // can not his vote (with no accountId, anonymous poll can not find the vote) + canNotDeleteAnyVote(); + + // poll not present in participant poll (anonymous poll) + gotoUrl(urlFixtures.participatedList(), true); + + checkPollNotFoundInGrid(pollId); + } + + @Test + public void checkVoteWithAdminVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(adminVotePollUri), true); + + // can not see votes + canNotSeeAnyVote(); + + // can vote + checkCanVote(adminVotePollUri); + + //TODO Fix this with http://chorem.org/issues/795 +// // can modifiy his vote +// checkCanModifiyVote(adminVotePollUri); + + //TODO Fix this with http://chorem.org/issues/795 +// // can delete his vote +// checkCanDeleteVote(adminVotePollUri); + + // connect as admin + adminLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can not see votes + canNotSeeAnyVote(); + + // can vote + checkCanVote(adminVotePollUri); + + // can not modifiy his vote (with no accountId, anonymous poll can not find the vote) + canNotModifyAnyVote(); + + // can not delete his vote (with no accountId, anonymous poll can not find the vote) + canNotDeleteAnyVote(); + + // poll not present in participant poll (anonymous poll) + gotoUrl(urlFixtures.participatedList(), true); + + checkPollNotFoundInGrid(pollId); + } +} Property changes on: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/anonymousPoll/AnonymousFreePollByConnectedIT.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Copied: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/anonymousPoll/AnonymousFreePollByNotConnectedIT.java (from rev 3632, trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/AnonymousFreePollByAnonymousIT.java) =================================================================== --- trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/anonymousPoll/AnonymousFreePollByNotConnectedIT.java (rev 0) +++ trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/anonymousPoll/AnonymousFreePollByNotConnectedIT.java 2012-08-26 23:15:33 UTC (rev 3639) @@ -0,0 +1,191 @@ +package org.chorem.pollen.ui.it.anonymousPoll; + +import org.chorem.pollen.ui.it.AbstractIT; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; + +/** + * Test a anonymous free poll created by a not connected user. + * <p/> + * For that poll nobody can see votes. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.4.5 + */ +public class AnonymousFreePollByNotConnectedIT extends AbstractIT { + + public AnonymousFreePollByNotConnectedIT(Class<? extends WebDriver> driverType) { + super(driverType, + "cacb52f4d49047b7a7aa24ec528fcc87", + "e814ba6e25174d5983ad796c400520f5", + "56acbf87f3c049c2adc757ef1da88ee1", + "c54a12ffde5d44a4ad9e609aa644fc80", + "15500943e49842c88d6ceeefaa62e2ed"); + } + + @Test + public void checkSummaryPollPage() { + + // can not access to summary page with no pollId + gotoUrl(urlFixtures.summaryPoll(), urlFixtures.poll_required(), false); + + // can not access to summary page with no creatorId + gotoUrl(urlFixtures.summaryPoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to summary page + gotoUrl(urlFixtures.summaryPoll(creatorUri), true); + + // user can vote (#voteUrl) + findElement(By.id("voteUrl")); + } + + @Test + public void checkModeratePollPage() { + + // can not access to moderate page with no pollId + gotoUrl(urlFixtures.moderatePoll(), urlFixtures.poll_required(), false); + + // can not access to moderate page with no creatorId + gotoUrl(urlFixtures.moderatePoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to moderate page + gotoUrl(urlFixtures.moderatePoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can not see votes + canNotSeeAnyVote(); + } + + @Test + public void checkVoteForPageWithCreatorId() { + + // access to votefor page with creatorId + gotoUrl(urlFixtures.voteforPoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can not see votes + canNotSeeAnyVote(); + } + + @Test + public void checkVoteForPageWithNoAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can vote + checkCanVote(pollUri); + + // can not see votes + canNotSeeAnyVote(); + } + + @Test + public void checkVoteWithNotConnectedVoteAccountId() { + + // access to votefor page with notConnected voter + gotoUrl(urlFixtures.voteforPoll(notConnectedVotePollUri), true); + + // can not see votes + canNotSeeAnyVote(); + + // can vote + checkCanVote(notConnectedVotePollUri); + + //TODO Fix this with http://chorem.org/issues/795 + // can modifiy his vote +// checkCanModifiyVote(notConnectedVotePollUri); + } + + @Test + public void checkVoteWithConnectedVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(connectedVotePollUri), true); + + // can not see votes + canNotSeeAnyVote(); + + // can vote + checkCanVote(connectedVotePollUri); + + //TODO Fix this with http://chorem.org/issues/795 + // can modifiy his vote +// checkCanModifiyVote(connectedVotePollUri); + + //TODO Fix this with http://chorem.org/issues/795 +// // can delete his vote +// checkCanDeleteVote(connectedVotePollUri); + // connect as user + userLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can not see votes + canNotSeeAnyVote(); + + // can vote + checkCanVote(pollUri); + + // can not modifiy his vote (with no accountId, anonymous poll can not find the vote) + canNotModifyAnyVote(); + + // can not his vote (with no accountId, anonymous poll can not find the vote) + canNotDeleteAnyVote(); + + // poll not present in participant poll (anonymous poll) + gotoUrl(urlFixtures.participatedList(), true); + + checkPollNotFoundInGrid(pollId); + } + + @Test + public void checkVoteWithAdminVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(adminVotePollUri), true); + + // can not see votes + canNotSeeAnyVote(); + + // can vote + checkCanVote(adminVotePollUri); + + //TODO Fix this with http://chorem.org/issues/795 +// // can modifiy his vote +// checkCanModifiyVote(adminVotePollUri); + + //TODO Fix this with http://chorem.org/issues/795 +// // can delete his vote +// checkCanDeleteVote(adminVotePollUri); + + // connect as admin + adminLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can not see votes + canNotSeeAnyVote(); + + // can vote + checkCanVote(adminVotePollUri); + + // can not modifiy his vote (with no accountId, anonymous poll can not find the vote) + canNotModifyAnyVote(); + + // can not delete his vote (with no accountId, anonymous poll can not find the vote) + canNotDeleteAnyVote(); + + // poll not present in participant poll (anonymous poll) + gotoUrl(urlFixtures.participatedList(), true); + + checkPollNotFoundInGrid(pollId); + } +} Property changes on: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/anonymousPoll/AnonymousFreePollByNotConnectedIT.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/creatorOnly/CreatorOnlyFreePollByAdminIT.java =================================================================== --- trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/creatorOnly/CreatorOnlyFreePollByAdminIT.java (rev 0) +++ trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/creatorOnly/CreatorOnlyFreePollByAdminIT.java 2012-08-26 23:15:33 UTC (rev 3639) @@ -0,0 +1,201 @@ +package org.chorem.pollen.ui.it.creatorOnly; + +import org.chorem.pollen.ui.it.AbstractIT; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; + +/** + * Test a creator only free poll created by an administrator. + * <p/> + * For that poll only creator or administrator can see votes. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.4.5 + */ +public class CreatorOnlyFreePollByAdminIT extends AbstractIT { + + public CreatorOnlyFreePollByAdminIT(Class<? extends WebDriver> driverType) { + super(driverType, + "a04bd349d8964c4fad48ac6ececc60a0", + "a1346bb80bb84913983e91673c76e80c", + "e6fa20f2afb24bdebfdc579c2574a3ab", + "01b2b146c6874593b678261f42014935", + "cf4f77e74b2f40428595452ce2ee6fbf"); + } + + @Test + public void checkSummaryPollPage() { + + // can not access to summary page with no pollId + gotoUrl(urlFixtures.summaryPoll(), urlFixtures.poll_required(), false); + + // can not access to summary page with no creatorId + gotoUrl(urlFixtures.summaryPoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to summary page + gotoUrl(urlFixtures.summaryPoll(creatorUri), true); + + // user can vote (#voteUrl) + findElement(By.id("voteUrl")); + } + + @Test + public void checkModeratePollPage() { + + // can not access to moderate page with no pollId + gotoUrl(urlFixtures.moderatePoll(), urlFixtures.poll_required(), false); + + // can not access to moderate page with no creatorId + gotoUrl(urlFixtures.moderatePoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to moderate page + gotoUrl(urlFixtures.moderatePoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can see all votes + canSeeAllVotes(); + + // can delete all votes + canDeleteAllVotes(); + } + + @Test + public void checkVoteForPageWithCreatorId() { + + // access to votefor page with creatorId + gotoUrl(urlFixtures.voteforPoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can see all votes + canSeeAllVotes(); + + // can delete all votes + canDeleteAllVotes(); + } + + @Test + public void checkVoteForPageWithNoAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can vote + checkCanVote(pollUri); + + // can not see votes + canNotSeeAnyVote(); + } + + @Test + public void checkVoteWithNotConnectedVoteAccountId() { + + // access to votefor page with notConnected voter + gotoUrl(urlFixtures.voteforPoll(notConnectedVotePollUri), true); + + // can see his own vote + canSeeOnlyNotConnectedVote(); + + // can vote + checkCanVote(notConnectedVotePollUri); + + // can modifiy his vote + canModifyNotConnectedVote(); + + // can delete his vote + canDeleteNotConnectedVote(); + } + + @Test + public void checkVoteWithConnectedVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(connectedVotePollUri), true); + + // can see votes his own vote + canSeeOnlyConnectedVote(); + + // can vote + checkCanVote(connectedVotePollUri); + + // can modifiy his vote + canModifyUserVote(); + + // can delete his vote + canDeleteConnectedVote(); + + // connect as user (he is the creator) + userLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can see his own vote + canSeeOnlyConnectedVote(); + + // can vote + checkCanVote(connectedVotePollUri); + + // can modifiy his vote + canModifyUserVote(); + + // can delete his votes + canDeleteConnectedVote(); + + // poll present in participant poll + gotoUrl(urlFixtures.participatedList(), true); + + //FIXME Find out how to wait until jquery is done (or can direct call the json query) + // found poll in grid +// checkPollFoundInGrid(pollId); + } + + @Test + public void checkVoteWithAdminVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(adminVotePollUri), true); + + // can see ony his own vote + canSeeOnlyAdminVote(); + + // can vote + checkCanVote(adminVotePollUri); + + // can modifiy his vote + canModifyAdminVote(); + + // can delete his vote + canDeleteAdminVote(); + + // connect as admin + adminLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(adminVotePollUri); + + // can modifiy his vote + canModifyAdminVote(); + + // can delete all votes + canDeleteAllVotes(); + + // poll present in participant poll + gotoUrl(urlFixtures.participatedList(), true); + + //FIXME Find out how to wait until jquery is done (or can direct call the json query) + // found poll in grid +// checkPollFoundInGrid(pollId); + } + +} Property changes on: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/creatorOnly/CreatorOnlyFreePollByAdminIT.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/creatorOnly/CreatorOnlyFreePollByConnectedIT.java =================================================================== --- trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/creatorOnly/CreatorOnlyFreePollByConnectedIT.java (rev 0) +++ trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/creatorOnly/CreatorOnlyFreePollByConnectedIT.java 2012-08-26 23:15:33 UTC (rev 3639) @@ -0,0 +1,201 @@ +package org.chorem.pollen.ui.it.creatorOnly; + +import org.chorem.pollen.ui.it.AbstractIT; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; + +/** + * Test a creator only free poll created by an connected user. + * <p/> + * For that poll only creator or administrator can see votes. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.4.5 + */ +public class CreatorOnlyFreePollByConnectedIT extends AbstractIT { + + public CreatorOnlyFreePollByConnectedIT(Class<? extends WebDriver> driverType) { + super(driverType, + "075ab18c50c74f83b894c042bba84ff5", + "0f51b7c953f6427f9c85807fa838d44f", + "4937a887797a4ab5ac618152383512ae", + "f162acd5dd8a4242a6f38b098ecec3c3", + "02dbe56ac36d458d95f1fe07ba783f61"); + } + + @Test + public void checkSummaryPollPage() { + + // can not access to summary page with no pollId + gotoUrl(urlFixtures.summaryPoll(), urlFixtures.poll_required(), false); + + // can not access to summary page with no creatorId + gotoUrl(urlFixtures.summaryPoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to summary page + gotoUrl(urlFixtures.summaryPoll(creatorUri), true); + + // user can vote (#voteUrl) + findElement(By.id("voteUrl")); + } + + @Test + public void checkModeratePollPage() { + + // can not access to moderate page with no pollId + gotoUrl(urlFixtures.moderatePoll(), urlFixtures.poll_required(), false); + + // can not access to moderate page with no creatorId + gotoUrl(urlFixtures.moderatePoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to moderate page + gotoUrl(urlFixtures.moderatePoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can see all votes + canSeeAllVotes(); + + // can delete all votes + canDeleteAllVotes(); + } + + @Test + public void checkVoteForPageWithCreatorId() { + + // access to votefor page with creatorId + gotoUrl(urlFixtures.voteforPoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can see all votes + canSeeAllVotes(); + + // can delete all votes + canDeleteAllVotes(); + } + + @Test + public void checkVoteForPageWithNoAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can vote + checkCanVote(pollUri); + + // can not see votes + canNotSeeAnyVote(); + } + + @Test + public void checkVoteWithNotConnectedVoteAccountId() { + + // access to votefor page with notConnected voter + gotoUrl(urlFixtures.voteforPoll(notConnectedVotePollUri), true); + + // can see his own vote + canSeeOnlyNotConnectedVote(); + + // can vote + checkCanVote(notConnectedVotePollUri); + + // can modifiy his vote + canModifyNotConnectedVote(); + + // can delete his vote + canDeleteNotConnectedVote(); + } + + @Test + public void checkVoteWithConnectedVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(connectedVotePollUri), true); + + // can see votes his own vote + canSeeOnlyConnectedVote(); + + // can vote + checkCanVote(connectedVotePollUri); + + // can modifiy his vote + canModifyUserVote(); + + // can delete his vote + canDeleteConnectedVote(); + + // connect as user (he is the creator) + userLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can see all votes (user is creator) + canSeeAllVotes(); + + // can vote + checkCanVote(connectedVotePollUri); + + // can modifiy his vote + canModifyUserVote(); + + // can delete all votes + canDeleteAllVotes(); + + // poll present in participant poll + gotoUrl(urlFixtures.participatedList(), true); + + //FIXME Find out how to wait until jquery is done (or can direct call the json query) + // found poll in grid +// checkPollFoundInGrid(pollId); + } + + @Test + public void checkVoteWithAdminVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(adminVotePollUri), true); + + // can see ony his own vote + canSeeOnlyAdminVote(); + + // can vote + checkCanVote(adminVotePollUri); + + // can modifiy his vote + canModifyAdminVote(); + + // can delete his vote + canDeleteAdminVote(); + + // connect as admin + adminLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(adminVotePollUri); + + // can modifiy his vote + canModifyAdminVote(); + + // can delete all votes + canDeleteAllVotes(); + + // poll present in participant poll + gotoUrl(urlFixtures.participatedList(), true); + + //FIXME Find out how to wait until jquery is done (or can direct call the json query) + // found poll in grid +// checkPollFoundInGrid(pollId); + } + +} Property changes on: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/creatorOnly/CreatorOnlyFreePollByConnectedIT.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/creatorOnly/CreatorOnlyFreePollByNotConnectedIT.java =================================================================== --- trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/creatorOnly/CreatorOnlyFreePollByNotConnectedIT.java (rev 0) +++ trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/creatorOnly/CreatorOnlyFreePollByNotConnectedIT.java 2012-08-26 23:15:33 UTC (rev 3639) @@ -0,0 +1,200 @@ +package org.chorem.pollen.ui.it.creatorOnly; + +import org.chorem.pollen.ui.it.AbstractIT; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; + +/** + * Test a creator only free poll created by a not connected user. + * <p/> + * For that poll only creator or administrator can see votes. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.4.5 + */ +public class CreatorOnlyFreePollByNotConnectedIT extends AbstractIT { + + public CreatorOnlyFreePollByNotConnectedIT(Class<? extends WebDriver> driverType) { + super(driverType, + "e61a350a1d714e479aad526ee85b7bc6", + "8517bd2f6b414072b3d9d6c4cb7e5fd0", + "e8fd28021faa434aa466c5f6bdbc6e94", + "52ef06ee93dd4095ae7498edb9e1c28e", + "c86b0b775e154fdeaf51ae1e5ef4074d"); + } + + @Test + public void checkSummaryPollPage() { + + // can not access to summary page with no pollId + gotoUrl(urlFixtures.summaryPoll(), urlFixtures.poll_required(), false); + + // can not access to summary page with no creatorId + gotoUrl(urlFixtures.summaryPoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to summary page + gotoUrl(urlFixtures.summaryPoll(creatorUri), true); + + // user can vote (#voteUrl) + findElement(By.id("voteUrl")); + } + + @Test + public void checkModeratePollPage() { + + // can not access to moderate page with no pollId + gotoUrl(urlFixtures.moderatePoll(), urlFixtures.poll_required(), false); + + // can not access to moderate page with no creatorId + gotoUrl(urlFixtures.moderatePoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to moderate page + gotoUrl(urlFixtures.moderatePoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can see all votes + canSeeAllVotes(); + + // can delete all votes + canDeleteAllVotes(); + } + + @Test + public void checkVoteForPageWithCreatorId() { + + // access to votefor page with creatorId + gotoUrl(urlFixtures.voteforPoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can see all votes + canSeeAllVotes(); + + // can delete all votes + canDeleteAllVotes(); + } + + @Test + public void checkVoteForPageWithNoAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can vote + checkCanVote(pollUri); + + // can not see votes + canNotSeeAnyVote(); + } + + @Test + public void checkVoteWithNotConnectedVoteAccountId() { + + // access to votefor page with notConnected voter + gotoUrl(urlFixtures.voteforPoll(notConnectedVotePollUri), true); + + // can see his own vote + canSeeOnlyNotConnectedVote(); + + // can vote + checkCanVote(notConnectedVotePollUri); + + // can modifiy his vote + canModifyNotConnectedVote(); + + // can delete his vote + canDeleteNotConnectedVote(); + } + + @Test + public void checkVoteWithConnectedVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(connectedVotePollUri), true); + + // can see votes his own vote + canSeeOnlyConnectedVote(); + + // can vote + checkCanVote(connectedVotePollUri); + + // can modifiy his vote + canModifyUserVote(); + + // can delete his vote + canDeleteConnectedVote(); + + // connect as user + userLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can see vote his own vote + canSeeOnlyConnectedVote(); + + // can vote + checkCanVote(connectedVotePollUri); + + // can modifiy his vote + canModifyUserVote(); + + // can delete his vote + canDeleteConnectedVote(); + + // poll present in participant poll + gotoUrl(urlFixtures.participatedList(), true); + + //FIXME Find out how to wait until jquery is done (or can direct call the json query) + // found poll in grid +// checkPollFoundInGrid(pollId); + } + + @Test + public void checkVoteWithAdminVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(adminVotePollUri), true); + + // can see ony his own vote + canSeeOnlyAdminVote(); + + // can vote + checkCanVote(adminVotePollUri); + + // can modifiy his vote + canModifyAdminVote(); + + // can delete his vote + canDeleteAdminVote(); + + // connect as admin + adminLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(adminVotePollUri); + + // can modifiy his vote + canModifyAdminVote(); + + // can delete all votes + canDeleteAllVotes(); + + // poll present in participant poll + gotoUrl(urlFixtures.participatedList(), true); + + //FIXME Find out how to wait until jquery is done (or can direct call the json query) + // found poll in grid +// checkPollFoundInGrid(pollId); + } +} Property changes on: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/creatorOnly/CreatorOnlyFreePollByNotConnectedIT.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/everybody/EverybodyFreePollByAdminIT.java =================================================================== --- trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/everybody/EverybodyFreePollByAdminIT.java (rev 0) +++ trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/everybody/EverybodyFreePollByAdminIT.java 2012-08-26 23:15:33 UTC (rev 3639) @@ -0,0 +1,201 @@ +package org.chorem.pollen.ui.it.everybody; + +import org.chorem.pollen.ui.it.AbstractIT; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; + +/** + * Test a everybody free poll created by a administrator user. + * <p/> + * For that poll everybody can see votes. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.4.5 + */ +public class EverybodyFreePollByAdminIT extends AbstractIT { + + public EverybodyFreePollByAdminIT(Class<? extends WebDriver> driverType) { + super(driverType, + "3300e59939bd4c9797e360060b8e54be", + "c370172faf7a4108be0d76630af34c4b", + "4399e0ff6dbe4544b64861d1e234ee1a", + "5af1c33357084f89a56d1cde89584cb7", + "335e6a3921fb4dd5b6220c55311b7931"); + } + + @Test + public void checkSummaryPollPage() { + + // can not access to summary page with no pollId + gotoUrl(urlFixtures.summaryPoll(), urlFixtures.poll_required(), false); + + // can not access to summary page with no creatorId + gotoUrl(urlFixtures.summaryPoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to summary page + gotoUrl(urlFixtures.summaryPoll(creatorUri), true); + + // user can vote (#voteUrl) + findElement(By.id("voteUrl")); + } + + @Test + public void checkModeratePollPage() { + + // can not access to moderate page with no pollId + gotoUrl(urlFixtures.moderatePoll(), urlFixtures.poll_required(), false); + + // can not access to moderate page with no creatorId + gotoUrl(urlFixtures.moderatePoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to moderate page + gotoUrl(urlFixtures.moderatePoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can see all votes + canSeeAllVotes(); + + // can delete all votes + canDeleteAllVotes(); + } + + @Test + public void checkVoteForPageWithCreatorId() { + + // access to votefor page with creatorId + gotoUrl(urlFixtures.voteforPoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can see all votes + canSeeAllVotes(); + + // can delete all votes + canDeleteAllVotes(); + } + + @Test + public void checkVoteForPageWithNoAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can vote + checkCanVote(pollUri); + + // can see all votes + canSeeAllVotes(); + } + + @Test + public void checkVoteWithNotConnectedVoteAccountId() { + + // access to votefor page with notConnected voter + gotoUrl(urlFixtures.voteforPoll(notConnectedVotePollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(notConnectedVotePollUri); + + // can modifiy his vote + canModifyNotConnectedVote(); + + // can delete his vote + canDeleteNotConnectedVote(); + } + + @Test + public void checkVoteWithConnectedVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(connectedVotePollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(connectedVotePollUri); + + // can modifiy his vote + canModifyUserVote(); + + // can delete his vote + canDeleteConnectedVote(); + + // connect as user (he is the creator) + userLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(connectedVotePollUri); + + // can modifiy his vote + canModifyUserVote(); + + // can delete his votes + canDeleteConnectedVote(); + + // poll present in participant poll + gotoUrl(urlFixtures.participatedList(), true); + + //FIXME Find out how to wait until jquery is done (or can direct call the json query) + // found poll in grid +// checkPollFoundInGrid(pollId); + } + + @Test + public void checkVoteWithAdminVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(adminVotePollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(adminVotePollUri); + + // can modifiy his vote + canModifyAdminVote(); + + // can delete his vote + canDeleteAdminVote(); + + // connect as admin + adminLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(adminVotePollUri); + + // can modifiy his vote + canModifyAdminVote(); + + // can delete all votes + canDeleteAllVotes(); + + // poll present in participant poll + gotoUrl(urlFixtures.participatedList(), true); + + //FIXME Find out how to wait until jquery is done (or can direct call the json query) + // found poll in grid +// checkPollFoundInGrid(pollId); + } + +} Property changes on: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/everybody/EverybodyFreePollByAdminIT.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/everybody/EverybodyFreePollByConnectedIT.java =================================================================== --- trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/everybody/EverybodyFreePollByConnectedIT.java (rev 0) +++ trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/everybody/EverybodyFreePollByConnectedIT.java 2012-08-26 23:15:33 UTC (rev 3639) @@ -0,0 +1,201 @@ +package org.chorem.pollen.ui.it.everybody; + +import org.chorem.pollen.ui.it.AbstractIT; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; + +/** + * Test a everybody free poll created by a connected user. + * <p/> + * For that poll everybody can see votes. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.4.5 + */ +public class EverybodyFreePollByConnectedIT extends AbstractIT { + + public EverybodyFreePollByConnectedIT(Class<? extends WebDriver> driverType) { + super(driverType, + "4cd79d032aa7433d9944ec9376c385c0", + "f26e253004d14547b465b5a414b65a7f", + "307222b5e17442758bd23fc9d8a19f5e", + "8a10f049538142669ca84bb034f7a886", + "6e92bf48f672429ea265a2647bef415d"); + } + + @Test + public void checkSummaryPollPage() { + + // can not access to summary page with no pollId + gotoUrl(urlFixtures.summaryPoll(), urlFixtures.poll_required(), false); + + // can not access to summary page with no creatorId + gotoUrl(urlFixtures.summaryPoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to summary page + gotoUrl(urlFixtures.summaryPoll(creatorUri), true); + + // user can vote (#voteUrl) + findElement(By.id("voteUrl")); + } + + @Test + public void checkModeratePollPage() { + + // can not access to moderate page with no pollId + gotoUrl(urlFixtures.moderatePoll(), urlFixtures.poll_required(), false); + + // can not access to moderate page with no creatorId + gotoUrl(urlFixtures.moderatePoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to moderate page + gotoUrl(urlFixtures.moderatePoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can see all votes + canSeeAllVotes(); + + // can delete all votes + canDeleteAllVotes(); + } + + @Test + public void checkVoteForPageWithCreatorId() { + + // access to votefor page with creatorId + gotoUrl(urlFixtures.voteforPoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can see all votes + canSeeAllVotes(); + + // can delete all votes + canDeleteAllVotes(); + } + + @Test + public void checkVoteForPageWithNoAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can vote + checkCanVote(pollUri); + + // can see all votes + canSeeAllVotes(); + } + + @Test + public void checkVoteWithNotConnectedVoteAccountId() { + + // access to votefor page with notConnected voter + gotoUrl(urlFixtures.voteforPoll(notConnectedVotePollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(notConnectedVotePollUri); + + // can modifiy his vote + canModifyNotConnectedVote(); + + // can delete his vote + canDeleteNotConnectedVote(); + } + + @Test + public void checkVoteWithConnectedVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(connectedVotePollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(connectedVotePollUri); + + // can modifiy his vote + canModifyUserVote(); + + // can delete his vote + canDeleteConnectedVote(); + + // connect as user (he is the creator) + userLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can see all votes (user is creator) + canSeeAllVotes(); + + // can vote + checkCanVote(connectedVotePollUri); + + // can modifiy his vote + canModifyUserVote(); + + // can delete all votes + canDeleteAllVotes(); + + // poll present in participant poll + gotoUrl(urlFixtures.participatedList(), true); + + //FIXME Find out how to wait until jquery is done (or can direct call the json query) + // found poll in grid +// checkPollFoundInGrid(pollId); + } + + @Test + public void checkVoteWithAdminVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(adminVotePollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(adminVotePollUri); + + // can modifiy his vote + canModifyAdminVote(); + + // can delete his vote + canDeleteAdminVote(); + + // connect as admin + adminLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(adminVotePollUri); + + // can modifiy his vote + canModifyAdminVote(); + + // can delete all votes + canDeleteAllVotes(); + + // poll present in participant poll + gotoUrl(urlFixtures.participatedList(), true); + + //FIXME Find out how to wait until jquery is done (or can direct call the json query) + // found poll in grid +// checkPollFoundInGrid(pollId); + } + +} Property changes on: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/everybody/EverybodyFreePollByConnectedIT.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/everybody/EverybodyFreePollByNotConnectedIT.java =================================================================== --- trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/everybody/EverybodyFreePollByNotConnectedIT.java (rev 0) +++ trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/everybody/EverybodyFreePollByNotConnectedIT.java 2012-08-26 23:15:33 UTC (rev 3639) @@ -0,0 +1,201 @@ +package org.chorem.pollen.ui.it.everybody; + +import org.chorem.pollen.ui.it.AbstractIT; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; + +/** + * Test a everybody free poll created by a not connected user. + * <p/> + * For that poll everybody can see votes. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.4.5 + */ +public class EverybodyFreePollByNotConnectedIT extends AbstractIT { + + public EverybodyFreePollByNotConnectedIT(Class<? extends WebDriver> driverType) { + super(driverType, + "2262a31f374e4969bb3593e762c0cae6", + "659bb046fc06493f9909ca9f34ca6261", + "6909131490ab4a1abae0daaf15129cdb", + "f058910736af48e9905f83f3f5de5b8d", + "2d97c079df054a7c9fc321b2df3488f3"); + } + + @Test + public void checkSummaryPollPage() { + + // can not access to summary page with no pollId + gotoUrl(urlFixtures.summaryPoll(), urlFixtures.poll_required(), false); + + // can not access to summary page with no creatorId + gotoUrl(urlFixtures.summaryPoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to summary page + gotoUrl(urlFixtures.summaryPoll(creatorUri), true); + + // user can vote (#voteUrl) + findElement(By.id("voteUrl")); + } + + @Test + public void checkModeratePollPage() { + + // can not access to moderate page with no pollId + gotoUrl(urlFixtures.moderatePoll(), urlFixtures.poll_required(), false); + + // can not access to moderate page with no creatorId + gotoUrl(urlFixtures.moderatePoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to moderate page + gotoUrl(urlFixtures.moderatePoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can see all votes + canSeeAllVotes(); + + // can delete all votes + canDeleteAllVotes(); + } + + @Test + public void checkVoteForPageWithCreatorId() { + + // access to votefor page with creatorId + gotoUrl(urlFixtures.voteforPoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can see all votes + canSeeAllVotes(); + + // can delete all votes + canDeleteAllVotes(); + } + + @Test + public void checkVoteForPageWithNoAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can vote + checkCanVote(pollUri); + + // can see all votes + canSeeAllVotes(); + } + + @Test + public void checkVoteWithNotConnectedVoteAccountId() { + + // access to votefor page with notConnected voter + gotoUrl(urlFixtures.voteforPoll(notConnectedVotePollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(notConnectedVotePollUri); + + // can modifiy his vote + canModifyNotConnectedVote(); + + // can delete his vote + canDeleteNotConnectedVote(); + } + + @Test + public void checkVoteWithConnectedVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(connectedVotePollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(connectedVotePollUri); + + // can modifiy his vote + canModifyUserVote(); + + // can delete his vote + canDeleteConnectedVote(); + + // connect as user + userLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(connectedVotePollUri); + + // can modifiy his vote + canModifyUserVote(); + + // can delete his vote + canDeleteConnectedVote(); + + // poll present in participant poll + gotoUrl(urlFixtures.participatedList(), true); + + //FIXME Find out how to wait until jquery is done (or can direct call the json query) + // found poll in grid +// checkPollFoundInGrid(pollId); + } + + @Test + public void checkVoteWithAdminVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(adminVotePollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(adminVotePollUri); + + // can modifiy his vote + canModifyAdminVote(); + + // can delete his vote + canDeleteAdminVote(); + + // connect as admin + adminLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(adminVotePollUri); + + // can modifiy his vote + canModifyAdminVote(); + + // can delete all votes + canDeleteAllVotes(); + + // poll present in participant poll + gotoUrl(urlFixtures.participatedList(), true); + + //FIXME Find out how to wait until jquery is done (or can direct call the json query) + // found poll in grid +// checkPollFoundInGrid(pollId); + } + +} Property changes on: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/everybody/EverybodyFreePollByNotConnectedIT.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/voterOnly/VoterOnlyFreePollByAdminIT.java =================================================================== --- trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/voterOnly/VoterOnlyFreePollByAdminIT.java (rev 0) +++ trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/voterOnly/VoterOnlyFreePollByAdminIT.java 2012-08-26 23:15:33 UTC (rev 3639) @@ -0,0 +1,201 @@ +package org.chorem.pollen.ui.it.voterOnly; + +import org.chorem.pollen.ui.it.AbstractIT; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; + +/** + * Test a voter only free poll created by a administrator user. + * <p/> + * For that poll only voter, creator or administrator can see votes. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.4.5 + */ +public class VoterOnlyFreePollByAdminIT extends AbstractIT { + + public VoterOnlyFreePollByAdminIT(Class<? extends WebDriver> driverType) { + super(driverType, + "7103c6d4a79246699425e99e1f344b98", + "717ebe61a3b64fcea453c9cba5953149", + "ad50a5d406d84aa09e3a02dd9ad0116c", + "24abe4ba077341b489af505531ac93de", + "2237dbc51f7c4268a8a7e10f6146ae87"); + } + + @Test + public void checkSummaryPollPage() { + + // can not access to summary page with no pollId + gotoUrl(urlFixtures.summaryPoll(), urlFixtures.poll_required(), false); + + // can not access to summary page with no creatorId + gotoUrl(urlFixtures.summaryPoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to summary page + gotoUrl(urlFixtures.summaryPoll(creatorUri), true); + + // user can vote (#voteUrl) + findElement(By.id("voteUrl")); + } + + @Test + public void checkModeratePollPage() { + + // can not access to moderate page with no pollId + gotoUrl(urlFixtures.moderatePoll(), urlFixtures.poll_required(), false); + + // can not access to moderate page with no creatorId + gotoUrl(urlFixtures.moderatePoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to moderate page + gotoUrl(urlFixtures.moderatePoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can see all votes + canSeeAllVotes(); + + // can delete all votes + canDeleteAllVotes(); + } + + @Test + public void checkVoteForPageWithCreatorId() { + + // access to votefor page with creatorId + gotoUrl(urlFixtures.voteforPoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can see all votes + canSeeAllVotes(); + + // can delete all votes + canDeleteAllVotes(); + } + + @Test + public void checkVoteForPageWithNoAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can vote + checkCanVote(pollUri); + + // can not see votes + canNotSeeAnyVote(); + } + + @Test + public void checkVoteWithNotConnectedVoteAccountId() { + + // access to votefor page with notConnected voter + gotoUrl(urlFixtures.voteforPoll(notConnectedVotePollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(notConnectedVotePollUri); + + // can modifiy his vote + canModifyNotConnectedVote(); + + // can delete his vote + canDeleteNotConnectedVote(); + } + + @Test + public void checkVoteWithConnectedVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(connectedVotePollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(connectedVotePollUri); + + // can modifiy his vote + canModifyUserVote(); + + // can delete his vote + canDeleteConnectedVote(); + + // connect as user (he is the creator) + userLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(connectedVotePollUri); + + // can modifiy his vote + canModifyUserVote(); + + // can delete his votes + canDeleteConnectedVote(); + + // poll present in participant poll + gotoUrl(urlFixtures.participatedList(), true); + + //FIXME Find out how to wait until jquery is done (or can direct call the json query) + // found poll in grid +// checkPollFoundInGrid(pollId); + } + + @Test + public void checkVoteWithAdminVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(adminVotePollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(adminVotePollUri); + + // can modifiy his vote + canModifyAdminVote(); + + // can delete his vote + canDeleteAdminVote(); + + // connect as admin + adminLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(adminVotePollUri); + + // can modifiy his vote + canModifyAdminVote(); + + // can delete all votes + canDeleteAllVotes(); + + // poll present in participant poll + gotoUrl(urlFixtures.participatedList(), true); + + //FIXME Find out how to wait until jquery is done (or can direct call the json query) + // found poll in grid +// checkPollFoundInGrid(pollId); + } + +} Property changes on: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/voterOnly/VoterOnlyFreePollByAdminIT.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/voterOnly/VoterOnlyFreePollByConnectedIT.java =================================================================== --- trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/voterOnly/VoterOnlyFreePollByConnectedIT.java (rev 0) +++ trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/voterOnly/VoterOnlyFreePollByConnectedIT.java 2012-08-26 23:15:33 UTC (rev 3639) @@ -0,0 +1,200 @@ +package org.chorem.pollen.ui.it.voterOnly; + +import org.chorem.pollen.ui.it.AbstractIT; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; + +/** + * Test a voter only free poll created by a connected user. + * <p/> + * For that poll only voter, creator or administrator can see votes. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.4.5 + */ +public class VoterOnlyFreePollByConnectedIT extends AbstractIT { + + public VoterOnlyFreePollByConnectedIT(Class<? extends WebDriver> driverType) { + super(driverType, + "b321ddccf7d743bf9c67b2664231d14f", + "a48f1b97a3f84443845009c074298bce", + "938e4831d7d547a59fd6d76c3bdfe6b5", + "b3e407acc97b4911b0de470b1d45a68f", + "6f980a4541e04edd9dec95d3dbde0830"); + } + + @Test + public void checkSummaryPollPage() { + + // can not access to summary page with no pollId + gotoUrl(urlFixtures.summaryPoll(), urlFixtures.poll_required(), false); + + // can not access to summary page with no creatorId + gotoUrl(urlFixtures.summaryPoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to summary page + gotoUrl(urlFixtures.summaryPoll(creatorUri), true); + + // user can vote (#voteUrl) + findElement(By.id("voteUrl")); + } + + @Test + public void checkModeratePollPage() { + + // can not access to moderate page with no pollId + gotoUrl(urlFixtures.moderatePoll(), urlFixtures.poll_required(), false); + + // can not access to moderate page with no creatorId + gotoUrl(urlFixtures.moderatePoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to moderate page + gotoUrl(urlFixtures.moderatePoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can see all votes + canSeeAllVotes(); + + // can delete all votes + canDeleteAllVotes(); + } + + @Test + public void checkVoteForPageWithCreatorId() { + + // access to votefor page with creatorId + gotoUrl(urlFixtures.voteforPoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can see all votes + canSeeAllVotes(); + + // can delete all votes + canDeleteAllVotes(); + } + + @Test + public void checkVoteForPageWithNoAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can vote + checkCanVote(pollUri); + + // can not see votes + canNotSeeAnyVote(); + } + + @Test + public void checkVoteWithNotConnectedVoteAccountId() { + + // access to votefor page with notConnected voter + gotoUrl(urlFixtures.voteforPoll(notConnectedVotePollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(notConnectedVotePollUri); + + // can modifiy his vote + canModifyNotConnectedVote(); + + // can delete his vote + canDeleteNotConnectedVote(); + } + + @Test + public void checkVoteWithConnectedVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(connectedVotePollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(connectedVotePollUri); + + // can modifiy his vote + canModifyUserVote(); + + // can delete his vote + canDeleteConnectedVote(); + + // connect as user (he is the creator) + userLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can see all votes (user is creator) + canSeeAllVotes(); + + // can vote + checkCanVote(connectedVotePollUri); + + // can modifiy his vote + canModifyUserVote(); + + // can delete all votes + canDeleteAllVotes(); + + // poll present in participant poll + gotoUrl(urlFixtures.participatedList(), true); + + //FIXME Find out how to wait until jquery is done (or can direct call the json query) + // found poll in grid +// checkPollFoundInGrid(pollId); + } + + @Test + public void checkVoteWithAdminVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(adminVotePollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(adminVotePollUri); + + // can modifiy his vote + canModifyAdminVote(); + + // can delete his vote + canDeleteAdminVote(); + + // connect as admin + adminLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(adminVotePollUri); + + // can modifiy his vote + canModifyAdminVote(); + + // can delete all votes + canDeleteAllVotes(); + + // poll present in participant poll + gotoUrl(urlFixtures.participatedList(), true); + + //FIXME Find out how to wait until jquery is done (or can direct call the json query) + // found poll in grid +// checkPollFoundInGrid(pollId); + } +} Property changes on: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/voterOnly/VoterOnlyFreePollByConnectedIT.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/voterOnly/VoterOnlyFreePollByNotConnectedIT.java =================================================================== --- trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/voterOnly/VoterOnlyFreePollByNotConnectedIT.java (rev 0) +++ trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/voterOnly/VoterOnlyFreePollByNotConnectedIT.java 2012-08-26 23:15:33 UTC (rev 3639) @@ -0,0 +1,201 @@ +package org.chorem.pollen.ui.it.voterOnly; + +import org.chorem.pollen.ui.it.AbstractIT; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; + +/** + * Test a voter only free poll created by a not connected user. + * <p/> + * For that poll only voter, creator or administrator can see votes. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.4.5 + */ +public class VoterOnlyFreePollByNotConnectedIT extends AbstractIT { + + public VoterOnlyFreePollByNotConnectedIT(Class<? extends WebDriver> driverType) { + super(driverType, + "8518ede7bf1247d2ba0dfe222575c5ba", + "ea5c96d4d44547f9b0717f30bfa6dd03", + "fa914a31f6c94cfa8561f48e3c45d6cf", + "5c67d277460b4b4eb1fb59a26bf4a622", + "28d450be407e4eabbb787739ec27ae52"); + } + + @Test + public void checkSummaryPollPage() { + + // can not access to summary page with no pollId + gotoUrl(urlFixtures.summaryPoll(), urlFixtures.poll_required(), false); + + // can not access to summary page with no creatorId + gotoUrl(urlFixtures.summaryPoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to summary page + gotoUrl(urlFixtures.summaryPoll(creatorUri), true); + + // user can vote (#voteUrl) + findElement(By.id("voteUrl")); + } + + @Test + public void checkModeratePollPage() { + + // can not access to moderate page with no pollId + gotoUrl(urlFixtures.moderatePoll(), urlFixtures.poll_required(), false); + + // can not access to moderate page with no creatorId + gotoUrl(urlFixtures.moderatePoll(pollUri), urlFixtures.poll_creator_required(), false); + + // access to moderate page + gotoUrl(urlFixtures.moderatePoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can see all votes + canSeeAllVotes(); + + // can delete all votes + canDeleteAllVotes(); + } + + @Test + public void checkVoteForPageWithCreatorId() { + + // access to votefor page with creatorId + gotoUrl(urlFixtures.voteforPoll(creatorUri), true); + + // can not vote + checkCanNotVote(creatorUri); + + // can see all votes + canSeeAllVotes(); + + // can delete all votes + canDeleteAllVotes(); + } + + @Test + public void checkVoteForPageWithNoAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can vote + checkCanVote(pollUri); + + // can not see votes + canNotSeeAnyVote(); + } + + @Test + public void checkVoteWithNotConnectedVoteAccountId() { + + // access to votefor page with notConnected voter + gotoUrl(urlFixtures.voteforPoll(notConnectedVotePollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(notConnectedVotePollUri); + + // can modifiy his vote + canModifyNotConnectedVote(); + + // can delete his vote + canDeleteNotConnectedVote(); + } + + @Test + public void checkVoteWithConnectedVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(connectedVotePollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(connectedVotePollUri); + + // can modifiy his vote + canModifyUserVote(); + + // can delete his vote + canDeleteConnectedVote(); + + // connect as user + userLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(connectedVotePollUri); + + // can modifiy his vote + canModifyUserVote(); + + // can delete his vote + canDeleteConnectedVote(); + + // poll present in participant poll + gotoUrl(urlFixtures.participatedList(), true); + + //FIXME Find out how to wait until jquery is done (or can direct call the json query) + // found poll in grid +// checkPollFoundInGrid(pollId); + } + + @Test + public void checkVoteWithAdminVoteAccountId() { + + // access to votefor page with no accountId + gotoUrl(urlFixtures.voteforPoll(adminVotePollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(adminVotePollUri); + + // can modifiy his vote + canModifyAdminVote(); + + // can delete his vote + canDeleteAdminVote(); + + // connect as admin + adminLogin(); + + // access to votefor page with no accountId (will use the userAccount) + gotoUrl(urlFixtures.voteforPoll(pollUri), true); + + // can see all votes + canSeeAllVotes(); + + // can vote + checkCanVote(adminVotePollUri); + + // can modifiy his vote + canModifyAdminVote(); + + // can delete all votes + canDeleteAllVotes(); + + // poll present in participant poll + gotoUrl(urlFixtures.participatedList(), true); + + //FIXME Find out how to wait until jquery is done (or can direct call the json query) + // found poll in grid +// checkPollFoundInGrid(pollId); + } + +} Property changes on: trunk/pollen-ui-struts2/src/it/pollVoteVisibility/src/test/java/org/chorem/pollen/ui/it/voterOnly/VoterOnlyFreePollByNotConnectedIT.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native
participants (1)
-
tchemit@users.chorem.org