use of org.seleniumhq.selenium.fluent.FluentWebElement in project selenium_java by sergueik.
the class AngularAndWebDriverTest method stress_test.
/*
Ported from protractor/stress/spec.js
*/
@Test(enabled = false)
public void stress_test() {
FluentWebDriver fwd = new FluentWebDriver(driver);
for (int i = 0; i < 20; ++i) {
resetBrowser();
driver.get("http://localhost:8080/index.html#/form");
FluentWebElement usernameInput = fwd.input(ByAngular.model("username"));
FluentWebElement name = fwd.span(ByAngular.binding("username"));
ngWebDriver.waitForAngularRequestsToFinish();
name.getText().shouldBe("Anon");
usernameInput.clearField().sendKeys("B");
name.getText().shouldBe("B");
}
}
use of org.seleniumhq.selenium.fluent.FluentWebElement in project selenium_java by sergueik.
the class AngularAndWebDriverTest method basic_actions.
/*
Ported from protractor/spec/basic/action_spec.js
*/
@Test(enabled = true)
public void basic_actions() {
FluentWebDriver fwd = new FluentWebDriver(driver);
driver.get("http://localhost:8080/index.html#/form");
ngWebDriver.waitForAngularRequestsToFinish();
FluentWebElement sliderBar = fwd.input(By.name("points"));
sliderBar.getAttribute("value").shouldBe("1");
new Actions(driver).dragAndDropBy(sliderBar.getWebElement(), 400, 20).build().perform();
sliderBar.getAttribute("value").shouldBe("10");
}
use of org.seleniumhq.selenium.fluent.FluentWebElement in project selenium_java by sergueik.
the class AngularAndWebDriverTest method basic_elements_should_allow_using_repeater_locator_within_map.
/*
Ported from protractor/spec/basic/elements_spec.js
TODO - many more specs in here
*/
@SuppressWarnings("serial")
@Test(enabled = false)
public void basic_elements_should_allow_using_repeater_locator_within_map() {
FluentWebDriver fwd = new FluentWebDriver(driver);
driver.get("http://localhost:8080/index.html#/repeater");
Map<String, String> expected = new HashMap<String, String>() {
{
put("M", "Monday");
put("T", "Tuesday");
put("W", "Wednesday");
put("Th", "Thursday");
put("F", "Friday");
}
};
Map<String, String> days = fwd.lis(ByAngular.repeater("allinfo in days")).map(new FluentWebElementMap<String, String>() {
public void map(FluentWebElement elem, int ix) {
put(elem.element(ByAngular.binding("allinfo.initial")).getText().toString(), elem.element(ByAngular.binding("allinfo.name")).getText().toString());
}
});
assertThat(days.entrySet(), equalTo(expected.entrySet()));
}
use of org.seleniumhq.selenium.fluent.FluentWebElement in project selenium_java by sergueik.
the class BookAFlightTest method a_booking_through_to_united_affiliate.
@Test
public void a_booking_through_to_united_affiliate() {
new Home(wd) {
{
fromAirportField().sendKeys("DAL");
waitForExpandoToComplete();
toAirportField().sendKeys("IAH");
timeBizOperation("DAL->IAH Initial Search Results");
searchButton().click();
}
};
new SearchResults(wd) {
{
waitForFlightListFor("DAL\nIAH");
bizOperationTiming.end(true);
timeBizOperation("DAL->IAH Return Leg Search Results");
firstShownLeg().click();
waitForFlightListFor("IAH\nDAL");
bizOperationTiming.end(true);
firstShownLeg().click();
new BookingOverlay(wd) {
{
hipmunkWindowHandle = delegate.getWindowHandle();
FluentWebElement unitedRow = unitedRow();
claimedUnitedPrice = Integer.parseInt(unitedRow.div().getText().toString().replace("$", ""));
timeBizOperation("DAL->IAH United.com Transfer");
// purchase
unitedRow.link().click();
changeWebDriverWindow(delegate);
}
};
}
};
new UnitedAirlinesBooking(wd) {
{
// includes cents
float actualPrice = getActualPrice();
assertThat("price", Math.round(actualPrice), equalTo(claimedUnitedPrice));
bizOperationTiming.end(true);
}
};
}
use of org.seleniumhq.selenium.fluent.FluentWebElement in project BuildRadiator by BuildRadiator.
the class RadiatorWebDriverTest method confirmDataRefreshes.
@Test
public void confirmDataRefreshes() {
Radiator rad = rad("xxx", "sseeccrreett", stepNames("A"), build("1", "running", 0, step("A", 0, "running")));
app = new TestVersionOfBuildRadiatorApp(rad).withFasterRefresh();
startAppAndOpenWebDriverOnRadiatorPage(CONTRIVED_PATH_FOR_TESTING + "#xxx/Main_Project_Trunk_Build");
final FluentWebElement rootDiv = FWD.within(secs(2)).div();
rootDiv.getText().within(secs(2)).shouldContain("(running)");
rad.stepPassed("1", "A");
FWD.trs().get(1).getText().within(secs(4)).shouldContain("(passed)");
rootDiv.getText().shouldNotContain("(running)");
}
Aggregations