Given the following markup:
<div id="bootstrapDropdown" class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button"
id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="true">
Dropdown
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 2</a></li>
<li><a href="#">Item 3</a></li>
<li><a href="#">Item 4</a></li>
</ul>
</div>
<ul id="zurbDropdown" class="dropdown menu" data-dropdown-menu>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 2</a></li>
<li><a href="#">Item 3</a></li>
<li><a href="#">Item 4</a></li>
</ul>
and the following page content
static content = {
bootstrapDropdown(wait: true) { $("#bootstrapDropdown") }
zurbDropdown(wait: true) { $("#zurbDropdown") }`
}
I would like to be able to select an item like:
bootstrapDropdown.select("Item 2")
zurbDropdown.select("Item 2")
I would like to have 2 custom navigators
BootstrapNavigator implements Selectable {
void select(String value) {
browser.js.exec(firstElement(), value, "...")
}
}
ZurbNavigator implements Selectable {
void select(String value) {
browser.js.exec(firstElement(), value, "...")
}
}
The innerNavigatorFactory could be used I suppose but something like:
static content = {
bootstrapDropdown(wait: true) { $bootstrap("#jqueryDropdown") }
zurbDropdown(wait: true) { $zurb("#zurbDropdown") }`
}
Would be nice. I would like to write geb navigators for different widget
toolkits but using the same interfaces. Do you see a clean way to do this?
--
You received this message because you are subscribed to the Google Groups "Geb
User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/geb-user/f5722893-c62b-48de-86c0-b7ab6329edf8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.