-
-
Save angiejones/746425b97b7d89523ec0f3c6c6b98f27 to your computer and use it in GitHub Desktop.
Playwright tests
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
package search; | |
import base.BaseTests; | |
import org.testng.annotations.Test; | |
import pages.SearchPage; | |
import java.util.List; | |
import static org.testng.Assert.*; | |
public class SearchTests extends BaseTests { | |
@Test | |
public void searchForExactTitle(){ | |
String title = "Agile Testing"; | |
searchPage.search(title); | |
assertEquals(searchPage.getNumberOfVisibleBooks(), 1, "Number of visible books"); | |
assertTrue(searchPage.getVisibleBooks().contains(title), "Title of visible book"); | |
} | |
@Test | |
public void searchForPartialTitle(){ | |
searchPage.search("Test"); | |
List<String> expectedBooks = List.of( | |
"Test Automation in the Real World", | |
"Experiences of Test Automation", | |
"Agile Testing", | |
"How Google Tests Software", | |
"Java For Testers" | |
); | |
assertEquals(searchPage.getNumberOfVisibleBooks(), expectedBooks.size(), "Number of visible books"); | |
assertEquals(searchPage.getVisibleBooks(), expectedBooks,"Titles of visible books"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment