[seam-commits] Seam SVN: r11375 - in branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seamspace: src/org/jboss/seam/example/seamspace/test/selenium and 1 other directory.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Thu Aug 13 08:17:45 EDT 2009
Author: mgencur at redhat.com
Date: 2009-08-13 08:17:44 -0400 (Thu, 13 Aug 2009)
New Revision: 11375
Added:
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seamspace/src/org/jboss/seam/example/seamspace/test/selenium/FriendRequestTest.java
Modified:
branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seamspace/jboss5.xml
Log:
JBPAPP-2483 Creation of a testcase for seamspace example
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seamspace/jboss5.xml
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seamspace/jboss5.xml 2009-08-13 11:35:28 UTC (rev 11374)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seamspace/jboss5.xml 2009-08-13 12:17:44 UTC (rev 11375)
@@ -28,6 +28,7 @@
<class name="org.jboss.seam.example.seamspace.test.selenium.UserTest" />
<class name="org.jboss.seam.example.seamspace.test.selenium.RoleTest" />
<class name="org.jboss.seam.example.seamspace.test.selenium.BlogTest" />
+ <class name="org.jboss.seam.example.seamspace.test.selenium.FriendRequestTest" />
</classes>
</test>
</suite>
Added: branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seamspace/src/org/jboss/seam/example/seamspace/test/selenium/FriendRequestTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seamspace/src/org/jboss/seam/example/seamspace/test/selenium/FriendRequestTest.java (rev 0)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/examples/seamspace/src/org/jboss/seam/example/seamspace/test/selenium/FriendRequestTest.java 2009-08-13 12:17:44 UTC (rev 11375)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.example.seamspace.test.selenium;
+
+import org.testng.annotations.Test;
+import static org.testng.AssertJUnit.assertTrue;
+
+
+/**
+ * This class tests "Send a friend request" at seamspace example. This
+ * option is available when user opens somebody's profile.
+ *
+ * @author Martin Gencur
+ *
+ */
+
+public class FriendRequestTest extends SeleniumSeamSpaceTest
+{
+ public static final String DUKE_IMAGE = "xpath=//img[contains(@src,\"id=2\")]";
+ public static final String FRIEND_REQUEST_LINK = "link=Send a friend request";
+ public static final String MESSAGE_AREA = "xpath=//textarea[contains(@id,\"introduction\")]";
+ public static final String MESSAGE_TEXT = "Hi Duke, how are you?";
+ public static final String REQUEST_SEND_BUTTON = "xpath=//input[contains(@value,\"Send request\")]";
+ public static final String REQUEST_SENT_MESSAGE = "Friend request sent";
+
+ @Test
+ public void sendFriendRequestText(){
+ browser.clickAndWait(DUKE_IMAGE);
+ browser.clickAndWait(FRIEND_REQUEST_LINK);
+ browser.type(MESSAGE_AREA, MESSAGE_TEXT);
+ browser.clickAndWait(REQUEST_SEND_BUTTON);
+ assertTrue("Friend request sent page expected",browser.isTextPresent(REQUEST_SENT_MESSAGE));
+ }
+
+}
More information about the seam-commits
mailing list