-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable use of ERMD2WListFilter for "ListMovie" page configuration and…
… add functional tests.
- Loading branch information
Showing
3 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
Tests/ERModernMoviesTest/Tests/er/modern/movies/test/ListFilterIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
package er.modern.movies.test; | ||
|
||
import static com.codeborne.selenide.Condition.text; | ||
import static com.codeborne.selenide.Condition.value; | ||
import static com.codeborne.selenide.Selenide.$; | ||
import static com.codeborne.selenide.Selenide.$$; | ||
import static com.codeborne.selenide.Selenide.open; | ||
|
||
import org.junit.Test; | ||
import org.openqa.selenium.By; | ||
|
||
import com.codeborne.selenide.Condition; | ||
|
||
public class ListFilterIT extends AbstractSelenideIT { | ||
|
||
@Test | ||
public void filterByPartialTitleTest() { | ||
open("/"); | ||
$(By.linkText("Login")).click(); | ||
// get list of all movies | ||
$(By.linkText("Find")).click(); | ||
$("input[type=search]").setValue("fiction"); | ||
// verify "Pulp Fiction" is listed | ||
$(".ListMovieObjTable").shouldHave(text("Pulp Fiction")); | ||
// and that it is the only match | ||
$$(".ListMovieObjTable tr.ObjRow").shouldHaveSize(1); | ||
} | ||
|
||
@Test | ||
public void filterByCategoryTest() { | ||
open("/"); | ||
$(By.linkText("Login")).click(); | ||
// get list of all movies | ||
$(By.linkText("Find")).click(); | ||
$("input[type=search]").setValue("noir"); | ||
// verify "Heathers" is listed | ||
$(".ListMovieObjTable").shouldHave(text("Heathers")); | ||
// and that it is one of 5 matches | ||
$$(".ListMovieObjTable tr.ObjRow").shouldHaveSize(5); | ||
} | ||
|
||
@Test | ||
public void filterByPlotSummaryTest() { | ||
open("/"); | ||
$(By.linkText("Login")).click(); | ||
// get list of all movies | ||
$(By.linkText("Find")).click(); | ||
$("input[type=search]").setValue("dark"); | ||
// verify "Heathers" is listed | ||
$(".ListMovieObjTable").shouldHave(text("Heathers")); | ||
// and that it is one of 2 matches | ||
$$(".ListMovieObjTable tr.ObjRow").shouldHaveSize(2); | ||
$("input[type=search]").setValue("darkn"); | ||
// verify "Apocalypse Now" is listed | ||
$(".ListMovieObjTable").shouldHave(text("Apocalypse Now")); | ||
// and that it is the only match | ||
$$(".ListMovieObjTable tr.ObjRow").shouldHaveSize(1); | ||
} | ||
|
||
@Test | ||
public void filterByDateTest() { | ||
open("/"); | ||
$(By.linkText("Login")).click(); | ||
// get list of all movies | ||
$(By.linkText("Find")).click(); | ||
$("input[type=search]").setValue("1987"); | ||
// verify "The Untouchables" is listed | ||
$(".ListMovieObjTable").shouldHave(text("The Untouchables")); | ||
// and that it is one of 3 matches | ||
$$(".ListMovieObjTable tr.ObjRow").shouldHaveSize(3); | ||
$("input[type=search]").setValue("01/03/1987"); | ||
// verify "The Untouchables" is listed | ||
$(".ListMovieObjTable").shouldHave(text("The Untouchables")); | ||
// and that it is the only match | ||
$$(".ListMovieObjTable tr.ObjRow").shouldHaveSize(1); | ||
} | ||
|
||
@Test | ||
public void filterByRevenueTest() { | ||
open("/"); | ||
$(By.linkText("Login")).click(); | ||
// get list of all movies | ||
$(By.linkText("Find")).click(); | ||
$("input[type=search]").setValue("400000"); | ||
// verify "Jurassic Park" is listed | ||
$(".ListMovieObjTable").shouldHave(text("Jurassic Park")); | ||
// and that it is one of 5 matches | ||
$$(".ListMovieObjTable tr.ObjRow").shouldHaveSize(5); | ||
} | ||
|
||
} |