File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
src/test/java/com/serenitydojo/playwright Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 33import com .microsoft .playwright .Browser ;
44import com .microsoft .playwright .Page ;
55import com .microsoft .playwright .Playwright ;
6+ import com .microsoft .playwright .impl .AssertionsTimeout ;
67import org .junit .jupiter .api .Assertions ;
78import org .junit .jupiter .api .Test ;
89
@@ -22,4 +23,22 @@ void shouldShowThePageTitle() {
2223 browser .close ();
2324 playwright .close ();
2425 }
26+
27+ @ Test
28+ void shouldShowSearchTermsInTheTitle () {
29+ Playwright playwright = Playwright .create ();
30+ Browser browser = playwright .chromium ().launch ();
31+ Page page = browser .newPage ();
32+
33+ page .navigate ("https://practicesoftwaretesting.com" );
34+ page .locator ("[placeholder=Search]" ).fill ("Pliers" );
35+ page .locator ("button:has-text('Search')" ).click ();
36+
37+ int matchingProductCount = page .locator (".card-title" ).count ();
38+
39+ Assertions .assertTrue (matchingProductCount > 0 );
40+
41+ browser .close ();
42+ playwright .close ();
43+ }
2544}
You can’t perform that action at this time.
0 commit comments