r3797 - in trunk/pollen-ui-struts2/src/it/createPoll: . src/test/java/org/chorem/pollen/ui/it
Author: tchemit Date: 2013-05-26 14:53:04 +0200 (Sun, 26 May 2013) New Revision: 3797 Url: http://chorem.org/projects/pollen/repository/revisions/3797 Log: fix its Modified: trunk/pollen-ui-struts2/src/it/createPoll/pom.xml trunk/pollen-ui-struts2/src/it/createPoll/src/test/java/org/chorem/pollen/ui/it/CreateFreeTextPollIT.java Modified: trunk/pollen-ui-struts2/src/it/createPoll/pom.xml =================================================================== --- trunk/pollen-ui-struts2/src/it/createPoll/pom.xml 2013-05-26 12:25:30 UTC (rev 3796) +++ trunk/pollen-ui-struts2/src/it/createPoll/pom.xml 2013-05-26 12:53:04 UTC (rev 3797) @@ -39,5 +39,13 @@ <name>Pollen :: IT createPoll</name> <description>createPoll</description> + <dependencies> + <dependency> + <groupId>xml-apis</groupId> + <artifactId>xml-apis</artifactId> + <version>1.4.01</version> + </dependency> + </dependencies> + </project> Modified: trunk/pollen-ui-struts2/src/it/createPoll/src/test/java/org/chorem/pollen/ui/it/CreateFreeTextPollIT.java =================================================================== --- trunk/pollen-ui-struts2/src/it/createPoll/src/test/java/org/chorem/pollen/ui/it/CreateFreeTextPollIT.java 2013-05-26 12:25:30 UTC (rev 3796) +++ trunk/pollen-ui-struts2/src/it/createPoll/src/test/java/org/chorem/pollen/ui/it/CreateFreeTextPollIT.java 2013-05-26 12:53:04 UTC (rev 3797) @@ -31,6 +31,7 @@ import org.openqa.selenium.WebElement; import java.util.Date; +import java.util.List; /** * Test the well work of a Free text poll creation page. @@ -87,6 +88,8 @@ Assert.assertTrue(choiceTwoElement.isDisplayed()); choiceTwoElement.sendKeys("Choix numero deux"); + doClickSomeWhere(); + // Submit form WebElement submit = findElement(By.name("action:create")); submit.click(); @@ -119,6 +122,8 @@ String choiceTwoValue = "Choix numero deux"; choiceTwoElement.sendKeys(choiceTwoValue); + doClickSomeWhere(); + // Submit form WebElement submit = findElement(By.name("action:create")); submit.click(); @@ -159,6 +164,8 @@ String pollTitle = "My Poll"; titleElement.sendKeys(pollTitle); + doClickSomeWhere(); + // Submit form WebElement submit = findElement(By.name("action:create")); submit.click(); @@ -459,4 +466,13 @@ Assert.assertNotNull(maxChoicesError); } + // Since we put some security (to avoid robots), something must be click on screen + protected void doClickSomeWhere() { + List<WebElement> choiceTypesElement = findElements(By.name("poll.choiceType")); + Assert.assertEquals(3, choiceTypesElement.size()); +// WebElement dateChoiceTypeElement = choiceTypesElement.get(1); +// dateChoiceTypeElement.click(); + WebElement textChoiceTypeElement = choiceTypesElement.get(0); + textChoiceTypeElement.click(); + } }
participants (1)
-
tchemit@users.chorem.org