Author: thomas.heute(a)jboss.com
Date: 2009-01-20 16:30:31 -0500 (Tue, 20 Jan 2009)
New Revision: 12576
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/build.xml
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSelenium.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java
Log:
Tests tweaks
Modified: branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/build.xml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/build.xml 2009-01-20
21:27:14 UTC (rev 12575)
+++ branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/build.xml 2009-01-20
21:30:31 UTC (rev 12576)
@@ -2,11 +2,12 @@
<property environment="env" />
+ <property name="workspace" location="build.xml" />
<property name="java.home" location="${env.JAVA_HOME}" />
<property name="suitename" location="testng-files" />
<property name="testname" location="testng-files" />
-
+
<property name="testng.dir" location="testng-files" />
<property name="testng.output.dir" location="test-output" />
<property name="test.build.dir" location="output/classes" />
@@ -55,11 +56,11 @@
<classpath refid="server.taskdef.classpath" />
</taskdef>
-<target name="init">
+ <target name="init">
<echo message="Browser : ${browser}" />
<echo message="Screenshot : ${screenshot}" />
- <echo message="Deleting testng report directory"/>
- <delete dir="${testng.output.dir}"/>
+ <echo message="Deleting testng report directory" />
+ <delete dir="${testng.output.dir}" />
</target>
@@ -89,8 +90,8 @@
</target>
<target name="copyApps">
- <echo message="Copying userInterceptor portlet into the ${portal.instance}
server"/>
- <copy file="apps/userDetail-portlet.war"
tofile="${jboss.home}/server/${portal.instance}/deploy/userDetail-portlet.war"/>
+ <echo message="Copying userInterceptor portlet into the ${portal.instance}
server" />
+ <copy file="apps/userDetail-portlet.war"
tofile="${jboss.home}/server/${portal.instance}/deploy/userDetail-portlet.war"
/>
</target>
<target name="clean">
@@ -120,8 +121,7 @@
<echo message="Runing TestNG" />
<mkdir dir="test-output" />
- <testng classpathref="test.cp" sourcedir="${test.src.dir}"
outputdir="test-output"
listeners="org.testng.reporters.JUnitXMLReporter"
- suitename="SeleniumSuite">
+ <testng classpathref="test.cp" sourcedir="${test.src.dir}"
outputdir="test-output"
listeners="org.testng.reporters.JUnitXMLReporter"
suitename="SeleniumSuite">
<xmlfileset dir="." includes="testng.xml" />
@@ -137,32 +137,33 @@
<antcall target="cleanup" />
</target>
- <target name="single-test" depends="init, compile, run-src">
+ <target name="single-test" depends="init, compile, run-src,
copyApps">
+ <echo message="Runing TestNG" />
- <testng classpathref="test.cp" sourcedir="${test.src.dir}"
outputdir="${testng.output.dir}" suitename="SeleniumTest"
testname="org.jboss.portal.test.selenium.SingleTestCase">
-<!-- listeners="org.testng.reporters.JUnitXMLReporter"-->
- <classfileset dir="${test.build.dir}"
- includes="${testname}" />
+ <mkdir dir="test-output" />
+ <testng classpathref="test.cp" sourcedir="${test.src.dir}"
outputdir="${testng.output.dir}" suitename="SeleniumSingleTest"
listeners="org.jboss.portal.test.selenium.JBossSeleniumTestListener">
+
+ <classfileset dir="${test.build.dir}" includes="${testname}"
/>
<sysproperty key="browser" value="${browser}" />
<sysproperty key="screenshot" value="${screenshot}" />
+ <sysproperty key="workspace" value="${workspace}" />
+
<jvmarg value="-ea" />
</testng>
</target>
- <target name="selenium-test" depends="init, compile,
run-src">
+ <target name="selenium-test" depends="init, compile, run-src,
copyApps">
+ <echo message="Runing TestNG" />
- <antcall target="copyApps" />
- <echo message="Runing TestNG" />
<mkdir dir="test-output" />
- <testng classpathref="test.cp" sourcedir="${test.src.dir}"
outputdir="${testng.output.dir}"
- suitename="SeleniumSuite">
+ <testng classpathref="test.cp" sourcedir="${test.src.dir}"
outputdir="${testng.output.dir}" suitename="SeleniumSuite">
<xmlfileset dir="." includes="testng.xml" />
<sysproperty key="browser" value="${browser}" />
<sysproperty key="screenshot" value="${screenshot}" />
- <sysproperty key="workspace" value="${workspace}"/>
+ <sysproperty key="workspace" value="${workspace}" />
<jvmarg value="-ea" />
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSelenium.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSelenium.java 2009-01-20
21:27:14 UTC (rev 12575)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSelenium.java 2009-01-20
21:30:31 UTC (rev 12576)
@@ -13,7 +13,7 @@
public class JBossSelenium extends DefaultSelenium {
- protected static String PAGE_LOAD= "350000";
+ protected static String PAGE_LOAD= "500000";
protected static int count;
@Override
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java 2009-01-20
21:27:14 UTC (rev 12575)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java 2009-01-20
21:30:31 UTC (rev 12576)
@@ -12,15 +12,17 @@
@Test(groups = { "cms_archive_upload" }, enabled = true)
public class CMSArchiveUploadTestCase extends JBossPortalSeleniumTestCase {
-
- private static final String ARCHIVE_WAITING = "90000";
- /* uncomment following lines and set the right path to the workspace in the case
- * you want to use this test case locally from eclipse */
+
+ private static final String ARCHIVE_WAITING = "60000";
/*
- {
- System.setProperty("workspace","/home/vrockai/workspace/selenium/selenium/");
- }
- */
+ * uncomment following lines and set the right path to the workspace in the
+ * case you want to use this test case locally from eclipse
+ */
+ /*
+ * {
+ *
System.setProperty("workspace","/home/vrockai/workspace/p2.7tests/ui-tests/"
+ * ); }
+ */
private static final String SUB_CANCEL_ARCH_UPLOAD = "cancel";
private static final String LNK_ADMIN = "link=Admin";
private static final String LNK_CMS = "link=CMS";
@@ -30,21 +32,21 @@
private static final String SEL_ACTION =
"//div[@id='center']/div/div/div[1]/div/select";
private final String WORKSPACE = System.getProperty("workspace");
- @BeforeMethod( groups = { "log" })
+ @BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
logoutIfPossible();
login("admin", "admin");
}
- @AfterMethod( groups = { "log" })
+ @AfterMethod(groups = { "log" })
public void logoutAfterTest() {
-
+
}
@Test(enabled = true, description = "Test archive consisting of two files
upload.")
public void testArchiveUpload() {
// canceling at the first stage
-
+
selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CMS);
@@ -54,18 +56,18 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
selenium.type(INP_ARCHIVE_FILE, WORKSPACE + "/test_files/archive.zip");
-
+
selenium.click(SUB_CANCEL_ARCH_UPLOAD);
selenium.waitForPageToLoad(PAGE_LOAD);
-
-
- Assert.assertFalse(selenium.isTextPresent("Your archive has been accepted for
processing"));
- Assert.assertFalse(selenium.isElementPresent("link=archive"));
-
+
+ Assert.assertFalse(selenium.isTextPresent("Your archive has been accepted for
processing"),
+ "archive was accepted for processing afte cancelling the upload");
+ Assert.assertFalse(selenium.isElementPresent("link=archive"), "not
uploaded (upload cancelled) archive found #1");
+
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertFalse(selenium.isElementPresent("link=archive"));
-
+ Assert.assertFalse(selenium.isElementPresent("link=archive"), "not
uploaded (upload cancelled) archive found #2");
+
// really uploading the file now
selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -76,12 +78,10 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
selenium.type(INP_ARCHIVE_FILE, WORKSPACE + "/test_files/archive.zip");
-
+
selenium.click(SUB_SEND_ARCHIVE);
selenium.waitForPageToLoad(PAGE_LOAD);
- //
-
- selenium.waitForPageToLoad(PAGE_LOAD);
+
Assert.assertEquals(selenium.getText(DIV_ARCHIVE_STATUS),
"Your archive has been accepted for processing. The resources will appear in
your Folder once the processing is finished");
@@ -89,19 +89,19 @@
selenium.click("link=Home");
selenium.setSpeed("0");
selenium.waitForPageToLoad(PAGE_LOAD);
-
- Assert.assertEquals(selenium.getText("link=archive"), "archive");
+ Assert.assertTrue(selenium.isElementPresent("link=archive"), "uploaded
archive not found");
+
selenium.click("link=archive");
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertEquals(selenium.getText("link=readme.txt"),
"readme.txt");
- Assert.assertEquals(selenium.getText("link=jbosslogo.png"),
"jbosslogo.png");
+ Assert.assertEquals(selenium.isElementPresent("link=readme.txt"),
"content of uploaded file not found #1");
+ Assert.assertEquals(selenium.isElementPresent("link=jbosslogo.png"),
"content of uploaded file not found #2");
}
-
+
@Test(enabled = true, description = "Test archive consisting of > 100 files
upload.")
public void testManyFilesArchiveUpload() {
-
+
selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CMS);
@@ -111,7 +111,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
selenium.type(INP_ARCHIVE_FILE, WORKSPACE + "/test_files/many_files.zip");
-
+
selenium.click(SUB_SEND_ARCHIVE);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -122,20 +122,18 @@
selenium.click("link=Home");
selenium.setSpeed("0");
selenium.waitForPageToLoad(PAGE_LOAD);
-
- Assert.assertTrue(selenium.isElementPresent("link=many_files"));
+ Assert.assertTrue(selenium.isElementPresent("link=many_files"),
"uploaded archive not found");
+
selenium.click("link=many_files");
selenium.waitForPageToLoad(PAGE_LOAD);
- //TODO assert all files
-
- Assert.assertTrue(selenium.isElementPresent("link=file31.txt"));
+ Assert.assertTrue(selenium.isElementPresent("link=file31.txt"), "content
of uploaded archive not found");
}
-
+
@Test(enabled = true, description = "Test archive consisting of 21MB file
upload.")
public void testBigArchiveUpload() {
-
+
selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CMS);
@@ -145,7 +143,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
selenium.type(INP_ARCHIVE_FILE, WORKSPACE + "/test_files/big_archive.zip");
-
+
selenium.click(SUB_SEND_ARCHIVE);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -156,8 +154,7 @@
selenium.click("link=Home");
selenium.setSpeed("0");
selenium.waitForPageToLoad(PAGE_LOAD);
-
- Assert.assertTrue(selenium.isElementPresent("link=bigfile"));
+ Assert.assertTrue(selenium.isElementPresent("link=bigfile"), "uploaded
archive not found");
}
}
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2009-01-20
21:27:14 UTC (rev 12575)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2009-01-20
21:30:31 UTC (rev 12576)
@@ -297,11 +297,13 @@
selenium.open("/portal/portal/default");
selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertFalse(selenium.isTextPresent("Enteprise Portal Platform"));
Assert.assertTrue(selenium.isElementPresent("//img[@alt='JBoss Portal 2.7: Go
Faster!']"));
selenium.click(LNK_EXPLORE);
selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("Enteprise Portal Platform"));
Assert.assertFalse(selenium.isElementPresent("//img[@alt='JBoss Portal 2.7: Go
Faster!']"));
-
+
login("admin", "admin");
selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -323,12 +325,14 @@
selenium.waitForPageToLoad(PAGE_LOAD);
logout();
+ Assert.assertFalse(selenium.isTextPresent("Enteprise Portal Platform"));
Assert.assertTrue(selenium.isElementPresent("//img[@alt='JBoss Portal 2.7: Go
Faster!']"));
selenium.open("/portal/portal/default");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_EXPLORE);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isElementPresent("//img[@alt='JBoss Portal 2.7: Go
Faster!']"));
+ Assert.assertFalse(selenium.isTextPresent("Enteprise Portal Platform"));
+ Assert.assertFalse(selenium.isElementPresent("//img[@alt='JBoss Portal 2.7: Go
Faster!']"));
}
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java 2009-01-20
21:27:14 UTC (rev 12575)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java 2009-01-20
21:30:31 UTC (rev 12576)
@@ -10,7 +10,7 @@
public class PortletInstancesTestCase extends JBossPortalSeleniumTestCase {
- private static final String TAB_PORTLET_INSTANCES = "instancesTable2";
+ private static final String TAB_PORTLET_INSTANCES =
"//table[contains(@id,'instancesTable2')]";
private static final String UL_PAGINATOR = "//ul[@class='pagination
property-container']";
private static final String SUBMIT_SECURITY_UPDATE =
"//input[contains(@id,'common-edit-security-form:update')]";
private static final String SUBMIT_SECURITY_CANCEL =
"//input[contains(@id,'common-edit-security-form:cancel')]";
@@ -68,9 +68,9 @@
int r = traversePortlets(NAME_COUNTPORT,0);
clickAndWait(MessageFormat.format(LNK_INSTANCE_BUTTON, r));
- safeSelect(SELECT_LANGUAGE, "Czech");
+ safeSelect(SELECT_LANGUAGE, "English");
- final String name = "Administracny";
+ final String name = "Administracning";
selenium.type(INPUT_NAME, name);
clickAndWait(SUBMIT_MODIFY_NAME);
Assert.assertTrue(findTableRow(TABLE_DISPNAMES, name, 1) >= 0);
@@ -131,7 +131,7 @@
@Test(enabled = true)
public void testSecure() {
String instance_name = "JSPPortletInstance";
- String table = TAB_PORTLET_INSTANCES;
+ //String table = TAB_PORTLET_INSTANCES;
// selenium.click(LINK_20_PAGE);
// selenium.waitForPageToLoad(PAGE_LOAD);
@@ -140,7 +140,7 @@
int r = traversePortlets(instance_name,0);
selenium.click(MessageFormat.format(LNK_SEC_BUTTON, r));
- selenium.waitForPageToLoad("30000");
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("//input[contains(@name,'common-edit-security-form:cars_2')]");
selenium.click("//input[contains(@name,'common-edit-security-form:cars_1')]");
selenium.click("//input[contains(@name,'common-edit-security-form:cars_0')]");
@@ -148,10 +148,10 @@
selenium.click("//input[contains(@name,'common-edit-security-form:cars_1')
and @value='admin']");
selenium.click("//input[contains(@name,'common-edit-security-form:cars_2')
and @value='admin']");
selenium.click(SUBMIT_SECURITY_UPDATE);
- selenium.waitForPageToLoad("30000");
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.open("/portal/auth/portal/default/");
- selenium.waitForPageToLoad("30000");
+ selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Greetings !"));
// then cancel
@@ -164,16 +164,16 @@
r = traversePortlets(instance_name,0);
selenium.click(MessageFormat.format(LNK_SEC_BUTTON, r));
- selenium.waitForPageToLoad("30000");
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("//input[contains(@name,'common-edit-security-form:cars_0')]");
selenium.click("//input[contains(@name,'common-edit-security-form:cars_1')
and @value='admin']");
selenium.click("//input[contains(@name,'common-edit-security-form:cars_0')
and @value='admin']");
selenium.click("//input[contains(@name,'common-edit-security-form:cars_2')
and @value='admin']");
selenium.click("//input[contains(@name,'common-edit-security-form:cars_1')]");
selenium.click(SUBMIT_SECURITY_CANCEL);
- selenium.waitForPageToLoad("30000");
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.open("/portal/auth/portal/default/");
- selenium.waitForPageToLoad("30000");
+ selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Greetings !"));
// then really stop the greetings portlet
@@ -184,17 +184,17 @@
//r = findTableRow(table, instance_name, 0);
r = traversePortlets(instance_name,0);
selenium.click(MessageFormat.format(LNK_SEC_BUTTON, r));
- selenium.waitForPageToLoad("30000");
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("//input[contains(@name,'common-edit-security-form:cars_0')]");
selenium.click("//input[contains(@name,'common-edit-security-form:cars_1')
and @value='admin']");
selenium.click("//input[contains(@name,'common-edit-security-form:cars_0')
and @value='admin']");
selenium.click("//input[contains(@name,'common-edit-security-form:cars_2')
and @value='admin']");
selenium.click("//input[contains(@name,'common-edit-security-form:cars_1')]");
selenium.click(SUBMIT_SECURITY_UPDATE);
- selenium.waitForPageToLoad("30000");
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.open("/portal/auth/portal/default/");
- selenium.waitForPageToLoad("30000");
+ selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertFalse(selenium.isTextPresent("Greetings !"));
}