Author: vrockai
Date: 2009-04-27 11:39:30 -0400 (Mon, 27 Apr 2009)
New Revision: 13274
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalAjaxSamplesTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalSamplesTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties
Log:
[JBPORTAL-2313] - selenium; url test, ajax and static, addded
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalAjaxSamplesTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalAjaxSamplesTestCase.java 2009-04-27
10:59:14 UTC (rev 13273)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalAjaxSamplesTestCase.java 2009-04-27
15:39:30 UTC (rev 13274)
@@ -154,6 +154,21 @@
private final String CACHE_DIV_1_RENDER = getLoc(casePfx +
"cache.div.1.render",
"//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/div[2]/div");
+ private final String URL_LNK = getLoc(casePfx + "url.lnk", "");
+ private final String URL_INP_NAME1 = getLoc(casePfx + "url.inp.name1",
"");
+ private final String URL_INP_VALUE1 = getLoc(casePfx + "url.inp.value1",
"");
+ private final String URL_SUB1 = getLoc(casePfx + "url.sub1", "");
+ private final String URL_DIV1 = getLoc(casePfx + "url.div1", "");
+ private final String URL_LNK1_R = getLoc(casePfx + "url.lnk1.red",
"");
+ private final String URL_LNK1_B = getLoc(casePfx + "url.lnk1.blue",
"");
+ private final String URL_LNK1_W = getLoc(casePfx + "url.lnk1.white",
"");
+ private final String URL_INP_NAME2 = getLoc(casePfx + "url.inp.name2",
"");
+ private final String URL_INP_VALUE2 = getLoc(casePfx + "url.inp.value2",
"");
+ private final String URL_SUB2 = getLoc(casePfx + "url.sub2", "");
+ private final String URL_DIV2 = getLoc(casePfx + "url.div2", "");
+ private final String URL_LNK2_R = getLoc(casePfx + "url.lnk2.red",
"");
+ private final String URL_LNK2_B = getLoc(casePfx + "url.lnk2.blue",
"");
+ private final String URL_LNK2_W = getLoc(casePfx + "url.lnk2.white",
"");
@BeforeMethod(groups = { "log" })
protected void loginBeforeTest() {
selenium.open("/portal/portal/default/default");
@@ -539,12 +554,27 @@
}
/**
- * Url portlet test.
+ * Url portlet test. Fills in the two input boxes with "name" and
"viliam" values. Then it clicks on the "red" link in the second box.
Finally, it is asserted
+ * that the table in the second portlet is red and values are filled right as they were
before clicking the "red" link.
*/
- // TODO enable test - more information needed
- @Test(enabled = false)
+ @Test(enabled = true)
public void urlPortletTest() {
+ selenium.click(URL_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.type(URL_INP_NAME1, "name");
+ selenium.type(URL_INP_VALUE1, "viliam");
+
+ assertTrue(selenium.isElementPresent(URL_DIV2));
+
+ selenium.click(URL_LNK2_R);
+ waitFor(AJAX_TIMEOUT);
+
+ assertTrue(selenium.isElementPresent(URL_DIV2));
+
+ assertEquals(selenium.getValue(URL_INP_NAME1), "name");
+ assertEquals(selenium.getValue(URL_INP_VALUE1), "viliam");
}
/**
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalSamplesTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalSamplesTestCase.java 2009-04-27
10:59:14 UTC (rev 13273)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortalSamplesTestCase.java 2009-04-27
15:39:30 UTC (rev 13274)
@@ -132,7 +132,23 @@
private final String CACHE_LNK_1ACT = getLoc(casePfx + "cache.lnk.1act",
"link=action");
private final String CACHE_2RENDER = getLoc(casePfx + "cache.2render",
"//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[2]/div");
private final String CACHE_1RENDER = getLoc(casePfx + "cache.1render",
"//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/div[2]/div");
-
+
+ private final String URL_LNK = getLoc(casePfx + "url.lnk", "");
+ private final String URL_INP_NAME1 = getLoc(casePfx + "url.inp.name1",
"");
+ private final String URL_INP_VALUE1 = getLoc(casePfx + "url.inp.value1",
"");
+ private final String URL_SUB1 = getLoc(casePfx + "url.sub1", "");
+ private final String URL_DIV1 = getLoc(casePfx + "url.div1", "");
+ private final String URL_LNK1_R = getLoc(casePfx + "url.lnk1.red",
"");
+ private final String URL_LNK1_B = getLoc(casePfx + "url.lnk1.blue",
"");
+ private final String URL_LNK1_W = getLoc(casePfx + "url.lnk1.white",
"");
+ private final String URL_INP_NAME2 = getLoc(casePfx + "url.inp.name2",
"");
+ private final String URL_INP_VALUE2 = getLoc(casePfx + "url.inp.value2",
"");
+ private final String URL_SUB2 = getLoc(casePfx + "url.sub2", "");
+ private final String URL_DIV2 = getLoc(casePfx + "url.div2", "");
+ private final String URL_LNK2_R = getLoc(casePfx + "url.lnk2.red",
"");
+ private final String URL_LNK2_B = getLoc(casePfx + "url.lnk2.blue",
"");
+ private final String URL_LNK2_W = getLoc(casePfx + "url.lnk2.white",
"");
+
/**
* Login before test.
*/
@@ -545,12 +561,30 @@
}
/**
- * Url portlet test.
+ * Url portlet test. Fills in the two input boxes with "name" and
"viliam" values. Then it clicks on the "red" link in the second box.
Finally, it is asserted
+ * that the table in the second portlet is red and values are filled right as they were
before clicking the "red" link.
*/
// TODO enable test - more information needed
- @Test(enabled = false)
+ @Test(enabled = true)
public void urlPortletTest() {
+ selenium.click(URL_LNK);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.type(URL_INP_NAME1, "name");
+ selenium.type(URL_INP_VALUE1, "viliam");
+
+ assertTrue(selenium.isElementPresent(URL_DIV2));
+
+ selenium.click(URL_LNK2_R);
+
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ assertTrue(selenium.isElementPresent(URL_DIV2));
+
+ assertEquals(selenium.getValue(URL_INP_NAME1), "");
+ assertEquals(selenium.getValue(URL_INP_VALUE1), "");
+
}
/**
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties
===================================================================
---
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties 2009-04-27
10:59:14 UTC (rev 13273)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties 2009-04-27
15:39:30 UTC (rev 13274)
@@ -533,6 +533,22 @@
samples.cache.2render=//div[@id='regionB']/div[2]/table/tbody/tr[2]/td[2]/div/div[2]/div
samples.cache.1render=//div[@id='regionB']/div[1]/table/tbody/tr[2]/td[2]/div/div[2]/div
+samples.url.lnk=link=URL portlet
+samples.url.inp.name1=name
+samples.url.inp.value1=value
+samples.url.sub1=
+samples.url.div1=
+samples.url.lnk1.blue
+samples.url.lnk1.red=
+samples.url.lnk1.white
+samples.url.inp.name2=
+samples.url.inp.value2=
+samples.url.sub2=
+samples.url.div2=//html/body/div[2]/div/div/div[2]/div[2]/div[2]/table/tbody/tr[2]/td[2]/div/table
+samples.url.lnk2.blue=
+samples.url.lnk2.red=//html/body/div[2]/div/div/div[2]/div[2]/div[2]/table/tbody/tr[2]/td[2]/div/a[2]
+samples.url.lnk2.white=
+
# PortalAjaxSamplesTestCase
samples.ajax.ses.lnk.invalidate=link=invalidate
@@ -561,7 +577,7 @@
samples.ajax.pub.div.3.juu=//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/form/table/tbody/tr/td[2]/input
samples.ajax.pub.div.2.juu=juu
samples.ajax.pub.div.2.foo=//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/form/table/tbody/tr/td[2]/input
-samples.ajax.pub.div.1.bar=bar
+samples.ajax.pub.div.1.bar=barsamples.url.lnk=link=URL portlet
samples.ajax.pub.div.1.foo=foo
samples.ajax.pub.lnk=//ul[@id='tabsHeader']/li[4]/ul/li[12]/a
samples.ajax.pevt.div.p3.max=//html/body/div[2]/div/div/div[2]/div[2]/div/div[3]/div/div/table/tbody/tr/td[2]/div/div[2]/span/a
@@ -610,7 +626,8 @@
samples.ajax.enc.inp.act=//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/div/form[2]/input
samples.ajax.enc.textarea2=//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/div[5]/textarea
samples.ajax.enc.textarea1=//textarea[@name='text']
-samples.ajax.char.all.sub.check=//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/div[8]/form/input[3]
+samples.ajax.char.all.sub.check=//hsamples.url.lnk=link=URL portlet
+
samples.ajax.char.inp.text.sub.check=//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/div[6]/form/input[4]
samples.ajax.char.lnk.textarea.check=//input[@value='check']
samples.ajax.char.inp.text=//input[@name='text']
@@ -626,3 +643,19 @@
samples.ajax.cache.lnk.1act=link=action
samples.ajax.cache.div.2.render=//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/div[2]/div
samples.ajax.cache.div.1.render=//html/body/div[2]/div/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[2]/td[2]/div/div/div[2]/div
+
+samples.ajax.url.lnk=//ul[@id='tabsHeader']/li[4]/ul/li[15]/a
+samples.ajax.url.inp.name1=name
+samples.ajax.url.inp.value1=value
+samples.ajax.url.sub1=
+samples.ajax.url.div1=
+samples.ajax.url.lnk1.blue
+samples.ajax.url.lnk1.red=
+samples.ajax.url.lnk1.white
+samples.ajax.url.inp.name2=
+samples.ajax.url.inp.value2=
+samples.ajax.url.sub2=
+samples.ajax.url.div2=//html/body/div[2]/div/div/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/table
+samples.ajax.url.lnk2.blue=
+samples.ajax.url.lnk2.red=//div[contains(@id,'expander')]/div[2]/div[2]/div/div[2]/div/div/table/tbody/tr[2]/td[2]/div/div/a[2]
+samples.ajax.url.lnk2.white=
\ No newline at end of file