Author: vmassol
Date: 2009-09-24 08:58:35 +0200 (Thu, 24 Sep 2009)
New Revision: 23883
Modified:
enterprise/branches/xwiki-enterprise-2.0/distribution-test/ldap-tests/src/test/it/com/xpn/xwiki/it/LDAPAuthTest.java
enterprise/branches/xwiki-enterprise-2.0/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/it/selenium/AllDocsTest.java
enterprise/branches/xwiki-enterprise-2.0/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/it/selenium/DocExtraTest.java
enterprise/branches/xwiki-enterprise-2.0/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/it/selenium/SectionTest.java
enterprise/branches/xwiki-enterprise-2.0/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/it/selenium/framework/AbstractXWikiTestCase.java
enterprise/branches/xwiki-enterprise-2.0/distribution-test/wysiwyg-tests/src/test/it/com/xpn/xwiki/it/selenium/LinkTest.java
Log:
Improve API names thanks to Marius
Modified:
enterprise/branches/xwiki-enterprise-2.0/distribution-test/ldap-tests/src/test/it/com/xpn/xwiki/it/LDAPAuthTest.java
===================================================================
---
enterprise/branches/xwiki-enterprise-2.0/distribution-test/ldap-tests/src/test/it/com/xpn/xwiki/it/LDAPAuthTest.java 2009-09-23
21:45:22 UTC (rev 23882)
+++
enterprise/branches/xwiki-enterprise-2.0/distribution-test/ldap-tests/src/test/it/com/xpn/xwiki/it/LDAPAuthTest.java 2009-09-24
06:58:35 UTC (rev 23883)
@@ -110,7 +110,7 @@
// ///////////////////
// Validate XWIKI-2201: LDAP group mapping defined in XWikiPreferences is not
working
open("XWiki", "XWikiAdminGroup");
- assertAndWaitBodyContains("XWiki." + LDAPTestSetup.WILLIAMBUSH_UID);
+ waitForBodyContains("XWiki." + LDAPTestSetup.WILLIAMBUSH_UID);
// ///////////////////
// Validate
Modified:
enterprise/branches/xwiki-enterprise-2.0/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/it/selenium/AllDocsTest.java
===================================================================
---
enterprise/branches/xwiki-enterprise-2.0/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/it/selenium/AllDocsTest.java 2009-09-23
21:45:22 UTC (rev 23882)
+++
enterprise/branches/xwiki-enterprise-2.0/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/it/selenium/AllDocsTest.java 2009-09-24
06:58:35 UTC (rev 23883)
@@ -60,7 +60,7 @@
// elements in the table
open("Main", "AllDocs");
// We verify we have a least 3 pages displayed
-
assertAndWaitTextContains("//span[@class='xwiki-livetable-pagination-content']",
"1 2 3");
+
waitForTextContains("//span[@class='xwiki-livetable-pagination-content']",
"1 2 3");
if (isAuthenticated()) {
logout();
}
@@ -69,7 +69,7 @@
// Validate presence of "Actions" column in table view for
administrator.
loginAsAdmin();
open("Main", "AllDocs");
-
assertAndWaitTextContains("//span[@class='xwiki-livetable-pagination-content']",
"1 2 3");
+
waitForTextContains("//span[@class='xwiki-livetable-pagination-content']",
"1 2 3");
assertElementPresent("//th[normalize-space(text())='Actions']");
// Validate input suggest for Page field.
@@ -77,29 +77,29 @@
// Note: We wait on the pagination result since it's the last element
updated and it's done after the
// table rows have been updated so this allows us to wait on it. In the code
below "1" represents the
// displayed pages.
-
assertAndWaitTextPresent("//span[@class='xwiki-livetable-pagination-content']",
"1");
+
waitForTextPresent("//span[@class='xwiki-livetable-pagination-content']",
"1");
assertElementPresent("//td[contains(@class,
'doc_name')]/a[text()='Treeview']");
// Validate input suggest for Space field.
open("Main", "AllDocs");
-
assertAndWaitTextContains("//span[@class='xwiki-livetable-pagination-content']",
"1 2 3");
+
waitForTextContains("//span[@class='xwiki-livetable-pagination-content']",
"1 2 3");
getSelenium().typeKeys("xpath=//input[(a)name='doc.space']".space']",
"XWiki");
getSelenium().typeKeys("xpath=//input[(a)name='doc.name']"c.name']",
"treeview");
-
assertAndWaitTextPresent("//span[@class='xwiki-livetable-pagination-content']",
"1");
+
waitForTextPresent("//span[@class='xwiki-livetable-pagination-content']",
"1");
assertElementPresent("//td[contains(@class,
'doc_name')]/a[text()='Treeview']");
// Validate input suggest for Last Author field.
open("Main", "AllDocs");
-
assertAndWaitTextContains("//span[@class='xwiki-livetable-pagination-content']",
"1 2 3");
+
waitForTextContains("//span[@class='xwiki-livetable-pagination-content']",
"1 2 3");
getSelenium().typeKeys("xpath=//input[(a)name='doc.author']"author']",
"SomeUnknownAuthor");
-
assertAndWaitTextPresent("//span[@class='xwiki-livetable-pagination-content']",
"");
+
waitForTextPresent("//span[@class='xwiki-livetable-pagination-content']",
"");
assertElementNotPresent("//td[contains(@class,
'doc_name')]/a[text()='Treeview']");
// Validate Copy link action.
open("Main", "AllDocs");
-
assertAndWaitTextContains("//span[@class='xwiki-livetable-pagination-content']",
"1 2 3");
+
waitForTextContains("//span[@class='xwiki-livetable-pagination-content']",
"1 2 3");
getSelenium().typeKeys("xpath=//input[(a)name='doc.name']"c.name']",
"treeview");
-
assertAndWaitTextPresent("//span[@class='xwiki-livetable-pagination-content']",
"1");
+
waitForTextPresent("//span[@class='xwiki-livetable-pagination-content']",
"1");
assertElementPresent("//td[contains(@class,
'doc_name')]/a[text()='Treeview']");
clickLinkWithText("copy");
setFieldValue("targetdoc", "New.TreeviewCopy");
@@ -107,40 +107,40 @@
open("Main", "AllDocs");
getSelenium().typeKeys("xpath=//input[(a)name='doc.space']".space']",
"New");
getSelenium().typeKeys("xpath=//input[(a)name='doc.name']"c.name']",
"treeviewcopy");
-
assertAndWaitTextPresent("//span[@class='xwiki-livetable-pagination-content']",
"1");
+
waitForTextPresent("//span[@class='xwiki-livetable-pagination-content']",
"1");
assertElementPresent("//td[contains(@class,
'doc_name')]/a[text()='TreeviewCopy']");
// Validate Rename link action.
open("Main", "AllDocs");
-
assertAndWaitTextContains("//span[@class='xwiki-livetable-pagination-content']",
"1 2 3");
+
waitForTextContains("//span[@class='xwiki-livetable-pagination-content']",
"1 2 3");
getSelenium().typeKeys("xpath=//input[(a)name='doc.name']"c.name']",
"TreeviewCopy");
-
assertAndWaitTextPresent("//span[@class='xwiki-livetable-pagination-content']",
"1");
+
waitForTextPresent("//span[@class='xwiki-livetable-pagination-content']",
"1");
clickLinkWithLocator("//tbody/tr/td/a[text()='rename']");
setFieldValue("newPageName", "TreeviewCopyRenamed");
clickLinkWithLocator("//input[@value='Rename']");
open("Main", "AllDocs");
getSelenium().typeKeys("xpath=//input[(a)name='doc.name']"c.name']",
"TreeviewCopyRenamed");
-
assertAndWaitTextPresent("//span[@class='xwiki-livetable-pagination-content']",
"1");
+
waitForTextPresent("//span[@class='xwiki-livetable-pagination-content']",
"1");
assertElementPresent("//td[contains(@class,
'doc_name')]/a[text()='TreeviewCopyRenamed']");
// Validate Delete link action.
open("Main", "AllDocs");
-
assertAndWaitTextContains("//span[@class='xwiki-livetable-pagination-content']",
"1 2 3");
+
waitForTextContains("//span[@class='xwiki-livetable-pagination-content']",
"1 2 3");
getSelenium().typeKeys("xpath=//input[(a)name='doc.name']"c.name']",
"Treeviewcopyrenamed");
-
assertAndWaitTextPresent("//span[@class='xwiki-livetable-pagination-content']",
"1");
+
waitForTextPresent("//span[@class='xwiki-livetable-pagination-content']",
"1");
clickLinkWithLocator("//tbody/tr/td/a[text()='delete']");
clickLinkWithLocator("//input[@value='yes']");
assertTextPresent("The document has been deleted.");
open("Main", "AllDocs");
getSelenium().typeKeys("xpath=//input[(a)name='doc.name']"c.name']",
"treeview");
-
assertAndWaitTextPresent("//span[@class='xwiki-livetable-pagination-content']",
"1");
+
waitForTextPresent("//span[@class='xwiki-livetable-pagination-content']",
"1");
assertElementNotPresent("//td[contains(@class,
'doc_name')]/a[text()='TreeviewCopyRenamed']");
// Validate Rights link action.
open("Main", "AllDocs");
-
assertAndWaitTextContains("//span[@class='xwiki-livetable-pagination-content']",
"1 2 3");
+
waitForTextContains("//span[@class='xwiki-livetable-pagination-content']",
"1 2 3");
getSelenium().typeKeys("xpath=//input[(a)name='doc.name']"c.name']",
"Treeview");
-
assertAndWaitTextPresent("//span[@class='xwiki-livetable-pagination-content']",
"1");
+
waitForTextPresent("//span[@class='xwiki-livetable-pagination-content']",
"1");
clickLinkWithLocator("//tbody/tr/td/a[text()='rights']");
Assert.assertEquals("Editing Rights for Tree", getTitle());
}
Modified:
enterprise/branches/xwiki-enterprise-2.0/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/it/selenium/DocExtraTest.java
===================================================================
---
enterprise/branches/xwiki-enterprise-2.0/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/it/selenium/DocExtraTest.java 2009-09-23
21:45:22 UTC (rev 23882)
+++
enterprise/branches/xwiki-enterprise-2.0/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/it/selenium/DocExtraTest.java 2009-09-24
06:58:35 UTC (rev 23883)
@@ -55,28 +55,28 @@
open("Main", "WebHome");
int initialScrollY =
Integer.parseInt(getSelenium().getEval("window.scrollY"));
- assertAndWaitForElement("//a[@id='Attachmentslink']");
+ waitForElement("//a[@id='Attachmentslink']");
clickLinkWithXPath("//a[@id='Attachmentslink']", false);
waitForCondition("selenium.browserbot.findElement(\"Attachmentspane\").className.indexOf(\"empty\")
== -1");
assertElementPresent("attachform");
int scrollY =
Integer.parseInt(getSelenium().getEval("window.scrollY"));
assertEquals(initialScrollY, scrollY);
- assertAndWaitForElement("//a[@id='Historylink']");
+ waitForElement("//a[@id='Historylink']");
clickLinkWithXPath("//a[@id='Historylink']", false);
waitForCondition("selenium.browserbot.findElement(\"Historypane\").className.indexOf(\"empty\")
== -1");
assertElementPresent("historyform");
scrollY = Integer.parseInt(getSelenium().getEval("window.scrollY"));
assertEquals(initialScrollY, scrollY);
- assertAndWaitForElement("//a[@id='Informationlink']");
+ waitForElement("//a[@id='Informationlink']");
clickLinkWithXPath("//a[@id='Informationlink']", false);
waitForCondition("selenium.browserbot.findElement(\"Informationpane\").className.indexOf(\"empty\")
== -1");
assertTextPresent("Created");
scrollY = Integer.parseInt(getSelenium().getEval("window.scrollY"));
assertEquals(initialScrollY, scrollY);
- assertAndWaitForElement("//a[@id='Commentslink']");
+ waitForElement("//a[@id='Commentslink']");
clickLinkWithXPath("//a[@id='Commentslink']", false);
waitForCondition("selenium.browserbot.findElement(\"Commentspane\").className.indexOf(\"empty\")
== -1");
assertElementPresent("commentform");
Modified:
enterprise/branches/xwiki-enterprise-2.0/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/it/selenium/SectionTest.java
===================================================================
---
enterprise/branches/xwiki-enterprise-2.0/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/it/selenium/SectionTest.java 2009-09-23
21:45:22 UTC (rev 23882)
+++
enterprise/branches/xwiki-enterprise-2.0/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/it/selenium/SectionTest.java 2009-09-24
06:58:35 UTC (rev 23883)
@@ -96,7 +96,7 @@
{
initXWiki20Env();
// Since the section edit links are inserted with JS we need to ensure
they've been generated
-
assertAndWaitForElement("//div[@id='xwikicontent']/span[2]/a");
+ waitForElement("//div[@id='xwikicontent']/span[2]/a");
// TODO: I don't understand why the following xpath expression doesn't
work:
//
clickLinkWithLocator("//div[@id='xwikicontent']/span/a[contains(@href,
'section=2']");
clickLinkWithLocator("//div[@id='xwikicontent']/span[2]/a");
// Edit the second editable section
@@ -114,7 +114,7 @@
{
initXWiki20Env();
// Since the section edit links are inserted with JS we need to ensure
they've been generated
-
assertAndWaitForElement("//div[@id='xwikicontent']/span[4]/a");
+ waitForElement("//div[@id='xwikicontent']/span[4]/a");
// TODO: I don't understand why the following xpath expression doesn't
work:
//
clickLinkWithLocator("//div[@id='xwikicontent']/span/a[contains(@href,
'section=4']");
clickLinkWithLocator("//div[@id='xwikicontent']/span[4]/a");
// Edit the last editable section
@@ -132,7 +132,7 @@
{
initXWiki20Env();
// Since the section edit links are inserted with JS we need to ensure
they've been generated
-
assertAndWaitForElement("//div[@id='xwikicontent']/span[4]/a");
+ waitForElement("//div[@id='xwikicontent']/span[4]/a");
// TODO: I don't understand why the following xpath expression doesn't
work:
//
clickLinkWithLocator("//div[@id='xwikicontent']/span/a[contains(@href,
'section=4']");
clickLinkWithLocator("//div[@id='xwikicontent']/span[4]/a");
// Edit the last editable section
Modified:
enterprise/branches/xwiki-enterprise-2.0/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/it/selenium/framework/AbstractXWikiTestCase.java
===================================================================
---
enterprise/branches/xwiki-enterprise-2.0/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/it/selenium/framework/AbstractXWikiTestCase.java 2009-09-23
21:45:22 UTC (rev 23882)
+++
enterprise/branches/xwiki-enterprise-2.0/distribution-test/selenium-tests/src/test/it/com/xpn/xwiki/it/selenium/framework/AbstractXWikiTestCase.java 2009-09-24
06:58:35 UTC (rev 23883)
@@ -148,33 +148,6 @@
assertTrue("[" + text + "] isn't present.",
getSelenium().isTextPresent(text));
}
- public void assertAndWaitTextPresent(final String elementLocator, final String
expectedValue)
- {
- new Wait() {
- public boolean until() {
- return getSelenium().getText(elementLocator).equals(expectedValue);
- }
- }.wait("element [" + elementLocator + "] not found or doesn't
have the value [" + expectedValue + "]");
- }
-
- public void assertAndWaitTextContains(final String elementLocator, final String
containsValue)
- {
- new Wait() {
- public boolean until() {
- return getSelenium().getText(elementLocator).indexOf(containsValue) >
-1;
- }
- }.wait("element [" + elementLocator + "] not found or doesn't
contain the value [" + containsValue + "]");
- }
-
- public void assertAndWaitBodyContains(final String containsValue)
- {
- new Wait() {
- public boolean until() {
- return getSelenium().getBodyText().indexOf(containsValue) > -1;
- }
- }.wait("Body text doesn't contain the value [" + containsValue +
"]");
- }
-
public void assertTextNotPresent(String text)
{
assertFalse("[" + text + "] is present.",
getSelenium().isTextPresent(text));
@@ -185,15 +158,6 @@
assertTrue("[" + elementLocator + "] isn't present.",
isElementPresent(elementLocator));
}
- public void assertAndWaitForElement(final String elementLocator)
- {
- new Wait() {
- public boolean until() {
- return getSelenium().isElementPresent(elementLocator);
- }
- }.wait("element [" + elementLocator + "] not found");
- }
-
public void assertElementNotPresent(String elementLocator)
{
assertFalse("[" + elementLocator + "] is present.",
isElementPresent(elementLocator));
@@ -316,6 +280,42 @@
getSelenium().waitForCondition(condition, "" + WAIT_TIME);
}
+ public void waitForTextPresent(final String elementLocator, final String
expectedValue)
+ {
+ new Wait() {
+ public boolean until() {
+ return getSelenium().getText(elementLocator).equals(expectedValue);
+ }
+ }.wait("element [" + elementLocator + "] not found or doesn't
have the value [" + expectedValue + "]");
+ }
+
+ public void waitForTextContains(final String elementLocator, final String
containsValue)
+ {
+ new Wait() {
+ public boolean until() {
+ return getSelenium().getText(elementLocator).indexOf(containsValue) >
-1;
+ }
+ }.wait("element [" + elementLocator + "] not found or doesn't
contain the value [" + containsValue + "]");
+ }
+
+ public void waitForBodyContains(final String containsValue)
+ {
+ new Wait() {
+ public boolean until() {
+ return getSelenium().getBodyText().indexOf(containsValue) > -1;
+ }
+ }.wait("Body text doesn't contain the value [" + containsValue +
"]");
+ }
+
+ public void waitForElement(final String elementLocator)
+ {
+ new Wait() {
+ public boolean until() {
+ return getSelenium().isElementPresent(elementLocator);
+ }
+ }.wait("element [" + elementLocator + "] not found");
+ }
+
/**
* {@inheritDoc}
*
Modified:
enterprise/branches/xwiki-enterprise-2.0/distribution-test/wysiwyg-tests/src/test/it/com/xpn/xwiki/it/selenium/LinkTest.java
===================================================================
---
enterprise/branches/xwiki-enterprise-2.0/distribution-test/wysiwyg-tests/src/test/it/com/xpn/xwiki/it/selenium/LinkTest.java 2009-09-23
21:45:22 UTC (rev 23882)
+++
enterprise/branches/xwiki-enterprise-2.0/distribution-test/wysiwyg-tests/src/test/it/com/xpn/xwiki/it/selenium/LinkTest.java 2009-09-24
06:58:35 UTC (rev 23883)
@@ -1851,7 +1851,7 @@
protected void waitForStepToLoad(String name)
{
- assertAndWaitForElement("//*[contains(@class, '" + name +
"')]");
+ waitForElement("//*[contains(@class, '" + name +
"')]");
}
protected void typeInExplorerInput(String text)
_______________________________________________
notifications mailing list
notifications(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/notifications