Hi,
html snippets:
JettyLogon.html
<div class="welcome">
<a href="http://localhost:8080/MenuNav.html">Menu Nav</a>
</div>
MenuNav.html
<div class="mainMenu">
<a href="http://localhost:8080/JettyLogon.html">Events</a>
<a href="http://localhost:8080/JettyLogon.html">Suppliers</a>
<a href="http://localhost:8080/JettyLogon.html">Venues</a>
<a href="http://localhost:8080/JettyLogon.html">Booking Report</a>
<a href="http://localhost:8080/JettyLogon.html">Notifications</a>
<a href="http://localhost:8080/JettyLogon.html">Help</a>
</div>
Here are my test cases.
Ui Modules:
public class JettyLogonModule extends DslContext {
public void defineUi() {
ui.Container(uid: "Welcome", clocator: [tag: "div", class: "welcome"]){
UrlLink(uid: "MenuLink", clocator: [text: "Menu Nav"])
}
}
class MenuNavModule extends DslContext {
public void defineUi(){
ui.Container(uid: "mainnav", clocator: [tag: "div", class: "mainMenu"],
group: true) {
UrlLink(uid: "events", clocator: [text: "Events"])
UrlLink(uid: "suppliers", clocator: [text: "Suppliers"])
UrlLink(uid: "venues", clocator: [text: "Venues"])
UrlLink(uid: "bookingReport", clocator: [text: "Booking Report"])
UrlLink(uid: "notifications", clocator: [text: "Notifications"])
UrlLink(uid: "help", clocator: [text: "Help"])
}
ui.Container(uid: "mainnav2", clocator: [tag: "div", class: "mainMenu"])
{
UrlLink(uid: "events", clocator: [text: "Events"])
UrlLink(uid: "suppliers", clocator: [text: "Suppliers"])
UrlLink(uid: "venues", clocator: [text: "Venues"])
UrlLink(uid: "bookingReport", clocator: [text: "Booking Report"])
UrlLink(uid: "notifications", clocator: [text: "Notifications"])
UrlLink(uid: "help", clocator: [text: "Help"])
}
ui.Container(uid: "mainnav3", clocator: [tag: "div", class: "welcome"]){
UrlLink(uid: "Link", clocator: [text: "Menu Nav"])
}
}
}
As you can see UI module "mainnav3" does not exist
@Test
public void testFlowWithSelenium() {
connect("JettyLogon");
useTelluriumApi(false);
useCache(false);
jlm.click("Welcome.MenuLink");
jlm.waitForPageToLoad(10000);
assertTrue("Did not find main menu",
mnm.isElementPresent("mainnav"));
assertFalse(mnm.isElementPresent("mainnav3.Link"));
mnm.click("mainnav2.suppliers");
mnm.waitForPageToLoad(20000);
assertTrue(jlm.isElementPresent("Welcome.MenuLink"));
}
@Test
public void testFlowWithTellurium() {
connect("JettyLogon");
useTelluriumApi(true);
useCache(false);
jlm.click("Welcome.MenuLink");
jlm.waitForPageToLoad(10000);
assertTrue("Did not find main menu",
mnm.isElementPresent("mainnav"));
assertFalse(mnm.isElementPresent("mainnav3.Link"));
mnm.click("mainnav2.suppliers");
mnm.waitForPageToLoad(20000);
assertTrue(jlm.isElementPresent("Welcome.MenuLink"));
useTelluriumApi(false);
}
The two tests passed.
Thanks,
Jian
--
You received this message because you are subscribed to the Google Groups
"tellurium-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/tellurium-users?hl=en.