Search in sources :

Example 1 with FluentExecutionStopped

use of org.seleniumhq.selenium.fluent.FluentExecutionStopped in project selenium_java by sergueik.

the class AngularAndWebDriverTest method basic_locators_by_repeater_should_find_one_row_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_one_row_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'").row(0)).getText().shouldBe("T");
    fwd.li(ByAngular.repeater("baz in days | filter:'T'").row(1)).getText().shouldBe("Th");
    fwd.li(ByAngular.repeater("baz in days | filt").row(1)).getText().shouldBe("Th");
    try {
        fwd.li(ByAngular.exactRepeater("baz in days | filt").row(1)).getText().shouldBe("T");
        fail("should have barfed");
    } catch (FluentExecutionStopped e) {
        assertThat(e.getMessage(), startsWith("NoSuchElementException during invocation of: ?.li(exactRepeater(baz in days | filt).row(1))"));
        assertThat(e.getCause().getMessage(), startsWith("exactRepeater(baz in days | filt).row(1) didn't have any matching elements at this place in the DOM"));
    }
}
Also used : FluentWebDriver(org.seleniumhq.selenium.fluent.FluentWebDriver) FluentExecutionStopped(org.seleniumhq.selenium.fluent.FluentExecutionStopped) Test(org.testng.annotations.Test)

Example 2 with FluentExecutionStopped

use of org.seleniumhq.selenium.fluent.FluentExecutionStopped in project selenium_java by sergueik.

the class AngularAndWebDriverTest method basic_locators_by_repeater_should_find_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_by_partial_match() {
    FluentWebDriver fwd = new FluentWebDriver(driver);
    driver.get("http://localhost:8080/index.html#/repeater");
    fwd.span(ByAngular.repeater("baz in days | filter:'T'").row(0).column("baz.initial")).getText().shouldBe("T");
    fwd.span(ByAngular.repeater("baz in days | fil").row(0).column("baz.initial")).getText().shouldBe("T");
    try {
        fwd.li(ByAngular.exactRepeater("baz in days | fil").row(0).column("baz.initial")).getText().shouldBe("T");
        fail("should have barfed");
    } catch (FluentExecutionStopped e) {
        assertThat(e.getMessage(), startsWith("NoSuchElementException during invocation of: ?.li(exactRepeater(baz in days | fil).row(0).column(baz.initial))"));
        assertThat(e.getCause().getMessage(), startsWith("exactRepeater(baz in days | fil).row(0).column(baz.initial) didn't have any matching elements at this place in the DOM"));
    }
}
Also used : FluentWebDriver(org.seleniumhq.selenium.fluent.FluentWebDriver) FluentExecutionStopped(org.seleniumhq.selenium.fluent.FluentExecutionStopped) Test(org.testng.annotations.Test)

Example 3 with FluentExecutionStopped

use of org.seleniumhq.selenium.fluent.FluentExecutionStopped in project selenium_java by sergueik.

the class AngularAndWebDriverTest method basic_locators_by_repeater_should_find_many_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_many_rows_by_partial_match() {
    FluentWebDriver fwd = new FluentWebDriver(driver);
    driver.get("http://localhost:8080/index.html#/repeater");
    FluentWebElements spans = fwd.spans(ByAngular.repeater("baz in days | filter:'T'").column("baz.initial"));
    spans.getText().shouldBe("TTh");
    spans.get(0).getText().shouldBe("T");
    spans.get(1).getText().shouldBe("Th");
    spans = fwd.spans(ByAngular.repeater("baz in days | fil").column("baz.initial"));
    spans.getText().shouldBe("TTh");
    spans.get(0).getText().shouldBe("T");
    spans.get(1).getText().shouldBe("Th");
    try {
        fwd.li(ByAngular.exactRepeater("baz in days | fil").column("baz.initial")).getText().shouldBe("TTh");
        fail("should have barfed");
    } catch (FluentExecutionStopped e) {
        assertThat(e.getMessage(), startsWith("NoSuchElementException during invocation of: ?.li(exactRepeater(baz in days | fil).column(baz.initial))"));
        assertThat(e.getCause().getMessage(), startsWith("exactRepeater(baz in days | fil).column(baz.initial) didn't have any matching elements at this place in the DOM"));
    }
}
Also used : FluentWebDriver(org.seleniumhq.selenium.fluent.FluentWebDriver) FluentExecutionStopped(org.seleniumhq.selenium.fluent.FluentExecutionStopped) FluentWebElements(org.seleniumhq.selenium.fluent.FluentWebElements) Test(org.testng.annotations.Test)

Example 4 with FluentExecutionStopped

use of org.seleniumhq.selenium.fluent.FluentExecutionStopped 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"));
    }
}
Also used : FluentWebDriver(org.seleniumhq.selenium.fluent.FluentWebDriver) FluentExecutionStopped(org.seleniumhq.selenium.fluent.FluentExecutionStopped) Test(org.testng.annotations.Test)

Example 5 with FluentExecutionStopped

use of org.seleniumhq.selenium.fluent.FluentExecutionStopped 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"));
    }
}
Also used : FluentWebDriver(org.seleniumhq.selenium.fluent.FluentWebDriver) FluentExecutionStopped(org.seleniumhq.selenium.fluent.FluentExecutionStopped) FluentWebElements(org.seleniumhq.selenium.fluent.FluentWebElements) Test(org.testng.annotations.Test)

Aggregations

FluentExecutionStopped (org.seleniumhq.selenium.fluent.FluentExecutionStopped)5 FluentWebDriver (org.seleniumhq.selenium.fluent.FluentWebDriver)5 Test (org.testng.annotations.Test)5 FluentWebElements (org.seleniumhq.selenium.fluent.FluentWebElements)2