<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!-- Copyright 2004 ThoughtWorks, Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> <title>Test WaitFor</title> </head> <body> First test waitForValue <table cellpadding="1" cellspacing="1" border="1"> <tbody> <tr> <td rowspan="1" colspan="3">Test WaitForValue<br> </td> </tr> <tr> <td>open</td> <td>../tests/html/test_async_event.html</td> <td> </td> </tr> <tr> <td>assertValue</td> <td>theField</td> <td>oldValue</td> </tr> <tr> <td>click</td> <td>theButton</td> <td> </td> </tr> <tr> <td>assertValue</td> <td>theField</td> <td>oldValue</td> </tr> <tr> <td>waitForValue</td> <td>theField</td> <td>regexp:n[aeiou]wValue</td> </tr> <tr> <td>verifyValue</td> <td>theField</td> <td>newValue</td> </tr> </tbody> </table> <br> Test waitForText <table cellpadding="1" cellspacing="1" border="1"> <tbody> <tr> <td>assertText</td> <td>theSpan</td> <td>Some text</td> </tr> <tr> <td>click</td> <td>theSpanButton</td> <td> </td> </tr> <tr> <td>assertText</td> <td>theSpan</td> <td>Some text</td> </tr> <tr> <td>waitForText</td> <td>theSpan</td> <td>regexp:Some n[aeiou]w text</td> </tr> <tr> <td>verifyText</td> <td>theSpan</td> <td>Some new text</td> </tr> </tbody> </table> <br> Test waiting for an alert. <table cellpadding="1" cellspacing="1" border="1"> <tbody> <tr> <td>click</td> <td>theAlertButton</td> <td> </td> </tr> <tr> <td>waitForAlert</td> <td>regexp:An [aeiou]lert</td> <td> </td> </tr> </tbody> </table> <br> Test for waiting for something on a new page. <table cellpadding="1" cellspacing="1" border="1"> <tbody> <tr> <td>open</td> <td>../tests/html/test_reload_onchange_page.html</td> <td> </td> </tr> <tr> <td>click</td> <td>theLink</td> <td></td> </tr> <tr> <td>waitForTitle</td> <td>Slow Loading Page</td> <td></td> </tr> <tr> <td>verifyTitle</td> <td>Slow Loading Page</td> <td></td> </tr> </tbody> </table> <br> Test for waiting for something that never arrives <table cellpadding="1" cellspacing="1" border="1"> <tbody> <tr> <td>setTimeout</td> <td>500</td> <td> </td> </tr> <tr> <td>assertFailureOnNext</td> <td>Timed out after 500ms</td> <td> </td> </tr> <tr> <td>waitForTextPresent</td> <td>thisTextIsNotPresent</td> <td></td> </tr> </tbody> </table> </body> </html>