Author: ppitonak(a)redhat.com
Date: 2011-01-20 08:48:30 -0500 (Thu, 20 Jan 2011)
New Revision: 21115
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToolbarBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richTabPanel/simple.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/waiting/EventFiredCondition.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jActionListener/TestA4JActionListener.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestCommand.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestSelectMany.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestSelectOne.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestTextInput.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jLog/TestA4JLog.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Inject.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/IssueTracking.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/AbstractCalendarTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestFacets.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richFunctions/TestClientFunctions.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelect.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/AbstractTestToggleControl.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbar/TestRichToolbar.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbarGroup/TestRichToolbarGroup.java
Log:
* tests fixed
* refactoring
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToolbarBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToolbarBean.java 2011-01-20
13:01:04 UTC (rev 21114)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToolbarBean.java 2011-01-20
13:48:30 UTC (rev 21115)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -25,6 +25,7 @@
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
+
import org.richfaces.component.UIToolbar;
import org.richfaces.tests.metamer.Attributes;
import org.slf4j.Logger;
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richTabPanel/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richTabPanel/simple.xhtml 2011-01-20
13:01:04 UTC (rev 21114)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richTabPanel/simple.xhtml 2011-01-20
13:48:30 UTC (rev 21115)
@@ -6,7 +6,7 @@
<!--
JBoss, Home of Professional Open Source
-Copyright 2010, Red Hat, Inc. and individual contributors
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
by the @authors tag. See the copyright.txt in the distribution for a
full listing of individual contributors.
@@ -40,7 +40,7 @@
<ui:define name="component">
- <rich:tabPanel id="tabPanel"
+ <rich:tabPanel id="tabPanel"
activeItem="#{richTabPanelBean.attributes['activeItem'].value}"
bypassUpdates="#{richTabPanelBean.attributes['bypassUpdates'].value}"
cycledSwitching="#{richTabPanelBean.attributes['cycledSwitching'].value}"
@@ -69,9 +69,13 @@
styleClass="#{richTabPanelBean.attributes['styleClass'].value}"
switchType="#{richTabPanelBean.attributes['switchType'].value}"
tabContentClass="#{richTabPanelBean.attributes['tabContentClass'].value}"
+
tabHeaderClass="#{richTabPanelBean.attributes['tabHeaderClass'].value}"
+
tabHeaderClassActive="#{richTabPanelBean.attributes['tabHeaderClassActive'].value}"
+
tabHeaderClassDisabled="#{richTabPanelBean.attributes['tabHeaderClassDisabled'].value}"
+
tabHeaderClassInactive="#{richTabPanelBean.attributes['tabHeaderClassInactive'].value}"
title="#{richTabPanelBean.attributes['title'].value}"
-
+
<rich:tab id="tab1" name="tab1" header="tab1
header">
content of tab 1
</rich:tab>
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/waiting/EventFiredCondition.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/waiting/EventFiredCondition.java 2011-01-20
13:01:04 UTC (rev 21114)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/waiting/EventFiredCondition.java 2011-01-20
13:48:30 UTC (rev 21115)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jActionListener/TestA4JActionListener.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jActionListener/TestA4JActionListener.java 2011-01-20
13:01:04 UTC (rev 21114)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jActionListener/TestA4JActionListener.java 2011-01-20
13:48:30 UTC (rev 21115)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestCommand.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestCommand.java 2011-01-20
13:01:04 UTC (rev 21114)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestCommand.java 2011-01-20
13:48:30 UTC (rev 21115)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestSelectMany.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestSelectMany.java 2011-01-20
13:01:04 UTC (rev 21114)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestSelectMany.java 2011-01-20
13:48:30 UTC (rev 21115)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestSelectOne.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestSelectOne.java 2011-01-20
13:01:04 UTC (rev 21114)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestSelectOne.java 2011-01-20
13:48:30 UTC (rev 21115)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestTextInput.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestTextInput.java 2011-01-20
13:01:04 UTC (rev 21114)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestTextInput.java 2011-01-20
13:48:30 UTC (rev 21115)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jLog/TestA4JLog.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jLog/TestA4JLog.java 2011-01-20
13:01:04 UTC (rev 21114)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jLog/TestA4JLog.java 2011-01-20
13:48:30 UTC (rev 21115)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java 2011-01-20
13:01:04 UTC (rev 21114)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java 2011-01-20
13:48:30 UTC (rev 21115)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Inject.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Inject.java 2011-01-20
13:01:04 UTC (rev 21114)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Inject.java 2011-01-20
13:48:30 UTC (rev 21115)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/IssueTracking.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/IssueTracking.java 2011-01-20
13:01:04 UTC (rev 21114)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/IssueTracking.java 2011-01-20
13:48:30 UTC (rev 21115)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/AbstractCalendarTest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/AbstractCalendarTest.java 2011-01-20
13:01:04 UTC (rev 21114)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCalendar/AbstractCalendarTest.java 2011-01-20
13:48:30 UTC (rev 21115)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestFacets.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestFacets.java 2011-01-20
13:01:04 UTC (rev 21114)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestFacets.java 2011-01-20
13:48:30 UTC (rev 21115)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richFunctions/TestClientFunctions.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richFunctions/TestClientFunctions.java 2011-01-20
13:01:04 UTC (rev 21114)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richFunctions/TestClientFunctions.java 2011-01-20
13:48:30 UTC (rev 21115)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java 2011-01-20
13:01:04 UTC (rev 21114)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java 2011-01-20
13:48:30 UTC (rev 21115)
@@ -152,7 +152,7 @@
selenium.waitForPageToLoad();
String height = selenium.getStyle(jq("span.rf-is-lst-scrl"),
CssProperty.HEIGHT);
- assertEquals(height, "300px", "Height of list did not
change");
+ assertEquals(height, "300px", "Height of list did not change
correctly.");
selenium.type(pjq("input[type=text][id$=listHeightInput]"),
"");
selenium.waitForPageToLoad();
@@ -160,7 +160,7 @@
// it cannot handle null because of a bug in Mojarra and Myfaces and
// generates style="height: ; " instead of default value
height = selenium.getStyle(jq("span.rf-is-lst-scrl"),
CssProperty.HEIGHT);
- assertEquals(height, "200px", "Height of list did not
change");
+ assertEquals(height, "100px", "Height of list did not change
correctly.");
}
@Test
@@ -415,7 +415,8 @@
selenium.click(options.format(10));
assertFalse(selenium.isDisplayed(popup), "Popup should not be
displayed.");
- assertEquals(selenium.getText(label), "Hawaii", "Label should
contain selected value.");
+ assertFalse(selenium.isDisplayed(label), "Label should not be
displayed.");
+ assertEquals(selenium.getValue(input), "Hawaii", "Input should
contain selected value.");
}
@Test
@@ -427,13 +428,13 @@
assertTrue(selenium.isDisplayed(popup), "Popup should be displayed.");
selenium.click(options.format(10));
- assertEquals(selenium.getText(label), "Click here to edit", "Label
should contain default value.");
+ assertFalse(selenium.isDisplayed(label), "Label should not be
displayed.");
assertFalse(selenium.isDisplayed(popup), "Popup should not be
displayed.");
selenium.fireEvent(input, Event.BLUR);
+ assertFalse(selenium.isDisplayed(label), "Label should not be
displayed.");
assertFalse(selenium.isDisplayed(popup), "Popup should not be
displayed.");
assertEquals(selenium.getValue(input), "Hawaii", "Input should
contain selected value.");
- waitGui.failWith("Label should contain selected
value.").until(textEquals.locator(label).text("Hawaii"));
}
@Test
@@ -446,7 +447,8 @@
selenium.click(options.format(10));
assertFalse(selenium.isDisplayed(popup), "Popup should not be
displayed.");
- assertEquals(selenium.getText(label), "Hawaii", "Label should
contain selected value.");
+ assertFalse(selenium.isDisplayed(label), "Label should not be
displayed.");
+ assertEquals(selenium.getValue(input), "Hawaii", "Input should
contain selected value.");
}
@Test
@@ -460,12 +462,13 @@
assertTrue(selenium.isDisplayed(popup), "Popup should be displayed.");
selenium.click(options.format(10));
- assertEquals(selenium.getText(label), "Click here to edit", "Label
should contain default value.");
+ assertFalse(selenium.isDisplayed(label), "Label should not be
displayed.");
assertFalse(selenium.isDisplayed(popup), "Popup should not be
displayed.");
- selenium.fireEvent(input, Event.BLUR);
+ guardNoRequest(selenium).fireEvent(input, Event.BLUR);
+ assertFalse(selenium.isDisplayed(label), "Label should not be
displayed.");
assertFalse(selenium.isDisplayed(popup), "Popup should not be
displayed.");
- assertEquals(selenium.getText(label), "Click here to edit", "Label
should contain default value.");
+ assertEquals(selenium.getValue(input), "Click here to edit",
"Input should contain default label.");
}
@Test
@@ -503,7 +506,7 @@
selenium.click(select);
selenium.click(options.format(10));
- assertEquals(selenium.getText(label), "Click here to edit", "Label
should contain default value.");
+ assertFalse(selenium.isDisplayed(label), "Label should not be
displayed.");
assertFalse(selenium.isDisplayed(popup), "Popup should not be
displayed.");
selenium.mouseDown(okButton);
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java 2011-01-20
13:01:04 UTC (rev 21114)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java 2011-01-20
13:48:30 UTC (rev 21115)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -25,6 +25,7 @@
import static
org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardNoRequest;
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.jboss.test.selenium.locator.option.OptionLocatorFactory.optionLabel;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
@@ -41,7 +42,6 @@
import javax.faces.event.PhaseId;
import org.jboss.test.selenium.css.CssProperty;
-
import org.jboss.test.selenium.encapsulated.JavaScript;
import org.jboss.test.selenium.geometry.Point;
import org.jboss.test.selenium.locator.Attribute;
@@ -231,7 +231,7 @@
}
@Test
- @Use(field = "delay", ints = {300, 500, 3700})
+ @Use(field = "delay", ints = {600, 1250, 3700})
public void testDelay() {
selenium.type(pjq("input[type=text][id$=delayInput]"),
delay.toString());
selenium.waitForPageToLoad();
@@ -334,35 +334,35 @@
public void testInputPosition() {
JQueryLocator br = pjq("span[id$=slider] br");
-
selenium.click(pjq("input[type=radio][name$=inputPositionInput][value=bottom]"));
+ selenium.select(pjq("select[id$=inputPositionInput]"),
optionLabel("bottom"));
selenium.waitForPageToLoad();
int inputPosition = selenium.getElementPositionTop(input);
int trackPosition = selenium.getElementPositionTop(track);
assertTrue(trackPosition < inputPosition, "Track should be above input on
the page.");
assertTrue(selenium.isElementPresent(br), "Track and input should not be on
the same line.");
-
selenium.click(pjq("input[type=radio][name$=inputPositionInput][value=top]"));
+ selenium.select(pjq("select[id$=inputPositionInput]"),
optionLabel("top"));
selenium.waitForPageToLoad();
inputPosition = selenium.getElementPositionTop(input);
trackPosition = selenium.getElementPositionTop(track);
assertTrue(trackPosition > inputPosition, "Track should be below input on
the page.");
assertTrue(selenium.isElementPresent(br), "Track and input should not be on
the same line.");
-
selenium.click(pjq("input[type=radio][name$=inputPositionInput][value=right]"));
+ selenium.select(pjq("select[id$=inputPositionInput]"),
optionLabel("right"));
selenium.waitForPageToLoad();
inputPosition = selenium.getElementPositionLeft(input);
trackPosition = selenium.getElementPositionLeft(track);
assertTrue(trackPosition < inputPosition, "Track should be on the left of
input on the page.");
assertFalse(selenium.isElementPresent(br), "Track and input should be on the
same line.");
-
selenium.click(pjq("input[type=radio][name$=inputPositionInput][value=left]"));
+ selenium.select(pjq("select[id$=inputPositionInput]"),
optionLabel("left"));
selenium.waitForPageToLoad();
inputPosition = selenium.getElementPositionLeft(input);
trackPosition = selenium.getElementPositionLeft(track);
assertTrue(trackPosition > inputPosition, "Track should be on the right
of input on the page.");
assertFalse(selenium.isElementPresent(br), "Track and input should be on the
same line.");
-
selenium.click(pjq("input[type=radio][name$=inputPositionInput][value=]"));
+ selenium.select(pjq("select[id$=inputPositionInput]"),
optionLabel("null"));
selenium.waitForPageToLoad();
inputPosition = selenium.getElementPositionLeft(input);
trackPosition = selenium.getElementPositionLeft(track);
@@ -436,9 +436,7 @@
selenium.type(pjq("input[type=text][id$=maxlengthInput]"),
"");
selenium.waitForPageToLoad();
- if (Integer.parseInt(selenium.getAttribute(attr)) == 0) {
- fail("Null attribute maxlength should not be evaluated as 0.");
- }
+ assertFalse(selenium.isAttributePresent(attr), "Attribute maxlength should
not be present.");
}
@Test
@@ -467,7 +465,7 @@
String reqTime = selenium.getText(time);
guardXhr(selenium).mouseDownAt(track, new Point(30, 0));
waitGui.failWith("Page was not updated").waitForChange(reqTime,
retrieveText.locator(time));
- assertEquals(selenium.getText(output), "-15", "Output was not
updated.");
+ assertEquals(selenium.getText(output), "-16", "Output was not
updated.");
String margin = selenium.getStyle(handle,
CssProperty.MARGIN_LEFT).replace("px", "").trim();
double marginD = Double.parseDouble(margin);
assertTrue(marginD > 25 && marginD < 35, "Left margin of
handle should be between 25 and 35.");
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelect.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelect.java 2011-01-20
13:01:04 UTC (rev 21114)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelect.java 2011-01-20
13:48:30 UTC (rev 21115)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -30,8 +30,8 @@
import static org.testng.Assert.assertTrue;
import java.net.URL;
-import org.jboss.test.selenium.css.CssProperty;
+import org.jboss.test.selenium.css.CssProperty;
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.locator.Attribute;
import org.jboss.test.selenium.locator.AttributeLocator;
@@ -215,8 +215,6 @@
selenium.type(pjq("input[type=text][id$=listHeightInput]"),
"");
selenium.waitForPageToLoad();
- // it cannot handle null because of a bug in Mojarra and Myfaces and
- // generates style="height: ; " instead of default value
height = selenium.getStyle(jq("span.rf-is-lst-scrl"),
CssProperty.HEIGHT);
assertEquals(height, "200px", "Height of list did not
change");
}
@@ -227,15 +225,15 @@
selenium.type(pjq("input[type=text][id$=listWidthInput]"),
"300px");
selenium.waitForPageToLoad();
- String width = selenium.getStyle(jq("span.rf-is-lst-pos"),
CssProperty.WIDTH);
+ selenium.mouseUp(button);
+ String width = selenium.getStyle(jq("div.rf-sel-lst-scrl"),
CssProperty.WIDTH);
assertEquals(width, "300px", "Width of list did not
change");
selenium.type(pjq("input[type=text][id$=listWidthInput]"),
"");
selenium.waitForPageToLoad();
- // it cannot handle null because of a bug in Mojarra and Myfaces and
- // generates style="width: ; " instead of default value
- width = selenium.getStyle(jq("span.rf-is-lst-pos"),
CssProperty.WIDTH);
+ selenium.mouseUp(button);
+ width = selenium.getStyle(jq("div.rf-sel-lst-scrl"),
CssProperty.WIDTH);
assertEquals(width, "200px", "Width of list did not
change");
}
@@ -457,11 +455,11 @@
selenium.click(pjq("input[type=radio][name$=showButtonInput][value=false]"));
selenium.waitForPageToLoad();
- selenium.click(select);
if (selenium.isElementPresent(button)) {
assertFalse(selenium.isVisible(button), "Button should not be
visible.");
}
+ selenium.mouseDown(input);
assertTrue(selenium.isVisible(popup), "Popup should be displayed.");
for (int i = 0; i < 50; i++) {
@@ -474,7 +472,8 @@
}
selenium.click(options.format(10));
- guardXhr(selenium).fireEvent(input, Event.BLUR);
+ selenium.fireEvent(input, Event.BLUR);
+ guardXhr(selenium).fireEvent(input, Event.BLUR); // some Selenium issue
assertTrue(selenium.belongsClass(options.format(10), "rf-sel-sel"));
waitGui.failWith("Bean was not
updated").until(textEquals.locator(output).text("Hawaii"));
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/AbstractTestToggleControl.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/AbstractTestToggleControl.java 2011-01-20
13:01:04 UTC (rev 21114)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToggleControl/AbstractTestToggleControl.java 2011-01-20
13:48:30 UTC (rev 21115)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbar/TestRichToolbar.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbar/TestRichToolbar.java 2011-01-20
13:01:04 UTC (rev 21114)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbar/TestRichToolbar.java 2011-01-20
13:48:30 UTC (rev 21115)
@@ -24,6 +24,7 @@
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
import static org.jboss.test.selenium.locator.option.OptionLocatorFactory.optionLabel;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
@@ -225,9 +226,13 @@
@Test
public void testWidth() {
- selenium.type(pjq("input[id$=widthInput]"), "");
+ AttributeLocator attr = toolbar.getAttribute(Attribute.WIDTH);
+ assertTrue(selenium.isAttributePresent(attr), "Attribute width should be
present.");
+ assertEquals(selenium.getAttribute(attr), "100%", "Attribute width
when it is not set.");
+
+ selenium.type(pjq("input[id$=widthInput]"), "500px");
selenium.waitForPageToLoad();
- testHtmlAttribute(toolbar, "width", "700px");
+ assertTrue(selenium.getAttribute(attr).contains("500px"),
"Attribute width should contain \"500px\".");
}
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbarGroup/TestRichToolbarGroup.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbarGroup/TestRichToolbarGroup.java 2011-01-20
13:01:04 UTC (rev 21114)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbarGroup/TestRichToolbarGroup.java 2011-01-20
13:48:30 UTC (rev 21115)
@@ -113,7 +113,7 @@
assertFalse(selenium.isElementPresent(separator), "No item separator should
be present on the page.");
- selenium.select(input, optionLabel("null"));
+ selenium.select(pjq("select[id$=itemSeparatorInput]"),
optionLabel("null"));
selenium.waitForPageToLoad();
assertFalse(selenium.isElementPresent(separator), "No item separator should
be present on the page.");