use of org.seleniumhq.selenium.fluent.FluentWebDriver in project selenium_java by sergueik.
the class AngularAndWebDriverTest method basic_locators_by_repeater_should_find_single_rows_by_partial_match.
/*
Ported from protractor/spec/basic/locators_spec.js
TODO - many more specs in here
*/
@Test(enabled = false)
public void basic_locators_by_repeater_should_find_single_rows_by_partial_match() {
FluentWebDriver fwd = new FluentWebDriver(driver);
driver.get("http://localhost:8080/index.html#/repeater");
fwd.li(ByAngular.repeater("baz in days | filter:'T'")).getText().shouldBe("T");
fwd.li(ByAngular.withRootSelector("[ng-app]").repeater("baz in days | filt")).getText().shouldBe("T");
try {
fwd.li(ByAngular.exactRepeater("baz in days | filt")).getText().shouldBe("T");
fail("should have barfed");
} catch (FluentExecutionStopped e) {
assertThat(e.getMessage(), startsWith("NoSuchElementException during invocation of: ?.li(exactRepeater(baz in days | filt))"));
assertThat(e.getCause().getMessage(), startsWith("exactRepeater(baz in days | filt) didn't have any matching elements at this place in the DOM"));
}
}
use of org.seleniumhq.selenium.fluent.FluentWebDriver in project selenium_java by sergueik.
the class AngularAndWebDriverTest method basic_elements_chained_call_should_wait_to_grab_the_WebElement_until_a_method_is_called.
/*
Ported from protractor/spec/basic/elements_spec.js
TODO - many more specs in here
*/
@Test(enabled = false)
public void basic_elements_chained_call_should_wait_to_grab_the_WebElement_until_a_method_is_called() {
FluentWebDriver fwd = new FluentWebDriver(driver);
driver.get("http://localhost:8080/index.html#/conflict");
FluentWebElement reused = fwd.div(id("baz")).span(ByAngular.binding("item.reusedBinding"));
reused.getText().shouldBe("Inner: inner");
}
use of org.seleniumhq.selenium.fluent.FluentWebDriver in project selenium_java by sergueik.
the class AngularAndWebDriverTest method altRoot_find_elements.
/*
Ported from protractor/spec/altRoot/findelements_spec.js
*/
@Test(enabled = false)
public void altRoot_find_elements() {
FluentWebDriver fwd = new FluentWebDriver(driver);
driver.get("http://localhost:8080/alt_root_index.html#/form");
ngWebDriver.waitForAngularRequestsToFinish();
fwd.span(ByAngular.binding("{{greeting}}")).getText().shouldBe("Hiya");
fwd.div(id("outside-ng")).getText().shouldBe("{{1 + 2}}");
fwd.div(id("inside-ng")).getText().shouldBe("3");
}
use of org.seleniumhq.selenium.fluent.FluentWebDriver in project selenium_java by sergueik.
the class AngularAndWebDriverTest method basic_locators_by_repeater_should_find_many_rows_by_partial_match2.
/*
Ported from protractor/spec/basic/locators_spec.js
TODO - many more specs in here
*/
@Test(enabled = false)
public void basic_locators_by_repeater_should_find_many_rows_by_partial_match2() {
FluentWebDriver fwd = new FluentWebDriver(driver);
driver.get("http://localhost:8080/index.html#/repeater");
FluentWebElements lis = fwd.lis(ByAngular.repeater("baz in days | filter:'T'"));
lis.getText().shouldBe("TTh");
lis.get(0).getText().shouldBe("T");
lis.get(1).getText().shouldBe("Th");
lis = fwd.lis(ByAngular.repeater("baz in days | fil"));
lis.getText().shouldBe("TTh");
lis.get(0).getText().shouldBe("T");
lis.get(1).getText().shouldBe("Th");
try {
fwd.lis(ByAngular.exactRepeater("baz in days | filt")).getText().shouldBe("T");
fail("should have barfed");
} catch (FluentExecutionStopped e) {
assertThat(e.getMessage(), startsWith("NoSuchElementException during invocation of: ?.lis(exactRepeater(baz in days | filt))"));
assertThat(e.getCause().getMessage(), startsWith("exactRepeater(baz in days | filt) didn't have any matching elements at this place in the DOM"));
}
}
use of org.seleniumhq.selenium.fluent.FluentWebDriver in project selenium_java by sergueik.
the class AngularAndWebDriverTest method basic_elements_should_chain_with_index_correctly.
/*
Ported from protractor/spec/basic/elements_spec.js
TODO - many more specs in here
*/
@Test(enabled = true)
public void basic_elements_should_chain_with_index_correctly() {
FluentWebDriver fwd = new FluentWebDriver(driver);
driver.get("http://localhost:8080/index.html");
fwd.inputs(By.cssSelector("#checkboxes input")).last(new IsIndex2Or3()).click();
fwd.span(By.cssSelector("#letterlist")).getText().shouldBe("'x'");
}
Aggregations