8000 Update README.md · seleniumQuery/seleniumQuery@cda603a · GitHub
[go: up one dir, main page]

Skip to content

Commit cda603a

Browse files
committed
Update README.md
1 parent 22d5258 commit cda603a

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

README.md

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,32 @@ $("#tab tr:nth-child(3n+1)").find("/img[@alt='calendar']/preceding::input").val(
102102
```
103103
Find more about them in [seleniumQuery Selectors wiki page.](https://github.com/seleniumQuery/seleniumQuery/wiki/seleniumQuery-Selectors)
104104

105+
<br>
106+
107+
###Waiting capabilities for improved Ajax testing
108+
109+
Other important feature is the leverage of `WebDriver`'s `FluentWait` capabilities **directly** in the element (no boilerplate code!) through the use of the `.waitUntil()` function:
110+
111+
```java
112+
// WebDriver cannot natively detect the end of an Ajax call.
113+
// To test your application's behavior, you can and should always work with the
114+
// Ajax's expected effects, visible for the end user.
115+
// Below is an example of a <div> that should be hidden as effect of an Ajax call.
116+
// The code will hold until the modal is gone. If it is never gone, seleniumQuery
117+
// will throw a timeout exception.
118+
$("#modalDiv :button:contains('OK')").click();
119+
$("#modalDiv :button:contains('OK')").waitUntil().is(":not(:visible)");
120+
121+
// Or, fluently:
122+
$("#modalDivOkButton").click().waitUntil().is(":not(:visible)");
123+
```
124+
125+
And, that's right, the `.is()` function above is your old-time friend that takes a selector as argument!
126+
127+
Check out what else `.waitUntil()` can do in the [seleniumQuery API wiki page](https://github.com/seleniumQuery/seleniumQuery/wiki/seleniumQuery-API).
128+
129+
<br>
130+
105131
###Flexible WebDriver builder system
106132

107133
How to setup the `WebDriver`? Simply use our builder. The driver will be instantiated only at the first use.
@@ -175,30 +201,6 @@ WebDriver myDriver = ...;
175201
$.driver().use(myDriver);
176202
```
177203

178-
179-
###Waiting capabilities for improved Ajax testing
180-
181-
Other important feature is the leverage of `WebDriver`'s `FluentWait` capabilities **directly** in the element (no boilerplate code!) through the use of the `.waitUntil()` function:
182-
183-
```java
184-
// WebDriver cannot natively detect the end of an Ajax call.
185-
// To test your application's behavior, you can and should always work with the
186-
// Ajax's expected effects, visible for the end user.
187-
// Below is an example of a <div> that should be hidden as effect of an Ajax call.
188-
// The code will hold until the modal is gone. If it is never gone, seleniumQuery
189-
// will throw a timeout exception.
190-
$("#modalDiv :button:contains('OK')").click();
191-
$("#modalDiv :button:contains('OK')").waitUntil().is(":not(:visible)");
192-
193-
// Or, fluently:
194-
$("#modalDivOkButton").click().waitUntil().is(":not(:visible)");
195-
```
196-
197-
And, that's right, the `.is()` function above is your old-time friend that takes a selector as argument!
198-
199-
Check out what else `.waitUntil()` can do in the [seleniumQuery API wiki page](https://github.com/seleniumQuery/seleniumQuery/wiki/seleniumQuery-API).
200-
201-
202204
<br>
203205

204206
##seleniumQuery still is Selenium - with "just" a jQuery interface

0 commit comments

Comments
 (0)
0